[Libreoffice-commits] core.git: sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Nov 27 06:32:40 PST 2013
sw/qa/extras/ooxmlimport/data/wpg-only.docx |binary
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 7 +++++++
writerfilter/source/dmapper/GraphicImport.cxx | 5 +++++
3 files changed, 12 insertions(+)
New commits:
commit 8518cf42f48cdf07ad14681cb19f476438542236
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Nov 27 15:22:44 2013 +0100
DOCX drawingML shape import: fix position of group shapes
Change-Id: Ib5db40ecd5782d729d406b285d3399cc2626e335
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 0000000..7c86361
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 69beb44..853c316 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<sal_Int32>(xFrame, "VertOrientPosition"));
}
+DECLARE_OOXMLIMPORT_TEST(testWpgOnly, "wpg-only.docx")
+{
+ uno::Reference<drawing::XShape> 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 aeea2d0..f1c161b 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();
More information about the Libreoffice-commits
mailing list