include/xmloff/XMLBase64ImportContext.hxx | 5 include/xmloff/XMLCharContext.hxx | 14 include/xmloff/XMLTextShapeImportHelper.hxx | 2 include/xmloff/shapeimport.hxx | 35 include/xmloff/txtimp.hxx | 9 include/xmloff/xmlictxt.hxx | 26 include/xmloff/xmlimp.hxx | 3 reportdesign/source/filter/xml/xmlCell.cxx | 2 reportdesign/source/filter/xml/xmlSubDocument.cxx | 2 sc/source/filter/xml/XMLTableShapeImportHelper.cxx | 81 - sc/source/filter/xml/XMLTableShapeImportHelper.hxx | 2 sc/source/filter/xml/XMLTableShapesContext.cxx | 2 sc/source/filter/xml/XMLTrackedChangesContext.cxx | 2 sc/source/filter/xml/importcontext.cxx | 5 sc/source/filter/xml/importcontext.hxx | 2 sc/source/filter/xml/xmlannoi.cxx | 4 sc/source/filter/xml/xmlcelli.cxx | 2 sc/source/filter/xml/xmlconti.cxx | 9 sc/source/filter/xml/xmlconti.hxx | 3 sc/source/filter/xml/xmlstyli.cxx | 1 sw/source/filter/xml/xmlfmt.cxx | 2 sw/source/filter/xml/xmlimp.cxx | 26 sw/source/filter/xml/xmltbli.cxx | 137 -- sw/source/filter/xml/xmltbli.hxx | 2 sw/source/filter/xml/xmltexti.cxx | 4 sw/source/filter/xml/xmltexti.hxx | 4 xmloff/inc/XMLImageMapContext.hxx | 2 xmloff/inc/XMLReplacementImageContext.hxx | 5 xmloff/inc/txtfldi.hxx | 185 -- xmloff/inc/txtvfldi.hxx | 49 xmloff/source/chart/SchXMLChartContext.cxx | 2 xmloff/source/chart/SchXMLPlotAreaContext.cxx | 4 xmloff/source/core/XMLBase64ImportContext.cxx | 9 xmloff/source/core/xmlictxt.cxx | 94 - xmloff/source/core/xmlimp.cxx | 103 - xmloff/source/draw/QRCodeContext.cxx | 68 - xmloff/source/draw/QRCodeContext.hxx | 4 xmloff/source/draw/SignatureLineContext.cxx | 51 xmloff/source/draw/SignatureLineContext.hxx | 4 xmloff/source/draw/XMLImageMapContext.cxx | 4 xmloff/source/draw/XMLNumberStyles.cxx | 2 xmloff/source/draw/XMLReplacementImageContext.cxx | 29 xmloff/source/draw/descriptionimp.cxx | 7 xmloff/source/draw/descriptionimp.hxx | 8 xmloff/source/draw/eventimp.cxx | 5 xmloff/source/draw/eventimp.hxx | 3 xmloff/source/draw/shapeexport.cxx | 4 xmloff/source/draw/shapeimport.cxx | 219 +-- xmloff/source/draw/ximp3dobject.cxx | 86 - xmloff/source/draw/ximp3dobject.hxx | 12 xmloff/source/draw/ximp3dscene.cxx | 35 xmloff/source/draw/ximp3dscene.hxx | 6 xmloff/source/draw/ximpcustomshape.cxx | 3 xmloff/source/draw/ximpcustomshape.hxx | 4 xmloff/source/draw/ximpgrp.cxx | 40 xmloff/source/draw/ximpgrp.hxx | 5 xmloff/source/draw/ximplink.cxx | 18 xmloff/source/draw/ximplink.hxx | 2 xmloff/source/draw/ximppage.cxx | 2 xmloff/source/draw/ximpshap.cxx | 1073 ++++++---------- xmloff/source/draw/ximpshap.hxx | 120 - xmloff/source/table/XMLTableImport.cxx | 128 - xmloff/source/text/XMLAutoMarkFileContext.cxx | 6 xmloff/source/text/XMLAutoMarkFileContext.hxx | 4 xmloff/source/text/XMLCalculationSettingsContext.cxx | 30 xmloff/source/text/XMLCalculationSettingsContext.hxx | 5 xmloff/source/text/XMLChangedRegionImportContext.cxx | 9 xmloff/source/text/XMLFootnoteImportContext.cxx | 1 xmloff/source/text/XMLIndexTOCContext.cxx | 13 xmloff/source/text/XMLIndexTOCContext.hxx | 5 xmloff/source/text/XMLSectionImportContext.cxx | 30 xmloff/source/text/XMLSectionImportContext.hxx | 5 xmloff/source/text/XMLSectionSourceDDEImportContext.cxx | 4 xmloff/source/text/XMLSectionSourceDDEImportContext.hxx | 3 xmloff/source/text/XMLTextFrameContext.cxx | 416 ++---- xmloff/source/text/XMLTextFrameContext.hxx | 7 xmloff/source/text/XMLTextFrameHyperlinkContext.cxx | 82 - xmloff/source/text/XMLTextFrameHyperlinkContext.hxx | 11 xmloff/source/text/XMLTextListBlockContext.cxx | 189 -- xmloff/source/text/XMLTextListBlockContext.hxx | 7 xmloff/source/text/XMLTextShapeImportHelper.cxx | 32 xmloff/source/text/XMLTrackedChangesImportContext.cxx | 9 xmloff/source/text/XMLTrackedChangesImportContext.hxx | 8 xmloff/source/text/txtfldi.cxx | 798 +++++------ xmloff/source/text/txtimp.cxx | 181 -- xmloff/source/text/txtparai.cxx | 215 --- xmloff/source/text/txtparai.hxx | 10 xmloff/source/text/txtvfldi.cxx | 71 - 88 files changed, 1677 insertions(+), 3255 deletions(-)
New commits: commit 5080bb930de3ecfce8ab78bbd23a9d48c2f2bfa0 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Sat Aug 29 11:19:28 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Dec 7 08:52:49 2020 +0100 convert SvXMLImport to fastparser, drop slowparser paths Change-Id: I0f880a7680373043fecf083cdf4de8b0bb7041a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103775 Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/xmloff/XMLBase64ImportContext.hxx b/include/xmloff/XMLBase64ImportContext.hxx index 94b07422203c..e2b62abea1a4 100644 --- a/include/xmloff/XMLBase64ImportContext.hxx +++ b/include/xmloff/XMLBase64ImportContext.hxx @@ -35,11 +35,6 @@ class XMLOFF_DLLPUBLIC XMLBase64ImportContext final : public SvXMLImportContext public: - XMLBase64ImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, - const OUString& rLName, - const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, - const css::uno::Reference< css::io::XOutputStream >& rOut ); - XMLBase64ImportContext( SvXMLImport& rImport, const css::uno::Reference< css::io::XOutputStream >& rOut ); diff --git a/include/xmloff/XMLCharContext.hxx b/include/xmloff/XMLCharContext.hxx index b17d8ea46d3c..dd63a83fc149 100644 --- a/include/xmloff/XMLCharContext.hxx +++ b/include/xmloff/XMLCharContext.hxx @@ -34,20 +34,6 @@ protected: sal_Unicode m_c; public: - - XMLCharContext( - SvXMLImport& rImport, - sal_uInt16 nPrfx, - const OUString& rLName, - const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - sal_Unicode c, - bool bCount ); - XMLCharContext( - SvXMLImport& rImport, - sal_uInt16 nPrfx, - const OUString& rLName, - const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - sal_Int16 nControl ); XMLCharContext( SvXMLImport& rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList, diff --git a/include/xmloff/XMLTextShapeImportHelper.hxx b/include/xmloff/XMLTextShapeImportHelper.hxx index 42f5d412f5b4..f02e566afbec 100644 --- a/include/xmloff/XMLTextShapeImportHelper.hxx +++ b/include/xmloff/XMLTextShapeImportHelper.hxx @@ -35,7 +35,7 @@ public: virtual void addShape( css::uno::Reference< css::drawing::XShape >& rShape, - const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList, css::uno::Reference< css::drawing::XShapes >& rShapes ) override; }; diff --git a/include/xmloff/shapeimport.hxx b/include/xmloff/shapeimport.hxx index 0f841acfd601..54e1407efa9d 100644 --- a/include/xmloff/shapeimport.hxx +++ b/include/xmloff/shapeimport.hxx @@ -251,29 +251,24 @@ public: virtual ~XMLShapeImportHelper() override; - SvXMLShapeContext* CreateGroupChildContext( - SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, - css::uno::Reference< css::drawing::XShapes > const & rShapes, - bool bTemporaryShape = false); - SvXMLShapeContext* CreateGroupChildContext( + static SvXMLShapeContext* CreateGroupChildContext( SvXMLImport& rImport, sal_Int32 nElement, - const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList, css::uno::Reference< css::drawing::XShapes > const & rShapes, bool bTemporaryShape = false); - SvXMLShapeContext* CreateFrameChildContext( - SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, + static SvXMLShapeContext* CreateFrameChildContext( + SvXMLImport& rImport, sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList, css::uno::Reference< css::drawing::XShapes > const & rShapes, - const css::uno::Reference< css::xml::sax::XAttributeList >& xFrameAttrList); - static SvXMLImportContextRef CreateFrameChildContext( - SvXMLImportContext *pThisContext, sal_uInt16 nPrefix, const OUString& rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ); - - SvXMLShapeContext* Create3DSceneChildContext( - SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xFrameAttrList); + static css::uno::Reference< css::xml::sax::XFastContextHandler > CreateFrameChildContext( + SvXMLImportContext *pThisContext, sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ); + + static SvXMLShapeContext* Create3DSceneChildContext( + SvXMLImport& rImport, sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList, css::uno::Reference< css::drawing::XShapes > const & rShapes); const SvXMLTokenMap& GetGroupShapeElemTokenMap(); @@ -299,7 +294,7 @@ public: // shape to the given XShapes. virtual void addShape( css::uno::Reference< css::drawing::XShape >& rShape, - const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList, css::uno::Reference< css::drawing::XShapes >& rShapes); // this function is called whenever the implementation classes have finished importing @@ -307,7 +302,7 @@ public: // all properties and styles are set. virtual void finishShape( css::uno::Reference< css::drawing::XShape >& rShape, - const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList, css::uno::Reference< css::drawing::XShapes >& rShapes); // tdf#127791 help function for group shape events diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx index bdd0e169c9d1..52438189209a 100644 --- a/include/xmloff/txtimp.hxx +++ b/include/xmloff/txtimp.hxx @@ -368,8 +368,8 @@ private: protected: virtual SvXMLImportContext *CreateTableChildContext( SvXMLImport& rImport, - sal_uInt16 nPrefix, const OUString& rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ); + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ); // access, lazy initialization and destruction of backpatchers // Code is implemented in XMLPropertyBackpatcher.cxx @@ -401,11 +401,6 @@ public: sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList, XMLTextType eType = XMLTextType::Shape ); - SvXMLImportContext *CreateTextChildContext( - SvXMLImport& rImport, - sal_uInt16 nPrefix, const OUString& rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - XMLTextType eType = XMLTextType::Shape ); SvXMLTokenMap const& GetTextElemTokenMap(); SvXMLTokenMap const& GetTextPElemTokenMap(); diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx index c0d484844faf..1fee33fce666 100644 --- a/include/xmloff/xmlictxt.hxx +++ b/include/xmloff/xmlictxt.hxx @@ -49,10 +49,7 @@ class XMLOFF_DLLPUBLIC SvXMLImportContext : public css::xml::sax::XFastContextHa friend class SvXMLImport; SvXMLImport& mrImport; - OUString maLocalName; oslInterlockedCount m_nRefCount; - sal_uInt16 mnPrefix; - bool mbPrefixAndLocalNameFilledIn; protected: @@ -61,17 +58,10 @@ protected: public: - bool IsPrefixFilledIn() const { return mnPrefix != 0; } - sal_uInt16 GetPrefix() const { assert(mbPrefixAndLocalNameFilledIn && "those fields not filled, probably fast-parser context"); return mnPrefix; } - const OUString& GetLocalName() const { assert(mbPrefixAndLocalNameFilledIn && "those fields not filled, probably fast-parser context"); return maLocalName; } - /** A contexts constructor does anything that is required if an element * starts. Namespace processing has been done already. * Note that virtual methods cannot be used inside constructors. Use * StartElement instead if this is required. */ - SvXMLImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, - const OUString& rLName ); - SvXMLImportContext( SvXMLImport& rImport ); /** A contexts destructor does anything that is required if an element @@ -80,17 +70,6 @@ public: * EndElement instead if this is required. */ virtual ~SvXMLImportContext(); - /** Create a children element context. By default, the import's - * CreateContext method is called to create a new default context. */ - virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, - const OUString& rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ); - - /** StartElement is called after a context has been constructed and - * before an elements context is parsed. It may be used for actions that - * require virtual methods. The default is to do nothing. */ - virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ); - // css::xml::sax::XFastContextHandler: virtual void SAL_CALL startFastElement (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override; @@ -107,11 +86,6 @@ public: virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, const css::uno::Reference<css::xml::sax::XFastAttributeList>& Attribs) override; - /** - * temporary method to forward call to CreateChildContext, for use during slow-to-fastparser transition - */ - css::uno::Reference< XFastContextHandler > createFastChildContextFallback(sal_Int32 Element, - const css::uno::Reference<css::xml::sax::XFastAttributeList>& Attribs); virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext( const OUString & Namespace, const OUString & Name, diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 4599bcbd751b..ae165a2201b8 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -384,9 +384,6 @@ public: // get import helper for events XMLEventImportHelper& GetEventImport(); - css::uno::Reference< css::xml::sax::XAttributeList > convertToSlowAttrList( - const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs); - static const OUString & getNameFromToken( sal_Int32 nToken ); static OUString getPrefixAndNameFromToken( sal_Int32 nToken ); static OUString getNamespacePrefixFromToken(sal_Int32 nToken, const SvXMLNamespaceMap* pMap); diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx index 51dc70c75ffb..27155525ba69 100644 --- a/reportdesign/source/filter/xml/xmlCell.cxx +++ b/reportdesign/source/filter/xml/xmlCell.cxx @@ -153,7 +153,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > OXMLCell::createFastCh if ( !m_bContainsShape ) m_nCurrentCount = m_pContainer->getSection()->getCount(); uno::Reference< drawing::XShapes > xShapes = m_pContainer->getSection().get(); - xContext = GetImport().GetShapeImport()->CreateGroupChildContext(rImport,nElement,xAttrList,xShapes); + xContext = XMLShapeImportHelper::CreateGroupChildContext(rImport,nElement,xAttrList,xShapes); m_bContainsShape = true; } break; diff --git a/reportdesign/source/filter/xml/xmlSubDocument.cxx b/reportdesign/source/filter/xml/xmlSubDocument.cxx index ec10ba195e86..f77f1392aad9 100644 --- a/reportdesign/source/filter/xml/xmlSubDocument.cxx +++ b/reportdesign/source/filter/xml/xmlSubDocument.cxx @@ -82,7 +82,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > OXMLSubDocument::creat if ( !m_bContainsShape ) m_nCurrentCount = m_pContainer->getSection()->getCount(); uno::Reference< drawing::XShapes > xShapes = m_pContainer->getSection().get(); - xContext = GetImport().GetShapeImport()->CreateGroupChildContext(GetImport(),nElement,xAttrList,xShapes); + xContext = XMLShapeImportHelper::CreateGroupChildContext(GetImport(),nElement,xAttrList,xShapes); m_bContainsShape = true; if (m_pCellParent) { diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx index 32317e7ec86e..443f23d611d2 100644 --- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx +++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx @@ -74,7 +74,7 @@ static uno::Reference< drawing::XShape > lcl_getTopLevelParent( const uno::Refer void XMLTableShapeImportHelper::finishShape( uno::Reference< drawing::XShape >& rShape, - const uno::Reference< xml::sax::XAttributeList >& xAttrList, + const uno::Reference< xml::sax::XFastAttributeList >& xAttrList, uno::Reference< drawing::XShapes >& rShapes ) { bool bNote = false; @@ -93,51 +93,48 @@ void XMLTableShapeImportHelper::finishShape( sal_Int32 nEndX(-1); sal_Int32 nEndY(-1); - sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; std::optional<OUString> xRangeList; SdrLayerID nLayerID = SDRLAYER_NOTFOUND; - for( sal_Int16 i=0; i < nAttrCount; ++i ) + for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { - const OUString& rAttrName(xAttrList->getNameByIndex( i )); - const OUString& rValue(xAttrList->getValueByIndex( i )); - - OUString aLocalName; - sal_uInt16 nPrefix( - static_cast<ScXMLImport&>(mrImporter).GetNamespaceMap().GetKeyByAttrName( rAttrName, - &aLocalName )); - if(nPrefix == XML_NAMESPACE_TABLE) + const OUString sValue = aIter.toString(); + + switch(aIter.getToken()) { - if (IsXMLToken(aLocalName, XML_END_CELL_ADDRESS)) + case XML_ELEMENT(TABLE, XML_END_CELL_ADDRESS): { sal_Int32 nOffset(0); ScDocument* pDoc = static_cast<ScXMLImport&>(mrImporter).GetDocument(); assert(pDoc); - ScRangeStringConverter::GetAddressFromString(aAnchor.maEnd, rValue, *pDoc, ::formula::FormulaGrammar::CONV_OOO, nOffset); + ScRangeStringConverter::GetAddressFromString(aAnchor.maEnd, sValue, *pDoc, ::formula::FormulaGrammar::CONV_OOO, nOffset); // When the cell end address is set, we let the shape resize with the cell aAnchor.mbResizeWithCell = true; + break; } - else if (IsXMLToken(aLocalName, XML_END_X)) + case XML_ELEMENT(TABLE, XML_END_X): { static_cast<ScXMLImport&>(mrImporter). GetMM100UnitConverter().convertMeasureToCore( - nEndX, rValue); + nEndX, sValue); aAnchor.maEndOffset.setX( nEndX ); + break; } - else if (IsXMLToken(aLocalName, XML_END_Y)) + case XML_ELEMENT(TABLE, XML_END_Y): { static_cast<ScXMLImport&>(mrImporter). GetMM100UnitConverter().convertMeasureToCore( - nEndY, rValue); + nEndY, sValue); aAnchor.maEndOffset.setY( nEndY ); + break; } - else if (IsXMLToken(aLocalName, XML_TABLE_BACKGROUND)) - if (IsXMLToken(rValue, XML_TRUE)) + case XML_ELEMENT(TABLE, XML_TABLE_BACKGROUND): + if (IsXMLToken(sValue, XML_TRUE)) nLayerID = SC_LAYER_BACK; - } - else if(nPrefix == XML_NAMESPACE_DRAW) - { - if (IsXMLToken(aLocalName, XML_NOTIFY_ON_UPDATE_OF_RANGES)) - xRangeList = rValue; + break; + case XML_ELEMENT(DRAW, XML_NOTIFY_ON_UPDATE_OF_RANGES): + xRangeList = sValue; + break; + default: ; } } SetLayer(rShape, nLayerID, rShape->getShapeType()); @@ -168,18 +165,18 @@ void XMLTableShapeImportHelper::finishShape( // get the style names for stream copying OUString aStyleName; OUString aTextStyle; - sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; - for( sal_Int16 i=0; i < nAttrCount; ++i ) + for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { - const OUString& rAttrName(xAttrList->getNameByIndex( i )); - OUString aLocalName; - sal_uInt16 nPrefix(static_cast<ScXMLImport&>(mrImporter).GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName )); - if(nPrefix == XML_NAMESPACE_DRAW) + const OUString sValue = aIter.toString(); + switch (aIter.getToken()) { - if (IsXMLToken(aLocalName, XML_STYLE_NAME)) - aStyleName = xAttrList->getValueByIndex( i ); - else if (IsXMLToken(aLocalName, XML_TEXT_STYLE_NAME)) - aTextStyle = xAttrList->getValueByIndex( i ); + case XML_ELEMENT(DRAW, XML_STYLE_NAME): + aStyleName = sValue; + break; + case XML_ELEMENT(DRAW, XML_TEXT_STYLE_NAME): + aTextStyle = sValue; + break; + default:; } } @@ -214,20 +211,14 @@ void XMLTableShapeImportHelper::finishShape( } } } - sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0); SdrLayerID nLayerID = SDRLAYER_NOTFOUND; - for( sal_Int16 i=0; i < nAttrCount; ++i ) + for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { - const OUString& rAttrName(xAttrList->getNameByIndex( i )); - const OUString& rValue(xAttrList->getValueByIndex( i )); - - OUString aLocalName; - sal_uInt16 nPrefix(static_cast<ScXMLImport&>(mrImporter).GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName )); - if(nPrefix == XML_NAMESPACE_TABLE) + if (aIter.getToken() == XML_ELEMENT(TABLE, XML_TABLE_BACKGROUND)) { - if (IsXMLToken(aLocalName, XML_TABLE_BACKGROUND)) - if (IsXMLToken(rValue, XML_TRUE)) - nLayerID = SC_LAYER_BACK; + if (IsXMLToken(aIter.toString(), XML_TRUE)) + nLayerID = SC_LAYER_BACK; + break; } } SetLayer(rShape, nLayerID, rShape->getShapeType()); diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.hxx b/sc/source/filter/xml/XMLTableShapeImportHelper.hxx index 55d85f6ad919..188411a97ce0 100644 --- a/sc/source/filter/xml/XMLTableShapeImportHelper.hxx +++ b/sc/source/filter/xml/XMLTableShapeImportHelper.hxx @@ -40,7 +40,7 @@ public: static void SetLayer(const css::uno::Reference<css::drawing::XShape>& rShape, SdrLayerID nLayerID, std::u16string_view sType); virtual void finishShape(css::uno::Reference< css::drawing::XShape >& rShape, - const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList, css::uno::Reference< css::drawing::XShapes >& rShapes) override; void SetCell (const ScAddress& rAddress) { aStartCell = rAddress; } diff --git a/sc/source/filter/xml/XMLTableShapesContext.cxx b/sc/source/filter/xml/XMLTableShapesContext.cxx index 866d6107d591..676bc560faa5 100644 --- a/sc/source/filter/xml/XMLTableShapesContext.cxx +++ b/sc/source/filter/xml/XMLTableShapesContext.cxx @@ -43,7 +43,7 @@ uno::Reference< xml::sax::XFastContextHandler > ScXMLTableShapesContext::createF { XMLTableShapeImportHelper* pTableShapeImport(static_cast<XMLTableShapeImportHelper*>(rXMLImport.GetShapeImport().get())); pTableShapeImport->SetOnTable(true); - return GetImport().GetShapeImport()->CreateGroupChildContext( + return XMLShapeImportHelper::CreateGroupChildContext( rXMLImport, nElement, xAttrList, xShapes); } XMLOFF_WARN_UNKNOWN_ELEMENT("sc", nElement); diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx index 74f0810831d8..2accb0987344 100644 --- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx +++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx @@ -693,7 +693,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLChangeTextPContext { if (!bWasContext) pTextPContext->characters(sText.makeStringAndClear()); - xContext = pTextPContext->createFastChildContextFallback(nElement, xAttrList); + xContext = pTextPContext->createFastChildContext(nElement, xAttrList); } } diff --git a/sc/source/filter/xml/importcontext.cxx b/sc/source/filter/xml/importcontext.cxx index 611c704c75c8..ef493f23b432 100644 --- a/sc/source/filter/xml/importcontext.cxx +++ b/sc/source/filter/xml/importcontext.cxx @@ -10,11 +10,6 @@ #include "importcontext.hxx" #include "xmlimprt.hxx" -ScXMLImportContext::ScXMLImportContext(ScXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName) : - SvXMLImportContext(rImport, nPrefix, rLocalName) -{ -} - ScXMLImportContext::ScXMLImportContext(SvXMLImport& rImport ) : SvXMLImportContext( rImport ) { diff --git a/sc/source/filter/xml/importcontext.hxx b/sc/source/filter/xml/importcontext.hxx index 0ed1c4d7ed49..01f09dadb051 100644 --- a/sc/source/filter/xml/importcontext.hxx +++ b/sc/source/filter/xml/importcontext.hxx @@ -20,8 +20,6 @@ class ScXMLImport; class ScXMLImportContext : public SvXMLImportContext { public: - ScXMLImportContext(ScXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName); - ScXMLImportContext(SvXMLImport& rImport); protected: diff --git a/sc/source/filter/xml/xmlannoi.cxx b/sc/source/filter/xml/xmlannoi.cxx index d14fb587645c..143d60a414c1 100644 --- a/sc/source/filter/xml/xmlannoi.cxx +++ b/sc/source/filter/xml/xmlannoi.cxx @@ -52,7 +52,7 @@ ScXMLAnnotationContext::ScXMLAnnotationContext( ScXMLImport& rImport, { XMLTableShapeImportHelper* pTableShapeImport = static_cast<XMLTableShapeImportHelper*>(GetScImport().GetShapeImport().get()); pTableShapeImport->SetAnnotation(this); - pShapeContext.reset( GetImport().GetShapeImport()->CreateGroupChildContext( + pShapeContext.reset( XMLShapeImportHelper::CreateGroupChildContext( GetScImport(), nElement, xAttrList, xLocalShapes, true) ); } @@ -126,7 +126,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > ScXMLAnnotationContext if( pShapeContext ) { - auto p = pShapeContext->createFastChildContextFallback(nElement, xAttrList); + auto p = pShapeContext->createFastChildContext(nElement, xAttrList); if (p) return p; } diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 3b1bab4f34ab..26d85c4768f4 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -697,7 +697,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLTableRowCellContex static_cast< XMLTableShapeImportHelper* >( rXMLImport.GetShapeImport().get() ); pTableShapeImport->SetOnTable(false); pTableShapeImport->SetCell(aCellPos); - pContext = GetImport().GetShapeImport()->CreateGroupChildContext( + pContext = XMLShapeImportHelper::CreateGroupChildContext( rXMLImport, nElement, xAttrList, xShapes); if (pContext) { diff --git a/sc/source/filter/xml/xmlconti.cxx b/sc/source/filter/xml/xmlconti.cxx index 871cabf888be..532354f28bf2 100644 --- a/sc/source/filter/xml/xmlconti.cxx +++ b/sc/source/filter/xml/xmlconti.cxx @@ -26,15 +26,6 @@ using namespace xmloff::token; -ScXMLContentContext::ScXMLContentContext( ScXMLImport& rImport, - sal_uInt16 nPrfx, - const OUString& rLName, - OUStringBuffer& sTempValue) : - ScXMLImportContext( rImport, nPrfx, rLName ), - sValue(sTempValue) -{ -} - ScXMLContentContext::ScXMLContentContext( ScXMLImport& rImport, OUStringBuffer& sTempValue) : ScXMLImportContext( rImport ), diff --git a/sc/source/filter/xml/xmlconti.hxx b/sc/source/filter/xml/xmlconti.hxx index 2eb568a27e24..eb3cbf40dec1 100644 --- a/sc/source/filter/xml/xmlconti.hxx +++ b/sc/source/filter/xml/xmlconti.hxx @@ -28,9 +28,6 @@ class ScXMLContentContext : public ScXMLImportContext public: - ScXMLContentContext( ScXMLImport& rImport, sal_uInt16 nPrfx, - const OUString& rLName, - OUStringBuffer& sValue); ScXMLContentContext( ScXMLImport& rImport, OUStringBuffer& sValue); diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 20ea0dffaa75..3a0fd7ecf2ba 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -263,7 +263,6 @@ namespace { class XMLTableCellPropsContext : public SvXMLPropertySetContext { - using SvXMLPropertySetContext::CreateChildContext; public: XMLTableCellPropsContext( SvXMLImport& rImport, sal_Int32 nElement, diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index 50a6aead1671..fa0b31a5e78d 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -608,7 +608,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SwXMLItemSetStyleConte pTextStyle->startFastElement( nElement, xTmpAttrList.get() ); rStyles.AddStyle( *pTextStyle ); } - return pTextStyle->createFastChildContextFallback( nElement, xAttrList ); + return pTextStyle->createFastChildContext( nElement, xAttrList ); } default: XMLOFF_WARN_UNKNOWN_ELEMENT("sw", nElement); diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 0a5c68b18719..feda4bec3ff4 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -151,12 +151,13 @@ namespace { // in SwXMLOfficeDocContext_Impl class SwXMLDocContext_Impl : public virtual SvXMLImportContext { + sal_Int32 mnElement; protected: // #i69629# SwXMLImport& GetSwImport() { return static_cast<SwXMLImport&>(GetImport()); } public: - SwXMLDocContext_Impl( SwXMLImport& rImport ); + SwXMLDocContext_Impl( SwXMLImport& rImport, sal_Int32 nElement ); virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override; @@ -164,8 +165,8 @@ public: } -SwXMLDocContext_Impl::SwXMLDocContext_Impl( SwXMLImport& rImport ) : - SvXMLImportContext( rImport ) +SwXMLDocContext_Impl::SwXMLDocContext_Impl( SwXMLImport& rImport, sal_Int32 nElement ) : + SvXMLImportContext( rImport ), mnElement(nElement) { } @@ -186,7 +187,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SwXMLDocContext_Impl::c break; case XML_ELEMENT(OFFICE, XML_AUTOMATIC_STYLES): // don't use the autostyles from the styles-document for the progress - if ( !IsPrefixFilledIn() || ! IsXMLToken( GetLocalName(), XML_DOCUMENT_STYLES ) ) + if ( mnElement != 0 && (mnElement & TOKEN_MASK) != XML_DOCUMENT_STYLES ) GetSwImport().GetProgressBarHelper()->Increment ( PROGRESS_BAR_STEP ); return GetSwImport().CreateStylesContext( true ); @@ -221,7 +222,7 @@ class SwXMLOfficeDocContext_Impl : { public: - SwXMLOfficeDocContext_Impl( SwXMLImport& rImport, + SwXMLOfficeDocContext_Impl( SwXMLImport& rImport, sal_Int32 nElement, const Reference< document::XDocumentProperties >& xDocProps); virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( @@ -232,9 +233,10 @@ public: SwXMLOfficeDocContext_Impl::SwXMLOfficeDocContext_Impl( SwXMLImport& rImport, + sal_Int32 nElement, const Reference< document::XDocumentProperties >& xDocProps) : SvXMLImportContext( rImport ), - SwXMLDocContext_Impl( rImport ), + SwXMLDocContext_Impl( rImport, nElement ), SvXMLMetaDocumentContext( rImport, xDocProps ) { } @@ -269,16 +271,16 @@ class SwXMLDocStylesContext_Impl : public SwXMLDocContext_Impl { public: - SwXMLDocStylesContext_Impl( SwXMLImport& rImport ); + SwXMLDocStylesContext_Impl( SwXMLImport& rImport, sal_Int32 nElement ); virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; }; } -SwXMLDocStylesContext_Impl::SwXMLDocStylesContext_Impl( SwXMLImport& rImport ) : +SwXMLDocStylesContext_Impl::SwXMLDocStylesContext_Impl( SwXMLImport& rImport, sal_Int32 nElement ) : SvXMLImportContext( rImport ), - SwXMLDocContext_Impl( rImport ) + SwXMLDocContext_Impl( rImport, nElement ) { } @@ -306,16 +308,16 @@ SvXMLImportContext *SwXMLImport::CreateFastContext( sal_Int32 nElement, uno::Reference<document::XDocumentProperties> const xDocProps( GetDocumentProperties()); // flat OpenDocument file format - pContext = new SwXMLOfficeDocContext_Impl( *this, xDocProps ); + pContext = new SwXMLOfficeDocContext_Impl( *this, nElement, xDocProps ); } break; // #i69629# - own subclasses for <office:document> and <office:document-styles> case XML_ELEMENT(OFFICE, XML_DOCUMENT_SETTINGS): case XML_ELEMENT(OFFICE, XML_DOCUMENT_CONTENT): - pContext = new SwXMLDocContext_Impl( *this ); + pContext = new SwXMLDocContext_Impl( *this, nElement ); break; case XML_ELEMENT(OFFICE, XML_DOCUMENT_STYLES): - pContext = new SwXMLDocStylesContext_Impl( *this ); + pContext = new SwXMLDocStylesContext_Impl( *this, nElement ); break; } return pContext; diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 22be0dad5587..39b9fabe39c3 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -1179,143 +1179,6 @@ SwXMLTableCell_Impl *SwXMLTableContext::GetCell( sal_uInt32 nRow, } -SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport, - const Reference< xml::sax::XAttributeList > & xAttrList ) : - XMLTextTableContext( rImport ), - m_pRows( new SwXMLTableRows_Impl ), - m_pTableNode( nullptr ), - m_pBox1( nullptr ), - m_bOwnsBox1( false ), - m_pSttNd1( nullptr ), - m_pBoxFormat( nullptr ), - m_pLineFormat( nullptr ), - m_bFirstSection( true ), - m_bRelWidth( true ), - m_bHasSubTables( false ), - m_nHeaderRows( 0 ), - m_nCurRow( 0 ), - m_nCurCol( 0 ), - m_nWidth( 0 ) -{ - OUString aName; - OUString sXmlId; - - // this method will modify the document directly -> lock SolarMutex - SolarMutexGuard aGuard; - - sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; - for( sal_Int16 i=0; i < nAttrCount; i++ ) - { - const OUString& rAttrName = xAttrList->getNameByIndex( i ); - - OUString aLocalName; - const sal_uInt16 nPrefix = - GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, - &aLocalName ); - const OUString& rValue = xAttrList->getValueByIndex( i ); - if( XML_NAMESPACE_TABLE == nPrefix ) - { - if( IsXMLToken( aLocalName, XML_STYLE_NAME ) ) - m_aStyleName = rValue; - else if( IsXMLToken( aLocalName, XML_NAME ) ) - aName = rValue; - else if( IsXMLToken( aLocalName, XML_DEFAULT_CELL_STYLE_NAME ) ) - m_aDfltCellStyleName = rValue; - else if( IsXMLToken( aLocalName, XML_TEMPLATE_NAME ) ) - m_aTemplateName = rValue; - } - else if ( (XML_NAMESPACE_XML == nPrefix) && - IsXMLToken( aLocalName, XML_ID ) ) - { - sXmlId = rValue; - } - } - - SwDoc *pDoc = SwImport::GetDocFromXMLImport( GetSwImport() ); - - OUString sTableName; - if( !aName.isEmpty() ) - { - const SwTableFormat *pTableFormat = pDoc->FindTableFormatByName( aName ); - if( !pTableFormat ) - sTableName = aName; - } - if( sTableName.isEmpty() ) - { - sTableName = pDoc->GetUniqueTableName(); - GetImport().GetTextImport() - ->GetRenameMap().Add( XML_TEXT_RENAME_TYPE_TABLE, aName, sTableName ); - } - - Reference< XTextTable > xTable; - SwXTextTable *pXTable = nullptr; - Reference<XMultiServiceFactory> xFactory( GetImport().GetModel(), - UNO_QUERY ); - OSL_ENSURE( xFactory.is(), "factory missing" ); - if( xFactory.is() ) - { - Reference<XInterface> xIfc = xFactory->createInstance( "com.sun.star.text.TextTable" ); - OSL_ENSURE( xIfc.is(), "Couldn't create a table" ); - - if( xIfc.is() ) - xTable.set( xIfc, UNO_QUERY ); - } - - if( xTable.is() ) - { - xTable->initialize( 1, 1 ); - - try - { - m_xTextContent = xTable; - GetImport().GetTextImport()->InsertTextContent( m_xTextContent ); - } - catch( IllegalArgumentException& ) - { - xTable = nullptr; - } - } - - if( xTable.is() ) - { - //FIXME - // xml:id for RDF metadata - GetImport().SetXmlId(xTable, sXmlId); - - Reference<XUnoTunnel> xTableTunnel( xTable, UNO_QUERY); - if( xTableTunnel.is() ) - { - pXTable = reinterpret_cast< SwXTextTable * >( - sal::static_int_cast< sal_IntPtr >( xTableTunnel->getSomething( SwXTextTable::getUnoTunnelId() ))); - OSL_ENSURE( pXTable, "SwXTextTable missing" ); - } - - Reference < XCellRange > xCellRange( xTable, UNO_QUERY ); - Reference < XCell > xCell = xCellRange->getCellByPosition( 0, 0 ); - Reference < XText> xText( xCell, UNO_QUERY ); - m_xOldCursor = GetImport().GetTextImport()->GetCursor(); - GetImport().GetTextImport()->SetCursor( xText->createTextCursor() ); - - // take care of open redlines for tables - GetImport().GetTextImport()->RedlineAdjustStartNodeCursor(); - } - if( !pXTable ) - return; - - SwFrameFormat *const pTableFrameFormat = pXTable->GetFrameFormat(); - OSL_ENSURE( pTableFrameFormat, "table format missing" ); - SwTable *pTable = SwTable::FindTable( pTableFrameFormat ); - OSL_ENSURE( pTable, "table missing" ); - m_pTableNode = pTable->GetTableNode(); - OSL_ENSURE( m_pTableNode, "table node missing" ); - - pTableFrameFormat->SetName( sTableName ); - - SwTableLine *pLine1 = m_pTableNode->GetTable().GetTabLines()[0U]; - m_pBox1 = pLine1->GetTabBoxes()[0U]; - m_pSttNd1 = m_pBox1->GetSttNd(); -} - SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport, const Reference< xml::sax::XFastAttributeList > & xAttrList ) : XMLTextTableContext( rImport ), diff --git a/sw/source/filter/xml/xmltbli.hxx b/sw/source/filter/xml/xmltbli.hxx index 4f71f7a5a164..fc544f6c6886 100644 --- a/sw/source/filter/xml/xmltbli.hxx +++ b/sw/source/filter/xml/xmltbli.hxx @@ -136,8 +136,6 @@ class SwXMLTableContext : public XMLTextTableContext public: - SwXMLTableContext( SwXMLImport& rImport, - const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ); SwXMLTableContext( SwXMLImport& rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ); SwXMLTableContext( SwXMLImport& rImport, diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 37402c63daf5..be863f65bfa3 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -180,8 +180,8 @@ SwXMLTextImportHelper::~SwXMLTextImportHelper() SvXMLImportContext *SwXMLTextImportHelper::CreateTableChildContext( SvXMLImport& rImport, - sal_uInt16 /*nPrefix*/, const OUString& /*rLocalName*/, - const uno::Reference< XAttributeList > & xAttrList ) + sal_Int32 /*nElement*/, + const uno::Reference< XFastAttributeList > & xAttrList ) { return new SwXMLTableContext( static_cast<SwXMLImport&>(rImport), xAttrList ); } diff --git a/sw/source/filter/xml/xmltexti.hxx b/sw/source/filter/xml/xmltexti.hxx index 1aefcfe641e0..067472e5a98f 100644 --- a/sw/source/filter/xml/xmltexti.hxx +++ b/sw/source/filter/xml/xmltexti.hxx @@ -31,8 +31,8 @@ class SwXMLTextImportHelper : public XMLTextImportHelper protected: virtual SvXMLImportContext *CreateTableChildContext( SvXMLImport& rImport, - sal_uInt16 nPrefix, const OUString& rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override; public: SwXMLTextImportHelper( diff --git a/xmloff/inc/XMLImageMapContext.hxx b/xmloff/inc/XMLImageMapContext.hxx index d026477a6c3a..5c9c173c1082 100644 --- a/xmloff/inc/XMLImageMapContext.hxx +++ b/xmloff/inc/XMLImageMapContext.hxx @@ -44,8 +44,6 @@ public: XMLImageMapContext( SvXMLImport& rImport, - sal_uInt16 nPrefix, - const OUString& rLocalName, css::uno::Reference< css::beans::XPropertySet> const & rPropertySet); virtual ~XMLImageMapContext() override; diff --git a/xmloff/inc/XMLReplacementImageContext.hxx b/xmloff/inc/XMLReplacementImageContext.hxx index 14a1e58355ee..4b089d6118ce 100644 --- a/xmloff/inc/XMLReplacementImageContext.hxx +++ b/xmloff/inc/XMLReplacementImageContext.hxx @@ -39,9 +39,8 @@ public: XMLReplacementImageContext( SvXMLImport& rImport, - sal_uInt16 nPrfx, - const OUString& rLName, - const css::uno::Reference< css::xml::sax::XAttributeList > & rAttrList, + sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList > & rAttrList, const css::uno::Reference< css::beans::XPropertySet >& rPropSet ); virtual ~XMLReplacementImageContext() override; diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx index b8560b17b3d6..2a694423b640 100644 --- a/xmloff/inc/txtfldi.hxx +++ b/xmloff/inc/txtfldi.hxx @@ -66,13 +66,7 @@ public: XMLTextFieldImportContext( SvXMLImport& rImport, /// XML Import XMLTextImportHelper& rHlp, /// Text import helper - const char* pService, /// name of SO API service - sal_uInt16 nPrfx, /// namespace prefix - const OUString& rLocalName); /// element name w/o prefix - XMLTextFieldImportContext( - SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - const char* pService); /// name of SO API service + const char* pService); /// name of SO API service /// process character data: will be collected in member sContentBuffer virtual void SAL_CALL characters( const OUString& sContent ) override; @@ -87,12 +81,6 @@ public: /// create the appropriate field context from /// (for use in paragraph import) - static XMLTextFieldImportContext* CreateTextFieldImportContext( - SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrefix, - const OUString& rName, - sal_uInt16 nToken); static XMLTextFieldImportContext* CreateTextFieldImportContext( SvXMLImport& rImport, XMLTextImportHelper& rHlp, @@ -141,9 +129,7 @@ public: XMLSenderFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper protected: /// start element @@ -171,9 +157,7 @@ public: XMLAuthorFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper private: /// start element @@ -202,9 +186,7 @@ public: XMLPlaceholderFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper private: /// process attribute values @@ -240,9 +222,7 @@ public: XMLTimeFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper /// process attribute values virtual void ProcessAttribute( sal_Int32 nAttrToken, @@ -261,9 +241,7 @@ public: XMLDateFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper /// process attribute values virtual void ProcessAttribute( sal_Int32 nAttrToken, @@ -285,9 +263,7 @@ public: XMLPageContinuationImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper /// process attribute values virtual void ProcessAttribute( sal_Int32 nAttrToken, @@ -316,9 +292,7 @@ public: XMLPageNumberImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper /// process attribute values @@ -354,8 +328,6 @@ protected: XMLDatabaseFieldImportContext(SvXMLImport& rImport, XMLTextImportHelper& rHlp, const char* pServiceName, - sal_uInt16 nPrfx, - const OUString& sLocalName, bool bUseDisplay ); public: @@ -380,9 +352,7 @@ class XMLDatabaseNameImportContext final : public XMLDatabaseFieldImportContext public: XMLDatabaseNameImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); /// process attribute values virtual void ProcessAttribute( sal_Int32 nAttrToken, @@ -401,16 +371,12 @@ protected: // for use in child classes XMLDatabaseNextImportContext(SvXMLImport& rImport, XMLTextImportHelper& rHlp, - const char* pServiceName, - sal_uInt16 nPrfx, - const OUString& sLocalName); + const char* pServiceName); public: XMLDatabaseNextImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); /// process attribute values virtual void ProcessAttribute( sal_Int32 nAttrToken, @@ -431,9 +397,7 @@ class XMLDatabaseSelectImportContext final : public XMLDatabaseNextImportContext public: XMLDatabaseSelectImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); /// process attribute values virtual void ProcessAttribute( sal_Int32 nAttrToken, @@ -458,9 +422,7 @@ class XMLDatabaseNumberImportContext final : public XMLDatabaseFieldImportContex public: XMLDatabaseNumberImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); /// process attribute values virtual void ProcessAttribute( sal_Int32 nAttrToken, @@ -488,9 +450,7 @@ public: XMLSimpleDocInfoImportContext(SvXMLImport& rImport, XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName, - sal_uInt16 nToken, + sal_Int32 nElementToken, bool bContent, bool bAuthor); @@ -503,7 +463,7 @@ protected: virtual void PrepareField( const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override; - static const char* MapTokenToServiceName(sal_uInt16 nToken); + static const char* MapTokenToServiceName(sal_Int32 nElementToken); }; /** import docinfo fields with date or time attributes and numberformats */ @@ -523,9 +483,7 @@ public: XMLDateTimeDocInfoImportContext(SvXMLImport& rImport, XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName, - sal_uInt16 nToken); + sal_Int32 nElement); private: /// process attribute values @@ -544,9 +502,7 @@ public: XMLRevisionDocInfoImportContext(SvXMLImport& rImport, XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName, - sal_uInt16 nToken); + sal_Int32 nElement); private: /// prepare XTextField for insertion into document @@ -569,9 +525,7 @@ public: XMLUserDocInfoImportContext(SvXMLImport& rImport, XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName, - sal_uInt16 nToken); + sal_Int32 nElement); private: /// process attribute values @@ -593,9 +547,7 @@ class XMLHiddenParagraphImportContext final : public XMLTextFieldImportContext public: XMLHiddenParagraphImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// process attribute values @@ -625,9 +577,7 @@ class XMLConditionalTextImportContext final : public XMLTextFieldImportContext public: XMLConditionalTextImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// process attribute values @@ -656,9 +606,7 @@ class XMLHiddenTextImportContext final : public XMLTextFieldImportContext public: XMLHiddenTextImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// process attribute values @@ -683,9 +631,7 @@ class XMLFileNameImportContext final : public XMLTextFieldImportContext public: XMLFileNameImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// process attribute values @@ -707,9 +653,7 @@ class XMLTemplateNameImportContext final : public XMLTextFieldImportContext public: XMLTemplateNameImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// process attribute values @@ -730,9 +674,7 @@ class XMLChapterImportContext final : public XMLTextFieldImportContext public: XMLChapterImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// process attribute values @@ -758,9 +700,7 @@ public: XMLCountFieldImportContext(SvXMLImport& rImport, XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName, - sal_uInt16 nToken); + sal_Int32 nElement); private: /// process attribute values @@ -771,7 +711,7 @@ private: virtual void PrepareField( const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; - static const char* MapTokenToServiceName(sal_uInt16 nToken); + static const char* MapTokenToServiceName(sal_Int32 nElement); }; /** import page variable fields (<text:get-page-variable>) */ @@ -785,9 +725,7 @@ class XMLPageVarGetFieldImportContext final : public XMLTextFieldImportContext public: XMLPageVarGetFieldImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// process attribute values @@ -808,9 +746,7 @@ class XMLPageVarSetFieldImportContext final : public XMLTextFieldImportContext public: XMLPageVarSetFieldImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// process attribute values @@ -835,9 +771,7 @@ class XMLMacroFieldImportContext final : public XMLTextFieldImportContext public: XMLMacroFieldImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// for <office:events> children @@ -859,7 +793,7 @@ class XMLReferenceFieldImportContext final : public XMLTextFieldImportContext { OUString sName; OUString sLanguage; - sal_uInt16 nElementToken; + sal_Int32 nElementToken; sal_Int16 nSource; sal_Int16 nType; @@ -870,9 +804,7 @@ public: XMLReferenceFieldImportContext(SvXMLImport& rImport, XMLTextImportHelper& rHlp, - sal_uInt16 nToken, - sal_uInt16 nPrfx, - const OUString& sLocalName); + sal_Int32 nToken); private: /// start element @@ -894,9 +826,7 @@ class XMLDdeFieldDeclsImportContext final : public SvXMLImportContext { public: - XMLDdeFieldDeclsImportContext(SvXMLImport& rImport, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLDdeFieldDeclsImportContext(SvXMLImport& rImport); virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32 nElement, @@ -925,9 +855,7 @@ class XMLDdeFieldImportContext final : public XMLTextFieldImportContext public: XMLDdeFieldImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// process attribute values @@ -949,9 +877,7 @@ class XMLSheetNameImportContext final : public XMLTextFieldImportContext public: XMLSheetNameImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// no attributes -> empty method @@ -970,9 +896,7 @@ public: XMLPageNameFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper /// process attribute values virtual void ProcessAttribute( sal_Int32 nAttrToken, @@ -1013,17 +937,15 @@ class XMLBibliographyFieldImportContext final : public XMLTextFieldImportContext public: XMLBibliographyFieldImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// process attributes (fill aValues) virtual void SAL_CALL startFastElement( sal_Int32 nElement, - const css::uno::Reference<css::xml::sax::XFastAttributeList> & xAttrList) override; + const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList) override; - /// empty method; all attributes are handled in startFastElement + /// empty method; all attributes are handled in StartElement virtual void ProcessAttribute( sal_Int32 nAttrToken, const OUString& sAttrValue ) override; @@ -1032,6 +954,7 @@ private: const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; static const char* MapBibliographyFieldName(const OUString& sName); + static const char* MapBibliographyFieldName(sal_Int32 nElement); }; /** Import an annotation field (<text:annotation>) */ @@ -1048,15 +971,13 @@ class XMLAnnotationImportContext final : public XMLTextFieldImportContext css::uno::Reference < css::text::XTextCursor > mxCursor; css::uno::Reference < css::text::XTextCursor > mxOldCursor; - sal_uInt16 m_nToken; + sal_Int32 mnElement; public: XMLAnnotationImportContext(SvXMLImport& rImport, XMLTextImportHelper& rHlp, - sal_uInt16 nToken, - sal_uInt16 nPrfx, - const OUString& sLocalName); + sal_Int32 nElement); private: /// process attributes @@ -1084,9 +1005,7 @@ class XMLScriptImportContext final : public XMLTextFieldImportContext public: XMLScriptImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// process attributes @@ -1106,9 +1025,7 @@ class XMLMeasureFieldImportContext final : public XMLTextFieldImportContext public: XMLMeasureFieldImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); private: /// process attribute values @@ -1135,9 +1052,7 @@ class XMLDropDownFieldImportContext final : public XMLTextFieldImportContext public: XMLDropDownFieldImportContext(SvXMLImport& rImport, - XMLTextImportHelper& rHlp, - sal_uInt16 nPrfx, - const OUString& sLocalName); + XMLTextImportHelper& rHlp); virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; @@ -1159,9 +1074,7 @@ public: XMLHeaderFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper /// process attribute values virtual void ProcessAttribute( sal_Int32 nAttrToken, @@ -1179,9 +1092,7 @@ public: XMLFooterFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper /// process attribute values virtual void ProcessAttribute( sal_Int32 nAttrToken, @@ -1199,9 +1110,7 @@ public: XMLDateTimeFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper /// process attribute values virtual void ProcessAttribute( sal_Int32 nAttrToken, diff --git a/xmloff/inc/txtvfldi.hxx b/xmloff/inc/txtvfldi.hxx index 5cfca16c312b..8d0fb73bdd51 100644 --- a/xmloff/inc/txtvfldi.hxx +++ b/xmloff/inc/txtvfldi.hxx @@ -138,8 +138,6 @@ public: SvXMLImport& rImport, /// XML Import XMLTextImportHelper& rHlp, /// text import helper const char* pServiceName, /// name of SO API service - sal_uInt16 nPrfx, /// namespace prefix - const OUString& rLocalName, /// element name w/o prefix // config variables for PrepareField behavior: bool bFormula, /// set Formula property bool bFormulaDefault, /// use content as default for formula @@ -177,9 +175,7 @@ public: XMLVariableGetFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& rLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper private: @@ -197,9 +193,7 @@ public: XMLExpressionFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper private: virtual void PrepareField( @@ -214,9 +208,7 @@ public: XMLTextInputFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& sLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper private: virtual void PrepareField( @@ -241,8 +233,6 @@ public: SvXMLImport& rImport, /// see XMLTextFieldImportContext XMLTextImportHelper& rHlp, /// see XMLTextFieldImportContext const char* pServiceName, /// see XMLTextFieldImportContext - sal_uInt16 nPrfx, /// see XMLTextFieldImportContext - const OUString& rLocalName, /// see XMLTextFieldImportContext // for finding appropriate field master (see endFastElement()) VarType eVarType, /// variable type // config variables: @@ -278,10 +268,8 @@ public: XMLVariableSetFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& rLocalName); /// element name w/o prefix - + XMLTextImportHelper& rHlp); /// Text import helper +\ private: /// prepare XTextField for insertion into document virtual void PrepareField( @@ -297,9 +285,7 @@ public: XMLVariableInputFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& rLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper private: @@ -318,9 +304,7 @@ public: XMLUserFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& rLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper }; /** user input fields (<text:user-field-input>) */ @@ -332,9 +316,7 @@ public: XMLUserFieldInputImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& rLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper virtual void PrepareField( const css::uno::Reference<css::beans::XPropertySet> & xPropertySet) override; @@ -355,9 +337,7 @@ public: XMLSequenceFieldImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// Text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& rLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// Text import helper private: @@ -382,12 +362,9 @@ class XMLVariableDeclsImportContext final : public SvXMLImportContext public: - XMLVariableDeclsImportContext( SvXMLImport& rImport, /// XML Import XMLTextImportHelper& rHlp, /// text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& rLocalName, /// element name w/o prefix enum VarType eVarType); /// variable type virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( @@ -431,9 +408,7 @@ public: XMLTableFormulaImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& rLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// text import helper private: @@ -463,9 +438,7 @@ public: XMLDatabaseDisplayImportContext( SvXMLImport& rImport, /// XML Import - XMLTextImportHelper& rHlp, /// text import helper - sal_uInt16 nPrfx, /// namespace prefix - const OUString& rLocalName); /// element name w/o prefix + XMLTextImportHelper& rHlp); /// text import helper private: diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index d6ab1baf5c09..8b4f79582138 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -1109,7 +1109,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SchXMLChartContext::cr SAL_WARN_IF( !mxDrawPage.is(), "xmloff.chart", "Invalid Chart Page" ); } if( mxDrawPage.is()) - pContext = GetImport().GetShapeImport()->CreateGroupChildContext( + pContext = XMLShapeImportHelper::CreateGroupChildContext( GetImport(), nElement, xAttrList, mxDrawPage ); break; } diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index d43e6e2fef91..985a4a633212 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -218,9 +218,13 @@ void SchXMLPlotAreaContext::startFastElement (sal_Int32 /*nElement*/, switch( aIter.getToken() ) { case XML_ELEMENT(SVG, XML_X): + case XML_ELEMENT(SVG_COMPAT, XML_X): case XML_ELEMENT(SVG, XML_Y): + case XML_ELEMENT(SVG_COMPAT, XML_Y): case XML_ELEMENT(SVG, XML_WIDTH): + case XML_ELEMENT(SVG_COMPAT, XML_WIDTH): case XML_ELEMENT(SVG, XML_HEIGHT): + case XML_ELEMENT(SVG_COMPAT, XML_HEIGHT): m_aOuterPositioning.readPositioningAttribute( aIter.getToken(), aValue ); break; case XML_ELEMENT(CHART, XML_STYLE_NAME): diff --git a/xmloff/source/core/XMLBase64ImportContext.cxx b/xmloff/source/core/XMLBase64ImportContext.cxx index 504460bff96a..301865a26c10 100644 --- a/xmloff/source/core/XMLBase64ImportContext.cxx +++ b/xmloff/source/core/XMLBase64ImportContext.cxx @@ -29,15 +29,6 @@ using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::io; -XMLBase64ImportContext::XMLBase64ImportContext( - SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, - const Reference< XAttributeList >&, - const Reference< XOutputStream >& rOut ) : - SvXMLImportContext( rImport, nPrfx, rLName ), - xOut( rOut ) -{ -} - XMLBase64ImportContext::XMLBase64ImportContext( SvXMLImport& rImport, const Reference< XOutputStream >& rOut ) : diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx index b41d847805f0..360763349c93 100644 --- a/xmloff/source/core/xmlictxt.cxx +++ b/xmloff/source/core/xmlictxt.cxx @@ -27,21 +27,9 @@ using namespace ::com::sun::star; -SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp, sal_uInt16 nPrfx, - const OUString& rLName ) - : mrImport(rImp) - , maLocalName(rLName) - , m_nRefCount(0) - , mnPrefix(nPrfx) - , mbPrefixAndLocalNameFilledIn(true) -{ -} - SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp ) : mrImport(rImp) , m_nRefCount(0) - , mnPrefix(0) - , mbPrefixAndLocalNameFilledIn(false) { } @@ -49,50 +37,13 @@ SvXMLImportContext::~SvXMLImportContext() { } -SvXMLImportContextRef SvXMLImportContext::CreateChildContext( sal_uInt16 /*nPrefix*/, - const OUString& /*rLocalName*/, - const uno::Reference<xml::sax::XAttributeList>& ) -{ - return nullptr; -} - -void SvXMLImportContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& ) -{ -} - void SvXMLImportContext::endFastElement(sal_Int32 ) { } // css::xml::sax::XFastContextHandler: -void SAL_CALL SvXMLImportContext::startFastElement(sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList > & Attribs) +void SAL_CALL SvXMLImportContext::startFastElement(sal_Int32 /*nElement*/, const uno::Reference< xml::sax::XFastAttributeList > & ) { - const OUString& rPrefix = SvXMLImport::getNamespacePrefixFromToken(nElement, &GetImport().GetNamespaceMap()); - const OUString& rLocalName = SvXMLImport::getNameFromToken( nElement ); - startUnknownElement( SvXMLImport::aDefaultNamespace, (rPrefix.isEmpty())? rLocalName : rPrefix + SvXMLImport::aNamespaceSeparator + rLocalName, Attribs ); - mrImport.maAttrList->Clear(); - mrImport.maNamespaceHandler->addNSDeclAttributes( mrImport.maAttrList ); - - for( auto &it : sax_fastparser::castToFastAttributeList( Attribs ) ) - { - sal_Int32 nToken = it.getToken(); - const OUString& rAttrNamespacePrefix = SvXMLImport::getNamespacePrefixFromToken(nToken, &GetImport().GetNamespaceMap()); - OUString sAttrName = SvXMLImport::getNameFromToken( nToken ); - if ( !rAttrNamespacePrefix.isEmpty() ) - sAttrName = rAttrNamespacePrefix + SvXMLImport::aNamespaceSeparator + sAttrName; - - mrImport.maAttrList->AddAttribute( sAttrName, "CDATA", it.toString() ); - } - - const uno::Sequence< xml::Attribute > unknownAttribs = Attribs->getUnknownAttributes(); - for ( const auto& rUnknownAttrib : unknownAttribs ) - { - const OUString& rAttrValue = rUnknownAttrib.Value; - const OUString& rAttrName = rUnknownAttrib.Name; - // note: rAttrName is expected to be namespace-prefixed here - mrImport.maAttrList->AddAttribute( rAttrName, "CDATA", rAttrValue ); - } - StartElement( mrImport.maAttrList.get() ); } void SAL_CALL SvXMLImportContext::startUnknownElement(const OUString & /*rNamespace*/, const OUString & /*rElementName*/, @@ -110,49 +61,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SvXMLImportContext::cre return nullptr; } -css::uno::Reference< css::xml::sax::XFastContextHandler > SvXMLImportContext::createFastChildContextFallback(sal_Int32 Element, const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -{ - auto p = createFastChildContext(Element, Attribs); - if (p) - return p; - - // fall back to slow-parser path - const OUString& rPrefix = SvXMLImport::getNamespacePrefixFromToken(Element, &mrImport.GetNamespaceMap()); - const OUString& rLocalName = SvXMLImport::getNameFromToken( Element ); - OUString aName = rPrefix.isEmpty() ? rLocalName : rPrefix + SvXMLImport::aNamespaceSeparator + rLocalName; - OUString aLocalName; - sal_uInt16 nPrefix = - mrImport.mpNamespaceMap->GetKeyByAttrName( aName, &aLocalName ); - - mrImport.maAttrList->Clear(); - - if ( Attribs.is() ) - { - for( auto &it : sax_fastparser::castToFastAttributeList( Attribs ) ) - { - sal_Int32 nToken = it.getToken(); - const OUString& rAttrNamespacePrefix = SvXMLImport::getNamespacePrefixFromToken(nToken, &mrImport.GetNamespaceMap()); - OUString sAttrName = SvXMLImport::getNameFromToken( nToken ); - if ( !rAttrNamespacePrefix.isEmpty() ) - sAttrName = rAttrNamespacePrefix + SvXMLImport::aNamespaceSeparator + sAttrName; - - mrImport.maAttrList->AddAttribute( sAttrName, "CDATA", it.toString() ); - } - - const uno::Sequence< xml::Attribute > unknownAttribs = Attribs->getUnknownAttributes(); - for ( const auto& rUnknownAttrib : unknownAttribs ) - { - const OUString& rAttrValue = rUnknownAttrib.Value; - const OUString& rAttrName = rUnknownAttrib.Name; - // note: rAttrName is expected to be namespace-prefixed here - mrImport.maAttrList->AddAttribute( rAttrName, "CDATA", rAttrValue ); - } - } - - SAL_INFO("xmloff.core", "calling CreateChildContext on " << typeid(*this).name()); - return CreateChildContext(nPrefix, aLocalName, mrImport.maAttrList.get() ).get(); -} - uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SvXMLImportContext::createUnknownChildContext (const OUString & /*rNamespace*/, const OUString & /*rName*/, const uno::Reference< xml::sax::XFastAttributeList > & /*Attribs*/) { diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 03e076c0cba3..d2c346fbe5f6 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -779,44 +779,6 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element, const SvXMLImportContextRef & pHandler = maContexts.top(); SAL_INFO("xmloff.core", "calling createFastChildContext on " << typeid(*pHandler.get()).name()); auto tmp = pHandler->createFastChildContext( Element, Attribs ); - if (!tmp) - { - // fall back to slow-parser path - const OUString& rPrefix = SvXMLImport::getNamespacePrefixFromToken(Element, &GetNamespaceMap()); - const OUString& rLocalName = SvXMLImport::getNameFromToken( Element ); - OUString aName = rPrefix.isEmpty() ? rLocalName : rPrefix + SvXMLImport::aNamespaceSeparator + rLocalName; - OUString aLocalName; - sal_uInt16 nPrefix = - mpNamespaceMap->GetKeyByAttrName( aName, &aLocalName ); - - maAttrList->Clear(); - - if ( Attribs.is() ) - { - for( auto &it : sax_fastparser::castToFastAttributeList( Attribs ) ) - { - sal_Int32 nToken = it.getToken(); - const OUString& rAttrNamespacePrefix = SvXMLImport::getNamespacePrefixFromToken(nToken, &GetNamespaceMap()); - OUString sAttrName = SvXMLImport::getNameFromToken( nToken ); - if ( !rAttrNamespacePrefix.isEmpty() ) - sAttrName = rAttrNamespacePrefix + SvXMLImport::aNamespaceSeparator + sAttrName; - - maAttrList->AddAttribute( sAttrName, "CDATA", it.toString() ); - } - - const uno::Sequence< xml::Attribute > unknownAttribs = Attribs->getUnknownAttributes(); - for ( const auto& rUnknownAttrib : unknownAttribs ) - { - const OUString& rAttrValue = rUnknownAttrib.Value; - const OUString& rAttrName = rUnknownAttrib.Name; - // note: rAttrName is expected to be namespace-prefixed here - maAttrList->AddAttribute( rAttrName, "CDATA", rAttrValue ); - } - } - - SAL_INFO("xmloff.core", "calling CreateChildContext on " << typeid(*pHandler).name()); - tmp = pHandler->CreateChildContext(nPrefix, aLocalName, maAttrList.get() ).get(); - } xContext = dynamic_cast<SvXMLImportContext*>(tmp.get()); assert((tmp && xContext) || (!tmp && !xContext)); } @@ -851,41 +813,6 @@ void SAL_CALL SvXMLImport::startUnknownElement (const OUString & rNamespace, con const SvXMLImportContextRef & pHandler = maContexts.top(); SAL_INFO("xmloff.core", "calling createUnknownChildContext on " << typeid(*pHandler.get()).name()); auto tmp = pHandler->createUnknownChildContext( rNamespace, rName, Attribs ); - if (!tmp) - { - // fall back to slow-parser path - OUString aLocalName; - sal_uInt16 nPrefix = mpNamespaceMap->GetKeyByAttrName( rName, &aLocalName ); - - maAttrList->Clear(); - maNamespaceHandler->addNSDeclAttributes( maAttrList ); - - if ( Attribs.is() ) - { - for( auto &it : sax_fastparser::castToFastAttributeList( Attribs ) ) - { - sal_Int32 nToken = it.getToken(); - const OUString& rAttrNamespacePrefix = SvXMLImport::getNamespacePrefixFromToken(nToken, &GetNamespaceMap()); - OUString sAttrName = SvXMLImport::getNameFromToken( nToken ); - if ( !rAttrNamespacePrefix.isEmpty() ) - sAttrName = rAttrNamespacePrefix + SvXMLImport::aNamespaceSeparator + sAttrName; - - maAttrList->AddAttribute( sAttrName, "CDATA", it.toString() ); - } - - const uno::Sequence< xml::Attribute > unknownAttribs = Attribs->getUnknownAttributes(); - for ( const auto& rUnknownAttrib : unknownAttribs ) - { - const OUString& rAttrValue = rUnknownAttrib.Value; - const OUString& rAttrName = rUnknownAttrib.Name; - // note: rAttrName is expected to be namespace-prefixed here - maAttrList->AddAttribute( rAttrName, "CDATA", rAttrValue ); - } - } - - SAL_INFO("xmloff.core", "calling CreateChildContext on " << typeid(*pHandler).name()); - tmp = pHandler->CreateChildContext(nPrefix, aLocalName, maAttrList.get() ).get(); - } xContext = dynamic_cast<SvXMLImportContext*>(tmp.get()); assert((tmp && xContext) || (!tmp && !xContext)); } @@ -1582,36 +1509,6 @@ XMLEventImportHelper& SvXMLImport::GetEventImport() return *mpEventImportHelper; } -css::uno::Reference< css::xml::sax::XAttributeList > SvXMLImport::convertToSlowAttrList(const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -{ - maAttrList->Clear(); - - if ( Attribs.is() ) - { - for( auto &it : sax_fastparser::castToFastAttributeList( Attribs ) ) - { - sal_Int32 nToken = it.getToken(); - const OUString& rAttrNamespacePrefix = SvXMLImport::getNamespacePrefixFromToken(nToken, &GetNamespaceMap()); - OUString sAttrName = SvXMLImport::getNameFromToken( nToken ); - if ( !rAttrNamespacePrefix.isEmpty() ) - sAttrName = rAttrNamespacePrefix + SvXMLImport::aNamespaceSeparator + sAttrName; - - maAttrList->AddAttribute( sAttrName, "CDATA", it.toString() ); - } - - const uno::Sequence< xml::Attribute > unknownAttribs = Attribs->getUnknownAttributes(); - for ( const auto& rUnknownAttrib : unknownAttribs ) - { - const OUString& rAttrValue = rUnknownAttrib.Value; - const OUString& rAttrName = rUnknownAttrib.Name; - // note: rAttrName is expected to be namespace-prefixed here - maAttrList->AddAttribute( rAttrName, "CDATA", rAttrValue ); - } - } - - return maAttrList.get(); -} - void SvXMLImport::SetFontDecls( XMLFontStylesContext *pFontDecls ) { if (mxFontDecls.is()) diff --git a/xmloff/source/draw/QRCodeContext.cxx b/xmloff/source/draw/QRCodeContext.cxx index a23f5ca11fd5..978737b34131 100644 --- a/xmloff/source/draw/QRCodeContext.cxx +++ b/xmloff/source/draw/QRCodeContext.cxx @@ -35,53 +35,47 @@ using namespace css::io; using namespace css::graphic; using namespace xmloff::token; -QRCodeContext::QRCodeContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, - const Reference<XAttributeList>& xAttrList, +QRCodeContext::QRCodeContext(SvXMLImport& rImport, sal_Int32 /*nElement*/, + const Reference<XFastAttributeList>& xAttrList, const Reference<XShape>& rxShape) - : SvXMLImportContext(rImport, nPrfx, rLocalName) + : SvXMLImportContext(rImport) { Reference<beans::XPropertySet> xPropSet(rxShape, UNO_QUERY_THROW); css::drawing::QRCode aQRCode; - const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; - for (sal_Int16 i = 0; i < nAttrCount; i++) + for (auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList)) { - OUString sAttrName = xAttrList->getNameByIndex(i); - OUString aLocalName; - sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName(sAttrName, &aLocalName); - OUString sValue = xAttrList->getValueByIndex(i); - - switch (nPrefix) + switch (aIter.getToken()) { - case XML_NAMESPACE_LO_EXT: - if (IsXMLToken(aLocalName, XML_QRCODE_ERROR_CORRECTION)) - { - OUString aErrorCorrValue = sValue; - - if (aErrorCorrValue == "low") - aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::LOW; - else if (aErrorCorrValue == "medium") - aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::MEDIUM; - else if (aErrorCorrValue == "quartile") - aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::QUARTILE; - else - aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::HIGH; - } + case XML_ELEMENT(LO_EXT, XML_QRCODE_ERROR_CORRECTION): + { + OUString aErrorCorrValue = aIter.toString(); - if (IsXMLToken(aLocalName, XML_QRCODE_BORDER)) - { - sal_Int32 nAttrVal; - if (sax::Converter::convertNumber(nAttrVal, sValue, 0)) - aQRCode.Border = nAttrVal; - } + if (aErrorCorrValue == "low") + aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::LOW; + else if (aErrorCorrValue == "medium") + aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::MEDIUM; + else if (aErrorCorrValue == "quartile") + aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::QUARTILE; + else + aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::HIGH; break; - - case XML_NAMESPACE_OFFICE: - if (IsXMLToken(aLocalName, XML_STRING_VALUE)) - { - aQRCode.Payload = sValue; - } + } + case XML_ELEMENT(LO_EXT, XML_QRCODE_BORDER): + { + sal_Int32 nAttrVal; + if (sax::Converter::convertNumber(nAttrVal, aIter.toString(), 0)) + aQRCode.Border = nAttrVal; + break; + } + case XML_ELEMENT(OFFICE, XML_STRING_VALUE): + { + aQRCode.Payload = aIter.toString(); + break; + } + default: + XMLOFF_WARN_UNKNOWN("xmloff", aIter); } } xPropSet->setPropertyValue("QRCodeProperties", Any(aQRCode)); diff --git a/xmloff/source/draw/QRCodeContext.hxx b/xmloff/source/draw/QRCodeContext.hxx index 74709bab40f8..c35c6f9bd988 100644 --- a/xmloff/source/draw/QRCodeContext.hxx +++ b/xmloff/source/draw/QRCodeContext.hxx @@ -18,8 +18,8 @@ class QRCodeContext : public SvXMLImportContext { public: - QRCodeContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, - const css::uno::Reference<css::xml::sax::XAttributeList>& xAttrList, + QRCodeContext(SvXMLImport& rImport, sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList, const css::uno::Reference<css::drawing::XShape>& rxShape); }; diff --git a/xmloff/source/draw/SignatureLineContext.cxx b/xmloff/source/draw/SignatureLineContext.cxx index aa51e54156f0..d85acded8226 100644 --- a/xmloff/source/draw/SignatureLineContext.cxx +++ b/xmloff/source/draw/SignatureLineContext.cxx @@ -23,6 +23,7 @@ #include <comphelper/storagehelper.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmlimp.hxx> +#include <xmloff/xmlnamespace.hxx> using namespace css; using namespace css::xml::sax; @@ -35,29 +36,34 @@ using namespace css::graphic; using namespace css::security; using namespace xmloff::token; -SignatureLineContext::SignatureLineContext(SvXMLImport& rImport, sal_uInt16 nPrfx, - const OUString& rLocalName, - const Reference<XAttributeList>& xAttrList, +SignatureLineContext::SignatureLineContext(SvXMLImport& rImport, sal_Int32 /*nElement*/, + const Reference<XFastAttributeList>& xAttrList, const Reference<XShape>& rxShape) - : SvXMLImportContext(rImport, nPrfx, rLocalName) + : SvXMLImportContext(rImport) { Reference<beans::XPropertySet> xPropSet(rxShape, UNO_QUERY_THROW); xPropSet->setPropertyValue("IsSignatureLine", Any(true)); - xPropSet->setPropertyValue("SignatureLineId", Any(xAttrList->getValueByName("loext:id"))); - xPropSet->setPropertyValue("SignatureLineSuggestedSignerName", - Any(xAttrList->getValueByName("loext:suggested-signer-name"))); - xPropSet->setPropertyValue("SignatureLineSuggestedSignerTitle", - Any(xAttrList->getValueByName("loext:suggested-signer-title"))); - xPropSet->setPropertyValue("SignatureLineSuggestedSignerEmail", - Any(xAttrList->getValueByName("loext:suggested-signer-email"))); - xPropSet->setPropertyValue("SignatureLineSigningInstructions", - Any(xAttrList->getValueByName("loext:signing-instructions"))); - - bool bShowSignDate = xAttrList->getValueByName("loext:show-sign-date") == GetXMLToken(XML_TRUE); - bool bCanAddComment - = xAttrList->getValueByName("loext:can-add-comment") == GetXMLToken(XML_TRUE); + xPropSet->setPropertyValue("SignatureLineId", + Any(xAttrList->getOptionalValue(XML_ELEMENT(LO_EXT, XML_ID)))); + xPropSet->setPropertyValue( + "SignatureLineSuggestedSignerName", + Any(xAttrList->getOptionalValue(XML_ELEMENT(LO_EXT, XML_SUGGESTED_SIGNER_NAME)))); + xPropSet->setPropertyValue( + "SignatureLineSuggestedSignerTitle", + Any(xAttrList->getOptionalValue(XML_ELEMENT(LO_EXT, XML_SUGGESTED_SIGNER_TITLE)))); + xPropSet->setPropertyValue( + "SignatureLineSuggestedSignerEmail", + Any(xAttrList->getOptionalValue(XML_ELEMENT(LO_EXT, XML_SUGGESTED_SIGNER_EMAIL)))); + xPropSet->setPropertyValue( + "SignatureLineSigningInstructions", + Any(xAttrList->getOptionalValue(XML_ELEMENT(LO_EXT, XML_SIGNING_INSTRUCTIONS)))); + + bool bShowSignDate = xAttrList->getOptionalValue(XML_ELEMENT(LO_EXT, XML_SHOW_SIGN_DATE)) + == GetXMLToken(XML_TRUE); + bool bCanAddComment = xAttrList->getOptionalValue(XML_ELEMENT(LO_EXT, XML_CAN_ADD_COMMENT)) + == GetXMLToken(XML_TRUE); xPropSet->setPropertyValue("SignatureLineShowSignDate", Any(bShowSignDate)); xPropSet->setPropertyValue("SignatureLineCanAddComment", Any(bCanAddComment)); @@ -91,11 +97,12 @@ SignatureLineContext::SignatureLineContext(SvXMLImport& rImport, sal_uInt16 nPrf // Try to find matching signature line image - if none exists that is fine, // then the signature line is not digitally signed. - auto pSignatureInfo = std::find_if( - xSignatureInfo.begin(), xSignatureInfo.end(), - [&xAttrList](const DocumentSignatureInformation& rSignatureInfo) { - return rSignatureInfo.SignatureLineId == xAttrList->getValueByName("loext:id"); - }); + auto pSignatureInfo + = std::find_if(xSignatureInfo.begin(), xSignatureInfo.end(), + [&xAttrList](const DocumentSignatureInformation& rSignatureInfo) { + return rSignatureInfo.SignatureLineId + == xAttrList->getOptionalValue(XML_ELEMENT(LO_EXT, XML_ID)); + }); bool bIsSigned(false); if (pSignatureInfo != xSignatureInfo.end()) { diff --git a/xmloff/source/draw/SignatureLineContext.hxx b/xmloff/source/draw/SignatureLineContext.hxx index f64b81bda5f4..cabefaafd954 100644 --- a/xmloff/source/draw/SignatureLineContext.hxx +++ b/xmloff/source/draw/SignatureLineContext.hxx @@ -18,8 +18,8 @@ class SignatureLineContext : public SvXMLImportContext { public: - SignatureLineContext(SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, - const css::uno::Reference<css::xml::sax::XAttributeList>& xAttrList, + SignatureLineContext(SvXMLImport& rImport, sal_Int32 nElement, + const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList, const css::uno::Reference<css::drawing::XShape>& rxShape); }; diff --git a/xmloff/source/draw/XMLImageMapContext.cxx b/xmloff/source/draw/XMLImageMapContext.cxx index 446e3e60801a..6ec8a01d6b29 100644 --- a/xmloff/source/draw/XMLImageMapContext.cxx +++ b/xmloff/source/draw/XMLImageMapContext.cxx @@ -496,10 +496,8 @@ constexpr OUStringLiteral gsImageMap(u"ImageMap"); XMLImageMapContext::XMLImageMapContext( SvXMLImport& rImport, - sal_uInt16 nPrefix, - const OUString& rLocalName, Reference<XPropertySet> const & rPropertySet) : - SvXMLImportContext(rImport, nPrefix, rLocalName), + SvXMLImportContext(rImport), xPropertySet(rPropertySet) { try diff --git a/xmloff/source/draw/XMLNumberStyles.cxx b/xmloff/source/draw/XMLNumberStyles.cxx index 44c85b8e2bfd..db2f93e8b607 100644 --- a/xmloff/source/draw/XMLNumberStyles.cxx +++ b/xmloff/source/draw/XMLNumberStyles.cxx @@ -555,7 +555,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLNumberFormatMembe sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) { - return mxSlaveContext->createFastChildContextFallback( nElement, xAttrList ); + return mxSlaveContext->createFastChildContext( nElement, xAttrList ); } void SdXMLNumberFormatMemberImportContext::startFastElement( diff --git a/xmloff/source/draw/XMLReplacementImageContext.cxx b/xmloff/source/draw/XMLReplacementImageContext.cxx index a096a4823d38..3d7ad0e62e93 100644 --- a/xmloff/source/draw/XMLReplacementImageContext.cxx +++ b/xmloff/source/draw/XMLReplacementImageContext.cxx @@ -37,34 +37,13 @@ using namespace ::xmloff::token; XMLReplacementImageContext::XMLReplacementImageContext( SvXMLImport& rImport, - sal_uInt16 nPrfx, const OUString& rLName, - const Reference< XAttributeList > & rAttrList, + sal_Int32 /*nElement*/, + const Reference< XFastAttributeList > & rAttrList, const Reference< XPropertySet > & rPropSet ) : - SvXMLImportContext( rImport, nPrfx, rLName ), + SvXMLImportContext( rImport ), m_xPropSet( rPropSet ) { - rtl::Reference < XMLTextImportHelper > xTxtImport = - GetImport().GetTextImport(); - const SvXMLTokenMap& rTokenMap = - xTxtImport->GetTextFrameAttrTokenMap(); - - sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0; - for( sal_Int16 i=0; i < nAttrCount; i++ ) - { - const OUString& rAttrName = rAttrList->getNameByIndex( i ); - const OUString& rValue = rAttrList->getValueByIndex( i ); - - OUString aLocalName; - sal_uInt16 nPrefix = - GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, - &aLocalName ); - switch( rTokenMap.Get( nPrefix, aLocalName ) ) - { - case XML_TOK_TEXT_FRAME_HREF: - m_sHRef = rValue; - break; - } - } + m_sHRef = rAttrList->getOptionalValue(XML_ELEMENT(XLINK, XML_HREF)); } XMLReplacementImageContext::~XMLReplacementImageContext() diff --git a/xmloff/source/draw/descriptionimp.cxx b/xmloff/source/draw/descriptionimp.cxx index 0e41cd680331..738f47dd2bf0 100644 --- a/xmloff/source/draw/descriptionimp.cxx +++ b/xmloff/source/draw/descriptionimp.cxx @@ -35,9 +35,8 @@ using namespace ::com::sun::star::beans; using namespace ::xmloff::token; -SdXMLDescriptionContext::SdXMLDescriptionContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, - const Reference< XAttributeList>&, const Reference< XShape >& rxShape) -: SvXMLImportContext(rImport, nPrfx, rLocalName), mxShape( rxShape ) +SdXMLDescriptionContext::SdXMLDescriptionContext( SvXMLImport& rImport, sal_Int32 nElement, const Reference< XShape >& rxShape) +: SvXMLImportContext(rImport), mxShape( rxShape ), mnElement(nElement) { } @@ -53,7 +52,7 @@ void SdXMLDescriptionContext::endFastElement(sal_Int32 ) try { uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY_THROW); - if(IsXMLToken(GetLocalName(),XML_TITLE)) + if( (mnElement & TOKEN_MASK) == XML_TITLE) { xPropSet->setPropertyValue("Title", Any(msText)); } diff --git a/xmloff/source/draw/descriptionimp.hxx b/xmloff/source/draw/descriptionimp.hxx index 6dee51daf293..57a1fa2b7c81 100644 --- a/xmloff/source/draw/descriptionimp.hxx +++ b/xmloff/source/draw/descriptionimp.hxx @@ -25,17 +25,15 @@ // office:events inside a shape -class SdXMLDescriptionContext : public SvXMLImportContext +class SdXMLDescriptionContext final : public SvXMLImportContext { private: css::uno::Reference< css::drawing::XShape > mxShape; OUString msText; + sal_Int32 mnElement; public: - SdXMLDescriptionContext( SvXMLImport& rImport, - sal_uInt16 nPrfx, - const OUString& rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList, + SdXMLDescriptionContext( SvXMLImport& rImport, sal_Int32 mnElement, const css::uno::Reference< css::drawing::XShape >& rxShape ); virtual ~SdXMLDescriptionContext() override; diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx index 226cacafc1d3..c71c71043cc2 100644 --- a/xmloff/source/draw/eventimp.cxx +++ b/xmloff/source/draw/eventimp.cxx @@ -436,9 +436,8 @@ void SdXMLEventContextData::ApplyProperties() } -SdXMLEventsContext::SdXMLEventsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, - const Reference< XAttributeList>&, const Reference< XShape >& rxShape) -: SvXMLImportContext(rImport, nPrfx, rLocalName), mxShape( rxShape ) +SdXMLEventsContext::SdXMLEventsContext( SvXMLImport& rImport, const Reference< XShape >& rxShape) +: SvXMLImportContext(rImport), mxShape( rxShape ) { } diff --git a/xmloff/source/draw/eventimp.hxx b/xmloff/source/draw/eventimp.hxx ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits