[Libreoffice-commits] core.git: xmloff/inc xmloff/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Sun Nov 15 19:06:39 UTC 2020
xmloff/inc/txtfldi.hxx | 7 +++----
xmloff/source/text/txtfldi.cxx | 34 ++++++++++++++++------------------
2 files changed, 19 insertions(+), 22 deletions(-)
New commits:
commit 07caaab2e49d5fb409810025867b5ada6968c7e2
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Nov 15 12:59:56 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Nov 15 20:05:56 2020 +0100
fastparser in XMLDatabaseFieldImportContext
Change-Id: I83aba0cfcf2f280750b43e4782ec376572dacba7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105895
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx
index 216c32ea677d..cedba840d6fc 100644
--- a/xmloff/inc/txtfldi.hxx
+++ b/xmloff/inc/txtfldi.hxx
@@ -361,10 +361,9 @@ public:
const css::uno::Reference< css::beans::XPropertySet> & xPropertySet) override;
/// handle database-location children
- virtual SvXMLImportContextRef CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const css::uno::Reference< css::xml::sax::XAttributeList> & xAttrList ) override;
+ virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
+ sal_Int32 nElement,
+ const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
};
/** import database name fields (<text:database-name>) */
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index fd643a6cd6ca..1622e0280933 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -1214,34 +1214,32 @@ void XMLDatabaseFieldImportContext::ProcessAttribute(
}
}
-SvXMLImportContextRef XMLDatabaseFieldImportContext::CreateChildContext(
- sal_uInt16 p_nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList>& xAttrList )
+css::uno::Reference< css::xml::sax::XFastContextHandler > XMLDatabaseFieldImportContext::createFastChildContext(
+ sal_Int32 nElement,
+ const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
{
- if( ( p_nPrefix == XML_NAMESPACE_FORM ) &&
- IsXMLToken( rLocalName, XML_CONNECTION_RESOURCE ) )
+ if (nElement == XML_ELEMENT(FORM, XML_CONNECTION_RESOURCE) )
{
- // process attribute list directly
- sal_Int16 nLength = xAttrList->getLength();
- for( sal_Int16 n = 0; n < nLength; n++ )
+ for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
{
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(n), &sLocalName );
-
- if( ( nPrefix == XML_NAMESPACE_XLINK ) &&
- IsXMLToken( sLocalName, XML_HREF ) )
+ switch (aIter.getToken())
{
- m_sDatabaseURL = xAttrList->getValueByIndex(n);
- m_bDatabaseOK = true;
- m_bDatabaseURLOK = true;
+ case XML_ELEMENT(XLINK, XML_HREF):
+ {
+ m_sDatabaseURL = aIter.toString();
+ m_bDatabaseOK = true;
+ m_bDatabaseURLOK = true;
+ }
+ break;
+ default:;
}
}
// we call ProcessAttribute in order to set bValid appropriately
ProcessAttribute( XML_TOKEN_INVALID, OUString() );
}
+ else
+ XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
return nullptr;
}
More information about the Libreoffice-commits
mailing list