avoid crash when finding a non chart OLE2 shape

Change-Id: I5f69e3dabe67aa09f6a77c65e196401622f4b951
This commit is contained in:
Markus Mohrhard 2014-05-30 22:44:21 +02:00
parent e7aa417021
commit 561b6824e6
2 changed files with 6 additions and 0 deletions

View file

@ -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));
}

View file

@ -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 ) );