[gnumeric] Fix cell-clearing/autofilter interaction. [#674814]



commit 3671619d1a76feb0f9cab500b8f62cdbe58bb8a3
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Fri Jun 15 00:20:43 2012 -0600

    Fix cell-clearing/autofilter interaction. [#674814]
    
    2012-06-14  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/sheet-object.c (sheet_objects_clear): filter-combos are not
    	included in "all objects"

 ChangeLog          |    5 +++++
 NEWS               |    1 +
 src/sheet-object.c |   18 +++++++++++-------
 3 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fe85c27..ee58db6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-14  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* src/sheet-object.c (sheet_objects_clear): filter-combos are not
+	included in "all objects"
+
 2012-06-12  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* src/commands.c (cmd_analysis_tool_undo): update wbc
diff --git a/NEWS b/NEWS
index 6f65c9c..a871620 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ Andreas:
 	* Fix random generator/new view combination crash. [#677956]
 	* Improve Mann-Whitney test to allow for two separate data ranges.
 	* Fix custom colour combos for conditional format selection. [#677967]
+	* Fix cell-clearing/autofilter interaction. [#674814]
 
 Jean:
 	* Fix graph series headers when a multiple selection is used. [#675913]
diff --git a/src/sheet-object.c b/src/sheet-object.c
index d421356..33d87bc 100644
--- a/src/sheet-object.c
+++ b/src/sheet-object.c
@@ -34,6 +34,7 @@
 #include "sheet-object-widget.h"
 #include "sheet-object-graph.h"
 #include "sheet-object-image.h"
+#include "sheet-filter-combo.h"
 #include "wbc-gtk-impl.h"
 #include "graph.h"
 #include "print.h"
@@ -356,7 +357,7 @@ sheet_object_init (GObject *object)
 }
 
 static void
-so_default_size (SheetObject const *so, double *width, double *height)
+so_default_size (G_GNUC_UNUSED SheetObject const *so, double *width, double *height)
 {
 	/* Provide some defaults (derived classes may want to override) */
 	*width  = 72.;
@@ -584,7 +585,7 @@ sheet_object_clear_sheet (SheetObject *so)
 }
 
 static void
-cb_sheet_object_invalidate_sheet (GnmDependent *dep, SheetObject *so, gpointer user)
+cb_sheet_object_invalidate_sheet (GnmDependent *dep, G_GNUC_UNUSED SheetObject *so, gpointer user)
 {
 	Sheet *sheet = user;
 	GnmExprRelocateInfo rinfo;
@@ -894,15 +895,15 @@ sheet_objects_relocate (GnmExprRelocateInfo const *rinfo, gboolean update,
 {
 	GSList   *ptr, *next;
 	GnmRange	 dest;
-	gboolean clear, change_sheets;
+	gboolean change_sheets;
 
 	g_return_if_fail (rinfo != NULL);
 	g_return_if_fail (IS_SHEET (rinfo->origin_sheet));
 	g_return_if_fail (IS_SHEET (rinfo->target_sheet));
 
 	dest = rinfo->origin;
-	clear = range_translate (&dest, rinfo->target_sheet,
-				 rinfo->col_offset, rinfo->row_offset);
+	range_translate (&dest, rinfo->target_sheet,
+			 rinfo->col_offset, rinfo->row_offset);
 	change_sheets = (rinfo->origin_sheet != rinfo->target_sheet);
 
 	/* Clear the destination range on the target sheet */
@@ -1005,7 +1006,8 @@ sheet_objects_clear (Sheet const *sheet, GnmRange const *r, GType t,
 	for (ptr = sheet->sheet_objects; ptr != NULL ; ptr = next ) {
 		GObject *obj = G_OBJECT (ptr->data);
 		next = ptr->next;
-		if (t == G_TYPE_NONE || t == G_OBJECT_TYPE (obj)) {
+		if ((t == G_TYPE_NONE && G_OBJECT_TYPE (obj) != GNM_FILTER_COMBO_TYPE) 
+		    || t == G_OBJECT_TYPE (obj)) {
 			SheetObject *so = SHEET_OBJECT (obj);
 			if (r == NULL || range_contained (&so->anchor.cell_bound, r))
 				clear_sheet (so, pundo);
@@ -1126,7 +1128,7 @@ sheet_object_direction_set (SheetObject *so, gdouble const *coords)
  * Return Value:
  **/
 gboolean
-sheet_object_rubber_band_directly (SheetObject const *so)
+sheet_object_rubber_band_directly (G_GNUC_UNUSED SheetObject const *so)
 {
 	return FALSE;
 }
@@ -1433,6 +1435,7 @@ sheet_object_imageable_get_type (void)
 			sizeof (SheetObjectImageableIface), /* class_size */
 			NULL,				/* base_init */
 			NULL,				/* base_finalize */
+			NULL, NULL, NULL, 0, 0, NULL, NULL
 		};
 
 		type = g_type_register_static (G_TYPE_INTERFACE,
@@ -1476,6 +1479,7 @@ sheet_object_exportable_get_type (void)
 			sizeof (SheetObjectExportableIface), /* class_size */
 			NULL,				/* base_init */
 			NULL,				/* base_finalize */
+			NULL, NULL, NULL, 0, 0, NULL, NULL
 		};
 
 		type = g_type_register_static (G_TYPE_INTERFACE,



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