diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index 6b992d986e86..fb24aa359f9d 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -330,6 +330,7 @@ void SAL_CALL ShapeContextHandler::endFastElement(::sal_Int32 Element) uno::Reference xServiceInfo(mxSavedShape, uno::UNO_QUERY); if (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.text.TextFrame")) mxWpsContext.clear(); + mxSavedShape.clear(); } } diff --git a/sw/qa/extras/ooxmlimport/data/missing-path.docx b/sw/qa/extras/ooxmlimport/data/missing-path.docx new file mode 100755 index 000000000000..8d75e9f630ed Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/missing-path.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index c2f3c9570447..8af52d678796 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,7 @@ #include #include #include +#include #include @@ -1653,6 +1655,15 @@ DECLARE_OOXMLIMPORT_TEST(testMceNested, "mce-nested.docx") CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty(xGroup->getByIndex(1), "TextVerticalAdjust")); } +DECLARE_OOXMLIMPORT_TEST(testMissingPath, "missing-path.docx") +{ + comphelper::SequenceAsHashMap aCustomShapeGeometry(getProperty(getShape(1), "CustomShapeGeometry")); + comphelper::SequenceAsHashMap aPath(aCustomShapeGeometry["Path"].get()); + uno::Sequence aCoordinates = aPath["Coordinates"].get< uno::Sequence >(); + // This was 0, the coordinate list was empty. + CPPUNIT_ASSERT_EQUAL(sal_Int32(19), aCoordinates.getLength()); +} + DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx") { // The document contains a rotated bitmap