summaryrefslogtreecommitdiff
path: root/writerperfect/source/writer/exp
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-08-15 16:13:14 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-08-15 19:46:52 +0200
commitb6f39c47fb477f16c65631523b0c18b4f262fadf (patch)
treeb68c147743d78e6b3073ac7c3aa52a2c1d25c580 /writerperfect/source/writer/exp
parent26b97ba18e72f7c25c836177d895d429162a0120 (diff)
EPUB export: initial index support
Split output by chapters. The index is still basic, just "Section N" entries so far. Change-Id: I4db659ee4110ab30f4b75f44c41f958533ddad7f Reviewed-on: https://gerrit.libreoffice.org/41177 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect/source/writer/exp')
-rw-r--r--writerperfect/source/writer/exp/txtparai.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/writerperfect/source/writer/exp/txtparai.cxx b/writerperfect/source/writer/exp/txtparai.cxx
index 8abf113dad52..02e4f78c1ef5 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -62,9 +62,21 @@ XMLImportContext *XMLParaContext::CreateChildContext(const OUString &rName, cons
return nullptr;
}
-void XMLParaContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+void XMLParaContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs)
{
- mrImport.GetGenerator().openParagraph(librevenge::RVNGPropertyList());
+ librevenge::RVNGPropertyList aPropertyList;
+ for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
+ {
+ const OUString &rAttributeName = xAttribs->getNameByIndex(i);
+ if (rAttributeName != "text:style-name")
+ {
+ OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8);
+ OString sValue = OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8);
+ aPropertyList.insert(sName.getStr(), sValue.getStr());
+ }
+ }
+
+ mrImport.GetGenerator().openParagraph(aPropertyList);
}
void XMLParaContext::endElement(const OUString &/*rName*/)