[gnumeric] xlsx: valgrind fixes.



commit c5d34bc6510cb5cb68d903b1c0e042fc933f4827
Author: Morten Welinder <terra gnome org>
Date:   Tue Feb 10 13:46:05 2015 -0500

    xlsx: valgrind fixes.

 plugins/excel/ChangeLog             |    7 +++++++
 plugins/excel/xlsx-write-docprops.c |    5 ++++-
 plugins/excel/xlsx-write.c          |    2 ++
 3 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index f7e2c85..fc4d895 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,10 @@
+2015-02-10  Morten Welinder  <terra gnome org>
+
+       * xlsx-write.c (xlsx2_file_save, xlsx_file_save): Initialize
+       counter.
+
+       * xlsx-write-docprops.c (xlsx_write_docprops): Plug leak.
+
 2015-02-09  Morten Welinder  <terra gnome org>
 
        * xlsx-read-drawing.c (xlsx_chart_line_headtail): First cut at
diff --git a/plugins/excel/xlsx-write-docprops.c b/plugins/excel/xlsx-write-docprops.c
index 930bc41..867d8db 100644
--- a/plugins/excel/xlsx-write-docprops.c
+++ b/plugins/excel/xlsx-write-docprops.c
@@ -518,9 +518,12 @@ xlsx_write_docprops_custom (XLSXWriteState *state, GsfOutfile *root_part, GsfOut
 static void
 xlsx_write_docprops (XLSXWriteState *state, GsfOutfile *root_part)
 {
-       GsfOutfile *docprops_dir    = (GsfOutfile *)gsf_outfile_new_child (root_part, "docProps", TRUE);
+       GsfOutfile *docprops_dir = (GsfOutfile *)gsf_outfile_new_child (root_part, "docProps", TRUE);
 
        xlsx_write_docprops_app (state, root_part, docprops_dir);
        xlsx_write_docprops_core (state, root_part, docprops_dir);
        xlsx_write_docprops_custom (state, root_part, docprops_dir);
+
+       gsf_output_close (GSF_OUTPUT (docprops_dir));
+       g_object_unref (docprops_dir);
 }
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index 96238a4..0905577 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -3114,6 +3114,7 @@ xlsx_file_save (G_GNUC_UNUSED GOFileSaver const *fs, GOIOContext *io_context,
        state.base.wb           = wb_view_get_workbook (wb_view);
        state.comment           = 0;
        state.custom_prop_id    = 29;
+       state.drawing_elem_id   = 1024;
 
        root_part = gsf_outfile_open_pkg_new (
                gsf_outfile_zip_new (output, NULL));
@@ -3142,6 +3143,7 @@ xlsx2_file_save (G_GNUC_UNUSED GOFileSaver const *fs, GOIOContext *io_context,
        state.base.wb           = wb_view_get_workbook (wb_view);
        state.comment           = 0;
        state.custom_prop_id    = 29;
+       state.drawing_elem_id   = 1024;
 
        root_part = gsf_outfile_open_pkg_new (
                gsf_outfile_zip_new (output, NULL));


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