oox/source/shape/ShapeContextHandler.cxx | 1 + sw/qa/extras/ooxmlimport/data/missing-path.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 11 +++++++++++ 3 files changed, 12 insertions(+)
New commits: commit 22e6916a820201e9750fcba683699e355e55c9d6 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Sat Feb 1 16:16:10 2014 +0100 oox: clear the saved shape when the shape really ends Change-Id: Id0d644407bf1f5672e654082328434b9464c140a diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index 6b992d9..fb24aa3 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<lang::XServiceInfo> 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 0000000..8d75e9f 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 c2f3c95..8af52d6 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -17,6 +17,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp> #include <com/sun/star/drawing/XControlShape.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> #include <com/sun/star/drawing/TextVerticalAdjust.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> @@ -48,6 +49,7 @@ #include <com/sun/star/text/XDocumentIndex.hpp> #include <vcl/svapp.hxx> #include <unotools/fltrcfg.hxx> +#include <comphelper/sequenceashashmap.hxx> #include <bordertest.hxx> @@ -1653,6 +1655,15 @@ DECLARE_OOXMLIMPORT_TEST(testMceNested, "mce-nested.docx") CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty<drawing::TextVerticalAdjust>(xGroup->getByIndex(1), "TextVerticalAdjust")); } +DECLARE_OOXMLIMPORT_TEST(testMissingPath, "missing-path.docx") +{ + comphelper::SequenceAsHashMap aCustomShapeGeometry(getProperty<beans::PropertyValues>(getShape(1), "CustomShapeGeometry")); + comphelper::SequenceAsHashMap aPath(aCustomShapeGeometry["Path"].get<beans::PropertyValues>()); + uno::Sequence<drawing::EnhancedCustomShapeParameterPair> aCoordinates = aPath["Coordinates"].get< uno::Sequence<drawing::EnhancedCustomShapeParameterPair> >(); + // 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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits