[gnumeric] compilation: silence a warning.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] compilation: silence a warning.
- Date: Sun, 3 Nov 2019 00:20:30 +0000 (UTC)
commit 9e4c82697ceebc753fd701a903b8bbb41a34d172
Author: Morten Welinder <terra gnome org>
Date: Sat Nov 2 20:19:41 2019 -0400
compilation: silence a warning.
ChangeLog | 5 +++++
src/gutils.c | 17 +++++++++--------
2 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index cd33af350..c72f50044 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-02 Morten Welinder <terra gnome org>
+
+ * src/gutils.c (gnm_file_saver_common_export_option): Reorganize a
+ bit to silence warning.
+
2019-10-31 Morten Welinder <terra gnome org>
* src/cell.c (gnm_cell_get_text_for_editing): Avoid excess
diff --git a/src/gutils.c b/src/gutils.c
index 18031f659..4971427ef 100644
--- a/src/gutils.c
+++ b/src/gutils.c
@@ -955,7 +955,7 @@ gnm_file_saver_common_export_option (GOFileSaver const *fs,
if (strcmp (key, "sheet") == 0 ||
strcmp (key, "active-sheet") == 0) {
GPtrArray *sheets;
- Sheet *sheet;
+ Sheet *sheet = NULL;
if (key[0] == 'a') {
// Not ideal -- we lack a view here
@@ -964,13 +964,14 @@ gnm_file_saver_common_export_option (GOFileSaver const *fs,
});
} else {
sheet = workbook_sheet_by_name (wb, value);
- if (!sheet) {
- if (err)
- *err = g_error_new (go_error_invalid (), 0,
- _("Unknown sheet \"%s\""),
- value);
- return TRUE;
- }
+ }
+
+ if (!sheet) {
+ if (err)
+ *err = g_error_new (go_error_invalid (), 0,
+ _("Unknown sheet \"%s\""),
+ value);
+ return TRUE;
}
sheets = g_object_get_data (G_OBJECT (wb), SSCONVERT_SHEET_SET_KEY);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]