[Libreoffice-commits] core.git: oox/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Jun 4 05:32:43 PDT 2014
oox/source/shape/ShapeContextHandler.cxx | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 866a4436d3cfac1ff42d7996250bf96fb703aeaa
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Jun 4 14:18:33 2014 +0200
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
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 34a84b4..f180f18 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();
}
More information about the Libreoffice-commits
mailing list