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

List:       kde-commits
Subject:    branches/work/kspread-style-storage
From:       Stefan Nikolaus <stefan.nikolaus () kdemail ! net>
Date:       2006-11-13 16:50:34
Message-ID: 1163436634.542237.28167.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 604665 by nikolaus:

Prepare insertion/deletion of columns/rows.


 M  +4 -0      Sheet.cpp  
 M  +20 -0     StyleStorage.cpp  
 M  +24 -0     StyleStorage.h  
 M  +9 -0      TODO  


--- branches/work/kspread-style-storage/Sheet.cpp #604664:604665
@@ -1239,6 +1239,7 @@
         //Recalculate range max (plus size of new column)
         d->sizeMaxX += columnFormat( col+i )->dblWidth();
     }
+    styleStorage()->insertColumns(col, nbCol + 1);
 
     foreach ( Sheet* sheet, workbook()->sheetList() )
     {
@@ -1283,6 +1284,7 @@
         //Recalculate range max (plus size of new row)
         d->sizeMaxY += rowFormat( row )->dblHeight();
     }
+    styleStorage()->insertRows(row, nbRow + 1);
 
     foreach ( Sheet* sheet, workbook()->sheetList() )
     {
@@ -1323,6 +1325,7 @@
         //Recalculate range max (plus size of new column)
         d->sizeMaxX += columnFormat( KS_colMax )->dblWidth();
     }
+    styleStorage()->deleteColumns(col, nbCol + 1);
 
     foreach ( Sheet* sheet, workbook()->sheetList() )
     {
@@ -1361,6 +1364,7 @@
         //Recalculate range max (plus size of new row)
         d->sizeMaxY += rowFormat( KS_rowMax )->dblHeight();
     }
+    styleStorage()->deleteRows(row, nbRow + 1);
 
     foreach ( Sheet* sheet, workbook()->sheetList() )
     {
--- branches/work/kspread-style-storage/StyleStorage.cpp #604664:604665
@@ -172,3 +172,23 @@
         }
     }
 }
+
+void StyleStorage::insertRows(int position, int number)
+{
+    d->tree.insertRows(position, number);
+}
+
+void StyleStorage::insertColumns(int position, int number)
+{
+    d->tree.insertColumns(position, number);
+}
+
+void StyleStorage::deleteRows(int position, int number)
+{
+    d->tree.deleteRows(position, number);
+}
+
+void StyleStorage::deleteColumns(int position, int number)
+{
+    d->tree.deleteColumns(position, number);
+}
--- branches/work/kspread-style-storage/StyleStorage.h #604664:604665
@@ -86,6 +86,30 @@
      */
     void insert(const Region& region, const Style& style );
 
+    /**
+     * Inserts \p number rows at the position \p position .
+     * It extends or shifts rectangles, respectively.
+     */
+    void insertRows(int position, int number = 1);
+
+    /**
+     * Inserts \p number columns at the position \p position .
+     * It extends or shifts rectangles, respectively.
+     */
+    void insertColumns(int position, int number = 1);
+
+    /**
+     * Deletes \p number rows at the position \p position .
+     * It shrinks or shifts rectangles, respectively.
+     */
+    void deleteRows(int position, int number = 1);
+
+    /**
+     * Deletes \p number columns at the position \p position .
+     * It shrinks or shifts rectangles, respectively.
+     */
+    void deleteColumns(int position, int number = 1);
+
 protected:
 
 private:
--- branches/work/kspread-style-storage/TODO #604664:604665
@@ -93,6 +93,10 @@
       (current merge status trunk@604612)
     - Remove old Format							done
     - reuse existing sub-styles (book-keeping)				done
+      Done on a per substyle basis.
+      Lookup: O(n)
+      n: number of different aggregations of a substyle,
+         e.g. red, blue, etc. for the background color substyle
     - garbage collection (on insertion or from time to time?)		----
     - Keep track of the used area.					----
       Styled cells do not necessarily occur in the cluster anymore.
@@ -100,6 +104,11 @@
     - Speedup the OpenDocument loading by 'collecting' the used area	done
       of each style and insert a minimal set of rectangles into the
       style storage.
+    - Undo of style changes						----
+      This should insert the inverse substyles or something similar.
+    - Add insertion/deletion of columns/rows				----
+    - Get rid of KSpread::Style::Currency. Use KSpread::Currency.	----
+    - Old native format loading/saving					----
 
   + Speed up selection.						      1 ----
     (probably improved with Format Storage?)
[prev in list] [next in list] [prev in thread] [next in thread] 

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