summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-07-03 11:47:23 +0200
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-07-03 14:05:36 +0200
commit816542b2bdd23423625ad4c2f0e706d5558b8ba9 (patch)
tree87f66cef1632c6be7ecb483ea077be37959ecf1b
parent392d59013afb83906bd5d181beda0ea4facab256 (diff)
fdo#80555: Set position of GraphicObjectShape objects correctly
Added a unit test for this issue. Change-Id: I13656f82c97e5bb8458cdc1cb47ddcc5f6d60330
-rw-r--r--sw/qa/extras/ooxmlimport/data/fdo80555.docxbin0 -> 15018 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx7
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx4
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/fdo80555.docx b/sw/qa/extras/ooxmlimport/data/fdo80555.docx
new file mode 100644
index 000000000000..a15bdc1ecd31
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/fdo80555.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 6562b974d6ff..21f5ac645708 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -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"));
}
+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
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index cf3da2af2224..038d974557d3 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -782,9 +782,11 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
m_pImpl->applyPosition(xShapeProps);
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.
+ // fdo#80555: also set position for graphic shapes here
m_xShape->setPosition(awt::Point(m_pImpl->nLeftPosition, m_pImpl->nTopPosition));
}
m_pImpl->applyRelativePosition(xShapeProps);