summaryrefslogtreecommitdiff
path: root/oox/qa
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2022-10-30 22:53:55 +0100
committerRegina Henschel <rb.henschel@t-online.de>2022-10-31 12:20:34 +0100
commitcf972fb9856957f4444199eb97464b83d8dc2698 (patch)
treef6205c76c729807c348528b83a95784f540aaa2d /oox/qa
parent6f32f1a12be06c4da92b807d8a35cb079984e26a (diff)
tdf#113187 exclude angle conversion from count of maGuideList
The ooxml import uses the special viewBox value '0 0 0 0' to indicate that the point coordinates are relative to shape size and not to viewBox and need special treatment. To detect this case the number of guides in maGuideList was used. But that number might be larger than the guides in ooxml because each arcTo command introduces two additional guides for the conversion from 1/60000 degree in ooxml to degree in LibreOffice. The patch excludes these guides from count. Thus now a path which has no references in its points will get a viewBox with non-zero width and height in all cases and is rendered now. Change-Id: I410638a1fe02f692fd46313c88b5ea518f1d094f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142050 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'oox/qa')
-rw-r--r--oox/qa/unit/data/tdf113187_arcTo_withoutReferences.pptxbin0 -> 14733 bytes
-rw-r--r--oox/qa/unit/drawingml.cxx20
2 files changed, 20 insertions, 0 deletions
diff --git a/oox/qa/unit/data/tdf113187_arcTo_withoutReferences.pptx b/oox/qa/unit/data/tdf113187_arcTo_withoutReferences.pptx
new file mode 100644
index 000000000000..1862c0257f29
--- /dev/null
+++ b/oox/qa/unit/data/tdf113187_arcTo_withoutReferences.pptx
Binary files differ
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: */