diff options
author | Justin Luth <justin.luth@collabora.com> | 2023-04-21 19:42:55 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-04-22 02:56:45 +0200 |
commit | d3a121cecfa8fb3c6f81b05822ba3309d77ab85d (patch) | |
tree | 3cc269c12dc01d99c6ac349204344e536d63a470 /sw/qa | |
parent | 006b35d50024b1932d84380b5d2fec1f7066bccd (diff) |
tdf#154703 sw framePr: export knowing import wrap spacing limitations
I noticed that the wrap margin spacing was being cut in half each round-trip.
That is because MS Word ignores the spacing on LEFT or RIGHT alignment,
while LO doesn't. Rather than monkey with layout, import just ignored
the spacing. Sounds like a good idea - but needed to do the same on export.
make CppunitTest_sw_ooxmlexport18 \
CPPUNIT_TEST_NAME=testTdf154703_framePrWrapSpacing
Change-Id: I3878d1bdb98cf027fe95137939caf6901c7188a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150796
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf154703_framePrWrapSpacing.docx | bin | 0 -> 13991 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 11 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf154703_framePrWrapSpacing.docx b/sw/qa/extras/ooxmlexport/data/tdf154703_framePrWrapSpacing.docx Binary files differnew file mode 100644 index 000000000000..57a9bea5a174 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf154703_framePrWrapSpacing.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index 171826175e0b..72cfe1723870 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -233,6 +233,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf154703_framePr2, "tdf154703_framePr2.rtf") assertXPath(pXmlDoc, "//w:body/w:p[3]/w:pPr/w:shd", "fill", "800000"); } +DECLARE_OOXMLEXPORT_TEST(testTdf154703_framePrWrapSpacing, "tdf154703_framePrWrapSpacing.docx") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); + if (!isExported()) + return; + + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + // before the fix, this was half of the correct value. + assertXPath(pXmlDoc, "//w:body/w:p/w:pPr/w:framePr", "hSpace", "2552"); +} + DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak, "tdf153613_anchoredAfterPgBreak.docx") { const auto& pLayout = parseLayoutDump(); |