summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-25 12:42:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-25 18:22:02 +0200
commit5bf60ba188bb96b4fbda0ff0aa30aa1815ca647f (patch)
treedb53a60ffb66defb694899cb81e76269285870ea /xmloff
parente2fe4fde592564d35099ad1e2659ad682dfb77f5 (diff)
use more fastparser in OReportStylesContext
Change-Id: Ie8126206d9144ccba1fb120d47af9ebe35a345d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101320 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/XMLGraphicsDefaultStyle.cxx5
-rw-r--r--xmloff/source/draw/ximpstyl.hxx2
-rw-r--r--xmloff/source/style/xmlstyle.cxx34
3 files changed, 41 insertions, 0 deletions
diff --git a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx
index 2fadc9811a88..5a18b149a354 100644
--- a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx
+++ b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx
@@ -54,6 +54,11 @@ XMLGraphicsDefaultStyle::XMLGraphicsDefaultStyle( SvXMLImport& rImport, sal_uInt
{
}
+XMLGraphicsDefaultStyle::XMLGraphicsDefaultStyle( SvXMLImport& rImport, sal_Int32 nElement, const Reference< XFastAttributeList >& xAttrList, SvXMLStylesContext& rStyles )
+: XMLPropStyleContext( rImport, nElement, xAttrList, rStyles, XmlStyleFamily::SD_GRAPHICS_ID, true )
+{
+}
+
XMLGraphicsDefaultStyle::~XMLGraphicsDefaultStyle()
{
}
diff --git a/xmloff/source/draw/ximpstyl.hxx b/xmloff/source/draw/ximpstyl.hxx
index cd8c9f225910..e335045b5873 100644
--- a/xmloff/source/draw/ximpstyl.hxx
+++ b/xmloff/source/draw/ximpstyl.hxx
@@ -187,12 +187,14 @@ protected:
sal_Int32 nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) override;
+ using SvXMLStylesContext::CreateStyleStyleChildContext;
virtual SvXMLStyleContext *CreateStyleStyleChildContext(
XmlStyleFamily nFamily,
sal_uInt16 nPrefix,
const OUString& rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList) override;
+ using SvXMLStylesContext::CreateDefaultStyleStyleChildContext;
virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext(
XmlStyleFamily nFamily, sal_uInt16 nPrefix,
const OUString& rLocalName,
diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx
index e5dbf53b7361..f5a84198d7fb 100644
--- a/xmloff/source/style/xmlstyle.cxx
+++ b/xmloff/source/style/xmlstyle.cxx
@@ -416,6 +416,23 @@ SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext(
switch (nElement)
{
+ case XML_ELEMENT(STYLE, XML_STYLE):
+ case XML_ELEMENT(STYLE, XML_DEFAULT_STYLE):
+ {
+ XmlStyleFamily nFamily = XmlStyleFamily::DATA_STYLE;
+ for( auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ) )
+ {
+ if( aIter.getToken() == XML_ELEMENT(STYLE, XML_FAMILY) )
+ {
+ nFamily = GetFamily( aIter.toString() );
+ break;
+ }
+ }
+ pStyle = XML_ELEMENT(STYLE, XML_STYLE)==nElement
+ ? CreateStyleStyleChildContext( nFamily, nElement, xAttrList )
+ : CreateDefaultStyleStyleChildContext( nFamily, nElement, xAttrList );
+ break;
+ }
case XML_ELEMENT(TEXT, XML_BIBLIOGRAPHY_CONFIGURATION):
pStyle = new XMLIndexBibliographyConfigurationContext(
GetImport(), nElement, xAttrList);
@@ -477,6 +494,9 @@ SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext(
}
}
+ if (!pStyle)
+ SAL_WARN("xmloff", "Unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+
return pStyle;
}
@@ -561,6 +581,13 @@ SvXMLStyleContext *SvXMLStylesContext::CreateStyleStyleChildContext(
return pStyle;
}
+SvXMLStyleContext *SvXMLStylesContext::CreateStyleStyleChildContext(
+ XmlStyleFamily /*nFamily*/, sal_Int32 /*nElement*/,
+ const uno::Reference< xml::sax::XFastAttributeList > & /*xAttrList*/ )
+{
+ return nullptr;
+}
+
SvXMLStyleContext *SvXMLStylesContext::CreateDefaultStyleStyleChildContext(
XmlStyleFamily /*nFamily*/, sal_uInt16 /*nPrefix*/, const OUString& /*rLocalName*/,
const uno::Reference< xml::sax::XAttributeList > & )
@@ -568,6 +595,13 @@ SvXMLStyleContext *SvXMLStylesContext::CreateDefaultStyleStyleChildContext(
return nullptr;
}
+SvXMLStyleContext *SvXMLStylesContext::CreateDefaultStyleStyleChildContext(
+ XmlStyleFamily /*nFamily*/, sal_Int32 /*nElement*/,
+ const uno::Reference< xml::sax::XFastAttributeList > & )
+{
+ return nullptr;
+}
+
bool SvXMLStylesContext::InsertStyleFamily( XmlStyleFamily ) const
{
return true;