summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-12-19 00:18:29 +0100
committerMichael Stahl <mstahl@redhat.com>2015-12-20 00:56:06 +0100
commitd54624ff7e7f97d8d7e8fd70572348f63b8a3da5 (patch)
tree3fba5b1b8ba73fe9190c34adc270e21161d50229 /oox
parentca29357f7310f057f79357e80a9129b670914404 (diff)
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
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/shapes.cxx16
1 files changed, 12 insertions, 4 deletions
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 <tools/globname.hxx>
#include <comphelper/classids.hxx>
#include <comphelper/storagehelper.hxx>
+#include <sot/exchange.hxx>
#include <vcl/cvtgrf.hxx>
#include <unotools/fontcvt.hxx>
#include <vcl/graph.hxx>
@@ -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() );