[gnumeric] xlsx: debug code and leak fixes.



commit f747c7b31f18468f342ec46c0f434ede0467221d
Author: Morten Welinder <terra gnome org>
Date:   Tue Feb 24 21:24:48 2015 -0500

    xlsx: debug code and leak fixes.

 plugins/excel/ChangeLog           |    5 +++++
 plugins/excel/xlsx-read-drawing.c |    6 ------
 plugins/excel/xlsx-read.c         |   15 +++++++--------
 3 files changed, 12 insertions(+), 14 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index e65ecb8..6bed6a1 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,10 @@
 2015-02-24  Morten Welinder  <terra gnome org>
 
+       * xlsx-read.c (xlsx_parse_rel_by_id): Debug code.
+
+       * xlsx-read-drawing.c (xlsx_vml_drop_style): Don't create objects
+       here -- that'll just leak.
+
        * xlsx-write-drawing.c (xlsx_write_axis): Pick the crossing axis
        within the relevant plot.
 
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index 2ab6d7a..d5f1cf1 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -3421,12 +3421,6 @@ xlsx_vml_shape (GsfXMLIn *xin, xmlChar const **attrs)
 static void
 xlsx_vml_drop_style (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 {
-       XLSXReadState *state = (XLSXReadState *)xin->user_state;
-       if (!strcmp (xin->content->str, "Combo"))
-               /* adding a combo box */
-               state->so = SHEET_OBJECT (g_object_new (sheet_widget_combo_get_type (), NULL));
-               state->so_direction = GOD_ANCHOR_DIR_DOWN_RIGHT;
-               sheet_object_set_sheet (state->so, state->sheet);
 }
 
 static void
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index f79e85a..9339e81 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -371,11 +371,11 @@ xlsx_parse_rel_by_id (GsfXMLIn *xin, char const *part_id,
                      GsfXMLInNS const *ns)
 {
        GError *err;
+       gboolean debug = gnm_debug_flag ("xlsx-parsing");
 
-#ifdef DEBUG_PARSER
-       g_print ("{ /* Parsing  : %s :: %s */\n",
-                gsf_input_name (gsf_xml_in_get_input (xin)), part_id);
-#endif
+       if (debug)
+               g_printerr ("{ /* Parsing  : %s :: %s */\n",
+                           gsf_input_name (gsf_xml_in_get_input (xin)), part_id);
 
        err = gsf_open_pkg_parse_rel_by_id (xin, part_id, dtd, ns);
        if (NULL != err) {
@@ -384,10 +384,9 @@ xlsx_parse_rel_by_id (GsfXMLIn *xin, char const *part_id,
                g_error_free (err);
        }
 
-#ifdef DEBUG_PARSER
-       g_print ("} /* DONE : %s :: %s */\n",
-                gsf_input_name (gsf_xml_in_get_input (xin)), part_id);
-#endif
+       if (debug)
+               g_printerr ("} /* DONE : %s :: %s */\n",
+                           gsf_input_name (gsf_xml_in_get_input (xin)), part_id);
 }
 
 /****************************************************************************/


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