Package: release.debian.org  
User: release.debian....@packages.debian.org                     
Usertags: unblock
Severity: normal 

Hi,

A new bug fix version has been released on calligra (the KDE Office Suite): 
http://www.calligra.org/news/calligra-2-4-4-and-2-5-5-released/

This bug fix version includes very important changes, other a bit less 
important, and some translation updates in desktop files. The debdiff of the 
entire release (without translations) is about 1000 lines, and the debdiff 
including only the most important is a bit less than 600 lines (see attached).

You can find the entire debdiff here : http://paste.debian.net/232487/

– The most important changes are :

Sheets:
  - A very nasty bug which made recalculations of spreadsheet contents go wrong 
under some circumstances (BUGS: 312981, 313010)
Kexi:
  - SQLite Driver: Fix possible data loss of compacted file (when process tools 
crash or fail for any reason)
  - Fix possible crash when pressing tab in the global search box

– We also had some changes on the package:

   - add break/replace on koffice-data for krita
  - a typo in a package description
  - a patch already in Debian, but now included upstream.

– The other changes are :

General: 
  - build visualimagecompare only if poppler is around

Kexi:
  - Kexi Forms:
    - Make palette background color property in text editor work (BUG: 309274)
    - Fix “data source tag” for text box (regression because of changes in KDE 
libraries’ line editor)
  - Remove limit of 101 fields in Kexi Table Designer (BUG: 309116)
  - Fix MySql login failure when not saving password – fix for case 3.1 (BUG: 
313025)
  - Property editor: make items are always sorted by key


The whole changes is quite big, but quickly readable, so we would like to 
upload the bug fix release of Calligra in wheezy. It would be more work for us 
to pick up only the most important commits, and we are not sure it's worth to 
dedicate time for this.

That's why we ask for your advice : may we ship only the most important changes 
or the entire bug fix release of Calligra (2.4.4) in wheezy ?

Regards,

Adrien


-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'unstable'), (700, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.7-trunk-amd64 (SMP w/2 CPU cores)
diff -Nru calligra-2.4.3/debian/changelog calligra-2.4.4/debian/changelog
--- calligra-2.4.3/debian/changelog	2012-12-16 01:19:42.000000000 +0100
+++ calligra-2.4.4/debian/changelog	2013-02-02 22:30:10.000000000 +0100
@@ -1,11 +1,42 @@
+calligra (1:2.4.4-1) UNRELEASED; urgency=low
+
+  [ Lisandro Damián Nicanor Pérez Meyer ]
+  * Fix the previous changelog:
+    - krita is the package that breaks/replaces krita-data.
+    - Add the missing epochs.
+    The changes were correctly done in the control file, the changes were just
+    typos in the changelog. Thanks Thorsten Glaser for noticing.
+
+  [ Adrien Grellier ]
+  * Fix typo in calligrasheets package description (Closes: #697261) 
+  * Make calligrastage break/replace koffice-data < 1:2.4 (Closes: #699200)
+  * New upstream bug fix release 2.4.4:
+    Sheets:
+      * A very nasty bug which made recalculations of spreadsheet
+        contents go wrong under some circumstances (BUGS: 312981, 313010)
+    Kexi:
+      * Make palette background color property in text editor work (BUG: 309274)
+      * Fix “data source tag” for text box (regression because of changes in
+        KDE libraries’ line editor)
+      * SQLite Driver: Fix possible data loss of compacted file (when process
+        tools crash or fail for any reason)
+      * Remove limit of 101 fields in Kexi Table Designer (BUG: 309116)
+      * Fix MySql login failure when not saving password – fix for
+        case 3.1 (BUG: 313025)
+      * Fix possible crash when pressing tab in the global search box
+  * remove upstream_Make-sure-not-to-write-behind-the-allocated-memory.patch
+    included upstream
+
+ -- Debian Qt/KDE Maintainers <debian-qt-...@lists.debian.org>  Sun, 16 Dec 2012 00:51:22 -0300
+
 calligra (1:2.4.3-4) unstable; urgency=low
 
   [ Lisandro Damián Nicanor Pérez Meyer ]
   * Team upload.
 
   [ Pino Toscano ]
-  * Make krita-data break/replace krita-data < 2.4. (Closes: #694854)
-  * Make karbon break/replace koffice-data < 2.4. (Closes: #694855)
+  * Make krita break/replace krita-data < 1:2.4. (Closes: #694854)
+  * Make karbon break/replace koffice-data < 1:2.4. (Closes: #694855)
 
  -- Lisandro Damián Nicanor Pérez Meyer <lisan...@debian.org>  Sat, 15 Dec 2012 21:19:38 -0300
 
diff -Nru calligra-2.4.3/debian/control calligra-2.4.4/debian/control
--- calligra-2.4.3/debian/control	2012-12-16 01:18:18.000000000 +0100
+++ calligra-2.4.4/debian/control	2013-02-02 22:05:50.000000000 +0100
@@ -349,7 +349,7 @@
 Description: spreadsheet for the Calligra Suite
  Tables is a powerful spreadsheet application.  It is scriptable and
  provides both table-oriented sheets and support for complex mathematical
- formulae and statistics. It is the sucessor of KSpread.
+ formulae and statistics. It is the successor of KSpread.
  .
  This package is part of the Calligra Suite.
 
@@ -403,8 +403,8 @@
 Package: calligrastage
 Architecture: any
 Section: kde
-Replaces: kpresenter (<< 1:2.4), calligra-data (<< 1:2.4.3-2)
-Breaks: kpresenter (<< 1:2.4), calligra-data (<< 1:2.4.3-2)
+Replaces: kpresenter (<< 1:2.4), calligra-data (<< 1:2.4.3-2), koffice-data (<< 1:2.4)
+Breaks: kpresenter (<< 1:2.4), calligra-data (<< 1:2.4.3-2), koffice-data (<< 1:2.4)
 Depends: ${misc:Depends}, ${shlibs:Depends}, calligra-libs (= ${binary:Version})
 Suggests: khelpcenter4
 Homepage: http://www.calligra-suite.org/stage/
diff -Nru calligra-2.4.3/debian/patches/series calligra-2.4.4/debian/patches/series
--- calligra-2.4.3/debian/patches/series	2012-12-16 01:18:18.000000000 +0100
+++ calligra-2.4.4/debian/patches/series	2013-02-02 22:21:51.000000000 +0100
@@ -1,2 +1 @@
 do_not_link_blas.diff
-upstream_Make-sure-not-to-write-behind-the-allocated-memory.patch
diff -Nru calligra-2.4.3/debian/patches/upstream_Make-sure-not-to-write-behind-the-allocated-memory.patch calligra-2.4.4/debian/patches/upstream_Make-sure-not-to-write-behind-the-allocated-memory.patch
--- calligra-2.4.3/debian/patches/upstream_Make-sure-not-to-write-behind-the-allocated-memory.patch	2012-12-16 01:18:18.000000000 +0100
+++ calligra-2.4.4/debian/patches/upstream_Make-sure-not-to-write-behind-the-allocated-memory.patch	1970-01-01 01:00:00.000000000 +0100
@@ -1,31 +0,0 @@
-From 7d72f7dd8d28d18c59a08a7d43bd4e0654043103 Mon Sep 17 00:00:00 2001
-From: Thorsten Zachmann <t.zachm...@zagge.de>
-Date: Sat, 4 Aug 2012 06:42:14 +0200
-Subject: [PATCH] Make sure not to write behind the allocated memory
-
-Validate the input data to not write behind the allocated memory. This fixes a
-buffer overflow found by Charlie Miller.
-(cherry picked from commit 8652ab672eaaa145dfb3782f5011de58aa4cc046)
----
- filters/words/msword-odf/wv2/src/styles.cpp |    5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
-index c3132f0..0d691f5 100644
---- a/filters/words/msword-odf/wv2/src/styles.cpp
-+++ b/filters/words/msword-odf/wv2/src/styles.cpp
-@@ -248,6 +248,11 @@ throw(InvalidFormatException)
- #ifdef WV2_DEBUG_STYLESHEET
-         wvlog << "cbUPX: " << cbUPX << endl;
- #endif
-+        // do not overflow the allocated buffer grupx
-+        if (offset + cbUPX > grupxLen) {
-+            wvlog << "====> Error: grupx would overflow!" << endl;
-+            return false;
-+        }
-         for ( U16 j = 0; j < cbUPX; ++j ) {
-             grupx[ offset + j ] = stream->readU8();  // read the whole UPX
- #ifdef WV2_DEBUG_STYLESHEET
--- 
-1.7.10.4
-
diff -Nru calligra-2.4.3/filters/generic_wrapper/generic_filter.desktop calligra-2.4.4/filters/generic_wrapper/generic_filter.desktop
diff -Nru calligra-2.4.3/filters/stage/kpr/export/odp2kpr.desktop calligra-2.4.4/filters/stage/kpr/export/odp2kpr.desktop
diff -Nru calligra-2.4.3/filters/stage/kpr/import/kpr2odp.desktop calligra-2.4.4/filters/stage/kpr/import/kpr2odp.desktop
diff -Nru calligra-2.4.3/filters/stage/words/kodp2odt.desktop calligra-2.4.4/filters/stage/words/kodp2odt.desktop
diff -Nru calligra-2.4.3/filters/stage/words/kprwords.desktop calligra-2.4.4/filters/stage/words/kprwords.desktop
diff -Nru calligra-2.4.3/filters/words/msword-odf/wv2/src/styles.cpp calligra-2.4.4/filters/words/msword-odf/wv2/src/styles.cpp
--- calligra-2.4.3/filters/words/msword-odf/wv2/src/styles.cpp	2012-06-26 06:21:31.000000000 +0200
+++ calligra-2.4.4/filters/words/msword-odf/wv2/src/styles.cpp	2013-01-22 14:21:54.000000000 +0100
@@ -248,6 +248,11 @@
 #ifdef WV2_DEBUG_STYLESHEET
         wvlog << "cbUPX: " << cbUPX << endl;
 #endif
+        // do not overflow the allocated buffer grupx
+        if (offset + cbUPX > grupxLen) {
+            wvlog << "====> Error: grupx would overflow!" << endl;
+            return false;
+        }
         for ( U16 j = 0; j < cbUPX; ++j ) {
             grupx[ offset + j ] = stream->readU8();  // read the whole UPX
 #ifdef WV2_DEBUG_STYLESHEET
diff -Nru calligra-2.4.3/flow/stencils/ChemEng/filter.desktop calligra-2.4.4/flow/stencils/ChemEng/filter.desktop
diff -Nru calligra-2.4.3/flow/stencils/Cisco/server_with_pc_router.desktop calligra-2.4.4/flow/stencils/Cisco/server_with_pc_router.desktop
diff -Nru calligra-2.4.3/flow/stencils/Cisco/storage_array.desktop calligra-2.4.4/flow/stencils/Cisco/storage_array.desktop
diff -Nru calligra-2.4.3/flow/stencils/Flags/antarctica.desktop calligra-2.4.4/flow/stencils/Flags/antarctica.desktop
diff -Nru calligra-2.4.3/flow/stencils/Flowchart/delay.desktop calligra-2.4.4/flow/stencils/Flowchart/delay.desktop
diff -Nru calligra-2.4.3/flow/stencils/Flowchart/manualop.desktop calligra-2.4.4/flow/stencils/Flowchart/manualop.desktop
diff -Nru calligra-2.4.3/flow/stencils/Flowchart/predefdproc.desktop calligra-2.4.4/flow/stencils/Flowchart/predefdproc.desktop
diff -Nru calligra-2.4.3/flow/stencils/Flowchart/preparation.desktop calligra-2.4.4/flow/stencils/Flowchart/preparation.desktop
diff -Nru calligra-2.4.3/kexi/kexidb/drivers/sqlite/sqlitepreparedstatement.cpp calligra-2.4.4/kexi/kexidb/drivers/sqlite/sqlitepreparedstatement.cpp
--- calligra-2.4.3/kexi/kexidb/drivers/sqlite/sqlitepreparedstatement.cpp	2012-06-26 06:18:00.000000000 +0200
+++ calligra-2.4.4/kexi/kexidb/drivers/sqlite/sqlitepreparedstatement.cpp	2013-01-22 14:21:54.000000000 +0100
@@ -29,7 +29,6 @@
         : KexiDB::PreparedStatement(type, conn, fields)
         , SQLiteConnectionInternal(conn.connection)
         , prepared_st_handle(0)
-        , m_resetRequired(false)
 {
     data_owned = false;
     data = dynamic_cast<KexiDB::SQLiteConnectionInternal&>(conn).data; //copy
@@ -59,14 +58,6 @@
 {
     if (!prepared_st_handle)
         return false;
-    if (m_resetRequired) {
-        res = sqlite3_reset(prepared_st_handle);
-        if (SQLITE_OK != res) {
-            //! @todo msg?
-            return false;
-        }
-        m_resetRequired = false;
-    }
 
     //for INSERT, we're iterating over inserting values
     //for SELECT, we're iterating over WHERE conditions
@@ -212,7 +203,7 @@
 
     //real execution
     res = sqlite3_step(prepared_st_handle);
-    m_resetRequired = true;
+    sqlite3_reset(prepared_st_handle);
     if (m_type == InsertStatement && res == SQLITE_DONE) {
         return true;
     }
diff -Nru calligra-2.4.3/kexi/kexidb/drivers/sqlite/sqlitepreparedstatement.h calligra-2.4.4/kexi/kexidb/drivers/sqlite/sqlitepreparedstatement.h
--- calligra-2.4.3/kexi/kexidb/drivers/sqlite/sqlitepreparedstatement.h	2012-06-26 06:18:00.000000000 +0200
+++ calligra-2.4.4/kexi/kexidb/drivers/sqlite/sqlitepreparedstatement.h	2013-01-22 14:21:54.000000000 +0100
@@ -38,7 +38,6 @@
     virtual bool execute();
 
     sqlite3_stmt *prepared_st_handle;
-    bool m_resetRequired : 1;
 };
 
 }
diff -Nru calligra-2.4.3/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp calligra-2.4.4/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp
--- calligra-2.4.3/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp	2012-06-26 06:21:31.000000000 +0200
+++ calligra-2.4.4/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp	2013-01-22 14:21:54.000000000 +0100
@@ -179,31 +179,46 @@
 void SQLiteVacuum::dumpProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
 {
     KexiDBDrvDbg << exitCode << exitStatus;
+    if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
+        cancelClicked();
+        m_result = false;
+    }
+
     if (m_dlg) {
         m_dlg->close();
         delete m_dlg;
         m_dlg = 0;
     }
-}
 
-void SQLiteVacuum::sqliteProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
-{
-    KexiDBDrvDbg << exitCode << exitStatus;
+    if (true != m_result) {
+        return;
+    }
 
-    const uint origSize = QFileInfo(m_filePath).size();
+    QFileInfo fi(m_filePath);
+    const uint origSize = fi.size();
 
-    if (0 != KDE::rename(m_tmpFilePath, m_filePath)) {
-        kWarning() << "Rename" << m_tmpFilePath << "to" << m_filePath << "failed.";
-        m_result == false;
+    if (0 != KDE::rename(m_tmpFilePath, fi.absoluteFilePath())) {
+        kWarning() << "Rename" << m_tmpFilePath << "to" << fi.absoluteFilePath() << "failed.";
+        m_result = false;
     }
 
     if (m_result == true) {
-        const uint newSize = QFileInfo(m_filePath).size();
+        const uint newSize = fi.size();
         const uint decrease = 100 - 100 * newSize / origSize;
         KMessageBox::information(0, i18n("The database has been compacted. Current size decreased by %1% to %2.", decrease, KIO::convertSize(newSize)));
     }
 }
 
+void SQLiteVacuum::sqliteProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
+{
+    KexiDBDrvDbg << exitCode << exitStatus;
+
+    if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
+        m_result = false;
+        return;
+    }
+}
+
 void SQLiteVacuum::cancelClicked()
 {
         //m_dumpProcess->terminate();
diff -Nru calligra-2.4.3/kexi/main/KexiSearchLineEdit.cpp calligra-2.4.4/kexi/main/KexiSearchLineEdit.cpp
--- calligra-2.4.3/kexi/main/KexiSearchLineEdit.cpp	2012-06-26 06:18:00.000000000 +0200
+++ calligra-2.4.4/kexi/main/KexiSearchLineEdit.cpp	2013-01-22 14:21:54.000000000 +0100
@@ -507,7 +507,9 @@
     update();
     if (e->reason() == Qt::TabFocusReason || e->reason() == Qt::BacktabFocusReason) {
         // go back to previously focused widget
-        d->previouslyFocusedWidget->setFocus();
+        if (d->previouslyFocusedWidget) {
+            d->previouslyFocusedWidget->setFocus();
+        }
         e->accept();
     }
     d->previouslyFocusedWidget = 0;
diff -Nru calligra-2.4.3/kexi/migration/mdb/src/keximdb/keximigrate_mdb.desktop calligra-2.4.4/kexi/migration/mdb/src/keximdb/keximigrate_mdb.desktop
diff -Nru calligra-2.4.3/kexi/migration/mysql/keximigrate_mysql.desktop calligra-2.4.4/kexi/migration/mysql/keximigrate_mysql.desktop
diff -Nru calligra-2.4.3/kexi/migration/pqxx/keximigrate_pqxx.desktop calligra-2.4.4/kexi/migration/pqxx/keximigrate_pqxx.desktop
diff -Nru calligra-2.4.3/kexi/migration/sybase/keximigrate_sybase.desktop calligra-2.4.4/kexi/migration/sybase/keximigrate_sybase.desktop
diff -Nru calligra-2.4.3/kexi/migration/txt/keximigrate_txt.desktop calligra-2.4.4/kexi/migration/txt/keximigrate_txt.desktop
diff -Nru calligra-2.4.3/kexi/migration/xbase/keximigrate_xbase.desktop calligra-2.4.4/kexi/migration/xbase/keximigrate_xbase.desktop
diff -Nru calligra-2.4.3/kexi/plugins/forms/kformdesigner_kexidbfactory.desktop calligra-2.4.4/kexi/plugins/forms/kformdesigner_kexidbfactory.desktop
diff -Nru calligra-2.4.3/kexi/plugins/forms/widgets/mapbrowser/kformdesigner_mapbrowser.desktop calligra-2.4.4/kexi/plugins/forms/widgets/mapbrowser/kformdesigner_mapbrowser.desktop
diff -Nru calligra-2.4.3/kexi/plugins/forms/widgets/webbrowser/kformdesigner_webbrowser.desktop calligra-2.4.4/kexi/plugins/forms/widgets/webbrowser/kformdesigner_webbrowser.desktop
diff -Nru calligra-2.4.3/krita/plugins/filters/bumpmap/kritabumpmapfilter.desktop calligra-2.4.4/krita/plugins/filters/bumpmap/kritabumpmapfilter.desktop
diff -Nru calligra-2.4.3/krita/plugins/filters/cubismfilter/kritacubismfilter.desktop calligra-2.4.4/krita/plugins/filters/cubismfilter/kritacubismfilter.desktop
diff -Nru calligra-2.4.3/krita/plugins/filters/randompickfilter/kritarandompickfilter.desktop calligra-2.4.4/krita/plugins/filters/randompickfilter/kritarandompickfilter.desktop
diff -Nru calligra-2.4.3/krita/plugins/filters/smalltilesfilter/kritasmalltilesfilter.desktop calligra-2.4.4/krita/plugins/filters/smalltilesfilter/kritasmalltilesfilter.desktop
diff -Nru calligra-2.4.3/krita/plugins/filters/sobelfilter/kritasobelfilter.desktop calligra-2.4.4/krita/plugins/filters/sobelfilter/kritasobelfilter.desktop
diff -Nru calligra-2.4.3/krita/plugins/filters/wavefilter/kritawavefilter.desktop calligra-2.4.4/krita/plugins/filters/wavefilter/kritawavefilter.desktop
diff -Nru calligra-2.4.3/libs/flake/KoRTree.h calligra-2.4.4/libs/flake/KoRTree.h
--- calligra-2.4.3/libs/flake/KoRTree.h	2012-06-26 06:18:01.000000000 +0200
+++ calligra-2.4.4/libs/flake/KoRTree.h	2013-01-22 14:17:37.000000000 +0100
@@ -106,7 +106,7 @@
 
     /**
      * @brief Find all data rectangles
-     * The order is guaranteed to be the same as that used by values().
+     * The order is NOT guaranteed to be the same as that used by values().
      *
      * @return a list containing all the data rectangles used in the tree
      */
@@ -114,7 +114,7 @@
 
     /**
      * @brief Find all data items
-     * The order is guaranteed to be the same as that used by keys().
+     * The order is NOT guaranteed to be the same as that used by keys().
      *
      * @return a list containing all the data used in the tree
      */
diff -Nru calligra-2.4.3/libs/main/calligraversion.h calligra-2.4.4/libs/main/calligraversion.h
--- calligra-2.4.3/libs/main/calligraversion.h	2012-06-26 06:22:03.000000000 +0200
+++ calligra-2.4.4/libs/main/calligraversion.h	2013-01-22 14:22:21.000000000 +0100
@@ -33,7 +33,7 @@
 * it contains the version at compile time. See Calligra::versionString() if you need
 * the Calligra version used at runtime.
 */
-#define CALLIGRA_VERSION_STRING "2.4.3"
+#define CALLIGRA_VERSION_STRING "2.4.4"
 
 /**
  * @def CALLIGRA_VERSION_MAJOR
@@ -54,7 +54,7 @@
  * @ingroup CalligraMacros
  * @brief Release version of Calligra, at compile time
 */
-#define CALLIGRA_VERSION_RELEASE 3
+#define CALLIGRA_VERSION_RELEASE 4
 
 /**
  * @ingroup CalligraMacros
diff -Nru calligra-2.4.3/libs/main/calligraversion.h~ calligra-2.4.4/libs/main/calligraversion.h~
--- calligra-2.4.3/libs/main/calligraversion.h~	2012-06-26 06:22:03.000000000 +0200
+++ calligra-2.4.4/libs/main/calligraversion.h~	2013-01-22 14:22:21.000000000 +0100
@@ -33,7 +33,7 @@
 * it contains the version at compile time. See Calligra::versionString() if you need
 * the Calligra version used at runtime.
 */
-#define CALLIGRA_VERSION_STRING "2.4.2"
+#define CALLIGRA_VERSION_STRING "2.4.4"
 
 /**
  * @def CALLIGRA_VERSION_MAJOR
@@ -54,7 +54,7 @@
  * @ingroup CalligraMacros
  * @brief Release version of Calligra, at compile time
 */
-#define CALLIGRA_VERSION_RELEASE 2
+#define CALLIGRA_VERSION_RELEASE 4
 
 /**
  * @ingroup CalligraMacros
diff -Nru calligra-2.4.3/plan/plugins/schedulers/tj/plantjscheduler.desktop calligra-2.4.4/plan/plugins/schedulers/tj/plantjscheduler.desktop
diff -Nru calligra-2.4.3/plugins/reporting/chart/koreport_chartplugin.desktop calligra-2.4.4/plugins/reporting/chart/koreport_chartplugin.desktop
diff -Nru calligra-2.4.3/plugins/reporting/maps/koreport_mapsplugin.desktop calligra-2.4.4/plugins/reporting/maps/koreport_mapsplugin.desktop
diff -Nru calligra-2.4.3/plugins/reporting/web/koreport_webplugin.desktop calligra-2.4.4/plugins/reporting/web/koreport_webplugin.desktop
diff -Nru calligra-2.4.3/servicetypes/kofilter.desktop calligra-2.4.4/servicetypes/kofilter.desktop
diff -Nru calligra-2.4.3/servicetypes/kofilterwrapper.desktop calligra-2.4.4/servicetypes/kofilterwrapper.desktop
diff -Nru calligra-2.4.3/sheets/data/templates/General/Worksheet.desktop calligra-2.4.4/sheets/data/templates/General/Worksheet.desktop
diff -Nru calligra-2.4.3/sheets/DependencyManager.cpp calligra-2.4.4/sheets/DependencyManager.cpp
--- calligra-2.4.3/sheets/DependencyManager.cpp	2012-06-26 06:18:01.000000000 +0200
+++ calligra-2.4.4/sheets/DependencyManager.cpp	2013-01-22 14:21:54.000000000 +0100
@@ -46,8 +46,8 @@
 // gdb or from debug output to check that everything is set up ok.
 void DependencyManager::Private::dump() const
 {
-    QHash<Cell, Region>::ConstIterator mend(providers.end());
-    for (QHash<Cell, Region>::ConstIterator mit(providers.begin()); mit != mend; ++mit) {
+    QMap<Cell, Region>::ConstIterator mend(providers.end());
+    for (QMap<Cell, Region>::ConstIterator mit(providers.begin()); mit != mend; ++mit) {
         Cell cell = mit.key();
 
         QStringList debugStr;
@@ -60,12 +60,11 @@
     }
 
     foreach(Sheet* sheet, consumers.keys()) {
-        QList<QRectF> keys = consumers[sheet]->keys();
-        QList<Cell> values = consumers[sheet]->values();
+        const QList< QPair<QRectF, Cell> > pairs = consumers[sheet]->intersectingPairs(QRect(1, 1, KS_colMax, KS_rowMax)).values();
         QHash<QString, QString> table;
-        for (int i = 0; i < keys.count(); ++i) {
-            Region tmpRange(keys[i].toRect(), sheet);
-            table.insertMulti(tmpRange.name(), values[i].name());
+        for (int i = 0; i < pairs.count(); ++i) {
+            Region tmpRange(pairs[i].first.toRect(), sheet);
+            table.insertMulti(tmpRange.name(), pairs[i].second.name());
         }
         foreach(QString uniqueKey, table.uniqueKeys()) {
             QStringList debugStr(table.values(uniqueKey));
@@ -190,7 +189,6 @@
     d->depths.clear();
 
     int cellsCount = 9;
-    int cellCurrent = 0;
 
     if (updater) {
         updater->setProgress(0);
@@ -200,20 +198,31 @@
     }
 
     Cell cell;
+    int cellCurrent = 0;
     foreach(const Sheet* sheet, map->sheetList()) {
         for (int c = 0; c < sheet->formulaStorage()->count(); ++c, ++cellCurrent) {
             cell = Cell(sheet, sheet->formulaStorage()->col(c), sheet->formulaStorage()->row(c));
 
             d->generateDependencies(cell, sheet->formulaStorage()->data(c));
+            if (!sheet->formulaStorage()->data(c).isValid())
+                cell.setValue(Value::errorPARSE());
+
+            if (updater)
+                updater->setProgress(int(qreal(cellCurrent) / qreal(cellsCount) * 50.));
+        }
+    }
+    cellCurrent = 0;
+    foreach(const Sheet* sheet, map->sheetList()) {
+        for (int c = 0; c < sheet->formulaStorage()->count(); ++c, ++cellCurrent) {
+            cell = Cell(sheet, sheet->formulaStorage()->col(c), sheet->formulaStorage()->row(c));
+
             if (!d->depths.contains(cell)) {
                 int depth = d->computeDepth(cell);
                 d->depths.insert(cell , depth);
             }
-            if (!sheet->formulaStorage()->data(c).isValid())
-                cell.setValue(Value::errorPARSE());
 
             if (updater)
-                updater->setProgress(int(qreal(cellCurrent) / qreal(cellsCount) * 100.));
+                updater->setProgress(50 + int(qreal(cellCurrent) / qreal(cellsCount) * 50.));
         }
     }
 
@@ -429,33 +438,13 @@
 
         int bottom = range.bottom();
         if (bottom > cells->rows()) bottom = cells->rows();
+        int right = range.right();
+        if (right > cells->columns()) right = cells->columns();
 
         for (int row = range.top(); row <= bottom; ++row) {
-            int col = 0;
-            Formula formula = sheet->formulaStorage()->firstInRow(row, &col);
-            if (col > 0 && col < range.left())
-                formula = sheet->formulaStorage()->nextInRow(col, row, &col);
-            while (col != 0 && col <= range.right()) {
+            for (int col = range.left(); col <= right; ++col) {
                 Cell cell(sheet, col, row);
-
-                // compute the cell depth and automatically the depths of its providers
-                int depth = computeDepth(cell);
-                depths.insert(cell, depth);
-
-                // compute the consumers' depths
-                QHash<Sheet*, RTree<Cell>*>::ConstIterator cit = consumers.constFind(cell.sheet());
-                if (cit == consumers.constEnd()) {
-                    formula = sheet->formulaStorage()->nextInRow(col, row, &col);
-                    continue;
-                }
-
-                const QList<Cell> consumers = cit.value()->contains(cell.cellPosition());
-                foreach (const Cell &c, consumers) {
-                    if (!region.contains(c.cellPosition(), c.sheet()))
-                        generateDepths(c, computedDepths);
-                }
-
-                formula = sheet->formulaStorage()->nextInRow(col, row, &col);
+                generateDepths(cell, computedDepths);
             }
         }
     }
diff -Nru calligra-2.4.3/sheets/Sheet.cpp calligra-2.4.4/sheets/Sheet.cpp
--- calligra-2.4.3/sheets/Sheet.cpp	2012-06-26 06:21:31.000000000 +0200
+++ calligra-2.4.4/sheets/Sheet.cpp	2013-01-22 14:21:54.000000000 +0100
@@ -842,10 +842,10 @@
         newPoint += QString::number(row);
 
     if (((ref == ColumnRemove
-            && col == pos.x() // Column is the deleted one : error
+            && (col >= pos.x() && col < pos.x() + nbCol) // Column is the deleted one : error
             && (fullRowOrColumn || row == pos.y())) ||
             (ref == RowRemove
-             && row == pos.y() // Row is the deleted one : error
+             && (row >= pos.y() && row < pos.y() + nbCol) // Row is the deleted one : error
              && (fullRowOrColumn || col == pos.x())) ||
             (ref == ColumnInsert
              && col + nbCol > KS_colMax
diff -Nru calligra-2.4.3/sheets/tests/TestDependencies.cpp calligra-2.4.4/sheets/tests/TestDependencies.cpp
--- calligra-2.4.3/sheets/tests/TestDependencies.cpp	2012-06-26 06:18:02.000000000 +0200
+++ calligra-2.4.4/sheets/tests/TestDependencies.cpp	2013-01-22 14:17:37.000000000 +0100
@@ -83,6 +83,31 @@
     QCOMPARE(m_storage->value(1, 3), Value::errorCIRCLE());
 }
 
+void TestDependencies::testDepths()
+{
+    Cell a1(m_sheet, 1, 1); a1.setUserInput("5");
+    Cell a2(m_sheet, 1, 2); a2.setUserInput("=A1");
+    Cell a3(m_sheet, 1, 3); a3.setUserInput("=A2");
+    Cell a4(m_sheet, 1, 4); a4.setUserInput("=A1 + A3");
+
+    QApplication::processEvents(); // handle Damages
+    
+    QMap<Cell, int> depths = m_map->dependencyManager()->depths();
+    QCOMPARE(depths[a1], 0);
+    QCOMPARE(depths[a2], 1);
+    QCOMPARE(depths[a3], 2);
+    QCOMPARE(depths[a4], 3);
+
+    a2.setUserInput("");
+    QApplication::processEvents(); // handle Damages
+    
+    depths = m_map->dependencyManager()->depths();
+    QCOMPARE(depths[a1], 0);
+    QCOMPARE(depths[a2], 0);
+    QCOMPARE(depths[a3], 1);
+    QCOMPARE(depths[a4], 2);
+}
+
 void TestDependencies::cleanupTestCase()
 {
     delete m_map;
diff -Nru calligra-2.4.3/sheets/tests/TestDependencies.h calligra-2.4.4/sheets/tests/TestDependencies.h
--- calligra-2.4.3/sheets/tests/TestDependencies.h	2012-06-26 06:18:02.000000000 +0200
+++ calligra-2.4.4/sheets/tests/TestDependencies.h	2013-01-22 14:17:37.000000000 +0100
@@ -39,6 +39,7 @@
     void initTestCase();
     void testCircleRemoval();
     void testCircles();
+    void testDepths();
     void cleanupTestCase();
 
 private:
diff -Nru calligra-2.4.3/sheets/tests/TestSheet.cpp calligra-2.4.4/sheets/tests/TestSheet.cpp
--- calligra-2.4.3/sheets/tests/TestSheet.cpp	2012-06-26 06:18:02.000000000 +0200
+++ calligra-2.4.4/sheets/tests/TestSheet.cpp	2013-01-22 14:21:54.000000000 +0100
@@ -67,37 +67,50 @@
 
 void SheetTest::testRemoveRows_data()
 {
+    QTest::addColumn<int>("col");
+    QTest::addColumn<int>("row");
     QTest::addColumn<QString>("formula");
     QTest::addColumn<int>("rowToRemove");
+    QTest::addColumn<int>("numRows");
     QTest::addColumn<QString>("result");
 
-    QTest::newRow("exact row")   << "=C4" << 4 << "=#Dependency!";
-    QTest::newRow("earlier row") << "=C4" << 3 << "=C3";
-    QTest::newRow("later row")   << "=C4" << 5 << "=C4";
-
-    QTest::newRow("range before start") << "=SUM(C4:C7)" << 3 << "=SUM(C3:C6)";
-    QTest::newRow("range start row")    << "=SUM(C4:C7)" << 4 << "=SUM(C4:C6)";
-    QTest::newRow("range middle row")   << "=SUM(C4:C7)" << 5 << "=SUM(C4:C6)";
-    QTest::newRow("range end row")      << "=SUM(C4:C7)" << 7 << "=SUM(C4:C6)";
-    QTest::newRow("range after end")    << "=SUM(C4:C7)" << 8 << "=SUM(C4:C7)";
-    QTest::newRow("entire range")       << "=SUM(C4:C4)" << 4 << "=SUM(#Dependency!:#Dependency!)";
-
-    QTest::newRow("2d range before start") << "=SUM(C4:E7)" << 3 << "=SUM(C3:E6)";
-    QTest::newRow("2d range start row")    << "=SUM(C4:E7)" << 4 << "=SUM(C4:E6)";
-    QTest::newRow("2d range middle row")   << "=SUM(C4:E7)" << 5 << "=SUM(C4:E6)";
-    QTest::newRow("2d range end row")      << "=SUM(C4:E7)" << 7 << "=SUM(C4:E6)";
-    QTest::newRow("2d range after end")    << "=SUM(C4:E7)" << 8 << "=SUM(C4:E7)";
+    QTest::newRow("exact row")   << 1 << 1 << "=C4" << 4 << 1 << "=#Dependency!";
+    QTest::newRow("earlier row") << 1 << 1 << "=C4" << 3 << 1 << "=C3";
+    QTest::newRow("later row")   << 1 << 1 << "=C4" << 5 << 1 << "=C4";
+
+    QTest::newRow("range before start") << 1 << 1 << "=SUM(C4:C7)" << 3 << 1 << "=SUM(C3:C6)";
+    QTest::newRow("range start row")    << 1 << 1 << "=SUM(C4:C7)" << 4 << 1 << "=SUM(C4:C6)";
+    QTest::newRow("range middle row")   << 1 << 1 << "=SUM(C4:C7)" << 5 << 1 << "=SUM(C4:C6)";
+    QTest::newRow("range end row")      << 1 << 1 << "=SUM(C4:C7)" << 7 << 1 << "=SUM(C4:C6)";
+    QTest::newRow("range after end")    << 1 << 1 << "=SUM(C4:C7)" << 8 << 1 << "=SUM(C4:C7)";
+    QTest::newRow("entire range")       << 1 << 1 << "=SUM(C4:C4)" << 4 << 1 << "=SUM(#Dependency!:#Dependency!)";
+
+    QTest::newRow("2d range before start") << 1 << 1 << "=SUM(C4:E7)" << 3 << 1 << "=SUM(C3:E6)";
+    QTest::newRow("2d range start row")    << 1 << 1 << "=SUM(C4:E7)" << 4 << 1 << "=SUM(C4:E6)";
+    QTest::newRow("2d range middle row")   << 1 << 1 << "=SUM(C4:E7)" << 5 << 1 << "=SUM(C4:E6)";
+    QTest::newRow("2d range end row")      << 1 << 1 << "=SUM(C4:E7)" << 7 << 1 << "=SUM(C4:E6)";
+    QTest::newRow("2d range after end")    << 1 << 1 << "=SUM(C4:E7)" << 8 << 1 << "=SUM(C4:E7)";
+
+    QTest::newRow("refer to last deleted row")      << 1 << 1 << "=A4" << 2 << 3 << "=#Dependency!";
+    QTest::newRow("refer to first not deleted row") << 1 << 1 << "=A4" << 2 << 2 << "=A2";
+
+    // Bug 313056
+    QTest::newRow("bug313056_1") << 4 << 5 << "=A1" << 3 << 2 << "=A1";
+    QTest::newRow("bug313056_2") << 2 << 32 << "=E9" << 5 << 26 << "=#Dependency!";
 }
 
 void SheetTest::testRemoveRows()
 {
+    QFETCH(int, col);
+    QFETCH(int, row);
     QFETCH(QString, formula);
     QFETCH(int, rowToRemove);
+    QFETCH(int, numRows);
     QFETCH(QString, result);
 
-    Cell cell(m_sheet, 1, 1);
+    Cell cell(m_sheet, col, row);
     cell.setUserInput(formula);
-    m_sheet->removeRows(rowToRemove, 1);
+    m_sheet->removeRows(rowToRemove, numRows);
 
     QCOMPARE(cell.userInput(), result);
 }
diff -Nru calligra-2.4.3/words/templates/Wordprocessing/A4.desktop calligra-2.4.4/words/templates/Wordprocessing/A4.desktop
diff -Nru calligra-2.4.3/words/templates/Wordprocessing/ProfessionalA4.desktop calligra-2.4.4/words/templates/Wordprocessing/ProfessionalA4.desktop
diff -Nru calligra-2.4.3/words/templates/Wordprocessing/ProfessionalLetter.desktop calligra-2.4.4/words/templates/Wordprocessing/ProfessionalLetter.desktop

Reply via email to