summaryrefslogtreecommitdiff
path: root/writerperfect/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-08-25 17:46:20 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-08-25 21:36:03 +0200
commit1584d5215cd38be1f7cf14efbfac2e08ef4a0705 (patch)
treeb98b895e0d461c50c8e6a6211e1eb8a51a6c8ec6 /writerperfect/source
parent64ced968cc82b552e178da033e7a3b5af6996ae1 (diff)
EPUB export: allow custom split method
Default is split on heading, but this allows e.g. split on page break instead. Change-Id: Ie392fc76f91d60029c7e5f2a0adc55cb18f6157d Reviewed-on: https://gerrit.libreoffice.org/41577 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect/source')
-rw-r--r--writerperfect/source/writer/EPUBExportFilter.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx b/writerperfect/source/writer/EPUBExportFilter.cxx
index ac16cd570198..778e6a4e51be 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -12,6 +12,7 @@
#include "config_libepubgen.h"
#include <libepubgen/EPUBTextGenerator.h>
+#include <libepubgen/libepubgen-decls.h>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -35,6 +36,7 @@ EPUBExportFilter::EPUBExportFilter(const uno::Reference<uno::XComponentContext>
sal_Bool EPUBExportFilter::filter(const uno::Sequence<beans::PropertyValue> &rDescriptor)
{
sal_Int32 nVersion = 30;
+ sal_Int32 nSplitMethod = libepubgen::EPUB_SPLIT_METHOD_HEADING;
uno::Sequence<beans::PropertyValue> aFilterData;
for (sal_Int32 i = 0; i < rDescriptor.getLength(); ++i)
{
@@ -49,13 +51,15 @@ sal_Bool EPUBExportFilter::filter(const uno::Sequence<beans::PropertyValue> &rDe
{
if (aFilterData[i].Name == "EPUBVersion")
aFilterData[i].Value >>= nVersion;
+ else if (aFilterData[i].Name == "EPUBSplitMethod")
+ aFilterData[i].Value >>= nSplitMethod;
}
// Build the export filter chain: the package has direct access to the ZIP
// file, the flat ODF filter has access to the doc model, everything else
// is in-between.
EPUBPackage aPackage(mxContext, rDescriptor);
- libepubgen::EPUBTextGenerator aGenerator(&aPackage, libepubgen::EPUB_SPLIT_METHOD_HEADING
+ libepubgen::EPUBTextGenerator aGenerator(&aPackage, static_cast<libepubgen::EPUBSplitMethod>(nSplitMethod)
#if LIBEPUBGEN_VERSION_SUPPORT
, nVersion
#endif