summaryrefslogtreecommitdiff
path: root/writerperfect/source/writer/exp/txtparai.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-08-25 16:12:03 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-08-25 17:46:01 +0200
commitbb4e52096db668533bae40f5155749a9986108a2 (patch)
tree0a74e2a14db6efe469ab4dbba2e10169c6971a8e /writerperfect/source/writer/exp/txtparai.cxx
parent8e246b5cccadbac1e6d6c39fcd2a872727683f75 (diff)
EPUB export: add support for page breaks
EPUB_SPLIT_METHOD is still hardcoded to HEADING, so while we send the page break info to librevenge now, it's ignored on that end. This requies basic infrastructure for automatic styles. Change-Id: Ibafead0dedd9dbfa6223a9c701a62611ba2671fd Reviewed-on: https://gerrit.libreoffice.org/41573 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.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/writerperfect/source/writer/exp/txtparai.cxx b/writerperfect/source/writer/exp/txtparai.cxx
index 600709d9fec8..e669cf89edf8 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -124,10 +124,23 @@ void XMLParaContext::startElement(const OUString &/*rName*/, const css::uno::Ref
for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
{
const OUString &rAttributeName = xAttribs->getNameByIndex(i);
- if (rAttributeName != "text:style-name")
+ const OUString &rAttributeValue = xAttribs->getValueByIndex(i);
+ if (rAttributeName == "text:style-name")
+ {
+ // Reference to an automatic style, try to look it up.
+ auto itStyle = mrImport.GetAutomaticStyles().find(rAttributeValue);
+ if (itStyle == mrImport.GetAutomaticStyles().end())
+ continue;
+
+ // Apply properties directly, librevenge has no notion of automatic styles.
+ librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
+ for (itProp.rewind(); itProp.next();)
+ aPropertyList.insert(itProp.key(), itProp());
+ }
+ else
{
OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8);
- OString sValue = OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8);
+ OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8);
aPropertyList.insert(sName.getStr(), sValue.getStr());
}
}