summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2022-04-15 15:04:16 +0200
committerRegina Henschel <rb.henschel@t-online.de>2022-04-15 22:16:40 +0200
commitb195cf4db4c21da3cf754689fb22f0b6a904a03e (patch)
treee7ca06802865f919fadcebdde4d31ac530e9775e /sd
parent65e846d73c023cb8ed8a8393a91032d4a816f2a0 (diff)
tdf#109169 use custGeom for Octagon Bevel shape
The shapes 'Octagon Bevel', type col_60da8460, and 'Diamond Bevel', type col-502ad400, are LO specific preset shapes. They have neither a counterpart in MS binary nor in OOXML. So they need to be exported with custGeom. To force custGeom these shape types are moved from vDenylist to vAllowlist. These shapes were exported as prst='rect' before. Change-Id: I9619345812b6dba8f14ec2cc6a92ae808a56b595 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133069 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/odp/tdf109169_Diamond.odpbin0 -> 14664 bytes
-rw-r--r--sd/qa/unit/data/odp/tdf109169_Octagon.odpbin0 -> 13380 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml3.cxx46
3 files changed, 46 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/tdf109169_Diamond.odp b/sd/qa/unit/data/odp/tdf109169_Diamond.odp
new file mode 100644
index 000000000000..cd6a18d1b318
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf109169_Diamond.odp
Binary files differ
diff --git a/sd/qa/unit/data/odp/tdf109169_Octagon.odp b/sd/qa/unit/data/odp/tdf109169_Octagon.odp
new file mode 100644
index 000000000000..f35e746f3b28
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf109169_Octagon.odp
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx
index 3f4bec336ef1..23486c66f254 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -11,6 +11,7 @@
#include <officecfg/Office/Common.hxx>
#include "sdmodeltestbase.hxx"
#include <comphelper/sequence.hxx>
+#include <comphelper/sequenceashashmap.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/editobj.hxx>
#include <editeng/numitem.hxx>
@@ -21,6 +22,7 @@
#include <svx/svdoole2.hxx>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
+#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/frame/XLoadable.hpp>
#include <com/sun/star/lang/Locale.hpp>
@@ -107,6 +109,8 @@ public:
void testTdf140912_PicturePlaceholder();
void testEnhancedPathViewBox();
void testTdf74670();
+ void testTdf109169_OctagonBevel();
+ void testTdf109169_DiamondBevel();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest3);
@@ -184,6 +188,8 @@ public:
CPPUNIT_TEST(testTdf140912_PicturePlaceholder);
CPPUNIT_TEST(testEnhancedPathViewBox);
CPPUNIT_TEST(testTdf74670);
+ CPPUNIT_TEST(testTdf109169_OctagonBevel);
+ CPPUNIT_TEST(testTdf109169_DiamondBevel);
CPPUNIT_TEST_SUITE_END();
virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
@@ -1919,6 +1925,46 @@ void SdOOXMLExportTest3::testTdf74670()
CPPUNIT_ASSERT_EQUAL(1, nImageFiles);
}
+void SdOOXMLExportTest3::testTdf109169_OctagonBevel()
+{
+ // The document has a shape 'Octagon Bevel'. It consists of an octagon with 8 points and eight
+ // facets with 4 points each, total 8+8*4=40 points. Without the patch it was exported as
+ // rectangle and thus had 4 points.
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf109169_Octagon.odp"), ODP);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+
+ auto xPropSet(getShapeFromPage(0, 0, xDocShRef));
+ auto aGeomPropSeq = xPropSet->getPropertyValue("CustomShapeGeometry")
+ .get<uno::Sequence<beans::PropertyValue>>();
+ comphelper::SequenceAsHashMap aCustomShapeGeometry(aGeomPropSeq);
+ auto aPathSeq((aCustomShapeGeometry["Path"]).get<uno::Sequence<beans::PropertyValue>>());
+ comphelper::SequenceAsHashMap aPath(aPathSeq);
+ auto aCoordinates(
+ (aPath["Coordinates"]).get<uno::Sequence<drawing::EnhancedCustomShapeParameterPair>>());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(40), aCoordinates.getLength());
+}
+
+void SdOOXMLExportTest3::testTdf109169_DiamondBevel()
+{
+ // The document has a shape 'Diamond Bevel'. It consists of a diamond with 4 points and four
+ // facets with 4 points each, total 4+4*4=20 points. Without the patch it was exported as
+ // rectangle and thus had 4 points.
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf109169_Diamond.odp"), ODP);
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+
+ auto xPropSet(getShapeFromPage(0, 0, xDocShRef));
+ auto aGeomPropSeq = xPropSet->getPropertyValue("CustomShapeGeometry")
+ .get<uno::Sequence<beans::PropertyValue>>();
+ comphelper::SequenceAsHashMap aCustomShapeGeometry(aGeomPropSeq);
+ auto aPathSeq((aCustomShapeGeometry["Path"]).get<uno::Sequence<beans::PropertyValue>>());
+ comphelper::SequenceAsHashMap aPath(aPathSeq);
+ auto aCoordinates(
+ (aPath["Coordinates"]).get<uno::Sequence<drawing::EnhancedCustomShapeParameterPair>>());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(20), aCoordinates.getLength());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest3);
CPPUNIT_PLUGIN_IMPLEMENT();