[gnumeric] fix style leak



commit c0205c403ce042305bceac86f2579a1396016375
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Tue Jun 2 14:22:54 2009 -0600

    fix style leak
    
    2009-06-02 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-read.c (oo_cell_start): fix style leak
---
 plugins/openoffice/ChangeLog         |    4 ++++
 plugins/openoffice/openoffice-read.c |    6 ++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 06dd839..3554b75 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,9 @@
 2009-06-02 Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* openoffice-read.c (oo_cell_start): fix style leak
+	
+2009-06-02 Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* openoffice-read.c (oo_cell_start): set a default date or
 	  time format if the incoming data is marked that way.
 	
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index d8129f8..1cf93a8 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -1136,6 +1136,7 @@ oo_cell_start (GsfXMLIn *xin, xmlChar const **attrs)
 			;
 		else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_TABLE, "style-name")) {
 			style = g_hash_table_lookup (state->styles.cell, attrs[1]);
+			gnm_style_ref (style);
 		}
 	}
 
@@ -1145,6 +1146,8 @@ oo_cell_start (GsfXMLIn *xin, xmlChar const **attrs)
 			gnm_expr_top_unref (texpr);
 		if (val)
 			value_release (val);
+		if (style)
+			gnm_style_unref (style);
 		return;
 	}
 
@@ -1164,14 +1167,13 @@ oo_cell_start (GsfXMLIn *xin, xmlChar const **attrs)
 		
 		if (style == NULL) {
 			style = gnm_style_new_default ();
-			gnm_style_ref(style);
+/* 			gnm_style_ref(style); */
 			gnm_style_set_format (style, format);
 		} else if (!gnm_style_is_element_set (style, MSTYLE_FORMAT))
 			gnm_style_set_format (style, format);
 	}
 
 	if (style != NULL) {
-		gnm_style_ref (style);
 		if (state->col_inc > 1 || state->row_inc > 1) {
 			range_init_cellpos_size (&tmp, &state->pos.eval,
 				state->col_inc, state->row_inc);



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