summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-05-22 22:05:24 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-05-23 09:12:06 +0200
commit5956828c88501ef1366e60010b05053a8e1e642e (patch)
tree28b6389baca36b8ced4199934cff55a3790510f7 /sw/qa
parent4552096794c408110630ab2eaf47bebaa6c403f2 (diff)
tdf#117505 RTF export: fix incorrect header distance for first/follow pages
In case the first and the follow page format has different header distances, the DOC and DOCX import work with the distance from the first page format when they take the last item from the MSWordSections container at the end of the export. RTF writes section info before the document content, and in case there are separate first and follow page formats, then we work with the follow format since commit 20a53cb9e9c7b797c091fe6ac6a34dfb28c61304 (INTEGRATION: CWS limerickfilterteam08 (1.16.32); FILE MERGED, 2003-09-01) as a fix for i#13107. There is no perfect solution here, the sw doc model can store different header distances for first and follow pages, while Word works with a single distance. But RTF/DOCX/DOC import puts the relevant header distance to the first page format and DOCX/DOC export reads the distance from there, so be consistent and do the same in the RTF export as well. This means the DOCX import -> RTF export -> RTF import sequence from the bugreport will result in a correct header distance. Change-Id: I3f1fe3080360702c41d680b8785cc3602e74685e Reviewed-on: https://gerrit.libreoffice.org/54680 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf117505.odtbin0 -> 19263 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport3.cxx11
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf117505.odt b/sw/qa/extras/rtfexport/data/tdf117505.odt
new file mode 100644
index 000000000000..91bde8f92393
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf117505.odt
Binary files differ
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index 142c7f6c8381..d27eec82fea9 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -145,6 +145,17 @@ DECLARE_RTFEXPORT_TEST(testTdf117268, "tdf117268.rtf")
CPPUNIT_ASSERT_EQUAL(xCell, xAnchorCell);
}
+DECLARE_RTFEXPORT_TEST(testTdf117505, "tdf117505.odt")
+{
+ uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles"));
+ uno::Reference<beans::XPropertySet> xFirstPage(xPageStyles->getByName("First Page"),
+ uno::UNO_QUERY);
+ // This was 499, small header height resulted in visible whitespace from
+ // remaining top margin -> header content moved down.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1499),
+ getProperty<sal_Int32>(xFirstPage, "HeaderHeight"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */