[Libreoffice-commits] core.git: xmloff/source
Noel (via logerrit)
logerrit at kemper.freedesktop.org
Tue Dec 1 11:19:37 UTC 2020
xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx | 35 ++++++++---------
xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx | 5 +-
2 files changed, 20 insertions(+), 20 deletions(-)
New commits:
commit 4bb80a6d97b9ab4f2017c6033f18f806f3d4828a
Author: Noel <noelgrandin at gmail.com>
AuthorDate: Tue Dec 1 10:16:30 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Dec 1 12:18:58 2020 +0100
fastparser in XMLIndexChapterInfoEntryContext
Change-Id: If6f31b8de868d8a4698bd01714e049ca0154efa9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106932
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx
index d394a78add77..8436d1bb339b 100644
--- a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx
+++ b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/text/ChapterFormat.hpp>
#include <sax/tools/converter.hxx>
+#include <sal/log.hxx>
#include "XMLIndexTemplateContext.hxx"
#include <xmloff/xmlimp.hxx>
@@ -74,46 +75,44 @@ const SvXMLEnumMapEntry<sal_uInt16> aChapterDisplayMap[] =
{ XML_TOKEN_INVALID, 0 }
};
-void XMLIndexChapterInfoEntryContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
+void XMLIndexChapterInfoEntryContext::startFastElement(
+ sal_Int32 /*nElement*/,
+ const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
{
// handle both, style name and bibliography info
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
+ for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
{
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- if (XML_NAMESPACE_TEXT == nPrefix)
+ switch(aIter.getToken())
{
- if ( IsXMLToken( sLocalName, XML_STYLE_NAME ) )
+ case XML_ELEMENT(TEXT, XML_STYLE_NAME):
{
- m_sCharStyleName = xAttrList->getValueByIndex(nAttr);
+ m_sCharStyleName = aIter.toString();
m_bCharStyleNameOK = true;
+ break;
}
- else if ( IsXMLToken( sLocalName, XML_DISPLAY ) )//i53420, always true, in TOC as well
+ case XML_ELEMENT(TEXT, XML_DISPLAY): //i53420, always true, in TOC as well
{
sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(
- nTmp, xAttrList->getValueByIndex(nAttr),
- aChapterDisplayMap))
+ if (SvXMLUnitConverter::convertEnum(nTmp, aIter.toString(), aChapterDisplayMap))
{
nChapterInfo = nTmp;
bChapterInfoOK = true;
}
+ break;
}
- else if ( IsXMLToken( sLocalName, XML_OUTLINE_LEVEL ) )
+ case XML_ELEMENT(TEXT, XML_OUTLINE_LEVEL):
{
sal_Int32 nTmp;
- if (::sax::Converter::convertNumber(nTmp,
- xAttrList->getValueByIndex(nAttr)))
+ if (::sax::Converter::convertNumber(nTmp, aIter.toString()))
{
//control on range is carried out in the UNO level
nOutlineLevel = static_cast<sal_uInt16>(nTmp);
bOutlineLevelOK = true;
}
+ break;
}
+ default:
+ XMLOFF_WARN_UNKNOWN("xmloff", aIter);
}
}
diff --git a/xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx b/xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx
index 13608a3b6009..e5779a107c17 100644
--- a/xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx
+++ b/xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx
@@ -56,8 +56,9 @@ public:
protected:
/** process parameters */
- virtual void StartElement(
- const css::uno::Reference<css::xml::sax::XAttributeList> & xAttrList) override;
+ virtual void SAL_CALL startFastElement(
+ sal_Int32 nElement,
+ const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
/** fill property values for this template entry */
virtual void FillPropertyValues(
More information about the Libreoffice-commits
mailing list