summaryrefslogtreecommitdiff
path: root/writerperfect/source/writer
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-07 17:29:18 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-07 20:59:10 +0200
commit01cc6e5107c706760939c2331ca57247bd02cb77 (patch)
treede627ff1d2d1038a656c5a759702d7ad2f74c5c6 /writerperfect/source/writer
parent5ffe8f05590e43eb8a668bb6da1f2e2ce0a7f713 (diff)
EPUB export: handle span-level line break
By pulling out common part of the paragraph/span context factory. Change-Id: If5fda87ce9f60e7e10d7f9406c30740bc8707143 Reviewed-on: https://gerrit.libreoffice.org/42064 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerperfect/source/writer')
-rw-r--r--writerperfect/source/writer/exp/txtparai.cxx13
-rw-r--r--writerperfect/source/writer/exp/txtparai.hxx3
2 files changed, 12 insertions, 4 deletions
diff --git a/writerperfect/source/writer/exp/txtparai.cxx b/writerperfect/source/writer/exp/txtparai.cxx
index c476904277e2..b085537cf106 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -103,7 +103,7 @@ XMLImportContext *XMLSpanContext::CreateChildContext(const OUString &rName, cons
return new XMLTextFrameContext(mrImport);
if (rName == "text:span")
return new XMLSpanContext(mrImport, &m_aPropertyList);
- return nullptr;
+ return writerperfect::exp::CreateChildContext(mrImport, rName);
}
void XMLSpanContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs)
@@ -207,9 +207,7 @@ XMLImportContext *XMLParaContext::CreateChildContext(const OUString &rName, cons
return new XMLSpanContext(mrImport, nullptr);
if (rName == "text:a")
return new XMLHyperlinkContext(mrImport);
- if (rName == "text:line-break")
- return new XMLLineBreakContext(mrImport);
- return nullptr;
+ return writerperfect::exp::CreateChildContext(mrImport, rName);
}
void XMLParaContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs)
@@ -253,6 +251,13 @@ void XMLParaContext::characters(const OUString &rChars)
mrImport.GetGenerator().closeSpan();
}
+XMLImportContext *CreateChildContext(XMLImport &rImport, const OUString &rName)
+{
+ if (rName == "text:line-break")
+ return new XMLLineBreakContext(rImport);
+ return nullptr;
+}
+
} // namespace exp
} // namespace writerperfect
diff --git a/writerperfect/source/writer/exp/txtparai.hxx b/writerperfect/source/writer/exp/txtparai.hxx
index 61c3fc5bfc73..52543ffeadde 100644
--- a/writerperfect/source/writer/exp/txtparai.hxx
+++ b/writerperfect/source/writer/exp/txtparai.hxx
@@ -33,6 +33,9 @@ private:
OUString m_aStyleName;
};
+/// Shared child context factory for paragraph and span contexts.
+XMLImportContext *CreateChildContext(XMLImport &rImport, const OUString &rName);
+
} // namespace exp
} // namespace writerperfect