[gnumeric] Fix enabling of modify comment or hyperlink. [#655877]



commit 56d1e1bc3acd8e3610f4a8feba39d58d9414a872
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu Aug 4 00:23:16 2011 -0600

    Fix enabling of modify comment or hyperlink. [#655877]
    
    2011-08-04 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/commands.c (cmd_set_comment_apply): enable aprpopriate actions
    	(cmd_hyperlink_undo): ditto
    	(cmd_hyperlink_redo): ditto

 ChangeLog      |    6 ++++++
 NEWS           |    1 +
 src/commands.c |   15 ++++++++++++++-
 3 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6d6324d..36d044e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-04 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* src/commands.c (cmd_set_comment_apply): enable aprpopriate actions
+	(cmd_hyperlink_undo): ditto
+	(cmd_hyperlink_redo): ditto
+
 2011-08-03  Jean Brefort  <jean brefort normalesup org>
 
 	* component/gnumeric.c: update component.
diff --git a/NEWS b/NEWS
index cea1028..642c8e8 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ Andreas:
 	* Use formatting attributes whenever we format numbers. 
 	[#584380][#651561]
 	* Clarify the distinction beween open/save and import/export.
+	* FIx enabling of modify comment or hyperlink. [#655877]
 
 Jean:
 	* Make things build against gtk+-3.0.
diff --git a/src/commands.c b/src/commands.c
index 291678d..f01af98 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -5039,6 +5039,7 @@ cmd_set_comment_apply (Sheet *sheet, GnmCellPos *pos,
 		       char const *author)
 {
 	GnmComment   *comment;
+	Workbook *wb = sheet->workbook;
 
 	comment = sheet_get_comment (sheet, pos);
 	if (comment) {
@@ -5063,6 +5064,10 @@ cmd_set_comment_apply (Sheet *sheet, GnmCellPos *pos,
 		cell_set_comment (sheet, pos, author, text, attributes);
 	}
 	sheet_mark_dirty (sheet);
+
+	WORKBOOK_FOREACH_CONTROL (wb, view, ctl,
+			wb_control_menu_state_update (ctl, MS_COMMENT_LINKS););
+
 	return FALSE;
 }
 
@@ -7140,6 +7145,7 @@ cmd_hyperlink_undo (GnmCommand *cmd,
 {
 	CmdHyperlink *me = CMD_HYPERLINK (cmd);
 	GSList *l;
+	Workbook *wb = wb_control_get_workbook (wbc);
 
 	g_return_val_if_fail (me != NULL, TRUE);
 
@@ -7172,6 +7178,9 @@ cmd_hyperlink_undo (GnmCommand *cmd,
 
 	select_selection (me->cmd.sheet, me->selection, wbc);
 
+	WORKBOOK_FOREACH_CONTROL (wb, view, ctl,
+			wb_control_menu_state_update (ctl, MS_COMMENT_LINKS););
+
 	return FALSE;
 }
 
@@ -7180,6 +7189,7 @@ cmd_hyperlink_redo (GnmCommand *cmd, WorkbookControl *wbc)
 {
 	CmdHyperlink *me = CMD_HYPERLINK (cmd);
 	GSList *l;
+	Workbook *wb = wb_control_get_workbook (wbc);
 
 	g_return_val_if_fail (me != NULL, TRUE);
 
@@ -7212,6 +7222,9 @@ cmd_hyperlink_redo (GnmCommand *cmd, WorkbookControl *wbc)
 
 	select_selection (me->cmd.sheet, me->selection, wbc);
 
+	WORKBOOK_FOREACH_CONTROL (wb, view, ctl,
+			wb_control_menu_state_update (ctl, MS_COMMENT_LINKS););
+
 	return FALSE;
 }
 
@@ -7380,7 +7393,7 @@ cmd_so_set_links_redo (GnmCommand *cmd, G_GNUC_UNUSED WorkbookControl *wbc)
 }
 
 static gboolean
-cmd_so_set_links_undo (GnmCommand *cmd, G_GNUC_UNUSED  WorkbookControl *wbc)
+cmd_so_set_links_undo (GnmCommand *cmd, WorkbookControl *wbc)
 {
 	return cmd_so_set_links_redo (cmd, wbc);
 }



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