summaryrefslogtreecommitdiff
path: root/writerperfect/source/writer/exp/txtparai.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-07 15:26:21 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-07 17:27:55 +0200
commitbf3a87d1ee9106161d26f33c1ccb6b7b0d0aa0b9 (patch)
treed099d9dcbc59742a4caf947c11b36e27e320d843 /writerperfect/source/writer/exp/txtparai.cxx
parentdd89afa6ee8166b69e7a1e86f22616ca8fc122c9 (diff)
EPUB export: handle line break
When it's directly under <text:p>, as a start. Change-Id: I05e7decbcfa2f4dae36c01179d7efd7c8645a26b Reviewed-on: https://gerrit.libreoffice.org/42059 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerperfect/source/writer/exp/txtparai.cxx')
-rw-r--r--writerperfect/source/writer/exp/txtparai.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/writerperfect/source/writer/exp/txtparai.cxx b/writerperfect/source/writer/exp/txtparai.cxx
index 984070ba7fc4..c476904277e2 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -133,6 +133,25 @@ void XMLSpanContext::characters(const OUString &rChars)
mrImport.GetGenerator().closeSpan();
}
+/// Handler for <text:line-break>.
+class XMLLineBreakContext : public XMLImportContext
+{
+public:
+ XMLLineBreakContext(XMLImport &rImport);
+
+ void SAL_CALL startElement(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+};
+
+XMLLineBreakContext::XMLLineBreakContext(XMLImport &rImport)
+ : XMLImportContext(rImport)
+{
+}
+
+void XMLLineBreakContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+{
+ mrImport.GetGenerator().insertLineBreak();
+}
+
/// Handler for <text:a>.
class XMLHyperlinkContext : public XMLImportContext
{
@@ -188,6 +207,8 @@ 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;
}