[gnumeric] lpsolve: check that the program is linear before writing bogus program
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] lpsolve: check that the program is linear before writing bogus program
- Date: Wed, 7 Jan 2015 03:11:27 +0000 (UTC)
commit 767ef346a6b21365abb7b62dde515a0a9a1792e7
Author: Morten Welinder <terra gnome org>
Date: Tue Jan 6 22:10:55 2015 -0500
lpsolve: check that the program is linear before writing bogus program
plugins/lpsolve/ChangeLog | 5 +++++
plugins/lpsolve/lpsolve-write.c | 10 ++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/plugins/lpsolve/ChangeLog b/plugins/lpsolve/ChangeLog
index 853acd6..9a3b419 100644
--- a/plugins/lpsolve/ChangeLog
+++ b/plugins/lpsolve/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-06 Morten Welinder <terra gnome org>
+
+ * lpsolve-write.c (lpsolve_create_program): Fail unless the
+ problem is linear.
+
2014-09-25 Morten Welinder <terra gnome org>
* Release 1.12.18
diff --git a/plugins/lpsolve/lpsolve-write.c b/plugins/lpsolve/lpsolve-write.c
index d156f7f..863d34c 100644
--- a/plugins/lpsolve/lpsolve-write.c
+++ b/plugins/lpsolve/lpsolve-write.c
@@ -182,6 +182,16 @@ lpsolve_create_program (Sheet *sheet, GOIOContext *io_context,
/* ---------------------------------------- */
+ if (sp->options.model_type != GNM_SOLVER_LP) {
+ g_set_error (err,
+ go_error_invalid (),
+ 0,
+ _("Only linear programs are handled."));
+ goto fail;
+ }
+
+ /* ---------------------------------------- */
+
progress = 2;
if (sp->options.assume_non_negative) progress++;
if (sp->options.assume_discrete) progress++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]