Kaydet (Commit) 5c725eb7 authored tarafından Regina Henschel's avatar Regina Henschel Kaydeden (comit) Thorsten Behrens

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: 's avatarRegina Henschel <rb.henschel@t-online.de>
üst 80152c8c
...@@ -276,6 +276,25 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf124212_handle_position) ...@@ -276,6 +276,25 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf124212_handle_position)
sal_Int32 nObservedX(aObservedPosition.X()); // tools::Point sal_Int32 nObservedX(aObservedPosition.X()); // tools::Point
CPPUNIT_ASSERT_EQUAL_MESSAGE("handle X coordinate", nDesiredX, nObservedX); 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff was suppressed by a .gitattributes entry.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment