[gnumeric] We don't want to duplicate GnmConventions



commit 3314f46ebec0c8849e6a5be4a6d7679c476dbbff
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu May 26 13:22:16 2011 -0600

    We don't want to duplicate GnmConventions
    
    2011-05-26  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/parse-util.h (gnm_conventions_dup): delete again
    	* src/parse-util.c (gnm_conventions_dup): delete again
    	* src/workbook-control.c (wb_control_parse_and_jump): use
    	existing GnmConventions

 ChangeLog              |    7 +++++++
 src/parse-util.c       |    7 -------
 src/parse-util.h       |    1 -
 src/workbook-control.c |   19 +++++++++++++------
 4 files changed, 20 insertions(+), 14 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0eb7ad7..592d80b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2011-05-26  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* src/parse-util.h (gnm_conventions_dup): delete again
+	* src/parse-util.c (gnm_conventions_dup): delete again
+	* src/workbook-control.c (wb_control_parse_and_jump): use
+	existing GnmConventions
+
+2011-05-26  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* src/workbook.c (workbook_sheet_state_size): adjust scale
 	(cmd_reorganize_sheets): use workbook_sheet_state_size
 
diff --git a/src/parse-util.c b/src/parse-util.c
index 34584ea..ac00a83 100644
--- a/src/parse-util.c
+++ b/src/parse-util.c
@@ -1399,13 +1399,6 @@ gnm_conventions_new (void)
 	return gnm_conventions_new_full (sizeof (GnmConventions));
 }
 
-GnmConventions *
-gnm_conventions_dup (GnmConventions const *c)
-{
-	GnmConventions *conv = g_memdup (c, sizeof (GnmConventions));
-	conv->ref_count = 1;
-}
-
 /**
  * gnm_conventions_unref :
  * @c : #GnmConventions
diff --git a/src/parse-util.h b/src/parse-util.h
index 2dc6dc9..1b0b39c 100644
--- a/src/parse-util.h
+++ b/src/parse-util.h
@@ -200,7 +200,6 @@ struct _GnmConventions {
 };
 GnmConventions *gnm_conventions_new	 (void);
 GnmConventions *gnm_conventions_new_full (unsigned size);
-GnmConventions *gnm_conventions_dup	 (GnmConventions const*c);
 
 GnmConventions *gnm_conventions_ref	 (GnmConventions *c);
 void		gnm_conventions_unref	 (GnmConventions *c);
diff --git a/src/workbook-control.c b/src/workbook-control.c
index 9697537..a0f65ce 100644
--- a/src/workbook-control.c
+++ b/src/workbook-control.c
@@ -282,18 +282,25 @@ wb_control_parse_and_jump (WorkbookControl *wbc, char const *text)
 						   GNM_EXPR_PARSE_DEFAULT);
 	if (target == NULL) {
 		GnmExprTop const *texpr;
-		GnmConventions *convs = gnm_conventions_dup 
-			(sheet_get_conventions(sv->sheet));
-		convs->r1c1_addresses = !convs->r1c1_addresses;
-		
+
 		texpr = gnm_expr_parse_str 
-			(text, &pp, GNM_EXPR_PARSE_DEFAULT, convs, NULL);
+			(text, &pp, GNM_EXPR_PARSE_DEFAULT, 
+			 gnm_conventions_xls_r1c1, NULL);
 		if (texpr != NULL)  {
 			target = gnm_expr_top_get_range (texpr);
 			gnm_expr_top_unref (texpr);
 		}
+	}
+	if (target == NULL) {
+		GnmExprTop const *texpr;
 
-		gnm_conventions_unref (convs);
+		texpr = gnm_expr_parse_str 
+			(text, &pp, GNM_EXPR_PARSE_DEFAULT, 
+			 gnm_conventions_default, NULL);
+		if (texpr != NULL)  {
+			target = gnm_expr_top_get_range (texpr);
+			gnm_expr_top_unref (texpr);
+		}
 	}
 	
 	if (target == NULL) {



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