[gnumeric] Code cleanup.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Code cleanup.
- Date: Sun, 25 Mar 2018 18:25:20 +0000 (UTC)
commit b0ec8a9273cb6f6572c3a854dfdb9a5cf4af2395
Author: Morten Welinder <terra gnome org>
Date: Sun Mar 25 14:25:00 2018 -0400
Code cleanup.
ChangeLog | 5 +++++
src/workbook-view.c | 4 ++--
src/workbook.c | 5 +++--
src/workbook.h | 2 +-
4 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 069e8b2..79ae346 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-03-25 Morten Welinder <terra gnome org>
+
+ * src/workbook.c (workbook_set_last_export_uri): Constify
+ argument. Callers fixed.
+
2018-03-23 Morten Welinder <terra gnome org>
* src/main-application.c (cpu_sanity_check): New function.
diff --git a/src/workbook-view.c b/src/workbook-view.c
index 01c289c..37838ab 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -1140,7 +1140,7 @@ wb_view_save_as (WorkbookView *wbv, GOFileSaver *fs, char const *uri,
go_doc_set_pristine (GO_DOC (wb), FALSE);
}
} else
- workbook_set_last_export_uri (wb, g_strdup (uri));
+ workbook_set_last_export_uri (wb, uri);
}
if (has_error || has_warning)
go_io_error_display (io_context);
@@ -1296,7 +1296,7 @@ workbook_view_new_from_input (GsfInput *input,
go_doc_set_dirty (GO_DOC (new_wb), FALSE);
if (optional_uri && workbook_get_file_exporter (new_wb))
workbook_set_last_export_uri
- (new_wb, g_strdup (optional_uri));
+ (new_wb, optional_uri);
}
} else
go_cmd_context_error_import (GO_CMD_CONTEXT (io_context),
diff --git a/src/workbook.c b/src/workbook.c
index 75fc6d0..2de39b4 100644
--- a/src/workbook.c
+++ b/src/workbook.c
@@ -528,10 +528,11 @@ workbook_set_file_exporter (Workbook *wb, GOFileSaver *fs)
}
void
-workbook_set_last_export_uri (Workbook *wb, gchar *uri)
+workbook_set_last_export_uri (Workbook *wb, const gchar *uri)
{
+ char *s = g_strdup (uri);
g_free (wb->last_export_uri);
- wb->last_export_uri = uri;
+ wb->last_export_uri = s;
WORKBOOK_FOREACH_CONTROL (wb, wbv, wbc,
wb_control_menu_state_update (wbc, MS_FILE_EXPORT_IMPORT););
}
diff --git a/src/workbook.h b/src/workbook.h
index 985bf62..157e60f 100644
--- a/src/workbook.h
+++ b/src/workbook.h
@@ -55,7 +55,7 @@ GOFileSaver *workbook_get_file_saver (Workbook *wb);
GOFileSaver *workbook_get_file_exporter (Workbook *wb);
gchar const *workbook_get_last_export_uri (Workbook *wb);
void workbook_set_file_exporter (Workbook *wb, GOFileSaver *fs);
-void workbook_set_last_export_uri (Workbook *wb, gchar *uri);
+void workbook_set_last_export_uri (Workbook *wb, const gchar *uri);
/* See also sheet_foreach_cell_in_range */
GnmValue *workbook_foreach_cell_in_range (GnmEvalPos const *pos,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]