[gnumeric] Only export active names to ODF



commit bbea9dafe6279c8c8e777d781a23814b4b8ce275
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Fri May 20 12:18:17 2011 -0600

    Only export active names to ODF
    
    2011-05-20  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-write.c (odf_write_named_expression): only write
    	active names

 plugins/openoffice/ChangeLog          |    7 ++++++-
 plugins/openoffice/openoffice-write.c |    5 ++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index fc7cd12..e923d32 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,8 +1,13 @@
 2011-05-20  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* openoffice-write.c (odf_write_named_expression): only write
+	active names
+
+2011-05-20  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* openoffice-read.c (oo_cellref_parse): return invalid_sheet when
 	encountering #REF!, check for this return value in all callers
-	(oo_rangeref_parse): check for invalid_sheet, check for this return 
+	(oo_rangeref_parse): check for invalid_sheet, check for this return
 	value in all callers
 	(oo_expr_rangeref_parse): check for [#REF!]
 
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 2f0d2fe..eedec7d 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -4087,6 +4087,9 @@ odf_write_named_expression (gpointer key, GnmNamedExpr *nexpr, GnmOOExport *stat
 
 	g_return_if_fail (nexpr != NULL);
 
+	if (!expr_name_is_active (nexpr))
+		return;
+
 	sheet = nexpr->pos.sheet;
         if (sheet == NULL)
 		sheet = workbook_sheet_by_index (state->wb, 0);
@@ -4126,7 +4129,7 @@ odf_write_named_expression (gpointer key, GnmNamedExpr *nexpr, GnmOOExport *stat
 					      nexpr->pos.sheet->name_unquoted);
 
 		gsf_xml_out_end_element (state->xml); /* </table:named-range> */
-	} else if (!expr_name_is_placeholder (nexpr) || nexpr->ref_count > 1) {
+	} else if (!expr_name_is_placeholder (nexpr) && nexpr->texpr != NULL) {
 		gsf_xml_out_start_element
 			(state->xml, TABLE "named-expression");
 		gsf_xml_out_add_cstr (state->xml, TABLE "name", name);



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