diff --git a/sw/qa/extras/ooxmlimport/data/wpg-only.docx b/sw/qa/extras/ooxmlimport/data/wpg-only.docx new file mode 100755 index 000000000000..7c86361f9d34 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/wpg-only.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 69beb44e2055..853c3169a43e 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1548,6 +1548,13 @@ DECLARE_OOXMLIMPORT_TEST(textboxWpsOnly, "textbox-wps-only.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(2805), getProperty(xFrame, "VertOrientPosition")); } +DECLARE_OOXMLIMPORT_TEST(testWpgOnly, "wpg-only.docx") +{ + uno::Reference xShape = getShape(1); + // Check position, it was nearly 0. This is a shape, so use getPosition(), not a property. + CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(548005)), xShape->getPosition().X); +} + DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx") { // The document contains a rotated bitmap diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index aeea2d0119bf..f1c161b2f642 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -1029,6 +1029,11 @@ void GraphicImport::lcl_attribute(Id nName, Value & val) // For non-textframes, this is handled already in oox::drawingml::Shape::createAndInsert(). m_pImpl->applyPosition(xShapeProps); } + else if (xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")) + { + // Position of the groupshape should be set after children have been added. + m_xShape->setPosition(awt::Point(m_pImpl->nLeftPosition, m_pImpl->nTopPosition)); + } m_pImpl->applyMargins(xShapeProps); bool bOpaque = m_pImpl->bOpaque && !m_pImpl->rDomainMapper.IsInHeaderFooter();