summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-12-14 18:16:56 +0100
committerAndras Timar <atimar@suse.com>2013-01-22 11:36:55 +0100
commit22f8333ea6ca8e5c74b8be8a9900136e13874d7c (patch)
treef5ec010ad0c5f9c3850c34a590be0a3f40b87ec1 /writerfilter/source
parentfb286e44b862c12d0e84632f9d0a9ae6fd3ea2c1 (diff)
n#792778 DOCX import: parse group shapes in oox only
Previously textframes inside groupshapes were tried to be imported as TextFrames, but then their addition to a GroupShape failed, so the text simply ended up as a normal paragraph. Fix this by importing members of groupshapes as drawinglayer objects, just like how the WW8 import does. Also fix two testcases, which implicitely tested that the groupshape VML element is ignored on import. Change-Id: I1a9fba8a5fd532203a825e55b1d5996277ea12fa Signed-off-by: Andras Timar <atimar@suse.com>
Diffstat (limited to 'writerfilter/source')
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx42
1 files changed, 25 insertions, 17 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 37c33365a46a..5865846cd260 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -2073,6 +2073,7 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
{
uno::Reference< xml::sax::XFastContextHandler > xContextHandler;
+ bool bGroupShape = Element == Token_t(NS_vml | OOXML_group);
sal_uInt32 nNamespace = Element & 0xffff0000;
switch (nNamespace)
@@ -2080,26 +2081,33 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
case NS_wordprocessingml:
case NS_vml_wordprocessingDrawing:
case NS_office:
- xContextHandler.set(OOXMLFactory::getInstance()->createFastChildContextFromStart(this, Element));
- break;
+ if (!bGroupShape)
+ xContextHandler.set(OOXMLFactory::getInstance()->createFastChildContextFromStart(this, Element));
+ // no break;
default:
- if (mrShapeContext.is())
+ if (!xContextHandler.is())
{
- uno::Reference<XFastContextHandler> pChildContext =
- mrShapeContext->createFastChildContext(Element, Attribs);
-
- OOXMLFastContextHandlerWrapper * pWrapper =
- new OOXMLFastContextHandlerWrapper(this, pChildContext);
-
- pWrapper->addNamespace(NS_wordprocessingml);
- pWrapper->addNamespace(NS_vml_wordprocessingDrawing);
- pWrapper->addNamespace(NS_office);
- pWrapper->addToken( NS_vml|OOXML_textbox );
-
- xContextHandler.set(pWrapper);
+ if (mrShapeContext.is())
+ {
+ uno::Reference<XFastContextHandler> pChildContext =
+ mrShapeContext->createFastChildContext(Element, Attribs);
+
+ OOXMLFastContextHandlerWrapper * pWrapper =
+ new OOXMLFastContextHandlerWrapper(this, pChildContext);
+
+ if (!bGroupShape)
+ {
+ pWrapper->addNamespace(NS_wordprocessingml);
+ pWrapper->addNamespace(NS_vml_wordprocessingDrawing);
+ pWrapper->addNamespace(NS_office);
+ pWrapper->addToken( NS_vml|OOXML_textbox );
+ }
+
+ xContextHandler.set(pWrapper);
+ }
+ else
+ xContextHandler.set(this);
}
- else
- xContextHandler.set(this);
break;
}