Fix adding NULL objects to ExcEScenarioManager.
From 1678fb943a191ede8beacdaa57a94bc52313e7b6 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <[email protected]>
Date: Tue, 7 Jun 2011 16:36:26 -0430
Subject: [PATCH 1/2] Only add non-null scenes to manager.
---
sc/source/filter/xcl97/xcl97rec.cxx | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 7c8c921..5b43477 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1328,11 +1328,16 @@ ExcEScenarioManager::ExcEScenarioManager( const XclExpRoot& rRoot, SCTAB nTab )
while( rDoc.IsScenario( nNewTab ) )
{
- aScenes.push_back( new ExcEScenario( rRoot, nNewTab ) );
+ ExcEScenario *scene = new ExcEScenario( rRoot, nNewTab );
- if( rDoc.IsActiveScenario( nNewTab ) )
- nActive = static_cast<sal_uInt16>(nNewTab - nFirstTab);
- nNewTab++;
+ if (scene)
+ {
+ aScenes.push_back( scene );
+
+ if( rDoc.IsActiveScenario( nNewTab ) )
+ nActive = static_cast<sal_uInt16>(nNewTab - nFirstTab);
+ nNewTab++;
+ }
}
}
--
1.7.3.4
_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice