[gnumeric] solver: cut out more dead code.



commit 043e4816ba2799d4899001ab94e716156cceebd3
Author: Morten Welinder <terra gnome org>
Date:   Sun Nov 15 16:45:02 2009 -0500

    solver: cut out more dead code.

 configure.in                     |    1 -
 po-functions/POTFILES.in         |    1 -
 po/POTFILES.in                   |    1 -
 src/Makefile.am                  |    7 -
 src/dialogs/dialog-solver.c      |   24 +-
 src/solver.h                     |   87 ----
 src/tools/Makefile.am            |    5 -
 src/tools/solver/.gitignore      |    5 -
 src/tools/solver/ChangeLog       |  751 -----------------------------
 src/tools/solver/Makefile.am     |   20 -
 src/tools/solver/api.c           |  221 ---------
 src/tools/solver/api.h           |  101 ----
 src/tools/solver/reports-write.c |  966 --------------------------------------
 src/tools/solver/reports-write.h |   60 ---
 src/tools/solver/solver.c        |   73 ---
 15 files changed, 4 insertions(+), 2319 deletions(-)
---
diff --git a/configure.in b/configure.in
index b9ac188..814e0c5 100644
--- a/configure.in
+++ b/configure.in
@@ -1028,7 +1028,6 @@ src/dialogs/Makefile
 src/pixmaps/Makefile
 src/widgets/Makefile
 src/tools/Makefile
-src/tools/solver/Makefile
 src/cut-n-paste-code/Makefile
 doc/Makefile
 doc/C/Makefile
diff --git a/po-functions/POTFILES.in b/po-functions/POTFILES.in
index b1daa3c..132f662 100644
--- a/po-functions/POTFILES.in
+++ b/po-functions/POTFILES.in
@@ -205,7 +205,6 @@ src/tools/random-generator.c
 src/tools/random-generator-cor.c
 src/tools/scenarios.c
 src/tools/simulation.c
-src/tools/solver/reports-write.c
 src/tools/tabulate.c
 src/validation.c
 src/value-sheet.c
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 7eba53c..660ed38 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -335,7 +335,6 @@ src/tools/random-generator.c
 src/tools/random-generator-cor.c
 src/tools/scenarios.c
 src/tools/simulation.c
-src/tools/solver/reports-write.c
 src/tools/tabulate.c
 src/validation.c
 src/value-sheet.c
diff --git a/src/Makefile.am b/src/Makefile.am
index f2ecf74..a6ddef5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -291,7 +291,6 @@ libspreadsheet_include_HEADERS = 	\
 	sheet-object-widget.h			\
 	sheet-style.h				\
 	gnm-plugin.h				\
-	solver.h				\
 	sort.h					\
 	stf.h					\
 	stf-export.h				\
@@ -403,12 +402,6 @@ gnumeric_app_libs =				\
 	tools/libtools.la			\
 	widgets/libwidgets.la
 
-if ENABLE_SOLVER
-gnumeric_app_libs +=				\
-	tools/solver/libsolver.la
-endif
-
-
 # Rules for the marshalers code:
 GENMARSHAL_COMMAND = $(GLIB_GENMARSHAL) --prefix=gnm_
 
diff --git a/src/dialogs/dialog-solver.c b/src/dialogs/dialog-solver.c
index 125ef90..e5d655f 100644
--- a/src/dialogs/dialog-solver.c
+++ b/src/dialogs/dialog-solver.c
@@ -43,7 +43,6 @@
 #include <commands.h>
 #include <clipboard.h>
 #include <tools/gnm-solver.h>
-#include <solver.h>
 #include <widgets/gnumeric-expr-entry.h>
 
 #include <glade/glade.h>
@@ -762,9 +761,9 @@ fail:
 
 
 static void
-solver_add_scenario (SolverState *state, SolverResults *res, gchar const *name)
+solver_add_scenario (SolverState *state, GnmSolverResult *res, gchar const *name)
 {
-	GnmSolverParameters *param = res->param;
+	GnmSolverParameters *param = state->sheet->solver_parameters;
 	GnmValue         *input_range;
 	gchar const      *comment = _("Optimal solution created by solver.\n");
 	scenario_t       *scenario;
@@ -815,13 +814,9 @@ cb_dialog_solve_clicked (G_GNUC_UNUSED GtkWidget *button,
 	workbook_recalc (state->sheet->workbook);
 
 	if (res != NULL) {
-		SolverResults *oldres = NULL;
-		/* WARNING : The dialog may be deleted by the reports
-		 * solver_reporting will return FALSE if state is gone and cleared */
-		if (0 &&
-		    res->quality == GNM_SOLVER_RESULT_OPTIMAL &&
+		if (res->quality == GNM_SOLVER_RESULT_OPTIMAL &&
 		    param->options.add_scenario)
-			solver_add_scenario (state, oldres,
+			solver_add_scenario (state, res,
 					     param->options.scenario_name);
 
 		g_object_unref (res);
@@ -838,17 +833,6 @@ cb_dialog_solve_clicked (G_GNUC_UNUSED GtkWidget *button,
 		g_error_free (err);
 }
 
-static void
-bool_entry_changed (GtkToggleButton *tb, SolverState *state)
-{
-	GnmSolverParameters *param = state->sheet->solver_parameters;
-	gulong offset =
-		GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (tb), "offset"));
-	gboolean *pb =
-		(gboolean *)((char *)param + offset);
-	*pb = gtk_toggle_button_get_active (tb);
-}
-
 #define INIT_BOOL_ENTRY(name_, field_)					\
 do {									\
 	GtkWidget *w_ = glade_xml_get_widget (state->gui, (name_));	\
diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am
index 8f501d3..c3042b4 100644
--- a/src/tools/Makefile.am
+++ b/src/tools/Makefile.am
@@ -2,17 +2,12 @@
 # Gnumeric's Tools Makefile.
 # Author: Jukka-Pekka Iivonen (jiivonen hutcs cs hut fi)
 
-if ENABLE_SOLVER
-  SUBDIRS = solver
-endif
-
 AM_CPPFLAGS = 						\
 	-DGNOMELOCALEDIR=\""$(datadir)/locale"\" 	\
 	-I$(top_srcdir)					\
 	-I$(top_srcdir)/src				\
 	-I$(top_srcdir)/src/tools			\
 	-I$(top_srcdir)/src/dialogs			\
-	-I$(srcdir)/solver				\
 	-I$(top_builddir)/src				\
 	-DGNUMERIC_INTERNAL				\
 	$(GNUMERIC_CFLAGS)



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