summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorSzabolcs Toth <toth.szabolcs@nisz.hu>2020-10-14 16:32:05 +0200
committerLászló Németh <nemeth@numbertext.org>2020-10-27 13:35:49 +0100
commitc690d49770d0c93a95bd8c3d11e95c1d17a17a60 (patch)
treee7b2fd69fc61b79da8f5ef1abd9008ec666a4a34 /sw/qa
parentc9eb53f200225f2ee6ca695e1326843a487aee51 (diff)
tdf#137641 DOCX export: fix relative from top page border
alignment. Follow-up of commit 1c593e1916c9164c7db71da2017cfc26972f8e9f (tdf#133045 sw: add shape alignment to the top page border). Change-Id: Ie5bc536556b72030d17829a917f91a15ad5157a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104660 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf137641_RelativeFromTopMargin.docxbin0 -> 19650 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx30
2 files changed, 30 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf137641_RelativeFromTopMargin.docx b/sw/qa/extras/ooxmlexport/data/tdf137641_RelativeFromTopMargin.docx
new file mode 100644
index 000000000000..2cd299ff211a
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf137641_RelativeFromTopMargin.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 1ff3ccf8ec3e..4c0dfbf9ebbb 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -1560,6 +1560,36 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf115557, "tdf115557.docx")
assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1);
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAlignmentRelativeFromTopMargin, "tdf137641_RelativeFromTopMargin.docx")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+
+ assertXPath(pXmlDoc,
+ "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/"
+ "wp:anchor/wp:positionV",
+ "relativeFrom", "topMargin");
+ assertXPathContent(pXmlDoc,
+ "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/"
+ "wp:anchor/wp:positionV/wp:align",
+ "top");
+ assertXPath(pXmlDoc,
+ "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/"
+ "wp:anchor/wp:positionV",
+ "relativeFrom", "topMargin");
+ assertXPathContent(pXmlDoc,
+ "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/"
+ "wp:anchor/wp:positionV/wp:align",
+ "bottom");
+ assertXPath(pXmlDoc,
+ "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/"
+ "wp:anchor/wp:positionV",
+ "relativeFrom", "topMargin");
+ assertXPathContent(pXmlDoc,
+ "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/"
+ "wp:anchor/wp:positionV/wp:align",
+ "center");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */