diff options
author | Tibor Nagy <nagy.tibor2@nisz.hu> | 2022-02-21 14:07:51 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2022-03-01 13:45:48 +0100 |
commit | 744e6c0b758fefe6011f09860b44f03ab70fbcfe (patch) | |
tree | f3b9bb3593cd63d92b6e6c8eb7bd867cd5ebcab0 /sd/qa | |
parent | 5911b25000f443d8ab39265e356628b8117f8a73 (diff) |
tdf#147459 PPTX: add "glue points" to some basic shapes
(ellipse, triangle, right triangle, trapezoid,
parallelogram, diamond, pentagon, hexagon, heptagon,
octagon).
These glue points allow to add and use connectors
on basic shapes, e.g. by specifying 8 glue points on
outline of ellipses (and not 4 glue points only on
their bounding boxes).
Usage: insert a basic shape from the list above,
select it, and click on the icon Connectors to
show and use the new glue points on the outline of
the shape.
Note: PPTX import doesn't import connectors
connected to the glue points – only ODP export keeps
them for the planned editing, i.e. moving the connected
shapes without losing the connecting lines and arrows.
Change-Id: Iaef21ce8dc3f6677fa2fd6a484adf6d546e72ad1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130281
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf147459.pptx | bin | 0 -> 13686 bytes | |||
-rw-r--r-- | sd/qa/unit/data/xml/n820786_0.xml | 2 | ||||
-rw-r--r-- | sd/qa/unit/data/xml/tdf109317_0.xml | 3 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 35 |
4 files changed, 40 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf147459.pptx b/sd/qa/unit/data/pptx/tdf147459.pptx Binary files differnew file mode 100644 index 000000000000..ef71ec94d55f --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf147459.pptx diff --git a/sd/qa/unit/data/xml/n820786_0.xml b/sd/qa/unit/data/xml/n820786_0.xml index a7e7c40cbb3b..7c99d7806999 100644 --- a/sd/qa/unit/data/xml/n820786_0.xml +++ b/sd/qa/unit/data/xml/n820786_0.xml @@ -127,6 +127,7 @@ </EnhancedCustomShapeParameterPair> </Coordinates> </PropertyValue> + <PropertyValue name="GluePoints" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Segments"> <Segments> <EnhancedCustomShapeSegment command="1" count="1"/> @@ -209,6 +210,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 f7ed3136257f..76f9ed70ff9a 100644 --- a/sd/qa/unit/data/xml/tdf109317_0.xml +++ b/sd/qa/unit/data/xml/tdf109317_0.xml @@ -238,6 +238,7 @@ <PropertyValue name="Type" value="ooxml-rtTriangle" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Path"> <Path> + <PropertyValue name="GluePoints" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="TextFrames" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Coordinates"> <Coordinates> @@ -293,6 +294,7 @@ <PropertyValue name="Type" value="ooxml-rtTriangle" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Path"> <Path> + <PropertyValue name="GluePoints" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="TextFrames" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Coordinates"> <Coordinates> @@ -348,6 +350,7 @@ <PropertyValue name="Type" value="ooxml-rtTriangle" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Path"> <Path> + <PropertyValue name="GluePoints" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="TextFrames" handle="0" propertyState="DIRECT_VALUE"/> <PropertyValue name="Coordinates"> <Coordinates> diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 9d479fb69437..215d668b2f3f 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -51,6 +51,7 @@ #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> #include <stlpool.hxx> #include <comphelper/sequenceashashmap.hxx> @@ -79,6 +80,7 @@ public: virtual void setUp() override; void testDocumentLayout(); + void testTdf147459(); void testTdf146223(); void testTdf144918(); void testTdf144917(); @@ -145,6 +147,7 @@ public: CPPUNIT_TEST_SUITE(SdImportTest); CPPUNIT_TEST(testDocumentLayout); + CPPUNIT_TEST(testTdf147459); CPPUNIT_TEST(testTdf146223); CPPUNIT_TEST(testTdf144918); CPPUNIT_TEST(testTdf144917); @@ -289,6 +292,38 @@ void SdImportTest::testDocumentLayout() } } +void SdImportTest::testTdf147459() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf147459.pptx"), PPTX); + uno::Reference<beans::XPropertySet> xTriangleShape(getShapeFromPage(0, 0, xDocShRef)); + uno::Sequence<beans::PropertyValue> aProps; + xTriangleShape->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(); + // The triangle has 6 glue points. + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), nCountGluePoints); + + xDocShRef->DoClose(); +} + void SdImportTest::testTdf146223() { sd::DrawDocShellRef xDocShRef |