[gnumeric] xls: improve the macro roundtrip situation.



commit 6183f70cd966ebf9ae1dce26f01ad1574c68d676
Author: Morten Welinder <terra gnome org>
Date:   Wed Feb 26 09:43:34 2014 -0500

    xls: improve the macro roundtrip situation.
    
    We now place the VBA files in the directory they came from.  That still
    does not seem to enough for Excel, though.

 NEWS                    |    1 +
 plugins/excel/ChangeLog |    5 +++++
 plugins/excel/boot.c    |   13 ++++++++++---
 3 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index d52f6fb..e1e4d56 100644
--- a/NEWS
+++ b/NEWS
@@ -40,6 +40,7 @@ Morten:
        * Work around gtk+ criticals.  [#725142]
        * Fix xls/biff8 export of long comments.  [#725168]
        * Fix xls/biff8 import of comment's text attributes.  [#725168]
+       * Improve the xls macro-roundtrip situation.  [Part of #725220]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.11
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 01d229c..1efa118 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2014-02-26  Morten Welinder  <terra gnome org>
+
+       * boot.c (excel_save): Make sure to save macros in the
+       _VBA_PROJECT_CUR directory that we loaded them from.
+
 2014-02-25  Morten Welinder  <terra gnome org>
 
        * ms-container.c (ms_container_read_markup): Return NULL when no
diff --git a/plugins/excel/boot.c b/plugins/excel/boot.c
index 48a616a..4188f2e 100644
--- a/plugins/excel/boot.c
+++ b/plugins/excel/boot.c
@@ -301,9 +301,16 @@ excel_save (GOIOContext *context, WorkbookView const *wbv, GsfOutput *output,
        blob = g_object_get_data (G_OBJECT (wb), "MS_EXCEL_COMPOBJ");
        if (blob != NULL)
                gsf_structured_blob_write (blob, outfile);
+
        blob = g_object_get_data (G_OBJECT (wb), "MS_EXCEL_MACROS");
-       if (blob != NULL)
-               gsf_structured_blob_write (blob, outfile);
+       if (blob != NULL) {
+               GsfOutput *vba = gsf_outfile_new_child (outfile, "_VBA_PROJECT_CUR", TRUE);
+               if (vba) {
+                       gsf_structured_blob_write (blob, GSF_OUTFILE (vba));
+                       gsf_output_close (vba);
+                       g_object_unref (vba);
+               }
+       }
 
        gsf_output_close (GSF_OUTPUT (outfile));
        g_object_unref (outfile);
@@ -311,7 +318,7 @@ excel_save (GOIOContext *context, WorkbookView const *wbv, GsfOutput *output,
 
 void
 excel_dsf_file_save (GOFileSaver const *fs, GOIOContext *context,
-                      WorkbookView const *wbv, GsfOutput *output)
+                    WorkbookView const *wbv, GsfOutput *output)
 {
        excel_save (context, wbv, output, TRUE, TRUE);
 }


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