[gnumeric] Use current style when editing a style from teh conditional format dialog



commit bd13bf3040ce08660ae34b5609c3816de48e907c
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Sun Jul 10 13:10:46 2011 -0600

    Use current style when editing a style from teh conditional format dialog
    
     2011-07-10 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* dialogs.h (dialog_cell_format_select_style): add style argument
    	* dialog-cell-format-cond.c (cb_c_fmt_dialog_edit_style_button):
    	pass style to dialog_cell_format_select_style
    	* dialog-cell-format.c (dialog_cell_format_select_style): use
    	passed style

 src/dialogs/ChangeLog                 |    8 ++++++++
 src/dialogs/dialog-cell-format-cond.c |    5 ++++-
 src/dialogs/dialog-cell-format.c      |    9 ++++++++-
 src/dialogs/dialogs.h                 |    1 +
 4 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index df6d3d4..f8ddb3f 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,5 +1,13 @@
 2011-07-10 Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* dialogs.h (dialog_cell_format_select_style): add style argument
+	* dialog-cell-format-cond.c (cb_c_fmt_dialog_edit_style_button):
+	pass style to dialog_cell_format_select_style
+	* dialog-cell-format.c (dialog_cell_format_select_style): use
+	passed style
+
+2011-07-10 Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* cell-format-cond.ui: fix resize behaviour
 
 2011-07-10 Andreas J. Guelzow <aguelzow pyrshep ca>
diff --git a/src/dialogs/dialog-cell-format-cond.c b/src/dialogs/dialog-cell-format-cond.c
index 45b1d5f..17d24c3 100644
--- a/src/dialogs/dialog-cell-format-cond.c
+++ b/src/dialogs/dialog-cell-format-cond.c
@@ -275,8 +275,11 @@ cb_c_fmt_dialog_edit_style_button (G_GNUC_UNUSED GtkWidget *btn, CFormatState *s
 	pages |= cb_c_fmt_dialog_chooser_check_page 
 		(state, "check-validation", FD_VALIDATION);
 
+	if (state->editor.style != NULL)
+		gnm_style_ref (state->editor.style);
 	dialog_cell_format_select_style (state->wbcg, pages, 
-					 GTK_WINDOW (state->dialog), state);
+					 GTK_WINDOW (state->dialog), 
+					 state->editor.style, state);
 }
 
 static GnmStyleCond *
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index f11a281..1678d99 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -2524,7 +2524,8 @@ dialog_cell_format (WBCGtk *wbcg, FormatDialogPosition_t pageno)
 
 void
 dialog_cell_format_select_style (WBCGtk *wbcg, gint pages, 
-				 GtkWindow *w, gpointer closure)
+				 GtkWindow *w,
+				 GnmStyle *style, gpointer closure)
 {
 	FormatState  *state;
 	gint i;
@@ -2541,6 +2542,12 @@ dialog_cell_format_select_style (WBCGtk *wbcg, gint pages,
 	state->style_selector.closure = closure;
 	state->selection_mask	= 1;
 
+	if (style) {
+		gnm_style_unref (state->style);
+		state->style = style;
+		state->conflicts = 0;
+	}
+
 	fmt_dialog_impl (state, FD_BACKGROUND);
 
 	for (i = 0; i <= FD_LAST; i++) {
diff --git a/src/dialogs/dialogs.h b/src/dialogs/dialogs.h
index 3beab05..4086663 100644
--- a/src/dialogs/dialogs.h
+++ b/src/dialogs/dialogs.h
@@ -25,6 +25,7 @@ void	 dialog_cell_format	(WBCGtk *wbcg,
 				 FormatDialogPosition_t pageno);
 void	 dialog_cell_format_select_style (WBCGtk *wbcg,
 					  gint pages, GtkWindow *w,
+					  GnmStyle *style,
 					  gpointer closure);
 void	 dialog_cell_format_cond (WBCGtk *wbcg);
 void     dialog_cell_format_style_added (gpointer closure, GnmStyle *style);



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