[gnumeric] xls: fix FMR in debug code.



commit 2cee0a5121789a9ba3a8494414b3cc80b2edf925
Author: Morten Welinder <terra gnome org>
Date:   Fri Oct 9 10:44:47 2009 -0400

    xls: fix FMR in debug code.

 plugins/excel/ChangeLog        |    6 ++++++
 plugins/excel/ms-excel-read.c  |    4 ++--
 plugins/excel/ms-excel-write.c |    2 +-
 plugins/excel/ms-obj.c         |    2 ++
 plugins/excel/ms-obj.h         |    1 +
 5 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index bed5e15..9f6c9ae 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-09  Morten Welinder  <terra gnome org>
+
+	* ms-excel-read.c (excel_read_NAME): Fix FMR in debug code.
+
+	* ms-obj.c (ms_obj_read_biff8_obj): Read the macro reference too.
+
 2009-10-08  Morten Welinder  <terra gnome org>
 
 	* ms-escher.c (ms_escher_opt_add_bool): New function.
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index c239099..36becd5 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -3557,7 +3557,7 @@ excel_read_NAME (BiffQuery *q, GnmXLImporter *importer, ExcelReadSheet *esheet)
 
 	if (name != NULL) {
 		Sheet *sheet = NULL;
-		d (1, fprintf (stderr, "NAME : %s, sheet_index = %hu", name, sheet_index););
+		d (1, fprintf (stderr, "NAME : %s, sheet_index = %hu ", name, sheet_index););
 		if (sheet_index > 0) {
 			/* NOTE : the docs lie the index for biff7 is
 			 * indeed a reference to the externsheet
@@ -3631,7 +3631,7 @@ excel_read_NAME (BiffQuery *q, GnmXLImporter *importer, ExcelReadSheet *esheet)
 		status_txt = excel_get_text_fixme (importer, data, status_txt_len, NULL);
 
 		g_printerr ("Name record: '%s', '%s', '%s', '%s', '%s'\n",
-			name ? name : "(null)",
+			nexpr ? expr_name_name (nexpr) : "(null)",
 			menu_txt ? menu_txt : "(null)",
 			descr_txt ? descr_txt : "(null)",
 			help_txt ? help_txt : "(null)",
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index ac5ecf4..3bcf347 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -1541,7 +1541,7 @@ excel_write_NAME (G_GNUC_UNUSED gpointer key,
 	ms_biff_put_var_next (ewb->bp, BIFF_NAME_v0); /* yes v0 */
 	memset (data, 0, sizeof data);
 
-	name = nexpr->name->str;
+	name = expr_name_name (nexpr);
 	if (nexpr->pos.sheet != NULL) { /* sheet local */
 		GSF_LE_SET_GUINT16 (data + 8,
 			nexpr->pos.sheet->index_in_wb + 1);
diff --git a/plugins/excel/ms-obj.c b/plugins/excel/ms-obj.c
index a8b329b..888cce6 100644
--- a/plugins/excel/ms-obj.c
+++ b/plugins/excel/ms-obj.c
@@ -992,6 +992,8 @@ ms_obj_read_biff8_obj (BiffQuery *q, MSContainer *c, MSObj *obj)
 			break;
 
 		case GR_MACRO :
+			ms_obj_read_expr (obj, MS_OBJ_ATTR_MACRO_EXPR, c,
+				data+4, data + 4 + len);
 			ms_obj_dump (data, len, data_len_left, "MacroObject");
 			break;
 
diff --git a/plugins/excel/ms-obj.h b/plugins/excel/ms-obj.h
index 5253222..71dac97 100644
--- a/plugins/excel/ms-obj.h
+++ b/plugins/excel/ms-obj.h
@@ -72,6 +72,7 @@ typedef enum {
 	MS_OBJ_ATTR_IS_EXPR_MASK = 0x20000,
 	MS_OBJ_ATTR_LINKED_TO_CELL,
 	MS_OBJ_ATTR_INPUT_FROM,
+	MS_OBJ_ATTR_MACRO_EXPR,
 
     /* GObjects */
 	MS_OBJ_ATTR_IS_GOBJECT_MASK = 0x40000,



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