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) throw ()
 
virtual ~XMLTransformerBase () override throw ()
 
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 53 of file TransformerBase.hxx.

Constructor & Destructor Documentation

XMLTransformerBase::XMLTransformerBase ( XMLTransformerActionInit const *  pInit,
::xmloff::token::XMLTokenEnum const *  pTKMapInit 
)
throw (
)
XMLTransformerBase::~XMLTransformerBase ( )
throw (
)
overridevirtual

Definition at line 191 of file TransformerBase.cxx.

Member Function Documentation

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

Definition at line 367 of file TransformerBase.cxx.

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

Definition at line 331 of file TransformerBase.cxx.

References m_vContexts.

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

Definition at line 363 of file TransformerBase.cxx.

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 1367 of file TransformerBase.cxx.

Referenced by ProcessAttrList().

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

Definition at line 1220 of file TransformerBase.cxx.

References m_aExtPathPrefix, and nPos.

Referenced by ProcessAttrList().

bool XMLTransformerBase::ConvertURIToOOo ( OUString &  rURI,
bool  bSupportPackage 
) const
XMLTransformerContext * XMLTransformerBase::CreateContext ( sal_uInt16  nPrefix,
const OUString &  rLocalName,
const OUString &  rQName 
)
protected
virtual XMLTransformerContext* XMLTransformerBase::CreateUserDefinedContext ( const TransformerAction_Impl rAction,
const OUString &  rQName,
bool  bPersistent = false 
)
pure virtual
bool XMLTransformerBase::DecodeStyleName ( OUString &  rName)
static
bool XMLTransformerBase::EncodeStyleName ( OUString &  rName) const

Definition at line 977 of file TransformerBase.cxx.

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

Referenced by ProcessAttrList().

void SAL_CALL XMLTransformerBase::endCDATA ( )
overridevirtual

Definition at line 359 of file TransformerBase.cxx.

void SAL_CALL XMLTransformerBase::endDocument ( )
overridevirtual

Definition at line 200 of file TransformerBase.cxx.

References m_xHandler.

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

Definition at line 295 of file TransformerBase.cxx.

References m_pNamespaceMap, and m_vContexts.

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

Definition at line 1398 of file TransformerBase.cxx.

References m_vContexts.

Referenced by XMLEventOASISTransformerContext::StartElement().

const OUString& XMLTransformerBase::GetClass ( ) const
inline

Definition at line 174 of file TransformerBase.hxx.

References m_aClass.

Referenced by ProcessAttrList().

const XMLTransformerContext * XMLTransformerBase::GetCurrentContext ( ) const

Definition at line 1390 of file TransformerBase.cxx.

References m_vContexts.

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

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

Definition at line 107 of file TransformerBase.hxx.

References m_xHandler.

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

XMLTransformerActions& XMLTransformerBase::GetElemActions ( )
inline

Definition at line 116 of file TransformerBase.hxx.

References m_ElemActions.

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

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

Definition at line 113 of file TransformerBase.hxx.

References m_pNamespaceMap.

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

Definition at line 109 of file TransformerBase.hxx.

References m_xPropSet.

Referenced by XMLDocumentTransformerContext::StartElement().

SvXMLNamespaceMap& XMLTransformerBase::GetReplaceNamespaceMap ( )
inline

Definition at line 114 of file TransformerBase.hxx.

References m_vReplaceNamespaceMap.

Referenced by Oasis2OOoTransformer::Oasis2OOoTransformer().

XMLTokenEnum XMLTransformerBase::GetToken ( const OUString &  rStr) const
XMLTransformerActions * XMLTransformerBase::GetUserDefinedActions ( sal_uInt16  n)
virtual
void SAL_CALL XMLTransformerBase::ignorableWhitespace ( const OUString &  aWhitespaces)
overridevirtual

Definition at line 339 of file TransformerBase.cxx.

References m_xHandler.

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

Definition at line 1408 of file TransformerBase.cxx.

References mxModel.

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

bool XMLTransformerBase::NegPercent ( OUString &  rValue)
static
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, XMLMutableAttributeList::AddAttribute(), AddNamespacePrefix(), sax::Converter::convertMeasure(), ConvertRNGDateTimeToISO(), ConvertURIToOASIS(), ConvertURIToOOo(), DecodeStyleName(), EncodeStyleName(), GetClass(), SvXMLNamespaceMap::GetKeyByAttrName(), GetNamespaceMap(), XMLTransformerContext::GetQName(), GetUserDefinedActions(), xmloff::token::GetXMLToken(), i, isWriter(), xmloff::token::IsXMLToken(), lcl_getUnit(), m_vContexts, NegPercent(), pos, XMLMutableAttributeList::RemoveAttributeByIndex(), RemoveNamespacePrefix(), XMLMutableAttributeList::RenameAttributeByIndex(), RenameAttributeValue(), ReplaceInchWithIn(), ReplaceInWithInch(), ReplaceSingleInchWithIn(), ReplaceSingleInWithInch(), XMLMutableAttributeList::SetValueByIndex(), 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(), XMLProcAddAttrTransformerContext::StartElement(), XMLProcAttrTransformerContext::StartElement(), and XMLPersAttrListTContext::StartElement().

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

Definition at line 344 of file TransformerBase.cxx.

References m_xHandler.

bool XMLTransformerBase::RemoveNamespacePrefix ( OUString &  rName,
sal_uInt16  nPrefixOnly = 0xffffU 
) const
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 1355 of file TransformerBase.cxx.

Referenced by ProcessAttrList().

bool XMLTransformerBase::ReplaceInchWithIn ( OUString &  rValue)
static

Definition at line 889 of file TransformerBase.cxx.

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

Referenced by ProcessAttrList().

bool XMLTransformerBase::ReplaceInWithInch ( OUString &  rValue)
static
bool XMLTransformerBase::ReplaceSingleInchWithIn ( OUString &  rValue)
static
bool XMLTransformerBase::ReplaceSingleInWithInch ( OUString &  rValue)
static
void XMLTransformerBase::SetClass ( const OUString &  r)
inline

Definition at line 173 of file TransformerBase.hxx.

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

Definition at line 350 of file TransformerBase.cxx.

void SAL_CALL XMLTransformerBase::startCDATA ( )
overridevirtual

Definition at line 355 of file TransformerBase.cxx.

void SAL_CALL XMLTransformerBase::startDocument ( )
overridevirtual

Reimplemented in OOo2OasisTransformer.

Definition at line 195 of file TransformerBase.cxx.

References m_xHandler.

Referenced by OOo2OasisTransformer::startDocument().

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

Definition at line 371 of file TransformerBase.cxx.

Friends And Related Function Documentation

friend class XMLTransformerContext
friend

Member Data Documentation

OUString XMLTransformerBase::m_aClass
private

Definition at line 62 of file TransformerBase.hxx.

Referenced by GetClass().

OUString XMLTransformerBase::m_aExtPathPrefix
private

Definition at line 61 of file TransformerBase.hxx.

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

XMLTransformerActions XMLTransformerBase::m_ElemActions
private

Definition at line 67 of file TransformerBase.hxx.

Referenced by GetElemActions().

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

Definition at line 64 of file TransformerBase.hxx.

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

XMLTransformerTokenMap const XMLTransformerBase::m_TokenMap
private

Definition at line 68 of file TransformerBase.hxx.

Referenced by GetToken().

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

Definition at line 65 of file TransformerBase.hxx.

Referenced by GetReplaceNamespaceMap(), and startElement().

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

Definition at line 58 of file TransformerBase.hxx.

Referenced by GetPropertySet(), and initialize().

css::uno::Reference< css::frame::XModel > XMLTransformerBase::mxModel
protected
css::uno::Reference< css::i18n::XCharacterClassification > XMLTransformerBase::xCharClass
private

Definition at line 59 of file TransformerBase.hxx.

Referenced by EncodeStyleName().


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