summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/drawingml/shape.cxx5
-rw-r--r--oox/source/shape/WpgContext.cxx6
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf124398.docxbin0 -> 79734 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport2.cxx12
4 files changed, 21 insertions, 2 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index ba3e8d7fdb5d..d45a88a692cf 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -218,7 +218,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 95264e53ce15..75ff0422bcf2 100644
--- a/oox/source/shape/WpgContext.cxx
+++ b/oox/source/shape/WpgContext.cxx
@@ -57,7 +57,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;
diff --git a/sw/qa/extras/ooxmlimport/data/tdf124398.docx b/sw/qa/extras/ooxmlimport/data/tdf124398.docx
new file mode 100644
index 000000000000..4d1855347fd6
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf124398.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index 57c7f7ef4245..e5c6e182a02e 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -235,6 +235,18 @@ DECLARE_OOXMLIMPORT_TEST(testTdf112443, "tdf112443.docx")
// and as result only one page should be generated.
DECLARE_OOXMLIMPORT_TEST(testTdf113182, "tdf113182.docx") { CPPUNIT_ASSERT_EQUAL(1, getPages()); }
+DECLARE_OOXMLIMPORT_TEST(testTdf124398, "tdf124398.docx")
+{
+ uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xGroup.is());
+ // Without the accompanying fix in place, this test would have failed with 'Expected: 2; Actual:
+ // 1', i.e. the chart children of the group shape was lost.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xGroup->getCount());
+
+ uno::Reference<drawing::XShapeDescriptor> xShape(xGroup->getByIndex(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.OLE2Shape"), xShape->getShapeType());
+}
+
DECLARE_OOXMLIMPORT_TEST(testTdf113946, "tdf113946.docx")
{
OUString aTop = parseDump("/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds", "top");