diff options
author | Luke Deller <luke@deller.id.au> | 2017-07-12 23:56:50 +1000 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-07-20 15:19:40 +0200 |
commit | c027764f94a1fc0a367e03b412d3c11d6c10769c (patch) | |
tree | 44842001d7bbf60755eff4c8c0b444d186f25e6d /sw | |
parent | e26eb2f2728469d18caa28f9551c2eee85b1d7ec (diff) |
tdf#109080 First page header/footer ODF (1/2)
The proposal to add <style:header-first> / <style:footer-first>
to the ODF standard has not yet been accepted, so meanwhile we
should be using an extension namespace for these elements.
This first commit (intended for backport) adds support for reading
<loext:header-first> / <loext:footer-first>
Change-Id: I616b6a0acaead9d767ae7d119e539b865f3a6774
(cherry picked from commit bff8cd3d52223002263dcb8c09758c4fc753b6e3)
Reviewed-on: https://gerrit.libreoffice.org/40227
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/odfimport/data/tdf109080_loext_ns.odt | bin | 0 -> 9217 bytes | |||
-rw-r--r-- | sw/qa/extras/odfimport/data/tdf109080_style_ns.odt | bin | 0 -> 9219 bytes | |||
-rw-r--r-- | sw/qa/extras/odfimport/odfimport.cxx | 31 |
3 files changed, 31 insertions, 0 deletions
diff --git a/sw/qa/extras/odfimport/data/tdf109080_loext_ns.odt b/sw/qa/extras/odfimport/data/tdf109080_loext_ns.odt Binary files differnew file mode 100644 index 000000000000..ac7b3e272acc --- /dev/null +++ b/sw/qa/extras/odfimport/data/tdf109080_loext_ns.odt diff --git a/sw/qa/extras/odfimport/data/tdf109080_style_ns.odt b/sw/qa/extras/odfimport/data/tdf109080_style_ns.odt Binary files differnew file mode 100644 index 000000000000..ada290dc5fe1 --- /dev/null +++ b/sw/qa/extras/odfimport/data/tdf109080_style_ns.odt diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 06f2bf7f8a9c..2f1f12222f1f 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -800,5 +800,36 @@ DECLARE_ODFIMPORT_TEST(testTdf100033_2, "tdf100033_2.odt") CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xIndexAccess->getCount()); } +DECLARE_ODFIMPORT_TEST(testTdf109080_loext_ns, "tdf109080_loext_ns.odt") +{ + // Test we can import <loext:header-first> and <loext:footer-first> + + CPPUNIT_ASSERT_EQUAL(OUString("This is the first page header"), + parseDump("/root/page[1]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("This is the non-first-page header"), + parseDump("/root/page[2]/header/txt/text()")); + + CPPUNIT_ASSERT_EQUAL(OUString("This is the first page footer"), + parseDump("/root/page[1]/footer/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("This is the non-first-page footer"), + parseDump("/root/page[2]/footer/txt/text()")); +} + +DECLARE_ODFIMPORT_TEST(testTdf109080_style_ns, "tdf109080_style_ns.odt") +{ + // Test we can import <style:header-first> and <style:footer-first> + // (produced by LibreOffice 4.0 - 5.x) + + CPPUNIT_ASSERT_EQUAL(OUString("This is the first page header"), + parseDump("/root/page[1]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("This is the non-first-page header"), + parseDump("/root/page[2]/header/txt/text()")); + + CPPUNIT_ASSERT_EQUAL(OUString("This is the first page footer"), + parseDump("/root/page[1]/footer/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("This is the non-first-page footer"), + parseDump("/root/page[2]/footer/txt/text()")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |