diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-09-17 17:08:02 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-09-17 17:53:56 +0200 |
commit | ff5f02b9282e19a2a8a68604c588e9487021b0b5 (patch) | |
tree | df2dbe2c0c30fe857b934564794807262742d7d2 /sw/qa | |
parent | 29855141a874fa2d0d36959af6ae765eb3a05408 (diff) |
Related: tdf#124600 sw textbox: sync left/right margin of shape to textbox
Writer TextFrames have a default left/right margin; sync from shape to
textbox is needed to have correct layout when a DOCX shape has 0 left or
right margin.
The left margin of the shape was already correct.
(The shape in the docx file was extended to have text.)
Change-Id: I832f1bc460f2553bd7f08252d3e21000b4906538
Reviewed-on: https://gerrit.libreoffice.org/79068
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/tdf124600.docx | bin | 15667 -> 15746 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 11 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf124600.docx b/sw/qa/extras/ooxmlimport/data/tdf124600.docx Binary files differindex d5dfa313665e..16c4ceb2be5d 100644 --- a/sw/qa/extras/ooxmlimport/data/tdf124600.docx +++ 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 c0e006668c88..ef8c41158a05 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -141,6 +141,17 @@ DECLARE_OOXMLIMPORT_TEST(testTdf124600, "tdf124600.docx") // 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")); + + // Make sure that "Shape 1 text" (anchored in the header) has the same left margin as the body + // text. + OUString aShapeTextLeft = parseDump("/root/page/header/txt/anchored/fly/infos/bounds", "left"); + OUString aBodyTextLeft = parseDump("/root/page/body/txt/infos/bounds", "left"); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 1701 + // - Actual : 1815 + // i.e. there was a >0 left margin on the text of the shape, resulting in incorrect horizontal + // position. + CPPUNIT_ASSERT_EQUAL(aBodyTextLeft, aShapeTextLeft); } DECLARE_OOXMLIMPORT_TEST(testTdf120548, "tdf120548.docx") |