diff options
Diffstat (limited to 'reportdesign/source/filter/xml/xmlFormattedField.cxx')
-rw-r--r-- | reportdesign/source/filter/xml/xmlFormattedField.cxx | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/reportdesign/source/filter/xml/xmlFormattedField.cxx b/reportdesign/source/filter/xml/xmlFormattedField.cxx index 0e268a99565d..b5a646722d23 100644 --- a/reportdesign/source/filter/xml/xmlFormattedField.cxx +++ b/reportdesign/source/filter/xml/xmlFormattedField.cxx @@ -34,34 +34,29 @@ namespace rptxml using namespace ::com::sun::star; using namespace xml::sax; -OXMLFormattedField::OXMLFormattedField( ORptFilter& rImport, - sal_uInt16 nPrfx, const OUString& rLName - ,const uno::Reference< xml::sax::XAttributeList > & _xAttrList +OXMLFormattedField::OXMLFormattedField( ORptFilter& rImport + ,const uno::Reference< xml::sax::XFastAttributeList > & _xAttrList ,const uno::Reference< XFormattedField > & _xComponent ,OXMLTable* _pContainer ,bool _bPageCount) : - OXMLReportElementBase( rImport, nPrfx, rLName,_xComponent.get(),_pContainer) + OXMLReportElementBase( rImport,_xComponent.get(),_pContainer) { OSL_ENSURE(m_xReportComponent.is(),"Component is NULL!"); - const SvXMLNamespaceMap& rMap = rImport.GetNamespaceMap(); - const SvXMLTokenMap& rTokenMap = rImport.GetControlElemTokenMap(); - const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0; try { - for(sal_Int16 i = 0; i < nLength; ++i) + sax_fastparser::FastAttributeList *pAttribList = + sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); + for (auto &aIter : *pAttribList) { - OUString sLocalName; - const OUString sAttrName = _xAttrList->getNameByIndex( i ); - const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName ); - const OUString sValue = _xAttrList->getValueByIndex( i ); + OUString sValue = aIter.toString(); - switch( rTokenMap.Get( nPrefix, sLocalName ) ) + switch( aIter.getToken() ) { - case XML_TOK_DATA_FORMULA: + case XML_ELEMENT(REPORT, XML_FORMULA): _xComponent->setDataField(ORptFilter::convertFormula(sValue)); break; - case XML_TOK_SELECT_PAGE: + case XML_ELEMENT(REPORT, XML_SELECT_PAGE): _xComponent->setDataField("rpt:PageNumber()"); break; default: |