diff options
author | Tibor Nagy <nagy.tibor2@nisz.hu> | 2023-08-27 18:39:17 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2023-08-30 11:57:11 +0200 |
commit | 7b93531ba7f3edf98a54392cfc83dcf3185888bd (patch) | |
tree | bd66b530c7a4319258f260b9a46c4b8e577181cc /sd | |
parent | 978cce0001ef9f37fb5fa5037a876f31ec558166 (diff) |
tdf#156829 PPTX import: fix connector regression at missing glue points
Glue points weren't imported if the custom shape type is
"non-primitive", resulting broken line connectors, moreover
broken graphic design, as attached to the original bug report.
~Regression from commit cbf66ec3e60d07efb7c3cceed9b4f0fb4f0510c8
"tdf#89449 PPTX import: fix line connectors".
Change-Id: I9908a23f8e6997bc1384aaeb3e8ba43c08d20d42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156171
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf156829.pptx | bin | 0 -> 20052 bytes | |||
-rw-r--r-- | sd/qa/unit/data/xml/n762695_0.xml | 1 | ||||
-rw-r--r-- | sd/qa/unit/data/xml/n762695_1.xml | 2 | ||||
-rw-r--r-- | sd/qa/unit/data/xml/tdf109317_0.xml | 3 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 28 |
5 files changed, 34 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf156829.pptx b/sd/qa/unit/data/pptx/tdf156829.pptx Binary files differnew file mode 100644 index 000000000000..423588377279 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf156829.pptx diff --git a/sd/qa/unit/data/xml/n762695_0.xml b/sd/qa/unit/data/xml/n762695_0.xml index ae755e644de7..59b226e0d5f8 100644 --- a/sd/qa/unit/data/xml/n762695_0.xml +++ b/sd/qa/unit/data/xml/n762695_0.xml @@ -63,6 +63,7 @@ </EnhancedCustomShapeParameterPair> </Coordinates> </PropertyValue> + <PropertyValue name="GluePoints" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Segments"> <Segments> <EnhancedCustomShapeSegment command="1" count="1"/> diff --git a/sd/qa/unit/data/xml/n762695_1.xml b/sd/qa/unit/data/xml/n762695_1.xml index a43924138f45..02d3b735da86 100644 --- a/sd/qa/unit/data/xml/n762695_1.xml +++ b/sd/qa/unit/data/xml/n762695_1.xml @@ -67,6 +67,7 @@ </EnhancedCustomShapeParameterPair> </Coordinates> </PropertyValue> + <PropertyValue name="GluePoints" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Segments"> <Segments> <EnhancedCustomShapeSegment command="1" count="1"/> @@ -151,6 +152,7 @@ </EnhancedCustomShapeParameterPair> </Coordinates> </PropertyValue> + <PropertyValue name="GluePoints" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Segments"> <Segments> <EnhancedCustomShapeSegment command="1" count="1"/> diff --git a/sd/qa/unit/data/xml/tdf109317_0.xml b/sd/qa/unit/data/xml/tdf109317_0.xml index f34beafbdc80..745ffff59e74 100644 --- a/sd/qa/unit/data/xml/tdf109317_0.xml +++ b/sd/qa/unit/data/xml/tdf109317_0.xml @@ -22,6 +22,7 @@ <PropertyValue name="Type" value="ooxml-non-primitive" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Path"> <Path> + <PropertyValue name="GluePoints" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="SubViewSize" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="TextFrames" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Coordinates"> @@ -130,6 +131,7 @@ <PropertyValue name="Type" value="ooxml-non-primitive" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Path"> <Path> + <PropertyValue name="GluePoints" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="SubViewSize" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="TextFrames" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Coordinates"> @@ -406,6 +408,7 @@ <PropertyValue name="Type" value="ooxml-non-primitive" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Path"> <Path> + <PropertyValue name="GluePoints" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="SubViewSize" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="TextFrames" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Coordinates"> diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 2345e17ee7a4..adc7c12e4632 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -203,6 +203,34 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testDocumentLayout) } } +CPPUNIT_TEST_FIXTURE(SdImportTest, testFreeformShapeGluePoints) +{ + createSdImpressDoc("pptx/tdf156829.pptx"); + uno::Reference<beans::XPropertySet> xFreeformShape(getShapeFromPage(0, 0)); + uno::Sequence<beans::PropertyValue> aProps; + xFreeformShape->getPropertyValue("CustomShapeGeometry") >>= aProps; + + uno::Sequence<beans::PropertyValue> aPathProps; + for (beans::PropertyValue const& rProp : std::as_const(aProps)) + { + if (rProp.Name == "Path") + aPathProps = rProp.Value.get<uno::Sequence<beans::PropertyValue>>(); + } + + uno::Sequence<drawing::EnhancedCustomShapeParameterPair> seqGluePoints; + for (beans::PropertyValue const& rProp : std::as_const(aPathProps)) + { + if (rProp.Name == "GluePoints") + { + seqGluePoints + = rProp.Value.get<uno::Sequence<drawing::EnhancedCustomShapeParameterPair>>(); + } + } + + sal_Int32 nCountGluePoints = seqGluePoints.getLength(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), nCountGluePoints); +} + CPPUNIT_TEST_FIXTURE(SdImportTest, testTdf154363) { sal_Int32 nGlueId; |