[Libreoffice-commits] core.git: sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Feb 12 07:12:32 PST 2014
sw/qa/extras/ooxmlimport/data/groupshape-relsize.docx |binary
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 6 ++++++
writerfilter/source/dmapper/GraphicImport.cxx | 3 ++-
3 files changed, 8 insertions(+), 1 deletion(-)
New commits:
commit 02a17688f3cae61f531185cc9f4bb86cd1df8e9d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Feb 12 13:33:17 2014 +0100
DOCX drawingML import: fix relative size of group shapes
Change-Id: I5a126bd9eaacaee2e080837a34d8ac41cbb9ea10
diff --git a/sw/qa/extras/ooxmlimport/data/groupshape-relsize.docx b/sw/qa/extras/ooxmlimport/data/groupshape-relsize.docx
new file mode 100644
index 0000000..5aca958
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/groupshape-relsize.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 15c3fdf..f9a0240 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1757,6 +1757,12 @@ DECLARE_OOXMLIMPORT_TEST(testDMLGroupshapeSdt, "dml-groupshape-sdt.docx")
CPPUNIT_ASSERT_EQUAL(OUString("sdt and sdtContent inside groupshape"), uno::Reference<text::XTextRange>(xGroupShape->getByIndex(1), uno::UNO_QUERY)->getString());
}
+DECLARE_OOXMLIMPORT_TEST(testGroupshapeRelsize, "groupshape-relsize.docx")
+{
+ // This was 43760, i.e. the height of the groupshape was larger than the page height, which is obviously incorrect.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(9142730)), getShape(1)->getSize().Height);
+}
+
DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeCapitalization, "dml-groupshape-capitalization.docx")
{
// Capitalization inside a group shape was not imported
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 2009bf5..f3d33cf 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -955,7 +955,8 @@ void GraphicImport::lcl_sprm(Sprm & rSprm)
sal_Int16 nPositivePercentage = rtl::math::round(m_pImpl->m_rPositivePercentages.front().toDouble() / oox::drawingml::PER_PERCENT);
m_pImpl->m_rPositivePercentages.pop();
- if (nPositivePercentage)
+ uno::Reference<lang::XServiceInfo> xServiceInfo(m_xShape, uno::UNO_QUERY);
+ if (nPositivePercentage && !xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"))
{
uno::Reference<beans::XPropertySet> xPropertySet(m_xShape, uno::UNO_QUERY);
OUString aProperty = nSprmId == NS_ooxml::LN_CT_SizeRelH_pctWidth ? OUString("RelativeWidth") : OUString("RelativeHeight");
More information about the Libreoffice-commits
mailing list