diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-12-01 10:54:51 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-12-01 16:30:04 +0100 |
commit | ab7bdd1f91a7e6e25854601cca712488554ab960 (patch) | |
tree | 110157779e7bf585c863f981a7095f6f0d3581e4 /writerperfect/source | |
parent | 6af2cd34404ef6b19fb218931de0b42a2731c57f (diff) |
EPUB export: initial fixed layout support
This is just the bare minimum that is already a fixed layout and is
valid.
Change-Id: I64e1216d92125377d7836988586da9ea1d878536
Reviewed-on: https://gerrit.libreoffice.org/45643
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.cxx | 15 | ||||
-rw-r--r-- | writerperfect/source/writer/EPUBExportFilter.hxx | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx b/writerperfect/source/writer/EPUBExportFilter.cxx index ba9e30d85df9..8ebf5994aedc 100644 --- a/writerperfect/source/writer/EPUBExportFilter.cxx +++ b/writerperfect/source/writer/EPUBExportFilter.cxx @@ -48,10 +48,20 @@ sal_Int32 EPUBExportFilter::GetDefaultSplitMethod() return libepubgen::EPUB_SPLIT_METHOD_HEADING; } +sal_Int32 EPUBExportFilter::GetDefaultLayoutMethod() +{ +#if LIBEPUBGEN_VERSION_SUPPORT + return libepubgen::EPUB_LAYOUT_METHOD_REFLOWABLE; +#else + return 0; +#endif +} + sal_Bool EPUBExportFilter::filter(const uno::Sequence<beans::PropertyValue> &rDescriptor) { sal_Int32 nVersion = EPUBExportFilter::GetDefaultVersion(); sal_Int32 nSplitMethod = EPUBExportFilter::GetDefaultSplitMethod(); + sal_Int32 nLayoutMethod = EPUBExportFilter::GetDefaultLayoutMethod(); uno::Sequence<beans::PropertyValue> aFilterData; for (sal_Int32 i = 0; i < rDescriptor.getLength(); ++i) { @@ -68,6 +78,8 @@ sal_Bool EPUBExportFilter::filter(const uno::Sequence<beans::PropertyValue> &rDe aFilterData[i].Value >>= nVersion; else if (aFilterData[i].Name == "EPUBSplitMethod") aFilterData[i].Value >>= nSplitMethod; + else if (aFilterData[i].Name == "EPUBLayoutMethod") + aFilterData[i].Value >>= nLayoutMethod; } // Build the export filter chain: the package has direct access to the ZIP @@ -79,6 +91,9 @@ sal_Bool EPUBExportFilter::filter(const uno::Sequence<beans::PropertyValue> &rDe , nVersion #endif ); +#if LIBEPUBGEN_VERSION_SUPPORT + aGenerator.setLayoutMethod(static_cast<libepubgen::EPUBLayoutMethod>(nLayoutMethod)); +#endif OUString aSourceURL; uno::Reference<frame::XModel> xSourceModel(mxSourceDocument, uno::UNO_QUERY); if (xSourceModel.is()) diff --git a/writerperfect/source/writer/EPUBExportFilter.hxx b/writerperfect/source/writer/EPUBExportFilter.hxx index b423f96175e7..e96b0a84b695 100644 --- a/writerperfect/source/writer/EPUBExportFilter.hxx +++ b/writerperfect/source/writer/EPUBExportFilter.hxx @@ -50,6 +50,8 @@ public: static sal_Int32 GetDefaultVersion(); /// Gives the default split method. static sal_Int32 GetDefaultSplitMethod(); + /// Gives the default layout method. + static sal_Int32 GetDefaultLayoutMethod(); }; } // namespace writerperfect |