summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-04-29 08:35:29 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-04-29 09:57:04 +0200
commitfdf4aaa3dc5cc1d2e7a112e6c32d7845f13caef8 (patch)
tree5849b7d2d59c3f768ee8a8201404007c8e31c738 /oox
parenta5c0cf416faff2a4b273ac526a83c9c2575a5d51 (diff)
tdf#124398 DOCX drawingML import: handle charts in group shapes
Regression from commit 8c73b16f5f18f3bc1dbf9ff6c1475db56b44d304 (DOCX import: declare wpg as a supported feature, 2013-12-05), the problem was that <wpg:graphicFrame> did not forward to to the relevant oox context, and also Writer had no idea how to create a com.sun.star.drawing.OLE2Shape. Fix the later by using the same service name that's in use for the non-groupshape case. Change-Id: Id3536854da7c1f01525bb38d801496ecebd4c161 Reviewed-on: https://gerrit.libreoffice.org/71505 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx5
-rw-r--r--oox/source/shape/WpgContext.cxx6
2 files changed, 9 insertions, 2 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 3c84428389a5..41c8d9493dcf 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -220,7 +220,10 @@ ChartShapeInfo& Shape::setChartType( bool bEmbedShapes )
{
OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setChartType - multiple frame types" );
meFrameType = FRAMETYPE_CHART;
- msServiceName = "com.sun.star.drawing.OLE2Shape";
+ if (mbWps)
+ msServiceName = "com.sun.star.drawing.temporaryForXMLImportOLE2Shape";
+ else
+ msServiceName = "com.sun.star.drawing.OLE2Shape";
mxChartShapeInfo.reset( new ChartShapeInfo( bEmbedShapes ) );
return *mxChartShapeInfo;
}
diff --git a/oox/source/shape/WpgContext.cxx b/oox/source/shape/WpgContext.cxx
index c297ff16d822..33fb318e73e8 100644
--- a/oox/source/shape/WpgContext.cxx
+++ b/oox/source/shape/WpgContext.cxx
@@ -61,7 +61,11 @@ oox::core::ContextHandlerRef WpgContext::onCreateContext(sal_Int32 nElementToken
return new oox::drawingml::ShapeGroupContext(*this, mpShape, std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.GroupShape"));
}
case XML_graphicFrame:
- break;
+ {
+ auto pShape = std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.GraphicObjectShape");
+ pShape->setWps(true);
+ return new oox::drawingml::GraphicalObjectFrameContext(*this, mpShape, pShape, /*bEmbedShapesInChart=*/true);
+ }
default:
SAL_WARN("oox", "WpgContext::createFastChildContext: unhandled element: " << getBaseToken(nElementToken));
break;