diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2019-03-27 14:24:49 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2019-04-01 11:51:45 +0200 |
commit | 5c725eb7dee248c6d1792a9b9b9a9c813ca627e6 (patch) | |
tree | 9691ff1b3f97f3230e7442b5efba50200920e2df /svx/qa | |
parent | 80152c8c5e3482c1dc29ef1a8fbb1aea4399c39e (diff) |
tdf#124029 Force correct import pos&size of mso_sptArc shape
mso_sptArc uses the current pos&size of the sector as frame rectangle
LO has used the underlaying ellipse. That has resulted in wrong shape
position and text wrap problems in Writer. The patch sets the viewBox
to the current pos&size of the sector and thus force the frame
rectangle to the same values in LO as in MS Office.
For details see bug report.
Change-Id: I039c27f57966bad25e9f2123f50728e6a15f2f7e
Reviewed-on: https://gerrit.libreoffice.org/69829
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'svx/qa')
-rw-r--r-- | svx/qa/unit/customshapes.cxx | 19 | ||||
-rw-r--r-- | svx/qa/unit/data/tdf124029_Arc_position.doc | bin | 0 -> 19456 bytes |
2 files changed, 19 insertions, 0 deletions
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx index e2444b50f967..228ab7b3687b 100644 --- a/svx/qa/unit/customshapes.cxx +++ b/svx/qa/unit/customshapes.cxx @@ -276,6 +276,25 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf124212_handle_position) sal_Int32 nObservedX(aObservedPosition.X()); // tools::Point CPPUNIT_ASSERT_EQUAL_MESSAGE("handle X coordinate", nDesiredX, nObservedX); } + +CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf124029_arc_position) +{ + // tdf121029 MS binary custom shape mso_sptArc has wrong position + // MS uses the sector for position reference. Error was, that + // LibreOffice has used the underlaying ellipse. + const OUString sFileName("tdf124029_Arc_position.doc"); + OUString sURL = m_directories.getURLFromSrc(sDataDirectory) + sFileName; + mxComponent = loadFromDesktop(sURL, "com.sun.star.comp.text.TextDocument"); + CPPUNIT_ASSERT_MESSAGE("Could not load document", mxComponent.is()); + uno::Reference<drawing::XShape> xShape(getShape(0)); + // The visual wrong position is due to a wrong shape width. + uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); + CPPUNIT_ASSERT_MESSAGE("Could not get the shape properties", xShapeProps.is()); + awt::Rectangle aFrameRect; + xShapeProps->getPropertyValue(UNO_NAME_MISC_OBJ_FRAMERECT) >>= aFrameRect; + CPPUNIT_ASSERT_EQUAL_MESSAGE("shape width", static_cast<sal_uInt32>(1610), + static_cast<sal_uInt32>(aFrameRect.Width)); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/qa/unit/data/tdf124029_Arc_position.doc b/svx/qa/unit/data/tdf124029_Arc_position.doc Binary files differnew file mode 100644 index 000000000000..d5396c375b75 --- /dev/null +++ b/svx/qa/unit/data/tdf124029_Arc_position.doc |