summaryrefslogtreecommitdiff
path: root/oox/source/shape/ShapeContextHandler.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-04 14:18:33 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-04 14:30:25 +0200
commit866a4436d3cfac1ff42d7996250bf96fb703aeaa (patch)
treeeed8851d3640cfa8b69ca1a08cdf397e2d765f47 /oox/source/shape/ShapeContextHandler.cxx
parent10ec4a7cb24da8ced86880bbceeca4d2ad3436f1 (diff)
oox: handle textboxes in ShapeContextHandler::endFastElement()
DOCX shape import normally works by oox creating the shape, then writerfilter handling the shape text. For drawingML shapes, having shape text, this a bit more complicated, as there are shape properties after the shape text as well. ShapeContextHandler::endFastElement() assumed that shape text is only possible on css.text.TextFrame shapes: also handle shapes having a TextBox as well. sw/qa/extras/ooxmlimport/data/mce-nested.docx is a reproducer for this problem (group shape missing), when TextBoxes are enabled by default in oox. Change-Id: I7a412b31965cf363da0b0c7fcc732741f2037542
Diffstat (limited to 'oox/source/shape/ShapeContextHandler.cxx')
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 34a84b42f93f..f180f18bb906 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -331,7 +331,15 @@ void SAL_CALL ShapeContextHandler::endFastElement(::sal_Int32 Element)
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"))
+ bool bTextFrame = xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.text.TextFrame");
+ bool bTextBox = false;
+ if (!bTextFrame)
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(mxSavedShape, uno::UNO_QUERY);
+ if (xPropertySet.is())
+ bTextBox = xPropertySet->getPropertyValue("TextBox").get<bool>();
+ }
+ if (bTextFrame || bTextBox)
mxWpsContext.clear();
mxSavedShape.clear();
}