summaryrefslogtreecommitdiff
path: root/writerperfect/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-12 17:21:53 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-12 20:34:23 +0200
commitc49fb2ffaf988b0f9a4480eba5960cc2de16797f (patch)
treec46dd297c92bbe1002ef17fd8c4459102786faff /writerperfect/source
parente6746a005419235d20074d696a1f8fadbda0a003 (diff)
EPUB export: handle list content
Minimal effort to not loose content, no actual list formatting yet. Change-Id: Ic49ed2f1877c608fc4af5d4aa7ebb3b49908fd86 Reviewed-on: https://gerrit.libreoffice.org/42214 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerperfect/source')
-rw-r--r--writerperfect/source/writer/exp/XMLTextListContext.cxx36
-rw-r--r--writerperfect/source/writer/exp/XMLTextListContext.hxx34
-rw-r--r--writerperfect/source/writer/exp/XMLTextListItemContext.cxx40
-rw-r--r--writerperfect/source/writer/exp/XMLTextListItemContext.hxx34
-rw-r--r--writerperfect/source/writer/exp/xmltext.cxx3
5 files changed, 147 insertions, 0 deletions
diff --git a/writerperfect/source/writer/exp/XMLTextListContext.cxx b/writerperfect/source/writer/exp/XMLTextListContext.cxx
new file mode 100644
index 000000000000..edfd7371b15e
--- /dev/null
+++ b/writerperfect/source/writer/exp/XMLTextListContext.cxx
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "XMLTextListContext.hxx"
+
+#include "XMLTextListItemContext.hxx"
+
+using namespace com::sun::star;
+
+namespace writerperfect
+{
+namespace exp
+{
+
+XMLTextListContext::XMLTextListContext(XMLImport &rImport)
+ : XMLImportContext(rImport)
+{
+}
+
+XMLImportContext *XMLTextListContext::CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+{
+ if (rName == "text:list-item")
+ return new XMLTextListItemContext(mrImport);
+ return nullptr;
+}
+
+} // namespace exp
+} // namespace writerperfect
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/writer/exp/XMLTextListContext.hxx b/writerperfect/source/writer/exp/XMLTextListContext.hxx
new file mode 100644
index 000000000000..533257228fbb
--- /dev/null
+++ b/writerperfect/source/writer/exp/XMLTextListContext.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_SOURCE_WRITER_EXP_XMLTEXTLISTCONTEXT_HXX
+#define INCLUDED_WRITERPERFECT_SOURCE_WRITER_EXP_XMLTEXTLISTCONTEXT_HXX
+
+#include "xmlictxt.hxx"
+
+namespace writerperfect
+{
+namespace exp
+{
+
+/// Handler for <text:list>.
+class XMLTextListContext : public XMLImportContext
+{
+public:
+ XMLTextListContext(XMLImport &rImport);
+
+ XMLImportContext *CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+};
+
+} // namespace exp
+} // namespace writerperfect
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/writer/exp/XMLTextListItemContext.cxx b/writerperfect/source/writer/exp/XMLTextListItemContext.cxx
new file mode 100644
index 000000000000..7b166d52fb42
--- /dev/null
+++ b/writerperfect/source/writer/exp/XMLTextListItemContext.cxx
@@ -0,0 +1,40 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "XMLTextListItemContext.hxx"
+
+#include "XMLTextListContext.hxx"
+#include "txtparai.hxx"
+#include "xmlimp.hxx"
+
+using namespace com::sun::star;
+
+namespace writerperfect
+{
+namespace exp
+{
+
+XMLTextListItemContext::XMLTextListItemContext(XMLImport &rImport)
+ : XMLImportContext(rImport)
+{
+}
+
+XMLImportContext *XMLTextListItemContext::CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+{
+ if (rName == "text:p" || rName == "text:h")
+ return new XMLParaContext(mrImport);
+ if (rName == "text:list")
+ return new XMLTextListContext(mrImport);
+ return nullptr;
+}
+
+} // namespace exp
+} // namespace writerperfect
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/writer/exp/XMLTextListItemContext.hxx b/writerperfect/source/writer/exp/XMLTextListItemContext.hxx
new file mode 100644
index 000000000000..cb6a68aedf5a
--- /dev/null
+++ b/writerperfect/source/writer/exp/XMLTextListItemContext.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_SOURCE_WRITER_EXP_XMLTEXTLISTITEMCONTEXT_HXX
+#define INCLUDED_WRITERPERFECT_SOURCE_WRITER_EXP_XMLTEXTLISTITEMCONTEXT_HXX
+
+#include "xmlictxt.hxx"
+
+namespace writerperfect
+{
+namespace exp
+{
+
+/// Handler for <text:list-item>.
+class XMLTextListItemContext : public XMLImportContext
+{
+public:
+ XMLTextListItemContext(XMLImport &rImport);
+
+ XMLImportContext *CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+};
+
+} // namespace exp
+} // namespace writerperfect
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/writer/exp/xmltext.cxx b/writerperfect/source/writer/exp/xmltext.cxx
index 73a6f5e73465..14c5b306dd99 100644
--- a/writerperfect/source/writer/exp/xmltext.cxx
+++ b/writerperfect/source/writer/exp/xmltext.cxx
@@ -12,6 +12,7 @@
#include "txtparai.hxx"
#include "xmltbli.hxx"
#include "XMLSectionContext.hxx"
+#include "XMLTextListContext.hxx"
using namespace com::sun::star;
@@ -38,6 +39,8 @@ XMLImportContext *CreateTextChildContext(XMLImport &rImport, const OUString &rNa
return new XMLSectionContext(rImport);
if (rName == "table:table")
return new XMLTableContext(rImport);
+ if (rName == "text:list")
+ return new XMLTextListContext(rImport);
return nullptr;
}