LibreOffice Module xmloff (master) 1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
XMLTransformerBase Class Referenceabstract

#include <TransformerBase.hxx>

Inheritance diagram for XMLTransformerBase:
[legend]
Collaboration diagram for XMLTransformerBase:
[legend]

Public Member Functions

 XMLTransformerBase (XMLTransformerActionInit const *pInit, ::xmloff::token::XMLTokenEnum const *pTKMapInit) noexcept
 
virtual ~XMLTransformerBase () noexcept override
 
virtual void SAL_CALL startDocument () override
 
virtual void SAL_CALL endDocument () override
 
virtual void SAL_CALL startElement (const OUString &aName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override
 
virtual void SAL_CALL endElement (const OUString &aName) override
 
virtual void SAL_CALL characters (const OUString &aChars) override
 
virtual void SAL_CALL ignorableWhitespace (const OUString &aWhitespaces) override
 
virtual void SAL_CALL processingInstruction (const OUString &aTarget, const OUString &aData) override
 
virtual void SAL_CALL setDocumentLocator (const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override
 
virtual void SAL_CALL startCDATA () override
 
virtual void SAL_CALL endCDATA () override
 
virtual void SAL_CALL comment (const OUString &sComment) override
 
virtual void SAL_CALL allowLineBreak () override
 
virtual void SAL_CALL unknown (const OUString &sString) override
 
virtual void SAL_CALL initialize (const css::uno::Sequence< css::uno::Any > &aArguments) override
 
const css::uno::Reference< css::xml::sax::XDocumentHandler > & GetDocHandler () const
 
const css::uno::Reference< css::beans::XPropertySet > & GetPropertySet () const
 
SvXMLNamespaceMapGetNamespaceMap ()
 
const SvXMLNamespaceMapGetNamespaceMap () const
 
SvXMLNamespaceMapGetReplaceNamespaceMap ()
 
XMLTransformerActionsGetElemActions ()
 
virtual XMLTransformerActionsGetUserDefinedActions (sal_uInt16 n)
 
virtual XMLTransformerContextCreateUserDefinedContext (const TransformerAction_Impl &rAction, const OUString &rQName, bool bPersistent=false)=0
 
virtual OUString GetEventName (const OUString &rName, bool bForm=false)=0
 
XMLMutableAttributeListProcessAttrList (css::uno::Reference< css::xml::sax::XAttributeList > &rAttrList, sal_uInt16 nActionMap, bool bClone)
 
bool EncodeStyleName (OUString &rName) const
 
void AddNamespacePrefix (OUString &rName, sal_uInt16 nPrefix) const
 
bool RemoveNamespacePrefix (OUString &rName, sal_uInt16 nPrefixOnly=0xffffU) const
 
bool ConvertURIToOASIS (OUString &rURI, bool bSupportPackage) const
 
bool ConvertURIToOOo (OUString &rURI, bool bSupportPackage) const
 
::xmloff::token::XMLTokenEnum GetToken (const OUString &rStr) const
 
const XMLTransformerContextGetCurrentContext () const
 
const XMLTransformerContextGetAncestorContext (sal_uInt32 i) const
 
void SetClass (const OUString &r)
 
const OUString & GetClass () const
 
bool isWriter () const
 

Static Public Member Functions

static bool ReplaceSingleInchWithIn (OUString &rValue)
 
static bool ReplaceSingleInWithInch (OUString &rValue)
 
static bool ReplaceInchWithIn (OUString &rValue)
 
static bool ReplaceInWithInch (OUString &rValue)
 
static bool DecodeStyleName (OUString &rName)
 
static bool NegPercent (OUString &rValue)
 
static bool RenameAttributeValue (OUString &rOutAttributeValue, sal_Int32 nParam1, sal_Int32 nParam2, sal_Int32 nParam3)
 renames the given rOutAttributeValue if one of the parameters contains a matching token in its lower 16 bits. More...
 
static bool ConvertRNGDateTimeToISO (OUString &rDateTime)
 converts the '. More...
 

Protected Member Functions

XMLTransformerContextCreateContext (sal_uInt16 nPrefix, const OUString &rLocalName, const OUString &rQName)
 

Protected Attributes

css::uno::Reference< css::frame::XModel > mxModel
 

Private Attributes

css::uno::Reference< css::xml::sax::XDocumentHandler > m_xHandler
 
css::uno::Reference< css::beans::XPropertySetm_xPropSet
 
css::uno::Reference< css::i18n::XCharacterClassification > xCharClass
 
OUString m_aExtPathPrefix
 
OUString m_aClass
 
std::unique_ptr< SvXMLNamespaceMapm_pNamespaceMap
 
SvXMLNamespaceMap m_vReplaceNamespaceMap
 
std::vector< rtl::Reference< XMLTransformerContext > > m_vContexts
 
XMLTransformerActions m_ElemActions
 
XMLTransformerTokenMap const m_TokenMap
 

Friends

class XMLTransformerContext
 

Detailed Description

Definition at line 52 of file TransformerBase.hxx.

Constructor & Destructor Documentation

◆ XMLTransformerBase()

XMLTransformerBase::XMLTransformerBase ( XMLTransformerActionInit const *  pInit,
::xmloff::token::XMLTokenEnum const *  pTKMapInit 
)
noexcept

◆ ~XMLTransformerBase()

XMLTransformerBase::~XMLTransformerBase ( )
overridevirtualnoexcept

Definition at line 192 of file TransformerBase.cxx.

Member Function Documentation

◆ AddNamespacePrefix()

void XMLTransformerBase::AddNamespacePrefix ( OUString &  rName,
sal_uInt16  nPrefix 
) const

◆ allowLineBreak()

void SAL_CALL XMLTransformerBase::allowLineBreak ( )
overridevirtual

Definition at line 368 of file TransformerBase.cxx.

◆ characters()

void SAL_CALL XMLTransformerBase::characters ( const OUString &  aChars)
overridevirtual

Definition at line 332 of file TransformerBase.cxx.

References m_vContexts.

◆ comment()

void SAL_CALL XMLTransformerBase::comment ( const OUString &  sComment)
overridevirtual

Definition at line 364 of file TransformerBase.cxx.

◆ ConvertRNGDateTimeToISO()

bool XMLTransformerBase::ConvertRNGDateTimeToISO ( OUString &  rDateTime)
static

converts the '.

' that separates fractions of seconds in a dateTime string into a ',' that was used in the OOo format

Parameters
rDateTimeA dateTime string that will be parsed and changed in case a match was found.
Returns
<TRUE> if the given string was changed

Definition at line 1357 of file TransformerBase.cxx.

Referenced by ProcessAttrList().

◆ ConvertURIToOASIS()

bool XMLTransformerBase::ConvertURIToOASIS ( OUString &  rURI,
bool  bSupportPackage 
) const

Definition at line 1212 of file TransformerBase.cxx.

References m_aExtPathPrefix, and nPos.

Referenced by ProcessAttrList().

◆ ConvertURIToOOo()

bool XMLTransformerBase::ConvertURIToOOo ( OUString &  rURI,
bool  bSupportPackage 
) const

◆ CreateContext()

XMLTransformerContext * XMLTransformerBase::CreateContext ( sal_uInt16  nPrefix,
const OUString &  rLocalName,
const OUString &  rQName 
)
protected

◆ CreateUserDefinedContext()

virtual XMLTransformerContext * XMLTransformerBase::CreateUserDefinedContext ( const TransformerAction_Impl rAction,
const OUString &  rQName,
bool  bPersistent = false 
)
pure virtual

◆ DecodeStyleName()

bool XMLTransformerBase::DecodeStyleName ( OUString &  rName)
static

◆ EncodeStyleName()

bool XMLTransformerBase::EncodeStyleName ( OUString &  rName) const

Definition at line 969 of file TransformerBase.cxx.

References aBuffer, aHexTab, comphelper::getProcessComponentContext(), i, nType, and xCharClass.

Referenced by ProcessAttrList().

◆ endCDATA()

void SAL_CALL XMLTransformerBase::endCDATA ( )
overridevirtual

Definition at line 360 of file TransformerBase.cxx.

◆ endDocument()

void SAL_CALL XMLTransformerBase::endDocument ( )
overridevirtual

Definition at line 201 of file TransformerBase.cxx.

References m_xHandler.

◆ endElement()

void SAL_CALL XMLTransformerBase::endElement ( const OUString &  aName)
overridevirtual

Definition at line 296 of file TransformerBase.cxx.

References m_pNamespaceMap, and m_vContexts.

◆ GetAncestorContext()

const XMLTransformerContext * XMLTransformerBase::GetAncestorContext ( sal_uInt32  i) const

Definition at line 1388 of file TransformerBase.cxx.

References get(), m_vContexts, and n.

Referenced by XMLEventOASISTransformerContext::StartElement().

◆ GetClass()

const OUString & XMLTransformerBase::GetClass ( ) const
inline

Definition at line 173 of file TransformerBase.hxx.

References m_aClass.

Referenced by ProcessAttrList().

◆ GetCurrentContext()

const XMLTransformerContext * XMLTransformerBase::GetCurrentContext ( ) const

Definition at line 1380 of file TransformerBase.cxx.

References m_vContexts.

Referenced by CreateContext(), and Oasis2OOoTransformer::CreateUserDefinedContext().

◆ GetDocHandler()

const css::uno::Reference< css::xml::sax::XDocumentHandler > & XMLTransformerBase::GetDocHandler ( ) const
inline

Definition at line 106 of file TransformerBase.hxx.

References m_xHandler.

Referenced by OOo2OasisTransformer::cancel(), XMLTransformerContext::Characters(), XMLIgnoreTransformerContext::Characters(), XMLControlOOoTransformerContext::CreateChildContext(), XMLFrameOASISTransformerContext::CreateChildContext(), XMLTransformerContext::EndElement(), XMLControlOASISTransformerContext::EndElement(), XMLControlOOoTransformerContext::EndElement(), XMLEventOOoTransformerContext::EndElement(), XMLFormPropOOoTransformerContext::EndElement(), XMLFrameOASISTransformerContext::EndElement(), XMLFrameOOoTransformerContext::EndElement(), XMLMetaTransformerContext::EndElement(), XMLNotesTransformerContext::EndElement(), XMLProcAttrTransformerContext::EndElement(), XMLRenameElemTransformerContext::EndElement(), XMLStyleOASISTContext::EndElement(), XMLStyleOOoTContext::EndElement(), XMLPersAttrListTContext::Export(), XMLPropertiesTContext_Impl::Export(), XMLPersTextContentTContext::ExportContent(), OOo2OasisTransformer::filter(), OOo2OasisTransformer::Initialize(), OOo2OasisTransformer::setTargetDocument(), OOo2OasisTransformer::startDocument(), XMLTransformerContext::StartElement(), XMLControlOASISTransformerContext::StartElement(), XMLEventOOoTransformerContext::StartElement(), XMLFormPropOASISTransformerContext::StartElement(), XMLFrameOOoTransformerContext::StartElement(), XMLNotesTransformerContext::StartElement(), XMLProcAddAttrTransformerContext::StartElement(), XMLProcAttrTransformerContext::StartElement(), XMLRenameElemTransformerContext::StartElement(), XMLStyleOASISTContext::StartElement(), and XMLStyleOOoTContext::StartElement().

◆ GetElemActions()

XMLTransformerActions & XMLTransformerBase::GetElemActions ( )
inline

Definition at line 115 of file TransformerBase.hxx.

References m_ElemActions.

Referenced by XMLPersElemContentTContext::CreateChildContext(), and CreateContext().

◆ GetEventName()

virtual OUString XMLTransformerBase::GetEventName ( const OUString &  rName,
bool  bForm = false 
)
pure virtual

◆ GetNamespaceMap() [1/2]

SvXMLNamespaceMap & XMLTransformerBase::GetNamespaceMap ( )
inline

◆ GetNamespaceMap() [2/2]

const SvXMLNamespaceMap & XMLTransformerBase::GetNamespaceMap ( ) const
inline

Definition at line 112 of file TransformerBase.hxx.

References m_pNamespaceMap.

◆ GetPropertySet()

const css::uno::Reference< css::beans::XPropertySet > & XMLTransformerBase::GetPropertySet ( ) const
inline

Definition at line 108 of file TransformerBase.hxx.

References m_xPropSet.

Referenced by XMLDocumentTransformerContext::StartElement().

◆ GetReplaceNamespaceMap()

SvXMLNamespaceMap & XMLTransformerBase::GetReplaceNamespaceMap ( )
inline

Definition at line 113 of file TransformerBase.hxx.

References m_vReplaceNamespaceMap.

Referenced by Oasis2OOoTransformer::Oasis2OOoTransformer().

◆ GetToken()

XMLTokenEnum XMLTransformerBase::GetToken ( const OUString &  rStr) const

◆ GetUserDefinedActions()

XMLTransformerActions * XMLTransformerBase::GetUserDefinedActions ( sal_uInt16  n)
virtual

◆ ignorableWhitespace()

void SAL_CALL XMLTransformerBase::ignorableWhitespace ( const OUString &  aWhitespaces)
overridevirtual

Definition at line 340 of file TransformerBase.cxx.

References m_xHandler.

◆ initialize()

void SAL_CALL XMLTransformerBase::initialize ( const css::uno::Sequence< css::uno::Any > &  aArguments)
overridevirtual

Reimplemented in OOo2OasisTransformer.

Definition at line 377 of file TransformerBase.cxx.

References aArguments, Any, m_aExtPathPrefix, m_xHandler, m_xPropSet, mxModel, nPos, and sName.

Referenced by OOo2OasisTransformer::Initialize().

◆ isWriter()

bool XMLTransformerBase::isWriter ( ) const

Definition at line 1398 of file TransformerBase.cxx.

References mxModel.

Referenced by OOo2OasisTransformer::GetUserDefinedActions(), and ProcessAttrList().

◆ NegPercent()

bool XMLTransformerBase::NegPercent ( OUString &  rValue)
static

◆ ProcessAttrList()

XMLMutableAttributeList * XMLTransformerBase::ProcessAttrList ( css::uno::Reference< css::xml::sax::XAttributeList > &  rAttrList,
sal_uInt16  nActionMap,
bool  bClone 
)

Definition at line 467 of file TransformerBase.cxx.

References aBuffer, AddNamespacePrefix(), sax::Converter::convertMeasure(), ConvertRNGDateTimeToISO(), convertTwipToMm100(), ConvertURIToOASIS(), ConvertURIToOOo(), DecodeStyleName(), EncodeStyleName(), GetClass(), SvXMLNamespaceMap::GetKeyByAttrName(), GetNamespaceMap(), XMLTransformerContext::GetQName(), GetUserDefinedActions(), xmloff::token::GetXMLToken(), i, isWriter(), xmloff::token::IsXMLToken(), lcl_getUnit(), m_vContexts, o3tl::mm100, NegPercent(), pos, RemoveNamespacePrefix(), RenameAttributeValue(), ReplaceInchWithIn(), ReplaceInWithInch(), ReplaceSingleInchWithIn(), ReplaceSingleInWithInch(), o3tl::toTwips(), XML_ATACTION_ADD_APP_NAMESPACE_PREFIX, XML_ATACTION_ADD_NAMESPACE_PREFIX, XML_ATACTION_COPY, XML_ATACTION_DECODE_ID, XML_ATACTION_DECODE_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF, XML_ATACTION_ENCODE_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF, XML_ATACTION_IN2INCH, XML_ATACTION_IN2TWIPS, XML_ATACTION_INCH2IN, XML_ATACTION_INCHS2INS, XML_ATACTION_INS2INCHS, XML_ATACTION_NEG_PERCENT, XML_ATACTION_REMOVE, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX, XML_ATACTION_REMOVE_NAMESPACE_PREFIX, XML_ATACTION_RENAME, XML_ATACTION_RENAME_ADD_NAMESPACE_PREFIX, XML_ATACTION_RENAME_ATTRIBUTE, XML_ATACTION_RENAME_DECODE_STYLE_NAME_REF, XML_ATACTION_RENAME_ENCODE_STYLE_NAME_REF, XML_ATACTION_RENAME_IN2INCH, XML_ATACTION_RENAME_INCH2IN, XML_ATACTION_RENAME_NEG_PERCENT, XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX, XML_ATACTION_RENAME_RNG2ISO_DATETIME, XML_ATACTION_RNG2ISO_DATETIME, XML_ATACTION_SHAPEID, XML_ATACTION_STYLE_DISPLAY_NAME, XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO, XML_ATACTION_TWIPS2IN, XML_ATACTION_URI_OASIS, XML_ATACTION_URI_OOO, XML_ATACTION_WRITER_BACK_GRAPHIC_TRANSPARENCY, xmloff::token::XML_DISPLAY_NAME, xmloff::token::XML_DOCUMENT_STYLES, XML_NAMESPACE_OOOC, XML_NAMESPACE_OOOW, xmloff::token::XML_SPREADSHEET, and xmloff::token::XML_TEXT.

Referenced by XMLControlOOoTransformerContext::CreateChildContext(), XMLFrameOASISTransformerContext::CreateChildContext(), XMLFrameOOoTransformerContext::StartElement(), XMLPersAttrListTContext::StartElement(), XMLProcAddAttrTransformerContext::StartElement(), and XMLProcAttrTransformerContext::StartElement().

◆ processingInstruction()

void SAL_CALL XMLTransformerBase::processingInstruction ( const OUString &  aTarget,
const OUString &  aData 
)
overridevirtual

Definition at line 345 of file TransformerBase.cxx.

References m_xHandler, rData, and rTarget.

◆ RemoveNamespacePrefix()

bool XMLTransformerBase::RemoveNamespacePrefix ( OUString &  rName,
sal_uInt16  nPrefixOnly = 0xffffU 
) const

◆ RenameAttributeValue()

bool XMLTransformerBase::RenameAttributeValue ( OUString &  rOutAttributeValue,
sal_Int32  nParam1,
sal_Int32  nParam2,
sal_Int32  nParam3 
)
static

renames the given rOutAttributeValue if one of the parameters contains a matching token in its lower 16 bits.

The value is converted to the token that is given in the upper 16 bits of the matching parameter.

Definition at line 1345 of file TransformerBase.cxx.

Referenced by ProcessAttrList().

◆ ReplaceInchWithIn()

bool XMLTransformerBase::ReplaceInchWithIn ( OUString &  rValue)
static

Definition at line 881 of file TransformerBase.cxx.

References xmloff::token::GetXMLToken(), nPos, and xmloff::token::XML_IN.

Referenced by ProcessAttrList().

◆ ReplaceInWithInch()

bool XMLTransformerBase::ReplaceInWithInch ( OUString &  rValue)
static

◆ ReplaceSingleInchWithIn()

bool XMLTransformerBase::ReplaceSingleInchWithIn ( OUString &  rValue)
static

◆ ReplaceSingleInWithInch()

bool XMLTransformerBase::ReplaceSingleInWithInch ( OUString &  rValue)
static

◆ SetClass()

void XMLTransformerBase::SetClass ( const OUString &  r)
inline

Definition at line 172 of file TransformerBase.hxx.

References m_aClass.

◆ setDocumentLocator()

void SAL_CALL XMLTransformerBase::setDocumentLocator ( const css::uno::Reference< css::xml::sax::XLocator > &  xLocator)
overridevirtual

Definition at line 351 of file TransformerBase.cxx.

◆ startCDATA()

void SAL_CALL XMLTransformerBase::startCDATA ( )
overridevirtual

Definition at line 356 of file TransformerBase.cxx.

◆ startDocument()

void SAL_CALL XMLTransformerBase::startDocument ( )
overridevirtual

Reimplemented in OOo2OasisTransformer.

Definition at line 196 of file TransformerBase.cxx.

References m_xHandler.

Referenced by OOo2OasisTransformer::startDocument().

◆ startElement()

void SAL_CALL XMLTransformerBase::startElement ( const OUString &  aName,
const css::uno::Reference< css::xml::sax::XAttributeList > &  xAttribs 
)
overridevirtual

◆ unknown()

void SAL_CALL XMLTransformerBase::unknown ( const OUString &  sString)
overridevirtual

Definition at line 372 of file TransformerBase.cxx.

Friends And Related Function Documentation

◆ XMLTransformerContext

friend class XMLTransformerContext
friend

Member Data Documentation

◆ m_aClass

OUString XMLTransformerBase::m_aClass
private

Definition at line 61 of file TransformerBase.hxx.

Referenced by GetClass(), and SetClass().

◆ m_aExtPathPrefix

OUString XMLTransformerBase::m_aExtPathPrefix
private

Definition at line 60 of file TransformerBase.hxx.

Referenced by ConvertURIToOASIS(), ConvertURIToOOo(), and initialize().

◆ m_ElemActions

XMLTransformerActions XMLTransformerBase::m_ElemActions
private

Definition at line 66 of file TransformerBase.hxx.

Referenced by GetElemActions().

◆ m_pNamespaceMap

std::unique_ptr<SvXMLNamespaceMap> XMLTransformerBase::m_pNamespaceMap
private

Definition at line 63 of file TransformerBase.hxx.

Referenced by endElement(), GetNamespaceMap(), and startElement().

◆ m_TokenMap

XMLTransformerTokenMap const XMLTransformerBase::m_TokenMap
private

Definition at line 67 of file TransformerBase.hxx.

Referenced by GetToken().

◆ m_vContexts

std::vector<rtl::Reference<XMLTransformerContext> > XMLTransformerBase::m_vContexts
private

◆ m_vReplaceNamespaceMap

SvXMLNamespaceMap XMLTransformerBase::m_vReplaceNamespaceMap
private

Definition at line 64 of file TransformerBase.hxx.

Referenced by GetReplaceNamespaceMap(), and startElement().

◆ m_xHandler

css::uno::Reference< css::xml::sax::XDocumentHandler > XMLTransformerBase::m_xHandler
private

◆ m_xPropSet

css::uno::Reference< css::beans::XPropertySet > XMLTransformerBase::m_xPropSet
private

Definition at line 57 of file TransformerBase.hxx.

Referenced by GetPropertySet(), and initialize().

◆ mxModel

css::uno::Reference< css::frame::XModel > XMLTransformerBase::mxModel
protected

◆ xCharClass

css::uno::Reference< css::i18n::XCharacterClassification > XMLTransformerBase::xCharClass
private

Definition at line 58 of file TransformerBase.hxx.

Referenced by EncodeStyleName().


The documentation for this class was generated from the following files: