[gnumeric] Fix empty cell handling of the advanced filter. [#599064]



commit a0543fb1af997a96102ed37866f3e740482dbb91
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Mon Dec 28 10:05:40 2009 -0700

    Fix empty cell handling of the advanced filter. [#599064]
    
    2009-12-28  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/value.c (find_rows_that_match): make this behave like
    	  find_cells_that_match from the database plugin.

 ChangeLog                       |    5 +++++
 NEWS                            |    1 +
 plugins/fn-database/functions.c |    3 +++
 src/value.c                     |   11 +++++------
 4 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ab61925..c5b8cd1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-12-28  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* src/value.c (find_rows_that_match): make this behave like
+	  find_cells_that_match from the database plugin.
+
+2009-12-28  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* src/wbc-gtk.c (cb_sheet_label_button_press): unselect sheet 
 	  objects if necessary and possible
 
diff --git a/NEWS b/NEWS
index 4c5b32b..6708bd3 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Andreas:
 	* Allow the sheet object name to be specified. [#596545]
 	* Add menu item to select sheet objects. [#338615]
 	* Enable sheet tab menu when objects are selected. [#604496]
+	* Fix empty cell handling of the advanced filter. [#599064]
 
 Jean
 	* Fix import export of line type in scatter plots. [#605043]
diff --git a/plugins/fn-database/functions.c b/plugins/fn-database/functions.c
index 0a68381..acc6a55 100644
--- a/plugins/fn-database/functions.c
+++ b/plugins/fn-database/functions.c
@@ -91,6 +91,9 @@ GNM_PLUGIN_MODULE_HEADER;
  * find_cells_that_match :
  * Finds the cells from the given column that match the criteria.
  */
+
+#warning  We should really be using find_rows_that_match from value.c
+
 static GSList *
 find_cells_that_match (Sheet *sheet, GnmValue const *database,
 		       int col, GSList *criterias)
diff --git a/src/value.c b/src/value.c
index 8e5fbe6..001eaa8 100644
--- a/src/value.c
+++ b/src/value.c
@@ -1766,13 +1766,12 @@ find_rows_that_match (Sheet *sheet, int first_col, int first_row,
 			     cond_ptr != NULL ; cond_ptr = cond_ptr->next) {
 				GnmCriteria *cond = cond_ptr->data;
 				test_cell = sheet_cell_get (sheet, cond->column, row);
-				if (test_cell != NULL) {
+				if (test_cell != NULL)
 					gnm_cell_eval (test_cell);
-					if (!gnm_cell_is_empty (test_cell) &&
-					    !cond->fun (test_cell->value, cond)) {
-						add_flag = FALSE;
-						break;
-					}
+				if (gnm_cell_is_empty (test_cell) ||
+				    !cond->fun (test_cell->value, cond)) {
+					add_flag = FALSE;
+					break;
 				}
 			}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]