diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-07-03 14:17:08 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-10 14:16:01 +0000 |
commit | 627d1722892b2969373836c74c84f25995c4b112 (patch) | |
tree | c94eec0c8839372a35c3f7c638621816b6d6299c | |
parent | bb84f7814dcc3b8f729eead8009f71ba698bb8db (diff) |
fdo#80555: Set position of GraphicObjectShape objects correctly
Added a unit test for this issue.
(cherry picked from commit 816542b2bdd23423625ad4c2f0e706d5558b8ba9)
(cherry picked from commit c38be106ff1c1ff5e1b279e4ea2c710b524d23f1)
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Change-Id: I13656f82c97e5bb8458cdc1cb47ddcc5f6d60330
Reviewed-on: https://gerrit.libreoffice.org/10060
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/fdo80555.docx | bin | 0 -> 15018 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 4 |
3 files changed, 11 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/fdo80555.docx b/sw/qa/extras/ooxmlimport/data/fdo80555.docx Binary files differnew file mode 100644 index 000000000000..a15bdc1ecd31 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/fdo80555.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index f8f951fca63b..f2051faac7d5 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2173,6 +2173,14 @@ DECLARE_OOXMLIMPORT_TEST(testFootnote, "footnote.docx") CPPUNIT_ASSERT(aFootnote.endsWith("bar")); } +DECLARE_OOXMLIMPORT_TEST(testFdo80555, "fdo80555.docx") +{ + uno::Reference<drawing::XShape> xShape = getShape(1); + // Shape was wrongly placed at X=0, Y=0 + 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 11f5a73345c2..6cd88a5b19e7 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -777,9 +777,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); |