From 744e6c0b758fefe6011f09860b44f03ab70fbcfe Mon Sep 17 00:00:00 2001 From: Tibor Nagy Date: Mon, 21 Feb 2022 14:07:51 +0100 Subject: tdf#147459 PPTX: add "glue points" to some basic shapes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (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 Reviewed-by: László Németh --- sd/qa/unit/import-tests.cxx | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'sd/qa/unit/import-tests.cxx') 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 #include #include +#include #include #include @@ -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 xTriangleShape(getShapeFromPage(0, 0, xDocShRef)); + uno::Sequence aProps; + xTriangleShape->getPropertyValue("CustomShapeGeometry") >>= aProps; + + uno::Sequence aPathProps; + for (beans::PropertyValue const& rProp : std::as_const(aProps)) + { + if (rProp.Name == "Path") + aPathProps = rProp.Value.get>(); + } + + uno::Sequence seqGluePoints; + for (beans::PropertyValue const& rProp : std::as_const(aPathProps)) + { + if (rProp.Name == "GluePoints") + { + seqGluePoints + = rProp.Value.get>(); + } + } + + 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 -- cgit