[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bkoffice/koffice/change-tracking=5D_libs/kotext=3A_E?=
From: Ganesh Paramasivam <ganesh () crystalfab ! com>
Date: 2011-02-16 7:17:28
Message-ID: 20110216071728.E6D03A609B () git ! kde ! org
[Download RAW message or body]
Git commit 7ca136c546de0766900e93cccc268241e6d31d3b by Ganesh Paramasivam.
Committed on 16/02/2011 at 07:58.
Pushed by ganeshp into branch 'koffice/change-tracking'.
Enable tracking of table row insertion ( above and below )
M +24 -0 libs/kotext/KoTextEditor.cpp
http://commits.kde.org/koffice/7ca136c546de0766900e93cccc268241e6d31d3b
diff --git a/libs/kotext/KoTextEditor.cpp b/libs/kotext/KoTextEditor.cpp
index 4944b15..52ccecf 100644
--- a/libs/kotext/KoTextEditor.cpp
+++ b/libs/kotext/KoTextEditor.cpp
@@ -992,6 +992,18 @@ void KoTextEditor::insertTableRowAbove()
int row = cell.row();
table->insertRows(row, 1);
carsManager.insertRows(row, 1, carsManager.rowStyle(row));
+
+ KoChangeTracker *changeTracker = KoTextDocument(d->document).changeTracker();
+ if (changeTracker && changeTracker->recordChanges()) {
+ int changeId;
+ QString title(i18n("Insert Row Above"));
+ changeId = changeTracker->getInsertChangeId(title, 0);
+ for (int i=0; i < table->columns(); i++) {
+ QTextTableCellFormat cellFormat = table->cellAt(row, i).format().toTableCellFormat();
+ cellFormat.setProperty(KoCharacterStyle::ChangeTrackerId, changeId);
+ table->cellAt(row, i).setFormat(cellFormat);
+ }
+ }
}
d->updateState(KoTextEditor::Private::NoOp);
@@ -1022,6 +1034,18 @@ void KoTextEditor::insertTableRowBelow()
table->insertRows(row, 1);
carsManager.insertRows(row, 1, carsManager.rowStyle(row-1));
}
+
+ KoChangeTracker *changeTracker = KoTextDocument(d->document).changeTracker();
+ if (changeTracker && changeTracker->recordChanges()) {
+ int changeId;
+ QString title(i18n("Insert Row Above"));
+ changeId = changeTracker->getInsertChangeId(title, 0);
+ for (int i=0; i < table->columns(); i++) {
+ QTextTableCellFormat cellFormat = table->cellAt(row, i).format().toTableCellFormat();
+ cellFormat.setProperty(KoCharacterStyle::ChangeTrackerId, changeId);
+ table->cellAt(row, i).setFormat(cellFormat);
+ }
+ }
}
d->updateState(KoTextEditor::Private::NoOp);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic