From 966dc7f2cf500bb529394e1865e2cc6e5b264ab0 Mon Sep 17 00:00:00 2001 From: Mark Hung Date: Thu, 30 May 2019 22:59:29 +0800 Subject: EPUB export: fix not properly paired openPageSpan Fix the test case converting abi11105.abw to EPUB file. ( the attachment at ) 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 --- writerperfect/source/writer/exp/txtparai.hxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'writerperfect/source/writer/exp/txtparai.hxx') diff --git a/writerperfect/source/writer/exp/txtparai.hxx b/writerperfect/source/writer/exp/txtparai.hxx index b87a5762b7a3..561be4f0a115 100644 --- a/writerperfect/source/writer/exp/txtparai.hxx +++ b/writerperfect/source/writer/exp/txtparai.hxx @@ -24,7 +24,7 @@ namespace exp class XMLParaContext : public XMLImportContext { public: - XMLParaContext(XMLImport& rImport); + XMLParaContext(XMLImport& rImport, bool bTopLevel = false); rtl::Reference CreateChildContext( const OUString& rName, @@ -40,6 +40,9 @@ private: OUString m_aStyleName; /// List of properties spans should inherit from this paragraph. librevenge::RVNGPropertyList m_aTextPropertyList; + /// If the context is a direct child of XMLBodyContentContext. + /// Only direct child of XMLBodyContentContext has to handle page span. + bool m_bTopLevel; }; /// Shared child context factory for paragraph and span contexts. -- cgit v1.2.3