[gnumeric] avoid strange error message when trying to "goto" a non-address name
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] avoid strange error message when trying to "goto" a non-address name
- Date: Tue, 15 Jun 2010 23:12:28 +0000 (UTC)
commit 23789dc7f2ff0982cee30a6e66cc73f93dd98105
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Tue Jun 15 17:11:25 2010 -0600
avoid strange error message when trying to "goto" a non-address name
2010-06-15 Andreas J. Guelzow <aguelzow pyrshep ca>
* dialog-goto-cell.c (cb_load_names): only load names that are in
fact addresses.
(cb_dialog_goto_selection_changed): only try to go to addresses
src/dialogs/ChangeLog | 6 ++++++
src/dialogs/dialog-goto-cell.c | 31 ++++++++++++++-----------------
2 files changed, 20 insertions(+), 17 deletions(-)
---
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index ca7ce17..d17018c 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,5 +1,11 @@
2010-06-15 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * dialog-goto-cell.c (cb_load_names): only load names that are in
+ fact addresses.
+ (cb_dialog_goto_selection_changed): only try to go to addresses
+
+2010-06-15 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* dialog-formula-guru.c (dialog_formula_guru_adjust_children): load
tooltip
(dialog_formula_guru_init): set up tooltips
diff --git a/src/dialogs/dialog-goto-cell.c b/src/dialogs/dialog-goto-cell.c
index 45dd9b7..039c025 100644
--- a/src/dialogs/dialog-goto-cell.c
+++ b/src/dialogs/dialog-goto-cell.c
@@ -136,20 +136,16 @@ cb_load_names (G_GNUC_UNUSED gpointer key,
GnmNamedExpr *nexpr, LoadNames *user)
{
GtkTreeIter iter;
- char *expr_name = NULL;
-
- gtk_tree_store_append (user->state->model, &iter, &user->iter);
-
- if (nexpr->pos.sheet != NULL)
- expr_name = g_strdup_printf ("%s!%s",
- nexpr->pos.sheet->name_unquoted,
- expr_name_name (nexpr));
- gtk_tree_store_set (user->state->model, &iter,
- ITEM_NAME, expr_name ? expr_name : expr_name_name (nexpr),
- SHEET_POINTER, nexpr->pos.sheet,
- EXPRESSION, nexpr,
- -1);
- g_free (expr_name);
+ gboolean is_address = gnm_expr_top_is_rangeref (nexpr->texpr);
+
+ if (is_address) {
+ gtk_tree_store_append (user->state->model, &iter, &user->iter);
+ gtk_tree_store_set (user->state->model, &iter,
+ ITEM_NAME, expr_name_name (nexpr),
+ SHEET_POINTER, nexpr->pos.sheet,
+ EXPRESSION, nexpr,
+ -1);
+ }
}
static void
@@ -204,7 +200,7 @@ cb_dialog_goto_selection_changed (GtkTreeSelection *the_selection, GotoState *st
SHEET_POINTER, &sheet,
EXPRESSION, &name,
-1);
- if (name) {
+ if (name && gnm_expr_top_is_rangeref (name->texpr)) {
GnmParsePos pp;
char *where_to;
@@ -276,8 +272,9 @@ dialog_goto_init (GotoState *state)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled),
GTK_SHADOW_ETCHED_IN);
- state->model = gtk_tree_store_new (NUM_COLMNS, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_POINTER, G_TYPE_POINTER);
+ state->model = gtk_tree_store_new (NUM_COLMNS, G_TYPE_STRING,
+ G_TYPE_STRING, G_TYPE_POINTER,
+ G_TYPE_POINTER);
state->treeview = GTK_TREE_VIEW (
gtk_tree_view_new_with_model (GTK_TREE_MODEL (state->model)));
state->selection = gtk_tree_view_get_selection (state->treeview);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]