summaryrefslogtreecommitdiff
path: root/writerperfect/source/writer/exp/xmltext.cxx
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2019-05-30 22:59:29 +0800
committerMiklos Vajna <vmiklos@collabora.com>2019-05-31 09:12:23 +0200
commit966dc7f2cf500bb529394e1865e2cc6e5b264ab0 (patch)
tree68509d47df70595ca536f3ac6ae69516ef37e0a7 /writerperfect/source/writer/exp/xmltext.cxx
parent92418d9454e5842d34dd8140115ba42515c0d816 (diff)
EPUB export: fix not properly paired openPageSpan
Fix the test case converting abi11105.abw to EPUB file. ( the attachment at <https://bugzilla.abisource.com/show_bug.cgi?id=11105#c1> ) soffice.bin: .../sax/source/expatwrap/saxwriter.cxx:1184: virtual void (anonymous namespace)::SAXWriter::endElement(const rtl::OUString &): Assertion `aName == m_pSaxWriterHelper->m_DebugStartedElements.top()' failed. We used to invoke handlePageSpan when starting a paragraph or a table element that has master-page-name defined in the referred style, and invoke closePageSpan when XMLBodyContentContext. Limit the handling of page span to top-level paragraph or tables so that it doesn't messed up in the nested ( paragraph that changed it's page style in a table cell ) case. Change-Id: Ic8637663aaa7506ced9758bd7ccd7233309e8557 Reviewed-on: https://gerrit.libreoffice.org/73214 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerperfect/source/writer/exp/xmltext.cxx')
-rw-r--r--writerperfect/source/writer/exp/xmltext.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/writerperfect/source/writer/exp/xmltext.cxx b/writerperfect/source/writer/exp/xmltext.cxx
index 8177be04b573..d976ebdbf846 100644
--- a/writerperfect/source/writer/exp/xmltext.cxx
+++ b/writerperfect/source/writer/exp/xmltext.cxx
@@ -35,17 +35,18 @@ void XMLBodyContentContext::endElement(const OUString& /*rName*/)
rtl::Reference<XMLImportContext> XMLBodyContentContext::CreateChildContext(
const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
{
- return CreateTextChildContext(GetImport(), rName);
+ return CreateTextChildContext(GetImport(), rName, true);
}
-rtl::Reference<XMLImportContext> CreateTextChildContext(XMLImport& rImport, const OUString& rName)
+rtl::Reference<XMLImportContext> CreateTextChildContext(XMLImport& rImport, const OUString& rName,
+ bool bTopLevel)
{
if (rName == "text:p" || rName == "text:h")
- return new XMLParaContext(rImport);
+ return new XMLParaContext(rImport, bTopLevel);
if (rName == "text:section")
return new XMLSectionContext(rImport);
if (rName == "table:table")
- return new XMLTableContext(rImport);
+ return new XMLTableContext(rImport, bTopLevel);
if (rName == "text:list")
return new XMLTextListContext(rImport);
return nullptr;