Commit a9c2dd34 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

some house cleaning.

2002-02-20  Jody Goldberg <jody@gnome.org>

	* src/workbook.h : some house cleaning.

	* src/workbook.c (workbook_is_pristine) : remove stuf for
	  external_dependents.  No use having fogotten stubs hanging around.

	* src/workbook-control-gui.c (cb_insert_component) : look for
	  ControlFactories.
	(cb_insert_shaped_component) : look for CanvasComponentFactories.

	* src/commands.h : remove include for gtkobject.

	* idl/GNOME_Gnumeric_Graph.idl : We a ControlFactory now, not an
	  Embeddable.
parent c6786d63
2002-02-20 Jody Goldberg <jody@gnome.org>
* src/workbook.h : some house cleaning.
* src/workbook.c (workbook_is_pristine) : remove stuf for
external_dependents. No use having fogotten stubs hanging around.
* src/workbook-control-gui.c (cb_insert_component) : look for
ControlFactories.
(cb_insert_shaped_component) : look for CanvasComponentFactories.
* src/commands.h : remove include for gtkobject.
* idl/GNOME_Gnumeric_Graph.idl : We a ControlFactory now, not an
Embeddable.
2002-02-20 Morten Welinder <terra@diku.dk>
* src/mathfunc.c (display): Fix format.
......
2002-02-20 Jody Goldberg <jody@gnome.org>
* src/workbook.h : some house cleaning.
* src/workbook.c (workbook_is_pristine) : remove stuf for
external_dependents. No use having fogotten stubs hanging around.
* src/workbook-control-gui.c (cb_insert_component) : look for
ControlFactories.
(cb_insert_shaped_component) : look for CanvasComponentFactories.
* src/commands.h : remove include for gtkobject.
* idl/GNOME_Gnumeric_Graph.idl : We a ControlFactory now, not an
Embeddable.
2002-02-20 Morten Welinder <terra@diku.dk>
* src/mathfunc.c (display): Fix format.
......
2002-02-20 Jody Goldberg <jody@gnome.org>
* src/workbook.h : some house cleaning.
* src/workbook.c (workbook_is_pristine) : remove stuf for
external_dependents. No use having fogotten stubs hanging around.
* src/workbook-control-gui.c (cb_insert_component) : look for
ControlFactories.
(cb_insert_shaped_component) : look for CanvasComponentFactories.
* src/commands.h : remove include for gtkobject.
* idl/GNOME_Gnumeric_Graph.idl : We a ControlFactory now, not an
Embeddable.
2002-02-20 Morten Welinder <terra@diku.dk>
* src/mathfunc.c (display): Fix format.
......
......@@ -73,7 +73,7 @@ module GNOME {
void seriesDelete (in SeriesID series) raises (Error);
};
interface Manager : Bonobo::Embeddable {
interface Manager : Bonobo::ControlFactory {
ConfigGuru configure (in string type);
/**
......
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* fn-lookup.c: Built in lookup functions and functions registration
*
......@@ -475,7 +475,7 @@ gnumeric_choose (FunctionEvalInfo *ei, ExprList *l)
static const char *help_vlookup = {
N_("@FUNCTION=VLOOKUP\n"
"@SYNTAX=VLOOKUP(value,range,column[,approximate])\n"
"@SYNTAX=VLOOKUP(value,range,column[,approximate,as_index])\n"
"@DESCRIPTION="
"VLOOKUP function finds the row in range that has a first "
......@@ -484,7 +484,8 @@ static const char *help_vlookup = {
"then the values must be sorted in order of ascending value for "
"correct function; in this case it finds the row with value less "
"than @value. It returns the value in the row found at a 1 based "
"offset in @column columns into the @range."
"offset in @column columns into the @range. @as_index returns the "
"offset that matched rather than the value"
"\n"
"Returns #NUM! if @column < 0. "
"Returns #REF! if @column falls outside @range."
......@@ -509,17 +510,13 @@ gnumeric_vlookup (FunctionEvalInfo *ei, Value **args)
if (col_idx > value_area_get_width (ei->pos, args [1]))
return value_new_error (ei->pos, gnumeric_err_REF);
if (!args[3]) {
approx = TRUE;
} else {
approx = value_get_as_checked_bool (args [3]);
}
if (approx) {
index = find_index_bisection (ei, args[0], args[1], 1, TRUE);
} else {
index = find_index_linear (ei, args[0], args[1], 0, TRUE);
}
approx = (args[3] != NULL)
? value_get_as_checked_bool (args [3]) : TRUE;
index = approx
? find_index_bisection (ei, args[0], args[1], 1, TRUE)
: find_index_linear (ei, args[0], args[1], 0, TRUE);
if (args[4] != NULL && value_get_as_checked_bool (args [4]))
return value_new_int (index);
if (index >= 0) {
const Value *v;
......@@ -536,7 +533,7 @@ gnumeric_vlookup (FunctionEvalInfo *ei, Value **args)
static const char *help_hlookup = {
N_("@FUNCTION=HLOOKUP\n"
"@SYNTAX=HLOOKUP(value,range,row[,approximate])\n"
"@SYNTAX=HLOOKUP(value,range,row[,approximate,as_index])\n"
"@DESCRIPTION="
"HLOOKUP function finds the col in range that has a first "
......@@ -545,7 +542,8 @@ static const char *help_hlookup = {
"then the values must be sorted in order of ascending value for "
"correct function; in this case it finds the col with value less "
"than @value it returns the value in the col found at a 1 based "
"offset in @row rows into the @range."
"offset in @row rows into the @range. @as_index returns the offset "
"that matched rather than the value"
"\n"
"Returns #NUM! if @row < 0. "
"Returns #REF! if @row falls outside @range."
......@@ -570,17 +568,13 @@ gnumeric_hlookup (FunctionEvalInfo *ei, Value **args)
if (row_idx > value_area_get_height (ei->pos, args [1]))
return value_new_error (ei->pos, gnumeric_err_REF);
if (!args[3]) {
approx = TRUE;
} else {
approx = value_get_as_checked_bool (args [3]);
}
if (approx) {
index = find_index_bisection (ei, args[0], args[1], 1, FALSE);
} else {
index = find_index_linear (ei, args[0], args[1], 0, FALSE);
}
approx = (args[3] != NULL)
? value_get_as_checked_bool (args [3]) : TRUE;
index = approx
? find_index_bisection (ei, args[0], args[1], 1, FALSE)
: find_index_linear (ei, args[0], args[1], 0, FALSE);
if (args[4] != NULL && value_get_as_checked_bool (args [4]))
return value_new_int (index);
if (index >= 0) {
const Value *v;
......@@ -1139,7 +1133,7 @@ lookup_functions_init (void)
function_add_args (cat, "columns", "A", "ref",
&help_columns, gnumeric_columns);
function_add_args (cat, "hlookup",
"?Af|b","val,range,col_idx,approx",
"?Af|bb","val,range,col_idx,approx,as_index",
&help_hlookup, gnumeric_hlookup);
function_add_args (cat, "hyperlink",
"s|s","link_location, optional_label",
......@@ -1162,6 +1156,6 @@ lookup_functions_init (void)
"array",
&help_transpose, gnumeric_transpose);
function_add_args (cat, "vlookup",
"?Af|b","val,range,col_idx,approx",
"?Af|bb","val,range,col_idx,approx,as_index",
&help_vlookup, gnumeric_vlookup);
}
......@@ -2,8 +2,6 @@
#ifndef GNUMERIC_COMMANDS_H
#define GNUMERIC_COMMANDS_H
#include <gtk/gtkobject.h>
#include "consolidate.h"
#include "gnumeric.h"
#include "sort.h"
......
2002-02-20 Jody Goldberg <jody@gnome.org>
* fn-lookup.c (HLOOKUP,VLOOKUP) : offer an 'as_index' flag.
2002-02-20 Morten Welinder <terra@diku.dk>
* fn-*.c: Constify all help texts.
......
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* fn-lookup.c: Built in lookup functions and functions registration
*
......@@ -475,7 +475,7 @@ gnumeric_choose (FunctionEvalInfo *ei, ExprList *l)
static const char *help_vlookup = {
N_("@FUNCTION=VLOOKUP\n"
"@SYNTAX=VLOOKUP(value,range,column[,approximate])\n"
"@SYNTAX=VLOOKUP(value,range,column[,approximate,as_index])\n"
"@DESCRIPTION="
"VLOOKUP function finds the row in range that has a first "
......@@ -484,7 +484,8 @@ static const char *help_vlookup = {
"then the values must be sorted in order of ascending value for "
"correct function; in this case it finds the row with value less "
"than @value. It returns the value in the row found at a 1 based "
"offset in @column columns into the @range."
"offset in @column columns into the @range. @as_index returns the "
"offset that matched rather than the value"
"\n"
"Returns #NUM! if @column < 0. "
"Returns #REF! if @column falls outside @range."
......@@ -509,17 +510,13 @@ gnumeric_vlookup (FunctionEvalInfo *ei, Value **args)
if (col_idx > value_area_get_width (ei->pos, args [1]))
return value_new_error (ei->pos, gnumeric_err_REF);
if (!args[3]) {
approx = TRUE;
} else {
approx = value_get_as_checked_bool (args [3]);
}
if (approx) {
index = find_index_bisection (ei, args[0], args[1], 1, TRUE);
} else {
index = find_index_linear (ei, args[0], args[1], 0, TRUE);
}
approx = (args[3] != NULL)
? value_get_as_checked_bool (args [3]) : TRUE;
index = approx
? find_index_bisection (ei, args[0], args[1], 1, TRUE)
: find_index_linear (ei, args[0], args[1], 0, TRUE);
if (args[4] != NULL && value_get_as_checked_bool (args [4]))
return value_new_int (index);
if (index >= 0) {
const Value *v;
......@@ -536,7 +533,7 @@ gnumeric_vlookup (FunctionEvalInfo *ei, Value **args)
static const char *help_hlookup = {
N_("@FUNCTION=HLOOKUP\n"
"@SYNTAX=HLOOKUP(value,range,row[,approximate])\n"
"@SYNTAX=HLOOKUP(value,range,row[,approximate,as_index])\n"
"@DESCRIPTION="
"HLOOKUP function finds the col in range that has a first "
......@@ -545,7 +542,8 @@ static const char *help_hlookup = {
"then the values must be sorted in order of ascending value for "
"correct function; in this case it finds the col with value less "
"than @value it returns the value in the col found at a 1 based "
"offset in @row rows into the @range."
"offset in @row rows into the @range. @as_index returns the offset "
"that matched rather than the value"
"\n"
"Returns #NUM! if @row < 0. "
"Returns #REF! if @row falls outside @range."
......@@ -570,17 +568,13 @@ gnumeric_hlookup (FunctionEvalInfo *ei, Value **args)
if (row_idx > value_area_get_height (ei->pos, args [1]))
return value_new_error (ei->pos, gnumeric_err_REF);
if (!args[3]) {
approx = TRUE;
} else {
approx = value_get_as_checked_bool (args [3]);
}
if (approx) {
index = find_index_bisection (ei, args[0], args[1], 1, FALSE);
} else {
index = find_index_linear (ei, args[0], args[1], 0, FALSE);
}
approx = (args[3] != NULL)
? value_get_as_checked_bool (args [3]) : TRUE;
index = approx
? find_index_bisection (ei, args[0], args[1], 1, FALSE)
: find_index_linear (ei, args[0], args[1], 0, FALSE);
if (args[4] != NULL && value_get_as_checked_bool (args [4]))
return value_new_int (index);
if (index >= 0) {
const Value *v;
......@@ -1139,7 +1133,7 @@ lookup_functions_init (void)
function_add_args (cat, "columns", "A", "ref",
&help_columns, gnumeric_columns);
function_add_args (cat, "hlookup",
"?Af|b","val,range,col_idx,approx",
"?Af|bb","val,range,col_idx,approx,as_index",
&help_hlookup, gnumeric_hlookup);
function_add_args (cat, "hyperlink",
"s|s","link_location, optional_label",
......@@ -1162,6 +1156,6 @@ lookup_functions_init (void)
"array",
&help_transpose, gnumeric_transpose);
function_add_args (cat, "vlookup",
"?Af|b","val,range,col_idx,approx",
"?Af|bb","val,range,col_idx,approx,as_index",
&help_vlookup, gnumeric_vlookup);
}
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* sheet-object-container.c:
* SheetObject for containers (Bonobo, Graphs)
......@@ -66,8 +67,8 @@ sheet_object_container_new_view (SheetObject *so, SheetControlGUI *scg)
NULL);
gtk_object_set_data (GTK_OBJECT (view_item), "view_frame", view_frame);
g_signal_connect (G_OBJECT (view_frame),
"user_activate",
G_CALLBACK (cb_user_activation_request), view_item);
"user_activate",
G_CALLBACK (cb_user_activation_request), view_item);
scg_object_widget_register (so, view_widget, view_item);
gtk_widget_show (view_widget);
......
......@@ -2547,7 +2547,7 @@ static void
cb_insert_component (GtkWidget *widget, WorkbookControlGUI *wbcg)
{
static char const *required_interfaces [2] = {
"IDL:Bonobo/Embeddable:1.0", NULL
"IDL:Bonobo/ControlFactory:1.0", NULL
};
insert_bonobo_object (wbcg, required_interfaces);
}
......@@ -2556,7 +2556,7 @@ static void
cb_insert_shaped_component (GtkWidget *widget, WorkbookControlGUI *wbcg)
{
static char const *required_interfaces [2] = {
"IDL:Bonobo/Canvas/Item:1.0", NULL
"IDL:Bonobo/CanvasComponentFactory:1.0", NULL
};
insert_bonobo_object (wbcg, required_interfaces);
}
......
......@@ -37,9 +37,6 @@ struct _Workbook {
/* User defined names */
GList *names;
/* All objects with expressions */
Dependent *external_dependents;
/* Attached summary information */
SummaryInfo *summary_info;
......@@ -55,11 +52,7 @@ struct _Workbook {
};
typedef struct {
GObjectClass gtk_parent_class;
/* Signals */
void (*cell_changed) (Sheet *sheet, char *contents,
int col, int row);
GObjectClass base;
} WorkbookClass;
GType workbook_get_type (void);
......
......@@ -285,7 +285,7 @@ workbook_is_pristine (Workbook const *wb)
if (workbook_is_dirty (wb))
return FALSE;
if (wb->names || wb->external_dependents ||
if (wb->names ||
#ifdef ENABLE_BONOBO
wb->priv->workbook_views ||
#endif
......
......@@ -37,9 +37,6 @@ struct _Workbook {
/* User defined names */
GList *names;
/* All objects with expressions */
Dependent *external_dependents;
/* Attached summary information */
SummaryInfo *summary_info;
......@@ -55,11 +52,7 @@ struct _Workbook {
};
typedef struct {
GObjectClass gtk_parent_class;
/* Signals */
void (*cell_changed) (Sheet *sheet, char *contents,
int col, int row);
GObjectClass base;
} WorkbookClass;
GType workbook_get_type (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment