Commit 89aa026e authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

define G_OBJECT_GET_CLASS to simplify porting to 2.0

2001-12-24  Jody Goldberg <jody@gnome.org>

	* src/gnumeric.h : define G_OBJECT_GET_CLASS to simplify porting to 2.0

	For Yukihiro Nakai  <nakai@gnome.gr.jp>
	* src/stf-parse.c (stf_parse_is_valid_data) : check for multi-byte
	  before using locale specific isprint.
parent 406b416a
2001-12-24 Jody Goldberg <jody@gnome.org>
* src/gnumeric.h : define G_OBJECT_GET_CLASS to simplify porting to 2.0
For Yukihiro Nakai <nakai@gnome.gr.jp>
* src/stf-parse.c (stf_parse_is_valid_data) : check for multi-byte
before using locale specific isprint.
2001-12-24 Jody Goldberg <jody@gnome.org>
* src/style-condition.c (style_condition_expr_eval) : mark as needing
......
2001-12-24 Jody Goldberg <jody@gnome.org>
* src/gnumeric.h : define G_OBJECT_GET_CLASS to simplify porting to 2.0
For Yukihiro Nakai <nakai@gnome.gr.jp>
* src/stf-parse.c (stf_parse_is_valid_data) : check for multi-byte
before using locale specific isprint.
2001-12-24 Jody Goldberg <jody@gnome.org>
* src/style-condition.c (style_condition_expr_eval) : mark as needing
......
2001-12-24 Jody Goldberg <jody@gnome.org>
* src/gnumeric.h : define G_OBJECT_GET_CLASS to simplify porting to 2.0
For Yukihiro Nakai <nakai@gnome.gr.jp>
* src/stf-parse.c (stf_parse_is_valid_data) : check for multi-byte
before using locale specific isprint.
2001-12-24 Jody Goldberg <jody@gnome.org>
* src/style-condition.c (style_condition_expr_eval) : mark as needing
......
2001-12-24 Jody Goldberg <jody@gnome.org>
* src/gnumeric.h : define G_OBJECT_GET_CLASS to simplify porting to 2.0
For Yukihiro Nakai <nakai@gnome.gr.jp>
* src/stf-parse.c (stf_parse_is_valid_data) : check for multi-byte
before using locale specific isprint.
2001-12-24 Jody Goldberg <jody@gnome.org>
* src/style-condition.c (style_condition_expr_eval) : mark as needing
......
2001-12-24 Jody Goldberg <jody@gnome.org>
* boot.c (xbase_field_as_value) : be more picky about parsing dates.
The spec states that they must be in this format.
2001-12-15 Jody Goldberg <jody@gnome.org>
* Release 0.99.0
......
......@@ -108,7 +108,7 @@ xbase_field_as_value (guint8 *content, XBfield *field)
case 'D': {
/* double check that the date is stored according to spec */
int year, month, day;
if (sscanf (s, "%4d%2d%2d", &year, &month, &day)) {
if (sscanf (s, "%4d%2d%2d", &year, &month, &day) == 3) {
GDate *date = g_date_new_dmy (day, month, year);
val = value_new_int (datetime_g_to_serial (date));
g_date_free (date);
......
......@@ -13,7 +13,7 @@
#include <gal/util/e-util.h>
#include <libgnome/gnome-i18n.h>
#define CC_CLASS(o) COMMAND_CONTEXT_CLASS (GTK_OBJECT (o)->klass)
#define CC_CLASS(o) COMMAND_CONTEXT_CLASS (G_OBJECT_GET_CLASS (o))
/**
* command_context_format_message:
......
......@@ -103,6 +103,7 @@
#define GNUMERIC_COMMAND_CLASS(k) (GTK_CHECK_CLASS_CAST((k), GNUMERIC_COMMAND_TYPE, GnumericCommandClass))
#define IS_GNUMERIC_COMMAND(o) (GTK_CHECK_TYPE ((o), GNUMERIC_COMMAND_TYPE))
#define IS_GNUMERIC_COMMAND_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), GNUMERIC_COMMAND_TYPE))
#define CMD_CLASS(o) (GNUMERIC_COMMAND_CLASS (cmd->parent.klass))
typedef struct
{
......@@ -280,7 +281,7 @@ command_undo (WorkbookControl *wbc)
cmd = GNUMERIC_COMMAND (wb->undo_commands->data);
g_return_if_fail (cmd != NULL);
klass = GNUMERIC_COMMAND_CLASS (cmd->parent.klass);
klass = CMD_CLASS (cmd);
g_return_if_fail (klass != NULL);
/* TRUE indicates a failure to undo. Leave the command where it is */
......@@ -321,7 +322,7 @@ command_redo (WorkbookControl *wbc)
cmd = GNUMERIC_COMMAND (wb->redo_commands->data);
g_return_if_fail (cmd != NULL);
klass = GNUMERIC_COMMAND_CLASS (cmd->parent.klass);
klass = CMD_CLASS (cmd);
g_return_if_fail (klass != NULL);
/* TRUE indicates a failure to redo. Leave the command where it is */
......@@ -533,7 +534,7 @@ command_push_undo (WorkbookControl *wbc, GtkObject *obj)
cmd = GNUMERIC_COMMAND (obj);
g_return_val_if_fail (cmd != NULL, TRUE);
klass = GNUMERIC_COMMAND_CLASS (cmd->parent.klass);
klass = CMD_CLASS (cmd);
g_return_val_if_fail (klass != NULL, TRUE);
/* TRUE indicates a failure to do the command */
......
......@@ -28,7 +28,7 @@
#include <stdlib.h>
#define PARENT_TYPE (gtk_object_get_type ())
#define ACC(o) (COMPLETE_CLASS (GTK_OBJECT (o)->klass))
#define ACC(o) (COMPLETE_CLASS (G_OBJECT_GET_CLASS (o)))
static GtkObjectClass *parent_class;
......
......@@ -192,7 +192,7 @@ typedef struct _FormatState
GtkEntry *title;
GtkText *msg;
} input_msg;
void (*dialog_changed) (gpointer user_data);
gpointer dialog_changed_user_data;
} FormatState;
......@@ -331,7 +331,7 @@ setup_color_pickers (ColorPicker *picker,
picker->combo = combo;
picker->preview_update = preview_update;
switch (e) {
case MSTYLE_COLOR_PATTERN: /* Fall through */
case MSTYLE_COLOR_FORE:
......@@ -1256,14 +1256,14 @@ cb_font_changed (GtkWidget *widget, MStyle *mstyle, FormatState *state)
if (!state->enable_edit)
return;
for (i = 0 ; i < num_font_types; i++) {
for (i = 0 ; i < num_font_types; i++) {
MStyleElementType const t = font_types[i];
if (mstyle_is_element_set (mstyle, t)) {
mstyle_replace_element (mstyle, state->result, t);
changed = TRUE;
}
}
if (changed)
fmt_dialog_changed (state);
}
......@@ -1342,7 +1342,7 @@ fmt_dialog_init_font_page (FormatState *state)
state->font.selector = FONT_SELECTOR (font_widget);
font_selector_set_value (state->font.selector, state->value);
if (!mstyle_is_element_conflict (state->style, MSTYLE_FONT_NAME))
font_selector_set_name (state->font.selector,
mstyle_get_font_name (state->style));
......@@ -1408,7 +1408,7 @@ static void
draw_pattern_preview (FormatState *state)
{
g_return_if_fail (state->back.style != NULL);
fmt_dialog_changed (state);
if (state->enable_edit) {
......@@ -1425,23 +1425,23 @@ static void
cb_back_preview_color (ColorCombo *combo, GdkColor *c, gboolean by_user, FormatState *state)
{
state->back.back_color_is_default = (c == NULL);
if (c != NULL) {
mstyle_set_border (state->back.style, MSTYLE_BORDER_DIAGONAL,
style_border_ref (style_border_none ()));
mstyle_set_border (state->back.style, MSTYLE_BORDER_REV_DIAGONAL,
style_border_ref (style_border_none ()));
mstyle_set_color (state->back.style, MSTYLE_COLOR_BACK,
style_color_new (c->red, c->green, c->blue));
mstyle_set_pattern (state->back.style, state->back.pattern.cur_index);
mstyle_set_pattern (state->back.style, state->back.pattern.cur_index);
} else {
StyleBorder *border = style_border_fetch (STYLE_BORDER_THIN, style_color_black (), STYLE_BORDER_DIAGONAL);
mstyle_set_border (state->back.style, MSTYLE_BORDER_DIAGONAL, style_border_ref (border));
mstyle_set_border (state->back.style, MSTYLE_BORDER_REV_DIAGONAL, style_border_ref (border));
style_border_unref (border);
gtk_toggle_button_set_active (state->back.pattern.default_button, TRUE);
color_combo_set_color (COLOR_COMBO (state->back.pattern_color.combo), &gs_black);
......@@ -1449,7 +1449,7 @@ cb_back_preview_color (ColorCombo *combo, GdkColor *c, gboolean by_user, FormatS
style_color_new (0xffff, 0xffff, 0xffff));
mstyle_set_pattern (state->back.style, 0);
}
draw_pattern_preview (state);
}
......@@ -1475,7 +1475,7 @@ fmt_dialog_init_background_page (FormatState *state)
{
int w = 0;
int h = 0;
state->back.canvas =
GNOME_CANVAS (glade_xml_get_widget (state->gui, "back_sample"));
......@@ -1486,7 +1486,7 @@ fmt_dialog_init_background_page (FormatState *state)
gtk_object_get (GTK_OBJECT (state->back.canvas), "width", &w,
"height", &h, NULL);
gnome_canvas_set_scroll_region (state->back.canvas, -1, -1, w, h);
state->back.grid = PREVIEW_GRID (gnome_canvas_item_new (
gnome_canvas_root (state->back.canvas),
preview_grid_get_type (),
......@@ -2011,7 +2011,7 @@ static ExprTree *
validation_entry_to_expr (Sheet *sheet, GnumericExprEntry *gee)
{
ParsePos pp;
return gnumeric_expr_entry_parse (gee,
return gnumeric_expr_entry_parse (gee,
parse_pos_init (&pp, sheet->workbook, sheet, 0, 0), FALSE);
}
......@@ -2019,16 +2019,18 @@ static void
validation_rebuild_validation (FormatState *state)
{
StyleCondition *sc = NULL;
int constraint = gnumeric_option_menu_get_selected_index (state->validation.constraint_type);
int constraint;
if (!state->enable_edit)
return;
state->validation.changed = FALSE;
constraint = gnumeric_option_menu_get_selected_index (
state->validation.constraint_type);
if (constraint != 0) {
StyleCondition *scl = NULL;
int operator = gnumeric_option_menu_get_selected_index (state->validation.operator);
if (operator > 1) {
ExprTree *bound = validation_entry_to_expr (state->sheet, state->validation.bound1.entry);
if (bound != NULL)
......@@ -2067,7 +2069,7 @@ validation_rebuild_validation (FormatState *state)
flags |= SCF_ALLOW_BLANK;
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (state->validation.in_dropdown)))
flags |= SCF_IN_CELL_DROPDOWN;
scf = style_condition_new_flags (flags);
style_condition_chain (scl, SCB_OR, scf);
scl = scf;
......@@ -2087,10 +2089,10 @@ validation_rebuild_validation (FormatState *state)
g_free (msg);
g_free (title);
} else {
if (mstyle_is_element_set (state->result, MSTYLE_VALIDATION))
mstyle_unset_element (state->result, MSTYLE_VALIDATION);
if (!mstyle_is_element_set (state->result, MSTYLE_VALIDATION))
return;
mstyle_unset_element (state->result, MSTYLE_VALIDATION);
}
fmt_dialog_changed (state);
}
......@@ -2104,10 +2106,10 @@ cb_validation_error_action_deactivate (GtkMenuShell *shell, FormatState *state)
gtk_widget_set_sensitive (GTK_WIDGET (state->validation.error.msg_label), flag);
gtk_widget_set_sensitive (GTK_WIDGET (state->validation.error.title), flag);
gtk_widget_set_sensitive (GTK_WIDGET (state->validation.error.msg), flag);
if (flag) {
char *s = NULL;
switch (index) {
case 1 :
s = gnome_pixmap_file ("gnome-error.png");
......@@ -2119,7 +2121,7 @@ cb_validation_error_action_deactivate (GtkMenuShell *shell, FormatState *state)
s = gnome_pixmap_file ("gnome-info.png");
break;
}
if (s != NULL) {
gnome_pixmap_load_file (state->validation.error.image, s);
g_free (s);
......@@ -2127,7 +2129,7 @@ cb_validation_error_action_deactivate (GtkMenuShell *shell, FormatState *state)
gtk_widget_show (GTK_WIDGET (state->validation.error.image));
} else
gtk_widget_hide (GTK_WIDGET (state->validation.error.image));
validation_rebuild_validation (state);
}
......@@ -2135,7 +2137,7 @@ static void
cb_validation_operator_deactivate (GtkMenuShell *shell, FormatState *state)
{
int index = gnumeric_option_menu_get_selected_index (state->validation.operator);
if (index > 1) {
gtk_widget_hide (GTK_WIDGET (state->validation.bound2.name));
gtk_widget_hide (GTK_WIDGET (state->validation.bound2.entry));
......@@ -2165,7 +2167,7 @@ cb_validation_operator_deactivate (GtkMenuShell *shell, FormatState *state)
default :
g_warning ("Unknown operator index");
}
validation_rebuild_validation (state);
}
......@@ -2173,7 +2175,7 @@ static void
cb_validation_constraint_type_deactivate (GtkMenuShell *shell, FormatState *state)
{
gboolean flag = (gnumeric_option_menu_get_selected_index (state->validation.constraint_type) != 0);
gtk_widget_set_sensitive (GTK_WIDGET (state->validation.operator), flag);
gtk_widget_set_sensitive (GTK_WIDGET (state->validation.bound1.entry), flag);
gtk_widget_set_sensitive (GTK_WIDGET (state->validation.bound2.entry), flag);
......@@ -2186,7 +2188,7 @@ cb_validation_constraint_type_deactivate (GtkMenuShell *shell, FormatState *stat
gtk_widget_set_sensitive (GTK_WIDGET (state->validation.error.action_label), flag);
gtk_widget_set_sensitive (GTK_WIDGET (state->validation.error.action), flag);
cb_validation_error_action_deactivate (GTK_MENU_SHELL (gtk_option_menu_get_menu (state->validation.error.action)), state);
}
......@@ -2223,7 +2225,7 @@ fmt_dialog_init_validation_from_style_condition (FormatState *state, StyleCondit
for (sci = sc; sci != NULL; sci = sci->next) {
char *text = NULL;
switch (sci->type) {
case SCT_EXPR :
if (!got_bound1) {
......@@ -2235,7 +2237,7 @@ fmt_dialog_init_validation_from_style_condition (FormatState *state, StyleCondit
text = expr_tree_as_string (sci->u.expr.dep.expression, &pp);
gtk_entry_set_text (GTK_ENTRY (state->validation.bound1.entry), text);
g_free (text);
bound1_op = sci->u.expr.op;
got_bound1 = TRUE;
} else if (!got_bound2) {
......@@ -2258,7 +2260,7 @@ fmt_dialog_init_validation_from_style_condition (FormatState *state, StyleCondit
text = expr_tree_as_string (sci->u.expr.dep.expression, &pp);
gtk_entry_set_text (GTK_ENTRY (state->validation.bound2.entry), text);
g_free (text);
got_bound2 = TRUE;
} else {
/*
......@@ -2367,7 +2369,7 @@ fmt_dialog_init_validation_page (FormatState *state)
* Maps directly onto the error style option menu
*/
gtk_option_menu_set_history (state->validation.error.action, v->vs);
if (v->title)
gtk_entry_set_text (GTK_ENTRY (state->validation.error.title), v->title->str);
......@@ -2377,7 +2379,7 @@ fmt_dialog_init_validation_page (FormatState *state)
fmt_dialog_init_validation_from_style_condition (state, v->sc);
}
cb_validation_constraint_type_deactivate (GTK_MENU_SHELL (gtk_option_menu_get_menu (state->validation.constraint_type)), state);
cb_validation_operator_deactivate (GTK_MENU_SHELL (gtk_option_menu_get_menu (state->validation.operator)), state);
}
......@@ -2388,7 +2390,7 @@ static void
cb_input_msg_flag_toggled (GtkToggleButton *button, FormatState *state)
{
gboolean flag = gtk_toggle_button_get_active (button);
gtk_widget_set_sensitive (GTK_WIDGET (state->input_msg.title_label), flag);
gtk_widget_set_sensitive (GTK_WIDGET (state->input_msg.msg_label), flag);
gtk_widget_set_sensitive (GTK_WIDGET (state->input_msg.title), flag);
......@@ -2408,7 +2410,7 @@ fmt_dialog_init_input_msg_page (FormatState *state)
gtk_notebook_remove_page (GTK_NOTEBOOK (GNOME_PROPERTY_BOX (state->dialog)->notebook), 7);
return;
#endif
/* Setup widgets */
state->input_msg.flag = GTK_TOGGLE_BUTTON (glade_xml_get_widget (state->gui, "input_msg_flag"));
state->input_msg.title_label = GTK_LABEL (glade_xml_get_widget (state->gui, "input_msg_title_label"));
......@@ -2484,13 +2486,15 @@ cb_fmt_dialog_set_focus (GtkWidget *window, GtkWidget *focus_widget,
if (IS_GNUMERIC_EXPR_ENTRY (focus_widget)) {
GnumericExprEntryFlags flags;
wbcg_set_entry (state->wbcg,
GNUMERIC_EXPR_ENTRY (focus_widget));
flags = GNUM_EE_ABS_ROW | GNUM_EE_ABS_COL | GNUM_EE_SHEET_OPTIONAL;
gnumeric_expr_entry_set_flags (state->validation.bound1.entry, flags, flags);
gnumeric_expr_entry_set_flags (state->validation.bound2.entry, flags, flags);
gnumeric_expr_entry_set_flags (state->validation.bound1.entry,
flags, flags | GNUM_EE_SINGLE_RANGE);
gnumeric_expr_entry_set_flags (state->validation.bound2.entry,
flags, flags | GNUM_EE_SINGLE_RANGE);
} else
wbcg_set_entry (state->wbcg, NULL);
}
......@@ -2657,7 +2661,7 @@ fmt_dialog_impl (FormatState *state, FormatDialogPosition_t pageno)
fmt_dialog_init_protection_page (state);
fmt_dialog_init_validation_page (state);
fmt_dialog_init_input_msg_page (state);
/* Setup border line pattern buttons & select the 1st button */
for (i = MSTYLE_BORDER_TOP; i < MSTYLE_BORDER_DIAGONAL; i++) {
StyleBorder const *border = mstyle_get_border (state->style, i);
......@@ -2772,7 +2776,7 @@ fmt_dialog_impl (FormatState *state, FormatDialogPosition_t pageno)
set_initial_focus (state);
gtk_notebook_set_scrollable (GTK_NOTEBOOK (GNOME_PROPERTY_BOX (dialog)->notebook), TRUE);
/* Ok, edit events from now on are real */
state->enable_edit = TRUE;
......@@ -2788,7 +2792,7 @@ fmt_dialog_impl (FormatState *state, FormatDialogPosition_t pageno)
* then move around and apply it to different cells.
*/
wbcg_edit_attach_guru (state->wbcg, GTK_WIDGET (state->dialog));
gnumeric_dialog_show (state->wbcg, GNOME_DIALOG (dialog), FALSE, TRUE);
}
......
......@@ -9,7 +9,7 @@
#define IS_GNUM_FILE_OPENER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_GNUM_FILE_OPENER))
#define GNUM_FILE_OPENER_METHOD(obj,name) \
((GNUM_FILE_OPENER_CLASS (GTK_OBJECT (obj)->klass))->name)
((GNUM_FILE_OPENER_CLASS (G_OBJECT_GET_CLASS (obj)))->name)
struct _GnumFileOpenerClass {
GtkObjectClass parent_class;
......@@ -45,7 +45,7 @@ void gnum_file_opener_setup (GnumFileOpener *fo, const gchar *id,
#define IS_GNUM_FILE_SAVER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_GNUM_FILE_SAVER))
#define GNUM_FILE_SAVER_METHOD(obj,name) \
((GNUM_FILE_SAVER_CLASS (GTK_OBJECT (obj)->klass))->name)
((GNUM_FILE_SAVER_CLASS (G_OBJECT_GET_CLASS (obj)))->name)
struct _GnumFileSaverClass {
GtkObjectClass parent_class;
......
......@@ -125,4 +125,7 @@ typedef enum _SpanCalcFlags {
typedef struct _SearchReplace SearchReplace;
/* simplify porting to gtk-2 */
#define G_OBJECT_GET_CLASS(obj) (GTK_OBJECT(obj)->klass)
#endif /* GNUMERIC_H */
......@@ -15,7 +15,7 @@
#include <gal/util/e-util.h>
#define PARENT_TYPE (gtk_object_get_type ())
#define PL_GET_CLASS(loader) GNUMERIC_PLUGIN_LOADER_CLASS (GTK_OBJECT (loader)->klass)
#define PL_GET_CLASS(loader) GNUMERIC_PLUGIN_LOADER_CLASS (G_OBJECT_GET_CLASS (loader))
void gnumeric_plugin_loader_unload_service_general_real (GnumericPluginLoader *loader,
PluginService *service,
......
......@@ -1516,7 +1516,7 @@ scg_cursor_visible (SheetControlGUI *scg, gboolean is_visible)
/***************************************************************************/
#define SO_CLASS(so) SHEET_OBJECT_CLASS(GTK_OBJECT(so)->klass)
#define SO_CLASS(so) SHEET_OBJECT_CLASS (G_OBJECT_GET_CLASS(so))
static void
scg_object_stop_editing (SheetControlGUI *scg, SheetObject *so)
......@@ -1635,7 +1635,7 @@ display_object_menu (SheetObject *so, GnomeCanvasItem *view, GdkEvent *event)
scg_mode_edit_object (scg, so);
menu = GTK_MENU (gtk_menu_new ());
SHEET_OBJECT_CLASS (GTK_OBJECT(so)->klass)->populate_menu (so, GTK_OBJECT (view), menu);
SHEET_OBJECT_CLASS (G_OBJECT_GET_CLASS(so))->populate_menu (so, GTK_OBJECT (view), menu);
gtk_widget_show_all (GTK_WIDGET (menu));
gnumeric_popup_menu (menu, &event->button);
......
......@@ -38,7 +38,7 @@
static SheetObjectClass *sheet_object_bonobo_parent_class;
#define SOB_CLASS(o) SHEET_OBJECT_CLASS (GTK_OBJECT (o)->klass)
#define SOB_CLASS(o) SHEET_OBJECT_CLASS (G_OBJECT_GET_CLASS (o))
static void
sheet_object_bonobo_destroy (GtkObject *object)
......
......@@ -51,7 +51,7 @@
#define SHEET_OBJECT_WIDGET(obj) (GTK_CHECK_CAST((obj), SHEET_OBJECT_WIDGET_TYPE, SheetObjectWidget))
#define SHEET_OBJECT_WIDGET_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), SHEET_OBJECT_WIDGET_TYPE, SheetObjectWidgetClass))
#define IS_SHEET_WIDGET_OBJECT(o) (GTK_CHECK_TYPE((o), SHEET_OBJECT_WIDGET_TYPE))
#define SOW_CLASS(so) (SHEET_OBJECT_WIDGET_CLASS (GTK_OBJECT(so)->klass))
#define SOW_CLASS(so) (SHEET_OBJECT_WIDGET_CLASS (G_OBJECT_GET_CLASS(so)))
#define SOW_MAKE_TYPE(n1, n2, fn_config, fn_set_sheet, fn_clear_sheet,\
fn_clone, fn_write_xml, fn_read_xml) \
......
......@@ -30,12 +30,11 @@
#include <gal/util/e-util.h>
/* Returns the class for a SheetObject */
#define SO_CLASS(so) SHEET_OBJECT_CLASS(GTK_OBJECT(so)->klass)
#define SO_CLASS(so) SHEET_OBJECT_CLASS(G_OBJECT_GET_CLASS(so))
#define SO_VIEW_SHEET_CONTROL_KEY "SheetControl"
#define SO_VIEW_OBJECT_KEY "SheetObject"
GtkType sheet_object_get_type (void);
static GtkObjectClass *sheet_object_parent_class;
static void
......
......@@ -29,6 +29,8 @@
#include "clipboard.h"
#include <ctype.h>
#include <wctype.h>
#include <stdlib.h>
#define WARN_TOO_MANY_ROWS _("Too many rows in data to parse: %d")
#define WARN_TOO_MANY_COLS _("Too many columns in data to parse: %d")
......@@ -860,10 +862,24 @@ char const *
stf_parse_is_valid_data (char const *data)
{
unsigned char const *s;
wchar_t wstr;
int len;
for (s = data; *s != '\0'; s++)
if (!isprint (*s) && !isspace (*s))
for (s = data; *s != '\0';) {
len = mblen(s, MB_CUR_MAX);
if (len == -1)
return (char *)s;
if (len > 1) {
if (mbstowcs (&wstr, s, 1) == 1 &&
!iswprint (wstr) && !iswspace (wstr))
return (char *)s;
s += len;
} else {
if (!isprint (*s) && !isspace (*s))
return (char *)s;
s++;
}
}
return NULL;
}
......
......@@ -521,7 +521,7 @@ cb_scg_destroy (SheetControlGUI *scg, GnumericExprEntry *expr_entry)
* %GNUM_EE_ABS_ROW Row reference must be absolute.
* %GNUM_EE_FULL_COL Range consists of full columns.
* %GNUM_EE_FULL_ROW Range consists of full rows.
* %GNUM_EE_SHEET_OPTIONAL Sheet must not be displayed if current sheet.
* %GNUM_EE_SHEET_OPTIONAL Current sheet name not auto-added.
**/
void
gnumeric_expr_entry_set_flags (GnumericExprEntry *ee,
......
......@@ -12,7 +12,7 @@
#include "workbook-control-priv.h"
#include <gal/util/e-util.h>
#define CCG_CLASS(o) CMD_CONTEXT_CORBA_CLASS (GTK_OBJECT (o)->klass)
#define CCG_CLASS(o) CMD_CONTEXT_CORBA_CLASS (G_OBJECT_GET_CLASS (o))
typedef struct {
WorkbookControl parent;
......
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