diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-12-06 16:54:07 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-12-06 20:34:25 +0100 |
commit | 814cb2433da6bd608e935fa5531d2a2b92867985 (patch) | |
tree | f941f00aa2a5dc72dde441e66784bd2f695a7135 /sw | |
parent | d22a5d7425f247c6edce2747f6fe83d80e5e51bb (diff) |
Related: tdf#115719 DOCX import: fix increased spacing vs left-aligned objects
Commit 8b73bafbc18acb4dd8911d2f2de8158d98eb6144 (tdf#115719 DOCX import:
increase paragraph spacing for anchored objects, 2018-02-14) added an
import-time tweak for a problem that has been confirmed to be a Word
layout bug in the meantime (and the tweak makes Writer behave the same
way if the document has been created by an affected Word version for
layout compatiblity).
Later, commit 4883da6fd25e4645a3b30cb58212a2f666dae75a (Related:
tdf#124600 DOCX import: ignore left wrap on left-aligned shapes,
2018-02-14) fixed left spacing of anchored objects aligned to the left,
to be in sync with what the DOC import does.
This broke the previous fix in case the shapes are left-aligned.
Fix the problem by tracking what is the in-file-format and logical left
margin, so the final doc model has the value necessary for correct
horizontal positioning and the importer has the value that's necessary
for correct vertical positioning.
Change-Id: I8f16cbe7bad40e243111c902bdc1ab0e8141d6b9
Reviewed-on: https://gerrit.libreoffice.org/84654
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf115719b.docx | bin | 0 -> 18845 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 12 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf115719b.docx b/sw/qa/extras/ooxmlexport/data/tdf115719b.docx Binary files differnew file mode 100644 index 000000000000..a632e3df0e7a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf115719b.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 72e2104d935a..d4aa8d886626 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -291,6 +291,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf115719, "tdf115719.docx") CPPUNIT_ASSERT_EQUAL(2, getPages()); } +DECLARE_OOXMLIMPORT_TEST(testTdf115719b, "tdf115719b.docx") +{ + // This is similar to testTdf115719, but here the left textbox is not aligned "from left, by + // 0cm" but simply aligned to left, which is a different codepath. + + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 2 + // - Actual : 1 + // i.e. the the textboxes did not appear on the 2nd page, but everything was on a single page. + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + DECLARE_OOXMLEXPORT_TEST(testTdf123243, "tdf123243.docx") { // Without the accompanying fix in place, this test would have failed with 'Expected: 1; Actual: |