[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_I?=
From: Ganesh Paramasivam <ganesh () crystalfab ! com>
Date: 2011-02-17 11:34:39
Message-ID: 20110217113439.A95FDA60A6 () git ! kde ! org
[Download RAW message or body]
Git commit 62e56f9ea717597d8054cb84b5b15cdfd3ab3503 by Ganesh Paramasivam.
Committed on 17/02/2011 at 12:34.
Pushed by ganeshp into branch 'koffice/change-tracking'.
Initial checkin of new classes needed to extend and enhance show/hide changes to \
support deleted rows and columns
M +8 -0 libs/kotext/CMakeLists.txt
A +19 -0 libs/kotext/changetracker/KoDeletedCellData.cpp [License: LGPL \
(v2+)] A +19 -0 libs/kotext/changetracker/KoDeletedCellData.h [License: \
LGPL (v2+)] A +19 -0 libs/kotext/changetracker/KoDeletedColumnData.cpp \
[License: LGPL (v2+)] A +27 -0 libs/kotext/changetracker/KoDeletedColumnData.h \
[License: LGPL (v2+)] A +86 -0 \
libs/kotext/changetracker/KoDeletedRowColumnDataStore.cpp [License: LGPL \
(v2+)] A +62 -0 libs/kotext/changetracker/KoDeletedRowColumnDataStore.h \
[License: LGPL (v2+)] A +19 -0 libs/kotext/changetracker/KoDeletedRowData.cpp \
[License: LGPL (v2+)] A +27 -0 libs/kotext/changetracker/KoDeletedRowData.h \
[License: LGPL (v2+)]
http://commits.kde.org/koffice/62e56f9ea717597d8054cb84b5b15cdfd3ab3503
diff --git a/libs/kotext/CMakeLists.txt b/libs/kotext/CMakeLists.txt
index f7ca9a7..2ab8ebf 100644
--- a/libs/kotext/CMakeLists.txt
+++ b/libs/kotext/CMakeLists.txt
@@ -78,6 +78,10 @@ set(kotext_LIB_SRCS
changetracker/KoChangeTrackerElement.cpp
changetracker/KoDeleteChangeMarker.cpp
changetracker/KoFormatChangeInformation.cpp
+ changetracker/KoDeletedRowColumnDataStore.cpp
+ changetracker/KoDeletedRowData.cpp
+ changetracker/KoDeletedColumnData.cpp
+ changetracker/KoDeletedCellData.cpp
KoTextDrag.cpp
)
@@ -158,6 +162,10 @@ install(
changetracker/KoChangeTracker.h
changetracker/KoChangeTrackerElement.h
changetracker/KoDeleteChangeMarker.h
+ changetracker/KoDeletedRowColumnDataStore.h
+ changetracker/KoDeletedRowData.cpp
+ changetracker/KoDeletedColumnData.cpp
+ changetracker/KoDeletedCellData.cpp
DESTINATION
${INCLUDE_INSTALL_DIR}/changetracker COMPONENT Devel
)
diff --git a/libs/kotext/changetracker/KoDeletedCellData.cpp \
b/libs/kotext/changetracker/KoDeletedCellData.cpp new file mode 100644
index 0000000..f09a24b
--- /dev/null
+++ b/libs/kotext/changetracker/KoDeletedCellData.cpp
@@ -0,0 +1,19 @@
+/* This file is part of the KDE project
+ * Copyright (C) 2011 Ganesh Paramasivam <ganesh@crystalfab.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
diff --git a/libs/kotext/changetracker/KoDeletedCellData.h \
b/libs/kotext/changetracker/KoDeletedCellData.h new file mode 100644
index 0000000..f09a24b
--- /dev/null
+++ b/libs/kotext/changetracker/KoDeletedCellData.h
@@ -0,0 +1,19 @@
+/* This file is part of the KDE project
+ * Copyright (C) 2011 Ganesh Paramasivam <ganesh@crystalfab.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
diff --git a/libs/kotext/changetracker/KoDeletedColumnData.cpp \
b/libs/kotext/changetracker/KoDeletedColumnData.cpp new file mode 100644
index 0000000..f09a24b
--- /dev/null
+++ b/libs/kotext/changetracker/KoDeletedColumnData.cpp
@@ -0,0 +1,19 @@
+/* This file is part of the KDE project
+ * Copyright (C) 2011 Ganesh Paramasivam <ganesh@crystalfab.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
diff --git a/libs/kotext/changetracker/KoDeletedColumnData.h \
b/libs/kotext/changetracker/KoDeletedColumnData.h new file mode 100644
index 0000000..94b37fe
--- /dev/null
+++ b/libs/kotext/changetracker/KoDeletedColumnData.h
@@ -0,0 +1,27 @@
+/* This file is part of the KDE project
+ * Copyright (C) 2011 Ganesh Paramasivam <ganesh@crystalfab.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __KODELETEDCOLUMNDATA_H__
+#define __KODELETEDCOLUMNDATA_H__
+
+class KoDeletedColumnData
+{
+};
+
+#endif
diff --git a/libs/kotext/changetracker/KoDeletedRowColumnDataStore.cpp \
b/libs/kotext/changetracker/KoDeletedRowColumnDataStore.cpp new file mode 100644
index 0000000..4d0081b
--- /dev/null
+++ b/libs/kotext/changetracker/KoDeletedRowColumnDataStore.cpp
@@ -0,0 +1,86 @@
+/* This file is part of the KDE project
+ * Copyright (C) 2011 Ganesh Paramasivam <ganesh@crystalfab.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "KoDeletedRowColumnDataStore.h"
+#include "KoDeletedRowData.h"
+#include "KoDeletedColumnData.h"
+
+KoDeletedRowColumnDataStore::KoDeletedRowColumnDataStore()
+{
+}
+
+KoDeletedRowColumnDataStore::~KoDeletedRowColumnDataStore()
+{
+}
+
+KoDeletedRowData *KoDeletedRowColumnDataStore::addDeletedRow(QTextTable *table, int \
rowNumber, int changeId) +{
+ KoDeletedRowData *deletedRowData = new KoDeletedRowData();
+ deletedRowDataMap.insert(changeId, deletedRowData);
+ QVector<int> *tableChangeIds = tableChangeIdsMap.value(table, NULL);
+ if (!tableChangeIds) {
+ tableChangeIds = new QVector<int>();
+ tableChangeIdsMap.insert(table, tableChangeIds);
+ }
+ tableChangeIds->push_back(changeId);
+ return deletedRowData;
+}
+
+KoDeletedColumnData *KoDeletedRowColumnDataStore::addDeletedColumn(QTextTable \
*table, int columnNumber, int changeId) +{
+ KoDeletedColumnData *deletedColumnData = new KoDeletedColumnData();
+ deletedColumnDataMap.insert(changeId, deletedColumnData);
+ QVector<int> *tableChangeIds = tableChangeIdsMap.value(table, NULL);
+ if (!tableChangeIds) {
+ tableChangeIds = new QVector<int>();
+ tableChangeIdsMap.insert(table, tableChangeIds);
+ }
+ tableChangeIds->push_back(changeId);
+ return deletedColumnData;
+}
+
+const QVector<int> *KoDeletedRowColumnDataStore::deletedRowColumnChangeIds(QTextTable \
*table) +{
+ return tableChangeIdsMap.value(table, NULL);
+}
+
+KoDeletedRowColumnDataStore::DeleteType KoDeletedRowColumnDataStore::deleteType(int \
changeId) +{
+ KoDeletedRowColumnDataStore::DeleteType retValue;
+ if (deletedRowDataMap.value(changeId, NULL)) {
+ retValue = KoDeletedRowColumnDataStore::eDeletedRow;
+ } else if(deletedColumnDataMap.value(changeId, NULL)) {
+ retValue = KoDeletedRowColumnDataStore::eDeletedColumn;
+ } else {
+ retValue = KoDeletedRowColumnDataStore::eUnknownDeleteType;
+ }
+
+ return retValue;
+}
+
+KoDeletedRowData *KoDeletedRowColumnDataStore::deletedRowData(int changeId)
+{
+ return deletedRowDataMap.value(changeId, NULL);
+}
+
+KoDeletedColumnData *KoDeletedRowColumnDataStore::deletedColumnData(int changeId)
+{
+ return deletedColumnDataMap.value(changeId, NULL);
+}
+
diff --git a/libs/kotext/changetracker/KoDeletedRowColumnDataStore.h \
b/libs/kotext/changetracker/KoDeletedRowColumnDataStore.h new file mode 100644
index 0000000..3246423
--- /dev/null
+++ b/libs/kotext/changetracker/KoDeletedRowColumnDataStore.h
@@ -0,0 +1,62 @@
+/* This file is part of the KDE project
+ * Copyright (C) 2011 Ganesh Paramasivam <ganesh@crystalfab.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __KODELETEDROWCOLUMNDATASTORE_H__
+#define __KODELETEDROWCOLUMNDATASTORE_H__
+
+#include <QVector>
+#include <QMap>
+
+class KoDeletedRowData;
+class KoDeletedColumnData;
+class QTextTable;
+
+class KoDeletedRowColumnDataStore {
+ public:
+ typedef enum {
+ eDeletedRow,
+ eDeletedColumn,
+ eUnknownDeleteType
+ } DeleteType;
+
+ KoDeletedRowColumnDataStore();
+
+ ~KoDeletedRowColumnDataStore();
+
+ KoDeletedRowData *addDeletedRow(QTextTable *table, int rowNumber, int \
changeId); +
+ KoDeletedColumnData *addDeletedColumn(QTextTable *table, int columnNumber, \
int changeId); +
+ const QVector<int> *deletedRowColumnChangeIds(QTextTable *table);
+
+ DeleteType deleteType(int changeId);
+
+ KoDeletedRowData *deletedRowData(int changeId);
+
+ KoDeletedColumnData *deletedColumnData(int changeId);
+
+ private:
+
+ QMap<QTextTable *, QVector<int> *> tableChangeIdsMap;
+
+ QMap<int, KoDeletedRowData *> deletedRowDataMap;
+
+ QMap<int, KoDeletedColumnData *> deletedColumnDataMap;
+};
+#endif
diff --git a/libs/kotext/changetracker/KoDeletedRowData.cpp \
b/libs/kotext/changetracker/KoDeletedRowData.cpp new file mode 100644
index 0000000..f09a24b
--- /dev/null
+++ b/libs/kotext/changetracker/KoDeletedRowData.cpp
@@ -0,0 +1,19 @@
+/* This file is part of the KDE project
+ * Copyright (C) 2011 Ganesh Paramasivam <ganesh@crystalfab.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
diff --git a/libs/kotext/changetracker/KoDeletedRowData.h \
b/libs/kotext/changetracker/KoDeletedRowData.h new file mode 100644
index 0000000..fb11538
--- /dev/null
+++ b/libs/kotext/changetracker/KoDeletedRowData.h
@@ -0,0 +1,27 @@
+/* This file is part of the KDE project
+ * Copyright (C) 2011 Ganesh Paramasivam <ganesh@crystalfab.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __KODELETEDROWDATA_H__
+#define __KODELETEDROWDATA_H__
+
+class KoDeletedRowData
+{
+};
+
+#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic