summaryrefslogtreecommitdiff
path: root/sd/qa/unit/import-tests.cxx
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2022-02-21 14:07:51 +0100
committerLászló Németh <nemeth@numbertext.org>2022-03-01 13:45:48 +0100
commit744e6c0b758fefe6011f09860b44f03ab70fbcfe (patch)
treef3b9bb3593cd63d92b6e6c8eb7bd867cd5ebcab0 /sd/qa/unit/import-tests.cxx
parent5911b25000f443d8ab39265e356628b8117f8a73 (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/unit/import-tests.cxx')
-rw-r--r--sd/qa/unit/import-tests.cxx35
1 files changed, 35 insertions, 0 deletions
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