Kaydet (Commit) 816542b2 authored tarafından Jacobo Aragunde Pérez's avatar Jacobo Aragunde Pérez

fdo#80555: Set position of GraphicObjectShape objects correctly

Added a unit test for this issue.

Change-Id: I13656f82c97e5bb8458cdc1cb47ddcc5f6d60330
üst 392d5901
...@@ -2230,6 +2230,13 @@ DECLARE_OOXMLIMPORT_TEST(testTableBtlrCenter, "table-btlr-center.docx") ...@@ -2230,6 +2230,13 @@ DECLARE_OOXMLIMPORT_TEST(testTableBtlrCenter, "table-btlr-center.docx")
CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty<sal_Int16>(xTable->getCellByName("A2"), "VertOrient")); CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty<sal_Int16>(xTable->getCellByName("A2"), "VertOrient"));
} }
DECLARE_OOXMLIMPORT_TEST(testFdo80555, "fdo80555.docx")
{
uno::Reference<drawing::XShape> xShape = getShape(1);
CPPUNIT_ASSERT_EQUAL(sal_Int32(3318), xShape->getPosition().X);
CPPUNIT_ASSERT_EQUAL(sal_Int32(245), xShape->getPosition().Y);
}
#endif #endif
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -782,9 +782,11 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) ...@@ -782,9 +782,11 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
m_pImpl->applyPosition(xShapeProps); m_pImpl->applyPosition(xShapeProps);
uno::Reference<lang::XServiceInfo> xServiceInfo(m_xShape, uno::UNO_QUERY_THROW); uno::Reference<lang::XServiceInfo> xServiceInfo(m_xShape, uno::UNO_QUERY_THROW);
if (xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) if (xServiceInfo->supportsService("com.sun.star.drawing.GroupShape") ||
xServiceInfo->supportsService("com.sun.star.drawing.GraphicObjectShape"))
{ {
// Position of the groupshape should be set after children have been added. // Position of the groupshape should be set after children have been added.
// fdo#80555: also set position for graphic shapes here
m_xShape->setPosition(awt::Point(m_pImpl->nLeftPosition, m_pImpl->nTopPosition)); m_xShape->setPosition(awt::Point(m_pImpl->nLeftPosition, m_pImpl->nTopPosition));
} }
m_pImpl->applyRelativePosition(xShapeProps); m_pImpl->applyRelativePosition(xShapeProps);
......
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