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

List:       kde-commits
Subject:    [calligra/calligra/2.6] libs/kotext/commands: fix a regression making undo/redo for column and row r
From:       C. Boemann <cbo () boemann ! dk>
Date:       2013-01-20 12:10:30
Message-ID: 20130120121030.12C88A6091 () git ! kde ! org
[Download RAW message or body]

Git commit 31eaca62d8c69732056641e09778c30e93b38efc by C. Boemann.
Committed on 20/01/2013 at 13:05.
Pushed by boemann into branch 'calligra/2.6'.

fix a regression making undo/redo for column and row reszes not working

was a regression caused by commit 68f274e9db08605f0911618be9ca2ecbd3858c47

BUG: 313362

M  +12   -4    libs/kotext/commands/ResizeTableCommand.cpp

http://commits.kde.org/calligra/31eaca62d8c69732056641e09778c30e93b38efc

diff --git a/libs/kotext/commands/ResizeTableCommand.cpp b/libs/kotext/commands/ResizeTableCommand.cpp
index fff1fb9..7775b93 100644
--- a/libs/kotext/commands/ResizeTableCommand.cpp
+++ b/libs/kotext/commands/ResizeTableCommand.cpp
@@ -64,10 +64,14 @@ void ResizeTableCommand::undo()
     KoTableColumnAndRowStyleManager carsManager = KoTableColumnAndRowStyleManager::getManager(table);
 
     if (m_oldColumnStyle) {
-        carsManager.columnStyle(m_band).copyProperties(m_oldColumnStyle);
+        KoTableColumnStyle style = carsManager.columnStyle(m_band);
+        style.copyProperties(m_oldColumnStyle);
+        carsManager.setColumnStyle(m_band, style);
     }
     if (m_oldRowStyle) {
-        carsManager.rowStyle(m_band).copyProperties(m_oldRowStyle);
+        KoTableRowStyle style = carsManager.rowStyle(m_band);
+        style.copyProperties(m_oldRowStyle);
+        carsManager.setRowStyle(m_band, style);
     }
     KUndo2Command::undo();
     m_document->markContentsDirty(m_tablePosition, table->lastPosition()-table->firstPosition());
@@ -83,9 +87,13 @@ void ResizeTableCommand::redo()
 
     if (!m_first) {
         if (m_horizontal) {
-            carsManager.columnStyle(m_band).copyProperties(m_newColumnStyle);
+            KoTableColumnStyle style = carsManager.columnStyle(m_band);
+            style.copyProperties(m_newColumnStyle);
+            carsManager.setColumnStyle(m_band, style);
         } else {
-            carsManager.rowStyle(m_band).copyProperties(m_newRowStyle);
+            KoTableRowStyle style = carsManager.rowStyle(m_band);
+            style.copyProperties(m_newRowStyle);
+            carsManager.setRowStyle(m_band, style);
         }
         KUndo2Command::redo();
     } else {
[prev in list] [next in list] [prev in thread] [next in thread] 

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