From ab7bdd1f91a7e6e25854601cca712488554ab960 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 1 Dec 2017 10:54:51 +0100 Subject: 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 Reviewed-by: Miklos Vajna --- writerperfect/source/writer/EPUBExportFilter.cxx | 15 +++++++++++++++ writerperfect/source/writer/EPUBExportFilter.hxx | 2 ++ 2 files changed, 17 insertions(+) (limited to 'writerperfect/source') 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 &rDescriptor) { sal_Int32 nVersion = EPUBExportFilter::GetDefaultVersion(); sal_Int32 nSplitMethod = EPUBExportFilter::GetDefaultSplitMethod(); + sal_Int32 nLayoutMethod = EPUBExportFilter::GetDefaultLayoutMethod(); uno::Sequence aFilterData; for (sal_Int32 i = 0; i < rDescriptor.getLength(); ++i) { @@ -68,6 +78,8 @@ sal_Bool EPUBExportFilter::filter(const uno::Sequence &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 &rDe , nVersion #endif ); +#if LIBEPUBGEN_VERSION_SUPPORT + aGenerator.setLayoutMethod(static_cast(nLayoutMethod)); +#endif OUString aSourceURL; uno::Reference 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 -- cgit