diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-28 12:29:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-28 13:25:27 +0200 |
commit | 1705fbe9daac56ee9bea8d8fd7c7f57e2bec49b5 (patch) | |
tree | aaf39244173a4cf20df6568140ebdbe5ec055656 /sc | |
parent | dfa8e18e8e6c7ad87e423393f8293a20188de1fd (diff) |
move the castToFastAttributeList function
to the slightly higher namespace, to make it easy and more readable to
use directly in a for-loop-range expression.
And make it return a reference rather than a pointer, since it is never
allowed to be nullptr.
Change-Id: I15d0b32493ef65cfc601b247c272b318f1eadfd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93049
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
23 files changed, 121 insertions, 186 deletions
diff --git a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx index 0e65e541afcd..9917eaaa0ba1 100644 --- a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx +++ b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx @@ -98,7 +98,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLCalculationSetting { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); if (nElement == XML_ELEMENT( TABLE, XML_NULL_DATE )) pContext = new ScXMLNullDateContext(GetScImport(), pAttribList, this); diff --git a/sc/source/filter/xml/XMLDDELinksContext.cxx b/sc/source/filter/xml/XMLDDELinksContext.cxx index a99b5a2f883f..592197e5d39d 100644 --- a/sc/source/filter/xml/XMLDDELinksContext.cxx +++ b/sc/source/filter/xml/XMLDDELinksContext.cxx @@ -77,7 +77,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDDELinkContext::cr { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -233,7 +233,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDDETableContext::c { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -294,7 +294,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDDERowContext::cre { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); if (nElement == XML_ELEMENT( TABLE, XML_TABLE_CELL )) pContext = new ScXMLDDECellContext(GetScImport(), pAttribList, pDDELink); diff --git a/sc/source/filter/xml/XMLDetectiveContext.cxx b/sc/source/filter/xml/XMLDetectiveContext.cxx index 9912aaa22663..3d62ce7076c9 100644 --- a/sc/source/filter/xml/XMLDetectiveContext.cxx +++ b/sc/source/filter/xml/XMLDetectiveContext.cxx @@ -73,7 +73,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDetectiveContext:: { SvXMLImportContext* pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx index 2da03d2f92e7..5f8a1368d120 100644 --- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx +++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx @@ -371,7 +371,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLTrackedChangesCont { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -538,7 +538,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLCellContentDeletio { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -593,7 +593,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDependingsContext: { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); // #i80033# read both old (dependence) and new (dependency) elements if (nElement == XML_ELEMENT( TABLE, XML_DEPENDENCE ) || @@ -633,7 +633,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDeletionsContext:: { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -927,7 +927,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLPreviousContext::c { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); if ( nElement == XML_ELEMENT( TABLE, XML_CHANGE_TRACK_TABLE_CELL ) ) pContext = new ScXMLChangeCellContext(GetScImport(), pAttribList, @@ -984,7 +984,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLContentChangeConte { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -1077,7 +1077,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLInsertionContext:: { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -1107,9 +1107,7 @@ ScXMLInsertionCutOffContext::ScXMLInsertionCutOffContext( ScXMLImport& rImport, { sal_uInt32 nID(0); sal_Int32 nPosition(0); - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { const OUString sValue = aIter.toString(); @@ -1137,9 +1135,7 @@ ScXMLMovementCutOffContext::ScXMLMovementCutOffContext( ScXMLImport& rImport, sal_Int32 nStartPosition(0); sal_Int32 nEndPosition(0); bool bPosition(false); - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { const OUString sValue = aIter.toString(); @@ -1251,7 +1247,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDeletionContext::c { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -1320,7 +1316,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLMovementContext::c { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -1393,7 +1389,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLRejectionContext:: { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { diff --git a/sc/source/filter/xml/celltextparacontext.cxx b/sc/source/filter/xml/celltextparacontext.cxx index e8f6886057ab..0947890d226c 100644 --- a/sc/source/filter/xml/celltextparacontext.cxx +++ b/sc/source/filter/xml/celltextparacontext.cxx @@ -103,21 +103,15 @@ ScXMLCellTextSpanContext::ScXMLCellTextSpanContext( void SAL_CALL ScXMLCellTextSpanContext::startFastElement( sal_Int32 /*nElement*/, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList ) { - if ( xAttrList.is() ) + for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); - - for (auto &aIter : *pAttribList) + switch (aIter.getToken()) { - switch (aIter.getToken()) - { - case XML_ELEMENT( TEXT, XML_STYLE_NAME ): - maStyleName = aIter.toString(); - break; - default: - ; - } + case XML_ELEMENT( TEXT, XML_STYLE_NAME ): + maStyleName = aIter.toString(); + break; + default: + ; } } } @@ -255,27 +249,21 @@ void ScXMLCellFieldURLContext::SetStyleName(const OUString& rStyleName) void SAL_CALL ScXMLCellFieldURLContext::startFastElement( sal_Int32 /*nElement*/, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList ) { - if ( xAttrList.is() ) + for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); - - for (auto &aIter : *pAttribList) + switch (aIter.getToken()) { - switch (aIter.getToken()) - { - case XML_ELEMENT( XLINK, XML_HREF ): - maURL = aIter.toString(); - break; - case XML_ELEMENT( XLINK, XML_TYPE ): - // Ignored for now. - break; - case XML_ELEMENT( OFFICE, XML_TARGET_FRAME_NAME ): - maTargetFrame = aIter.toString(); - break; - default: - ; - } + case XML_ELEMENT( XLINK, XML_HREF ): + maURL = aIter.toString(); + break; + case XML_ELEMENT( XLINK, XML_TYPE ): + // Ignored for now. + break; + case XML_ELEMENT( OFFICE, XML_TARGET_FRAME_NAME ): + maTargetFrame = aIter.toString(); + break; + default: + ; } } } @@ -306,23 +294,17 @@ void ScXMLCellFieldSContext::SetStyleName(const OUString& rStyleName) void SAL_CALL ScXMLCellFieldSContext::startFastElement( sal_Int32 /*nElement*/, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList ) { - if ( xAttrList.is() ) + for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); - - for (auto &aIter : *pAttribList) + switch (aIter.getToken()) { - switch (aIter.getToken()) - { - case XML_ELEMENT( TEXT, XML_C ): - mnCount = aIter.toInt32(); - if (mnCount <= 0) - mnCount = 1; // worth a warning? - break; - default: - ; - } + case XML_ELEMENT( TEXT, XML_C ): + mnCount = aIter.toInt32(); + if (mnCount <= 0) + mnCount = 1; // worth a warning? + break; + default: + ; } } } diff --git a/sc/source/filter/xml/xmlbodyi.cxx b/sc/source/filter/xml/xmlbodyi.cxx index da459b48a19a..0dd1c421d23d 100644 --- a/sc/source/filter/xml/xmlbodyi.cxx +++ b/sc/source/filter/xml/xmlbodyi.cxx @@ -132,7 +132,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch( nElement ) { diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index a35bd047893f..b53fe46c7146 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -688,7 +688,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLTableRowCellContex { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); // bool bTextP(false); switch (nElement) diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx index 8e372b2ae7f3..d1e581553488 100644 --- a/sc/source/filter/xml/xmlcoli.cxx +++ b/sc/source/filter/xml/xmlcoli.cxx @@ -177,7 +177,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLTableColsContext:: { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx index bd056a8a77c3..b178927caec8 100644 --- a/sc/source/filter/xml/xmlcondformat.cxx +++ b/sc/source/filter/xml/xmlcondformat.cxx @@ -39,7 +39,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL ScXMLConditio { SvXMLImportContext* pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -110,7 +110,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL ScXMLConditio { SvXMLImportContext* pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -381,7 +381,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL ScXMLColorSca { SvXMLImportContext* pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -515,7 +515,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL ScXMLDataBarF { SvXMLImportContext* pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -607,7 +607,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL ScXMLIconSetF { SvXMLImportContext* pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { diff --git a/sc/source/filter/xml/xmlconti.cxx b/sc/source/filter/xml/xmlconti.cxx index 41507f589f3e..b88760829bff 100644 --- a/sc/source/filter/xml/xmlconti.cxx +++ b/sc/source/filter/xml/xmlconti.cxx @@ -80,9 +80,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > ScXMLContentContext::c if (nElement == XML_ELEMENT(TEXT, XML_S)) { sal_Int32 nRepeat(0); - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { if (aIter.getToken() == XML_ELEMENT(TEXT, XML_C)) nRepeat = aIter.toInt32(); diff --git a/sc/source/filter/xml/xmlcvali.cxx b/sc/source/filter/xml/xmlcvali.cxx index c96572c26715..658f8007d0e7 100644 --- a/sc/source/filter/xml/xmlcvali.cxx +++ b/sc/source/filter/xml/xmlcvali.cxx @@ -151,7 +151,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLContentValidations { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -219,7 +219,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLContentValidationC { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index a9bc45030681..8b9bcd98325e 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -65,7 +65,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotTablesCon { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -194,7 +194,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotTableCont { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -766,7 +766,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceCellRangeCon { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -860,7 +860,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotFieldCont { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -1053,7 +1053,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotLevelCont { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -1214,7 +1214,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotSubTotals { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -1287,7 +1287,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotMembersCo { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -1460,7 +1460,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotGroupsCon { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); if (nElement == XML_ELEMENT( TABLE, XML_DATA_PILOT_GROUP )) { @@ -1493,7 +1493,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDataPilotGroupCont { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); if (nElement == XML_ELEMENT( TABLE, XML_DATA_PILOT_MEMBER ) || nElement == XML_ELEMENT( TABLE, XML_DATA_PILOT_GROUP_MEMBER )) diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx index 181050c98458..7e7a61d50f6a 100644 --- a/sc/source/filter/xml/xmldrani.cxx +++ b/sc/source/filter/xml/xmldrani.cxx @@ -64,7 +64,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDatabaseRangesCont { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch( nElement ) { @@ -196,7 +196,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDatabaseRangeConte { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -474,7 +474,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceSQLContext:: { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); if ( nElement == XML_ELEMENT( FORM, XML_CONNECTION_RESOURCE ) && sDBName.isEmpty() ) { @@ -524,7 +524,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceTableContext { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); if ( nElement == XML_ELEMENT( FORM, XML_CONNECTION_RESOURCE ) && sDBName.isEmpty() ) { @@ -573,7 +573,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSourceQueryContext { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); if ( nElement == XML_ELEMENT( FORM, XML_CONNECTION_RESOURCE ) && sDBName.isEmpty() ) { @@ -644,7 +644,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSubTotalRulesConte { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -751,7 +751,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSubTotalRuleContex { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { diff --git a/sc/source/filter/xml/xmlexternaltabi.cxx b/sc/source/filter/xml/xmlexternaltabi.cxx index c8748eb7cf0e..79249b78ad66 100644 --- a/sc/source/filter/xml/xmlexternaltabi.cxx +++ b/sc/source/filter/xml/xmlexternaltabi.cxx @@ -127,7 +127,7 @@ Reference< XFastContextHandler > SAL_CALL ScXMLExternalRefRowsContext::createFas const SvXMLTokenMap& rTokenMap = GetScImport().GetTableRowsElemTokenMap(); sal_uInt16 nToken = rTokenMap.Get( nElement ); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nToken) { @@ -182,7 +182,7 @@ Reference< XFastContextHandler > SAL_CALL ScXMLExternalRefRowContext::createFast const SvXMLTokenMap& rTokenMap = mrScImport.GetTableRowElemTokenMap(); sal_uInt16 nToken = rTokenMap.Get( nElement ); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); if (nToken == XML_TOK_TABLE_ROW_CELL || nToken == XML_TOK_TABLE_ROW_COVERED_CELL) return new ScXMLExternalRefCellContext(mrScImport, pAttribList, mrExternalRefInfo); diff --git a/sc/source/filter/xml/xmlfilti.cxx b/sc/source/filter/xml/xmlfilti.cxx index de47d97910f8..49013cfc4c6c 100644 --- a/sc/source/filter/xml/xmlfilti.cxx +++ b/sc/source/filter/xml/xmlfilti.cxx @@ -98,7 +98,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLFilterContext::cre { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -202,7 +202,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLAndContext::create { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -246,7 +246,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLOrContext::createF { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -330,7 +330,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLConditionContext:: { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -518,7 +518,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPFilterContext::c { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -577,7 +577,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPAndContext::crea { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { @@ -618,7 +618,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLDPOrContext::creat { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 05e0100e0147..02310a524091 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -336,7 +336,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL const uno::Reference< xml::sax::XFastAttributeList > & xAttrList ) { sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); return GetScImport().CreateBodyContext( pAttribList ); } diff --git a/sc/source/filter/xml/xmllabri.cxx b/sc/source/filter/xml/xmllabri.cxx index ef3f2fb84f4a..c7b28e8750a0 100644 --- a/sc/source/filter/xml/xmllabri.cxx +++ b/sc/source/filter/xml/xmllabri.cxx @@ -42,7 +42,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLLabelRangesContext { SvXMLImportContext* pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { diff --git a/sc/source/filter/xml/xmlmappingi.cxx b/sc/source/filter/xml/xmlmappingi.cxx index 7e4618e25d6a..701e5221e60c 100644 --- a/sc/source/filter/xml/xmlmappingi.cxx +++ b/sc/source/filter/xml/xmlmappingi.cxx @@ -38,7 +38,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLMappingsContext::c { SvXMLImportContext *pContext = nullptr; sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch( nElement ) { diff --git a/sc/source/filter/xml/xmlnexpi.cxx b/sc/source/filter/xml/xmlnexpi.cxx index 84b5482cff21..d4a37757aa06 100644 --- a/sc/source/filter/xml/xmlnexpi.cxx +++ b/sc/source/filter/xml/xmlnexpi.cxx @@ -61,7 +61,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLNamedExpressionsCo { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx index b5edafe287d9..e23b3467428d 100644 --- a/sc/source/filter/xml/xmlrowi.cxx +++ b/sc/source/filter/xml/xmlrowi.cxx @@ -101,7 +101,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch( nElement ) { @@ -258,7 +258,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch( nElement ) { diff --git a/sc/source/filter/xml/xmlsorti.cxx b/sc/source/filter/xml/xmlsorti.cxx index 066b6ab0e113..0991c275eaea 100644 --- a/sc/source/filter/xml/xmlsorti.cxx +++ b/sc/source/filter/xml/xmlsorti.cxx @@ -110,7 +110,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLSortContext::creat { SvXMLImportContext *pContext(nullptr); sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); switch (nElement) { diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index 0bab6377d4ee..fe7e0ad392e1 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -244,7 +244,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL const uno::Reference< xml::sax::XFastAttributeList > & xAttrList ) { sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); + &sax_fastparser::castToFastAttributeList( xAttrList ); if (pExternalRefInfo) { diff --git a/sc/source/filter/xml/xmltransformationi.cxx b/sc/source/filter/xml/xmltransformationi.cxx index 435d73915023..c872767a7fb0 100644 --- a/sc/source/filter/xml/xmltransformationi.cxx +++ b/sc/source/filter/xml/xmltransformationi.cxx @@ -32,7 +32,7 @@ uno::Reference<xml::sax::XFastContextHandler> { SvXMLImportContext* pContext = nullptr; sax_fastparser::FastAttributeList* pAttribList - = sax_fastparser::FastAttributeList::castToFastAttributeList(xAttrList); + = &sax_fastparser::castToFastAttributeList(xAttrList); switch (nElement) { @@ -103,7 +103,7 @@ uno::Reference<xml::sax::XFastContextHandler> sal_Int32 nElement, const uno::Reference<xml::sax::XFastAttributeList>& xAttrList) { sax_fastparser::FastAttributeList* pAttribList - = sax_fastparser::FastAttributeList::castToFastAttributeList(xAttrList); + = &sax_fastparser::castToFastAttributeList(xAttrList); const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList = pAttribList; @@ -208,25 +208,19 @@ uno::Reference<xml::sax::XFastContextHandler> SAL_CALL ScXMLColumnMergeContext::createFastChildContext( sal_Int32 nElement, const uno::Reference<xml::sax::XFastAttributeList>& xAttrList) { - sax_fastparser::FastAttributeList* pAttribList - = sax_fastparser::FastAttributeList::castToFastAttributeList(xAttrList); - const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList = pAttribList; switch (nElement) { case XML_ELEMENT(CALC_EXT, XML_COLUMN): { - if (rAttrList.is()) + for (auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList)) { - for (auto& aIter : *rAttrList) + switch (aIter.getToken()) { - switch (aIter.getToken()) + case XML_ELEMENT(CALC_EXT, XML_COLUMN): { - case XML_ELEMENT(CALC_EXT, XML_COLUMN): - { - maColumns.insert(aIter.toInt32()); - } - break; + maColumns.insert(aIter.toInt32()); } + break; } } } @@ -302,27 +296,19 @@ uno::Reference<xml::sax::XFastContextHandler> SAL_CALL ScXMLColumnTextContext::createFastChildContext( sal_Int32 nElement, const uno::Reference<xml::sax::XFastAttributeList>& xAttrList) { - sax_fastparser::FastAttributeList* pAttribList - = sax_fastparser::FastAttributeList::castToFastAttributeList(xAttrList); - - const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList = pAttribList; - switch (nElement) { case XML_ELEMENT(CALC_EXT, XML_COLUMN): { - if (rAttrList.is()) + for (auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList)) { - for (auto& aIter : *rAttrList) + switch (aIter.getToken()) { - switch (aIter.getToken()) + case XML_ELEMENT(CALC_EXT, XML_COLUMN): { - case XML_ELEMENT(CALC_EXT, XML_COLUMN): - { - maColumns.insert(aIter.toInt32()); - } - break; + maColumns.insert(aIter.toInt32()); } + break; } } } @@ -381,26 +367,19 @@ uno::Reference<xml::sax::XFastContextHandler> SAL_CALL ScXMLColumnAggregateContext::createFastChildContext( sal_Int32 nElement, const uno::Reference<xml::sax::XFastAttributeList>& xAttrList) { - sax_fastparser::FastAttributeList* pAttribList - = sax_fastparser::FastAttributeList::castToFastAttributeList(xAttrList); - const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList = pAttribList; - switch (nElement) { case XML_ELEMENT(CALC_EXT, XML_COLUMN): { - if (rAttrList.is()) + for (auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList)) { - for (auto& aIter : *rAttrList) + switch (aIter.getToken()) { - switch (aIter.getToken()) + case XML_ELEMENT(CALC_EXT, XML_COLUMN): { - case XML_ELEMENT(CALC_EXT, XML_COLUMN): - { - maColumns.insert(aIter.toInt32()); - } - break; + maColumns.insert(aIter.toInt32()); } + break; } } } @@ -482,26 +461,19 @@ uno::Reference<xml::sax::XFastContextHandler> SAL_CALL ScXMLColumnNumberContext::createFastChildContext( sal_Int32 nElement, const uno::Reference<xml::sax::XFastAttributeList>& xAttrList) { - sax_fastparser::FastAttributeList* pAttribList - = sax_fastparser::FastAttributeList::castToFastAttributeList(xAttrList); - const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList = pAttribList; - switch (nElement) { case XML_ELEMENT(CALC_EXT, XML_COLUMN): { - if (rAttrList.is()) + for (auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList)) { - for (auto& aIter : *rAttrList) + switch (aIter.getToken()) { - switch (aIter.getToken()) + case XML_ELEMENT(CALC_EXT, XML_COLUMN): { - case XML_ELEMENT(CALC_EXT, XML_COLUMN): - { - maColumns.insert(aIter.toInt32()); - } - break; + maColumns.insert(aIter.toInt32()); } + break; } } } @@ -545,25 +517,19 @@ uno::Reference<xml::sax::XFastContextHandler> SAL_CALL ScXMLColumnRemoveNullContext::createFastChildContext( sal_Int32 nElement, const uno::Reference<xml::sax::XFastAttributeList>& xAttrList) { - sax_fastparser::FastAttributeList* pAttribList - = sax_fastparser::FastAttributeList::castToFastAttributeList(xAttrList); - const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList = pAttribList; switch (nElement) { case XML_ELEMENT(CALC_EXT, XML_COLUMN): { - if (rAttrList.is()) + for (auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList)) { - for (auto& aIter : *rAttrList) + switch (aIter.getToken()) { - switch (aIter.getToken()) + case XML_ELEMENT(CALC_EXT, XML_COLUMN): { - case XML_ELEMENT(CALC_EXT, XML_COLUMN): - { - maColumns.insert(aIter.toInt32()); - } - break; + maColumns.insert(aIter.toInt32()); } + break; } } } @@ -647,24 +613,17 @@ ScXMLDateTimeContext::~ScXMLDateTimeContext() uno::Reference<xml::sax::XFastContextHandler> SAL_CALL ScXMLDateTimeContext::createFastChildContext( sal_Int32 nElement, const uno::Reference<xml::sax::XFastAttributeList>& xAttrList) { - sax_fastparser::FastAttributeList* pAttribList - = sax_fastparser::FastAttributeList::castToFastAttributeList(xAttrList); - const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList = pAttribList; - switch (nElement) { case XML_ELEMENT(CALC_EXT, XML_COLUMN): { - if (rAttrList.is()) + for (auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList)) { - for (auto& aIter : *rAttrList) + switch (aIter.getToken()) { - switch (aIter.getToken()) + case XML_ELEMENT(CALC_EXT, XML_COLUMN): { - case XML_ELEMENT(CALC_EXT, XML_COLUMN): - { - maColumns.insert(aIter.toInt32()); - } + maColumns.insert(aIter.toInt32()); break; } } |