From d54624ff7e7f97d8d7e8fd70572348f63b8a3da5 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Sat, 19 Dec 2015 00:18:29 +0100 Subject: oox: stop pointlessly loading embedded objects to check if it's a chart This fixes SdExportTest::testBnc822341 again, because the conversion TryToConvertToOOo() in OleEmbeddedObject no longer breaks it. Change-Id: Ib968722af426123afa08865290e5a4e762f19070 --- oox/source/export/shapes.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'oox/source') diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index e03a8f62fe0d..0c087e87c585 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -78,6 +78,7 @@ #include #include #include +#include #include #include #include @@ -1584,12 +1585,19 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape ) { Reference< XPropertySet > xPropSet( xShape, UNO_QUERY ); if( xPropSet.is() ) { - if( GetProperty( xPropSet, "Model" ) ) + OUString clsid; + xPropSet->getPropertyValue("CLSID") >>= clsid; + assert(!clsid.isEmpty()); + SvGlobalName aClassID; + bool const isValid(aClassID.MakeId(clsid)); + assert(isValid); (void)isValid; + { - Reference< XChartDocument > xChartDoc; - mAny >>= xChartDoc; - if( xChartDoc.is() ) + if (SotExchange::IsChart(aClassID)) { + Reference< XChartDocument > xChartDoc; + xPropSet->getPropertyValue("Model") >>= xChartDoc; + assert(xChartDoc.is()); //export the chart Reference< XModel > xModel( xChartDoc, UNO_QUERY ); ChartExport aChartExport( mnXmlNamespace, GetFS(), xModel, GetFB(), GetDocumentType() ); -- cgit