diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-09-17 11:30:26 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-09-17 12:36:33 +0200 |
commit | 4883da6fd25e4645a3b30cb58212a2f666dae75a (patch) | |
tree | 45d584ac988556fa5f115cb23c405e708d1128ff /sw/qa | |
parent | 2f679fd3e6f46df7cda77eb70a014bcfcac7df52 (diff) |
Related: tdf#124600 DOCX import: ignore left wrap on left-aligned shapes
The DOC import does the same in
SwWW8ImplReader::AdjustLRWrapForWordMargins(). This fixes one
sub-problem of the bugdoc, so now the shape anchored in the header has a
correct position.
This made it necessary to re-visit the tdf#115719 testcases, which are
minimal reproducers. The original document had from-left alignment
(instead of align-to-left), but this did not matter before. Bring the
test documents closer to the original large document, so the tests still
pass and don't depend on LO mis-handling the above mentioned
left-aligned situation. (The interesting property of tdf115719.docx,
where Word 2010 and Word 2013 handles the document differently is
preserved after this change.)
Change-Id: I973c13df47b0867e2c4756f0c448495257b7c9d5
Reviewed-on: https://gerrit.libreoffice.org/79049
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf115719.docx | bin | 18335 -> 18338 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/tdf115719b.docx | bin | 19861 -> 19839 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/tdf124600.docx | bin | 0 -> 15667 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 11 |
4 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf115719.docx b/sw/qa/extras/ooxmlexport/data/tdf115719.docx Binary files differindex f98f8b4a05dc..4eda09a98fa2 100644 --- a/sw/qa/extras/ooxmlexport/data/tdf115719.docx +++ b/sw/qa/extras/ooxmlexport/data/tdf115719.docx diff --git a/sw/qa/extras/ooxmlimport/data/tdf115719b.docx b/sw/qa/extras/ooxmlimport/data/tdf115719b.docx Binary files differindex 8c552baf76c1..4cb13228443a 100644 --- a/sw/qa/extras/ooxmlimport/data/tdf115719b.docx +++ b/sw/qa/extras/ooxmlimport/data/tdf115719b.docx diff --git a/sw/qa/extras/ooxmlimport/data/tdf124600.docx b/sw/qa/extras/ooxmlimport/data/tdf124600.docx Binary files differnew file mode 100644 index 000000000000..d5dfa313665e --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/tdf124600.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index e2d930b9f4bf..c0e006668c88 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -132,6 +132,17 @@ DECLARE_OOXMLIMPORT_TEST(testGroupShapeFontName, "groupshape-fontname.docx") getProperty<OUString>(getRun(getParagraphOfText(1, xText), 1), "CharFontNameAsian")); } +DECLARE_OOXMLIMPORT_TEST(testTdf124600, "tdf124600.docx") +{ + uno::Reference<drawing::XShape> xShape = getShape(1); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 0 + // - Actual : 318 + // i.e. the shape had an unexpected left margin, but not in Word. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), + getProperty<sal_Int32>(xShape, "HoriOrientPosition")); +} + DECLARE_OOXMLIMPORT_TEST(testTdf120548, "tdf120548.docx") { // Without the accompanying fix in place, this test would have failed with 'Expected: 00ff0000; |