[gnumeric] Solver: code cleanup.



commit 5691188081f01aa91a3f67da4683fe5f65254cb5
Author: Morten Welinder <terra gnome org>
Date:   Sat Apr 25 13:59:34 2015 -0400

    Solver: code cleanup.

 plugins/glpk/ChangeLog          |    4 ++++
 plugins/glpk/glpk-write.c       |    8 +++-----
 plugins/lpsolve/ChangeLog       |    4 ++++
 plugins/lpsolve/lpsolve-write.c |    8 +++-----
 4 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/plugins/glpk/ChangeLog b/plugins/glpk/ChangeLog
index 63d0ae9..012a07c 100644
--- a/plugins/glpk/ChangeLog
+++ b/plugins/glpk/ChangeLog
@@ -1,3 +1,7 @@
+2015-04-25  Morten Welinder  <terra gnome org>
+
+       * glpk-write.c (glpk_create_program): Drop sheet argument.
+
 2015-04-16  Morten Welinder <terra gnome org>
 
        * Release 1.12.22
diff --git a/plugins/glpk/glpk-write.c b/plugins/glpk/glpk-write.c
index 05984b2..e227e3d 100644
--- a/plugins/glpk/glpk-write.c
+++ b/plugins/glpk/glpk-write.c
@@ -163,11 +163,10 @@ fail:
 }
 
 static GString *
-glpk_create_program (Sheet *sheet, GOIOContext *io_context,
-                    GnmSubSolver *ssol, GError **err)
+glpk_create_program (GnmSubSolver *ssol, GOIOContext *io_context, GError **err)
 {
        GnmSolver *sol = GNM_SOLVER (ssol);
-       GnmSolverParameters *sp = sheet->solver_parameters;
+       GnmSolverParameters *sp = sol->params;
        GString *prg = NULL;
        GString *constraints = g_string_new (NULL);
        GString *binaries = g_string_new (NULL);
@@ -350,7 +349,6 @@ void
 glpk_file_save (GOFileSaver const *fs, GOIOContext *io_context,
                WorkbookView const *wb_view, GsfOutput *output)
 {
-       Sheet *sheet = wb_view_cur_sheet (wb_view);
        GError *err = NULL;
        GString *prg;
        GnmLocale *locale;
@@ -360,7 +358,7 @@ glpk_file_save (GOFileSaver const *fs, GOIOContext *io_context,
                                _("Writing glpk file..."));
 
        locale = gnm_push_C_locale ();
-       prg = glpk_create_program (sheet, io_context, ssol, &err);
+       prg = glpk_create_program (ssol, io_context, &err);
        gnm_pop_C_locale (locale);
 
        gnm_app_recalc ();
diff --git a/plugins/lpsolve/ChangeLog b/plugins/lpsolve/ChangeLog
index 3b021d0..a6363c6 100644
--- a/plugins/lpsolve/ChangeLog
+++ b/plugins/lpsolve/ChangeLog
@@ -1,3 +1,7 @@
+2015-04-25  Morten Welinder  <terra gnome org>
+
+       * lpsolve-write.c (lpsolve_create_program): Drop sheet argument.
+
 2015-04-16  Morten Welinder <terra gnome org>
 
        * Release 1.12.22
diff --git a/plugins/lpsolve/lpsolve-write.c b/plugins/lpsolve/lpsolve-write.c
index 54aaf74..f3555e2 100644
--- a/plugins/lpsolve/lpsolve-write.c
+++ b/plugins/lpsolve/lpsolve-write.c
@@ -166,11 +166,10 @@ fail:
 }
 
 static GString *
-lpsolve_create_program (Sheet *sheet, GOIOContext *io_context,
-                       GnmSubSolver *ssol, GError **err)
+lpsolve_create_program (GnmSubSolver *ssol, GOIOContext *io_context, GError **err)
 {
        GnmSolver *sol = GNM_SOLVER (ssol);
-       GnmSolverParameters *sp = sheet->solver_parameters;
+       GnmSolverParameters *sp = sol->params;
        GString *prg = NULL;
        GString *constraints = g_string_new (NULL);
        GString *declarations = g_string_new (NULL);
@@ -332,7 +331,6 @@ void
 lpsolve_file_save (GOFileSaver const *fs, GOIOContext *io_context,
                   WorkbookView const *wb_view, GsfOutput *output)
 {
-       Sheet *sheet = wb_view_cur_sheet (wb_view);
        GError *err = NULL;
        GString *prg;
        GnmLocale *locale;
@@ -342,7 +340,7 @@ lpsolve_file_save (GOFileSaver const *fs, GOIOContext *io_context,
                                _("Writing lpsolve file..."));
 
        locale = gnm_push_C_locale ();
-       prg = lpsolve_create_program (sheet, io_context, ssol, &err);
+       prg = lpsolve_create_program (ssol, io_context, &err);
        gnm_pop_C_locale (locale);
 
        gnm_app_recalc ();


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