summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx16
-rw-r--r--oox/source/token/properties.txt1
-rw-r--r--sd/qa/unit/data/pptx/tdf156829.pptxbin0 -> 20052 bytes
-rw-r--r--sd/qa/unit/data/xml/n762695_0.xml1
-rw-r--r--sd/qa/unit/data/xml/n762695_1.xml2
-rw-r--r--sd/qa/unit/data/xml/tdf109317_0.xml3
-rw-r--r--sd/qa/unit/import-tests.cxx28
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx2
8 files changed, 52 insertions, 1 deletions
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index ac6fba8e7d53..766876385c64 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -228,6 +228,22 @@ void CustomShapeProperties::pushToPropSet(
aPath.setProperty( PROP_TextFrames, aTextFrames);
}
+ if (!maConnectionSiteList.empty())
+ {
+ css::uno::Sequence<EnhancedCustomShapeParameterPair> seqGluePoints;
+ seqGluePoints.realloc(maConnectionSiteList.size());
+ sal_Int32 nId = 0;
+ for (auto& rGluePoint : asNonConstRange(seqGluePoints))
+ {
+ rGluePoint.First.Value = maConnectionSiteList[nId].pos.First.Value;
+ rGluePoint.First.Type = maConnectionSiteList[nId].pos.First.Type;
+ rGluePoint.Second.Value = maConnectionSiteList[nId].pos.Second.Value;
+ rGluePoint.Second.Type = maConnectionSiteList[nId].pos.Second.Type;
+ nId++;
+ }
+ aPath.setProperty(PROP_GluePoints, seqGluePoints);
+ }
+
sal_uInt32 nParameterPairs = 0;
for ( auto const & i: maPath2DList )
nParameterPairs += i.parameter.size();
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index a6de5458b663..b5a3478f45b0 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -224,6 +224,7 @@ GenerateVbaEvents
Geometry3D
GlowEffect
GlowEffectRadius
+GluePoints
GradientName
HatchName
Graphic
diff --git a/sd/qa/unit/data/pptx/tdf156829.pptx b/sd/qa/unit/data/pptx/tdf156829.pptx
new file mode 100644
index 000000000000..423588377279
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf156829.pptx
Binary files differ
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;
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 5666d8e5885d..6bbd898ad24a 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -3034,7 +3034,7 @@ void EnhancedCustomShape2d::ApplyGluePoints( SdrObject* pObj )
{
SdrGluePoint aGluePoint;
- aGluePoint.SetPos( GetPoint( rGluePoint, true, true ) );
+ aGluePoint.SetPos( GetPoint( rGluePoint, !m_bOOXMLShape, true ) );
aGluePoint.SetPercent( false );
aGluePoint.SetAlign( SdrAlign::VERT_TOP | SdrAlign::HORZ_LEFT );
aGluePoint.SetEscDir( SdrEscapeDirection::SMART );