summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-05-30 22:44:21 +0200
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-05-30 22:45:35 +0200
commit561b6824e6cbb8762f667e3bcc087a6105ee78b7 (patch)
treef0a016292b0ac201dca04a6c2176da4c0d9a1727
parente7aa4170212612f8b6bead91ceb6b4e86cf008d4 (diff)
avoid crash when finding a non chart OLE2 shape
Change-Id: I5f69e3dabe67aa09f6a77c65e196401622f4b951
-rw-r--r--sc/source/core/data/documen5.cxx3
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx3
2 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 4076b431ef7b..d89be232d223 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -688,6 +688,9 @@ std::vector<std::pair<uno::Reference<chart2::XChartDocument>, Rectangle> > ScDoc
continue;
uno::Reference< chart2::XChartDocument > xChartDoc( ScChartHelper::GetChartFromSdrObject( pObject ) );
+ if(!xChartDoc.is())
+ continue;
+
Rectangle aRect = pObject->GetLastBoundRect();
aRet.push_back(std::pair<uno::Reference<chart2::XChartDocument>, Rectangle>(xChartDoc, aRect));
}
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 338405a43745..80b7e77347e5 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -581,7 +581,10 @@ void ScTabViewShell::AddOpenGLChartWindows()
for(std::vector<std::pair<uno::Reference<chart2::XChartDocument>, Rectangle> >::iterator itr = aCharts.begin(),
itrEnd = aCharts.end(); itr != itrEnd; ++itr)
{
+ if(!itr->first.is())
+ return;
OpenGLWindow* pOpenGLWindow = new OpenGLWindow(pParentWindow);
+
pOpenGLWindow->Show(false);
Size aSize = itr->second.GetSize();
Size aWindowSize = pOpenGLWindow->LogicToPixel( aSize, MapMode( MAP_100TH_MM ) );