diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlictxt.cxx | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx index 69fce5c5208a..5c75a964caef 100644 --- a/xmloff/source/core/xmlictxt.cxx +++ b/xmloff/source/core/xmlictxt.cxx @@ -70,39 +70,36 @@ void SAL_CALL SvXMLImportContext::startFastElement(sal_Int32 nElement, const uno 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 ); -} - -void SAL_CALL SvXMLImportContext::startUnknownElement(const OUString & /*rNamespace*/, const OUString & /*rElementName*/, - const uno::Reference< xml::sax::XFastAttributeList > & Attribs) -{ mrImport.maAttrList->Clear(); mrImport.maNamespaceHandler->addNSDeclAttributes( mrImport.maAttrList ); - if ( Attribs.is() ) + 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 ) { - 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 ); - } + 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*/, + const uno::Reference< xml::sax::XFastAttributeList > & /*Attribs*/) +{ +} + void SAL_CALL SvXMLImportContext::endUnknownElement (const OUString & /*rNamespace*/, const OUString & /*rElementName*/) { } |