[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kspread
From:       Johannes Simon <johannes.simon () gmail ! com>
Date:       2010-09-18 23:36:26
Message-ID: 20100918233626.D5E48AC894 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1176877 by jsimon:

Because some of the shapes might be using a sheet in this map, delete all shapes in \
each sheet before all sheets are deleted together

 M  +4 -0      Map.cpp  
 M  +6 -0      Sheet.cpp  
 M  +5 -0      Sheet.h  


--- trunk/koffice/kspread/Map.cpp #1176876:1176877
@@ -181,6 +181,10 @@
 
 Map::~Map()
 {
+    // Because some of the shapes might be using a sheet in this map, delete
+    // all shapes in each sheet before all sheets are deleted together.
+    foreach(Sheet *sheet, d->lstSheets)
+        sheet->deleteShapes();
     // we have to explicitly delete the Sheets, not let QObject take care of that
     // as the sheet in its destructor expects the Map to still exist
     qDeleteAll(d->lstSheets);
--- trunk/koffice/kspread/Sheet.cpp #1176876:1176877
@@ -332,6 +332,12 @@
     emit shapeRemoved(this, shape);
 }
 
+void Sheet::deleteShapes()
+{
+    qDeleteAll(d->shapes);
+    d->shapes.clear();
+}
+
 KoResourceManager* Sheet::resourceManager() const
 {
     return map()->resourceManager();
--- trunk/koffice/kspread/Sheet.h #1176876:1176877
@@ -137,6 +137,11 @@
     virtual KoResourceManager* resourceManager() const;
 
     /**
+     * Deletes all shapes without emitting shapeRemoved()
+     */
+    void deleteShapes();
+
+    /**
      * \ingroup Embedding
      * Returns the sheet's shapes.
      * \return the shapes this sheet contains


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic