From 01283fe86cc523f1bed38bdfc5fbcb1694972169 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 1 Dec 2017 10:57:35 +0100 Subject: EPUB export allow requesting fixed layout from cmdline FilterData is a typed map of options, suitable for UNO API clients, also that's what the UI uses. OTOH the --convert-to cmdline option can only set a FilterOptions string, so support that way as well. --convert-to epub:EPUB:layout=fixed can be used to trigger this. Change-Id: I9f429107ae1db3dc4b6ab3b2b75665f096a1a33a Reviewed-on: https://gerrit.libreoffice.org/45646 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- writerperfect/qa/unit/EPUBExportTest.cxx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'writerperfect/qa') diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx index a9c3db57c299..ac6e25efc2ae 100644 --- a/writerperfect/qa/unit/EPUBExportTest.cxx +++ b/writerperfect/qa/unit/EPUBExportTest.cxx @@ -42,6 +42,7 @@ class EPUBExportTest : public test::BootstrapFixture, public unotest::MacrosTest utl::TempFile maTempFile; xmlDocPtr mpXmlDoc = nullptr; uno::Reference mxZipFile; + OUString maFilterOptions; public: void setUp() override; @@ -58,6 +59,7 @@ public: void testMimetype(); void testEPUB2(); void testEPUBFixedLayout(); + void testEPUBFixedLayoutOption(); void testPageBreakSplit(); void testSpanAutostyle(); void testParaAutostyleCharProps(); @@ -99,6 +101,7 @@ public: CPPUNIT_TEST(testMimetype); CPPUNIT_TEST(testEPUB2); CPPUNIT_TEST(testEPUBFixedLayout); + CPPUNIT_TEST(testEPUBFixedLayoutOption); CPPUNIT_TEST(testPageBreakSplit); CPPUNIT_TEST(testSpanAutostyle); CPPUNIT_TEST(testParaAutostyleCharProps); @@ -177,7 +180,10 @@ void EPUBExportTest::createDoc(const OUString &rFile, const uno::SequencestoreToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); mxZipFile = packages::zip::ZipFileAccess::createWithURL(mxComponentContext, maTempFile.GetURL()); } @@ -310,6 +316,17 @@ void EPUBExportTest::testEPUBFixedLayout() assertXPathContent(mpXmlDoc, "/opf:package/opf:metadata/opf:meta[@property='rendition:layout']", "pre-paginated"); } +void EPUBExportTest::testEPUBFixedLayoutOption() +{ + // Explicitly request fixed layout, this time via FilterOptions. + maFilterOptions = "layout=fixed"; + createDoc("hello.fodt", {}); + + // This failed, fixed layout was only working via the FilterData map. + mpXmlDoc = parseExport("OEBPS/content.opf"); + assertXPathContent(mpXmlDoc, "/opf:package/opf:metadata/opf:meta[@property='rendition:layout']", "pre-paginated"); +} + void EPUBExportTest::testPageBreakSplit() { uno::Sequence aFilterData(comphelper::InitPropertySequence( -- cgit