summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2023-10-03 13:44:15 -0400
committerJustin Luth <jluth@mail.com>2023-10-04 16:36:14 +0200
commit4dd491bc50801d10bb2f1004fff6ebcdb5da9f59 (patch)
treedafc7228022cb7c9a7b789a2bcc6a70e736ae6f5 /sw
parent0d21e1075f0288a007cb427ce508d6fbbf8503dd (diff)
tdf#157572 tdf#112287 tdf#154129 writerfilter framePr: fix vAnchor default
Fixes LO 7.6 regression commit 630732bfd8ed531e9d412a36a083f33763def054 See bug 157572 for the documentation. To test this, I used ooxmlexport5's tdf112287B.docx with Word 2010: -changed vertical relative to Paragraph - exported w:vAnchor="text" -changed vertical relative to Page - exported w:vAnchor="page" -changed vertical relative to Margin - did not export w:vAnchor So, obviously the default is "margin" Note that it always exports w:y=1 For importing, the default vAnchor changed depending on whether w:y=0 (text) or w:y=1 (margin) * an exception is when w:y=0 and vAlign is defined - then 'margin' make CppunitTest_sw_ooxmlexport5 \ CPPUNIT_TEST_NAME=testTdf157572_defaultVAnchor Change-Id: I126094eafc43a83e3a4efdd1ebc8d9cab9d49759 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157527 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf157572_defaultVAnchor.docxbin0 -> 12702 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx11
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf157572_defaultVAnchor.docx b/sw/qa/extras/ooxmlexport/data/tdf157572_defaultVAnchor.docx
new file mode 100644
index 000000000000..9f63950693f7
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf157572_defaultVAnchor.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index ceb6bdff9c06..71cea9fa2964 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -1429,6 +1429,17 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf112287)
assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr","yAlign","bottom");
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf157572_defaultVAnchor)
+{
+ loadAndSave("tdf157572_defaultVAnchor.docx");
+ xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
+
+ // vAnchor wasn't defined on import. It should default to 'margin' when w:y=non-zero
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr","vAnchor","margin");
+ // yAlign=something is not compatible with w:y=non-zero" - don't write anything out
+ // assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "yAlign");
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf112287B)
{
loadAndSave("tdf112287B.docx");