Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Fix adding NULL objects to ExcEScenarioManager.
From 1678fb943a191ede8beacdaa57a94bc52313e7b6 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
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


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.