diff options
author | Attila Bakos (NISZ) <bakos.attilakaroly@nisz.hu> | 2021-04-22 13:26:58 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2021-05-04 19:33:39 +0200 |
commit | 5812fb81013cc124a9b6a0b9912a34cc715fc495 (patch) | |
tree | 8617dfab21c1cedb212bcdb243ed1db578b9b638 /sw | |
parent | 88e6a1bfeac86e0c89d2ff08c908c2b5ae061177 (diff) |
tdf#138782 DOCX import: fix frame positions of old docs
by limiting AddFrameOffsets compatibility option
for docs created by MSO 2010 or older.
Likely regression from commit 355d25eac764713f4d52eac801ade6e2ff1deab0
(n#779627: added quite some compat options from the ww8
filter on writerfilter).
This patch fixes several bugs, which were
collected as duplicates by Gábor Kelemen.
Change-Id: I106e90c4bf00bb0b6a8986615cb3ad9c4828d5b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114476
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/layout/data/tdf138782.docx | bin | 0 -> 17574 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout2.cxx | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf138782.docx b/sw/qa/extras/layout/data/tdf138782.docx Binary files differnew file mode 100644 index 000000000000..8bad2ae1b8c4 --- /dev/null +++ b/sw/qa/extras/layout/data/tdf138782.docx diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index c8919f155c60..074f099d963e 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -2801,6 +2801,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137185) // Before the patch it failed, because the text appeared 2 times on each other. } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138782) +{ + CPPUNIT_ASSERT(createDoc("tdf138782.docx")); + auto pXml = parseLayoutDump(); + CPPUNIT_ASSERT(pXml); + + // Without the fix it failed because the 3rd shape was outside the page: + // - Expected less than: 13327 + // - Actual : 14469 + + CPPUNIT_ASSERT_LESS( + getXPath(pXml, "/root/page/infos/bounds", "right").toInt32(), + getXPath(pXml, "/root/page/body/txt[8]/anchored/SwAnchoredDrawObject/bounds", "right") + .toInt32()); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf135035) { createDoc("tdf135035.docx"); |