diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-07-26 09:04:41 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-07-27 11:26:33 +0200 |
commit | 87efbfc5198727c8bf357849833e0bb120458d64 (patch) | |
tree | ef09ba247c90cbdae6c3ff4c244800e90ef7c404 /sw/qa | |
parent | 73c593fe334cdd6928987f3506468295aef622d0 (diff) |
tdf#109077 sw textbox: fix as-char shapes with custom print area in para
Regression from d379d18666aa42031359ca8eb34b0021960347ae (oox: import
WPS shape with text as shape with textbox, 2014-06-18), the position of
the textbox should be relative to the print area of the text frame, not
to the text frame itself.
(cherry picked from commit 11d87b35474b642e99e7aa397aa18992c1bc20c9)
Conflicts:
sw/qa/extras/layout/layout.cxx
Change-Id: I2b591dc46ad4967edd8a1691d9b100ef0d74bed3
Reviewed-on: https://gerrit.libreoffice.org/58084
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/layout/data/tdf109077.docx | bin | 0 -> 13945 bytes | |||
-rwxr-xr-x | sw/qa/extras/layout/layout.cxx | 14 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf109077.docx b/sw/qa/extras/layout/data/tdf109077.docx Binary files differnew file mode 100644 index 000000000000..c0a67d2765c0 --- /dev/null +++ b/sw/qa/extras/layout/data/tdf109077.docx diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 2356832cc4ba..f9da84956c5f 100755 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -24,6 +24,7 @@ public: void testTableExtrusion2(); void testTdf116848(); void testTdf117245(); + void testTdf109077(); CPPUNIT_TEST_SUITE(SwLayoutWriter); CPPUNIT_TEST(testTdf116830); @@ -34,6 +35,7 @@ public: CPPUNIT_TEST(testTableExtrusion2); CPPUNIT_TEST(testTdf116848); CPPUNIT_TEST(testTdf117245); + CPPUNIT_TEST(testTdf109077); CPPUNIT_TEST_SUITE_END(); private: @@ -194,6 +196,18 @@ void SwLayoutWriter::testTdf117245() assertXPath(pXmlDoc, "/root/page/body/txt[2]/LineBreak", 1); } +void SwLayoutWriter::testTdf109077() +{ + createDoc("tdf109077.docx"); + xmlDocPtr pXmlDoc = parseLayoutDump(); + sal_Int32 nShapeTop + = getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", "top").toInt32(); + sal_Int32 nTextBoxTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", "top").toInt32(); + // This was 281: the top of the shape and its textbox should match, though + // tolerate differences <= 1px (about 15 twips). + CPPUNIT_ASSERT_LESS(static_cast<sal_Int32>(15), nTextBoxTop - nShapeTop); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter); CPPUNIT_PLUGIN_IMPLEMENT(); |