summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-02-27 15:33:22 +0200
committerCaolán McNamara <caolanm@redhat.com>2020-02-27 20:51:01 +0100
commitf8ad7ad58836c16f4bd3f7bf2832fd4768b5ea58 (patch)
tree3e0f51875e1300c224b0c4576042d2f5c52ea5f2 /sw
parent28f0ceb77e7c78debfc1372005ac2e2ecacc543b (diff)
tdf#130908 Chapter Numbering can't load custom style
regression from commit 83e97fef3fa4de900eda35d02168fcae01c85eed convert ImportStoredChapterNumberingRules to XFastParser and add some more debugging trace Change-Id: I224b9c442369a4c6a7746d7ff419f069d3430513 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89633 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 5320fccc290f338d344c5d3c75101c98057788cd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89583 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/config/StoredChapterNumbering.cxx29
1 files changed, 23 insertions, 6 deletions
diff --git a/sw/source/uibase/config/StoredChapterNumbering.cxx b/sw/source/uibase/config/StoredChapterNumbering.cxx
index 1a1e2cf8553c..eea0c260bbf5 100644
--- a/sw/source/uibase/config/StoredChapterNumbering.cxx
+++ b/sw/source/uibase/config/StoredChapterNumbering.cxx
@@ -290,7 +290,11 @@ public:
name = aIter.toString();
else if (IsXMLToken(aIter.toString(), XML_DISPLAY_NAME))
displayName = aIter.toString();
+ else
+ SAL_WARN("xmloff", "unknown value for style:family=" << aIter.toString());
}
+ else
+ SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
if (nFamily && !name.isEmpty() && !displayName.isEmpty())
{
@@ -333,27 +337,40 @@ public:
}
}
- virtual css::uno::Reference<XFastContextHandler> SAL_CALL createFastChildContext(
- sal_Int32 Element,
- const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override
+ virtual SvXMLImportContextRef CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override
{
- if (Element == XML_ELEMENT(TEXT, XML_OUTLINE_STYLE))
+ if (XML_NAMESPACE_TEXT == nPrefix && IsXMLToken(rLocalName, XML_OUTLINE_STYLE))
{
++m_nCounter;
if (m_nCounter <= SwChapterNumRules::nMaxRules)
{
SvxXMLListStyleContext *const pContext(
- new SvxXMLListStyleContext(GetImport(), Element, xAttrList, true));
+ new SvxXMLListStyleContext(GetImport(),
+ nPrefix, rLocalName, xAttrList, true));
m_Contexts.emplace_back(pContext);
return pContext;
}
}
+ return nullptr;
+ }
+
+ virtual css::uno::Reference<XFastContextHandler> SAL_CALL createFastChildContext(
+ sal_Int32 Element,
+ const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override
+ {
+ if (Element == XML_ELEMENT(TEXT, XML_OUTLINE_STYLE))
+ {
+ // handled in CreateChildContext
+ }
else if (Element == XML_ELEMENT(STYLE, XML_STYLE))
{
return new StoredChapterNumberingDummyStyleContext(GetImport(), xAttrList);
}
- return SvXMLImportContext::createFastChildContext(Element, xAttrList);
+ return nullptr;
}
};