summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/testCustomShapePresetExport.odtbin0 -> 86157 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport16.cxx31
2 files changed, 31 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/testCustomShapePresetExport.odt b/sw/qa/extras/ooxmlexport/data/testCustomShapePresetExport.odt
new file mode 100644
index 000000000000..4f132e760460
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/testCustomShapePresetExport.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 5d567543bcec..dcaa4e6e5e54 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -129,6 +129,37 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testGutterTop, "gutter-top.docx")
assertXPath(pXmlSettings, "/w:settings/w:gutterAtTop", 1);
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCustomShapePresetExport, "testCustomShapePresetExport.odt")
+{
+ // Check if the load failed.
+ CPPUNIT_ASSERT(getPages());
+
+ // Check all shapes of the file
+ int nCount = 0;
+ for (int i = 1; i <= getShapes(); i++)
+ {
+ uno::Reference<beans::XPropertySet> xProperties(getShape(i), uno::UNO_QUERY);
+ if (!xProperties->getPropertySetInfo()->hasPropertyByName("CustomShapeGeometry"))
+ continue;
+ // Get the custom shape property
+ auto aCustomShapeGeometry = xProperties->getPropertyValue("CustomShapeGeometry")
+ .get<uno::Sequence<beans::PropertyValue>>();
+ // Find for shape type
+ for (const auto& aCustomGeometryIterator : std::as_const(aCustomShapeGeometry))
+ {
+ if (aCustomGeometryIterator.Name == "Type")
+ CPPUNIT_ASSERT_MESSAGE(
+ "This is an ooxml preset shape with custom geometry! Shape type lost!",
+ aCustomGeometryIterator.Value.get<OUString>() != "ooxml-non-primitive");
+ // Without the fix, all shapes have ooxml-non-primitive type, and lost their
+ // real type (like triangle) with the textbox padding.
+ }
+ nCount++;
+ }
+ // Without the fix the count does not match.
+ CPPUNIT_ASSERT_EQUAL(17, nCount);
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf69635, "tdf69635.docx")
{
xmlDocUniquePtr pXmlHeader1 = parseExport("word/header1.xml");