summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf123324_testRelativeAnchorHeightFromTopMarginHasHeader.docxbin0 -> 20882 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf123324_testRelativeAnchorHeightFromTopMarginNoHeader.docxbin0 -> 14683 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx36
3 files changed, 36 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf123324_testRelativeAnchorHeightFromTopMarginHasHeader.docx b/sw/qa/extras/ooxmlexport/data/tdf123324_testRelativeAnchorHeightFromTopMarginHasHeader.docx
new file mode 100644
index 000000000000..b978eec993c7
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf123324_testRelativeAnchorHeightFromTopMarginHasHeader.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf123324_testRelativeAnchorHeightFromTopMarginNoHeader.docx b/sw/qa/extras/ooxmlexport/data/tdf123324_testRelativeAnchorHeightFromTopMarginNoHeader.docx
new file mode 100644
index 000000000000..70c2793cbf96
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf123324_testRelativeAnchorHeightFromTopMarginNoHeader.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 167c05111a51..3ca1a456182f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -1163,6 +1163,42 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf108505, "tdf108505.docx")
getProperty<OUString>(xText, "CharFontName"));
}
+DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromTopMarginHasHeader,
+ "tdf123324_testRelativeAnchorHeightFromTopMarginHasHeader.docx")
+{
+ // TODO: fix export too
+ if (mbExported)
+ return;
+ // tdf#123324 The height was set relative to page print area top,
+ // but this was handled relative to page height.
+ // Note: page print area top = margin + header height.
+ // In this case the header exists.
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ const sal_Int32 nAnchoredHeight
+ = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height").toInt32();
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2551), nAnchoredHeight);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromTopMarginNoHeader,
+ "tdf123324_testRelativeAnchorHeightFromTopMarginNoHeader.docx")
+{
+ // TODO: fix export too
+ if (mbExported)
+ return;
+ // tdf#123324 The height was set relative from top margin, but this was handled relative from page height.
+ // Note: the MSO Word margin = LO margin + LO header height.
+ // In this case the header does not exist, so MSO Word margin and LO Writer margin are the same.
+
+ // tdf#123324 The height was set relative to page print area top,
+ // but this was handled relative to page height.
+ // Note: page print area top = margin + header height.
+ // In this case the header does not exist, so OpenDocument and OOXML margins are the same.
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ const sal_Int32 nAnchoredHeight
+ = getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height").toInt32();
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2551), nAnchoredHeight);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */