summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx8
-rw-r--r--sw/qa/extras/ooxmlimport/data/mce-nested.docxbin28318 -> 33233 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx4
3 files changed, 12 insertions, 0 deletions
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 5ac772c36a21..6cd8e82d8ace 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -322,6 +322,14 @@ void SAL_CALL ShapeContextHandler::endFastElement(::sal_Int32 Element)
if (xContextHandler.is())
xContextHandler->endFastElement(Element);
+ // In case a textbox is sent, and later we get additional properties for
+ // the textbox, then the wps context is not cleared, so do that here.
+ if (Element == (NMSP_wps | XML_wsp))
+ {
+ uno::Reference<lang::XServiceInfo> xServiceInfo(mxSavedShape, uno::UNO_QUERY);
+ if (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.text.TextFrame"))
+ mxWpsContext.clear();
+ }
}
void SAL_CALL ShapeContextHandler::endUnknownElement
diff --git a/sw/qa/extras/ooxmlimport/data/mce-nested.docx b/sw/qa/extras/ooxmlimport/data/mce-nested.docx
index c110f63dae40..6804fc2bebc6 100644
--- a/sw/qa/extras/ooxmlimport/data/mce-nested.docx
+++ b/sw/qa/extras/ooxmlimport/data/mce-nested.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index a1a0d43572d5..9c6510d94ece 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1603,6 +1603,10 @@ DECLARE_OOXMLIMPORT_TEST(testMceNested, "mce-nested.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(2514600)), getProperty<sal_Int32>(xFrame, "VertOrientPosition"));
// This was -1 (default), make sure the background color is set.
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty<sal_Int32>(xFrame, "BackColor"));
+
+ uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor(getShape(2), uno::UNO_QUERY);
+ // This was a com.sun.star.drawing.CustomShape, due to incorrect handling of wpg elements after a wps textbox.
+ CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType());
}
DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx")