diff options
-rw-r--r-- | oox/inc/drawingml/customshapeproperties.hxx | 1 | ||||
-rw-r--r-- | oox/qa/unit/data/tdf113187_arcTo_withoutReferences.pptx | bin | 0 -> 14733 bytes | |||
-rw-r--r-- | oox/qa/unit/drawingml.cxx | 20 | ||||
-rw-r--r-- | oox/source/drawingml/customshapeproperties.cxx | 4 |
4 files changed, 24 insertions, 1 deletions
diff --git a/oox/inc/drawingml/customshapeproperties.hxx b/oox/inc/drawingml/customshapeproperties.hxx index c009a0fb7db0..61a151d9aa09 100644 --- a/oox/inc/drawingml/customshapeproperties.hxx +++ b/oox/inc/drawingml/customshapeproperties.hxx @@ -123,6 +123,7 @@ public: static sal_Int32 GetCustomShapeGuideValue( const std::vector< CustomShapeGuide >& rGuideList, std::u16string_view rFormulaName ); sal_Int32 getArcNum() { return mnArcNum++; } + sal_Int32 countArcTo() { return mnArcNum; } /** Returns whether or not the current CustomShapeProperties diff --git a/oox/qa/unit/data/tdf113187_arcTo_withoutReferences.pptx b/oox/qa/unit/data/tdf113187_arcTo_withoutReferences.pptx Binary files differnew file mode 100644 index 000000000000..1862c0257f29 --- /dev/null +++ b/oox/qa/unit/data/tdf113187_arcTo_withoutReferences.pptx diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx index 95e593627909..6150e4499eed 100644 --- a/oox/qa/unit/drawingml.cxx +++ b/oox/qa/unit/drawingml.cxx @@ -529,6 +529,26 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTextRot) } } +CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf113187ConstantArcTo) +{ + loadFromURL(u"tdf113187_arcTo_withoutReferences.pptx"); + + // Get ViewBox of shape + uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), + uno::UNO_QUERY); + uno::Reference<drawing::XShape> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aGeoPropSeq; + xShapeProps->getPropertyValue("CustomShapeGeometry") >>= aGeoPropSeq; + comphelper::SequenceAsHashMap aGeoPropMap(aGeoPropSeq); + + // Without the fix width and height of the ViewBox were 0 and thus the shape was not shown. + auto aViewBox = aGeoPropMap["ViewBox"].get<css::awt::Rectangle>(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3600000), aViewBox.Width); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3600000), aViewBox.Height); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index ef164194e7f0..9cdbb4ee8801 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -198,7 +198,9 @@ void CustomShapeProperties::pushToPropSet( // This size specifically affects scaling. // Note 2: Width and Height are set to 0 to force scaling to 1. awt::Rectangle aViewBox( 0, 0, aSize.Width, aSize.Height ); - if( !maGuideList.empty() ) + // tdf#113187 Each ArcTo introduces two additional equations for converting start and swing + // angles. They do not count for test for use of standard ooxml coordinates + if (maGuideList.size() - 2 * countArcTo() > 0) aViewBox = awt::Rectangle( 0, 0, 0, 0 ); aPropertyMap.setProperty( PROP_ViewBox, aViewBox); |