[gnumeric] Try to use the csv exporter rather than configurable after importing a csv file
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Try to use the csv exporter rather than configurable after importing a csv file
- Date: Wed, 8 Aug 2012 02:24:40 +0000 (UTC)
commit 40c5f9269ebbc209f103b9b5f10a5416e623f225
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Tue Aug 7 20:22:32 2012 -0600
Try to use the csv exporter rather than configurable after importing a csv file
2012-08-07 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/stf.c (stf_read_workbook_auto_csvtab): use the csv exporter in the
saveinfo if appropriate
ChangeLog | 5 +++++
src/stf.c | 7 ++++---
2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 979f965..604358a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2012-08-07 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * src/stf.c (stf_read_workbook_auto_csvtab): use the csv exporter in the
+ saveinfo if appropriate
+
+2012-08-07 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* src/workbook-view.c (wb_view_new_from_input): save uri for
export if appropriate
diff --git a/src/stf.c b/src/stf.c
index 6c03fb5..cac81b8 100644
--- a/src/stf.c
+++ b/src/stf.c
@@ -419,7 +419,7 @@ stf_read_workbook_auto_csvtab (G_GNUC_UNUSED GOFileOpener const *fo, gchar const
GOIOContext *context,
GoView *view, GsfInput *input)
{
- Sheet *sheet, *old_sheet;
+ Sheet *sheet;
Workbook *book;
char *name;
char *data;
@@ -436,7 +436,6 @@ stf_read_workbook_auto_csvtab (G_GNUC_UNUSED GOFileOpener const *fo, gchar const
g_return_if_fail (wbv != NULL);
book = wb_view_get_workbook (wbv);
- old_sheet = wb_view_cur_sheet (wbv);
data = stf_preparse (context, input, &data_len);
if (!data)
@@ -487,6 +486,7 @@ stf_read_workbook_auto_csvtab (G_GNUC_UNUSED GOFileOpener const *fo, gchar const
workbook_sheet_attach (book, sheet);
if (stf_parse_sheet (po, utf8data->str, NULL, sheet, 0, 0)) {
+ gboolean is_csv;
workbook_recalc_all (book);
resize_columns (sheet);
if (po->cols_exceeded || po->rows_exceeded) {
@@ -494,11 +494,12 @@ stf_read_workbook_auto_csvtab (G_GNUC_UNUSED GOFileOpener const *fo, gchar const
_("Some data did not fit on the "
"sheet and was dropped."));
}
+ is_csv = po->sep.chr[0] == ',';
workbook_set_saveinfo
(book,
GO_FILE_FL_WRITE_ONLY,
go_file_saver_for_id
- ("Gnumeric_stf:stf_assistant"));
+ (is_csv ? "Gnumeric_stf:stf_csv" : "Gnumeric_stf:stf_assistant"));
} else {
workbook_sheet_delete (sheet);
go_cmd_context_error_import (GO_CMD_CONTEXT (context),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]