Commit e8a3cf61 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa

Do not let the can-close dialog box to be run twice (one from the C-w

1999-10-22  Miguel de Icaza  <miguel@gnu.org>

	* src/workbook.c (workbook_can_close): Do not let the can-close
	dialog box to be run twice (one from the C-w dialog, another from
	the Window Manager request).

	* src/widgets/widget-font-selector.c (fs_destroy): display_font is
	not a GtkObject, but a pointer to a GnomeDisplayFont which is just
	a structure "owned" by GnomePrint.

	* src/dialogs/dialog-cell-format.c (cb_set_row_height): Only
	autofit when growing, not shrinking.

	* src/cell-draw.c (cell_draw): Remove margin from here.

	* src/widgets/widget-font-selector.c (size_selected): Set the size
	here.
	(font_selector_set): Set the size here too.

	* src/dialogs/dialog-cell-format.c (apply_font_format): Use the
	font dimension from the font selector, not from the GnomeFont.
parent edddd161
1999-10-22 Miguel de Icaza <miguel@gnu.org>
* src/workbook.c (workbook_can_close): Do not let the can-close
dialog box to be run twice (one from the C-w dialog, another from
the Window Manager request).
* src/widgets/widget-font-selector.c (fs_destroy): display_font is
not a GtkObject, but a pointer to a GnomeDisplayFont which is just
a structure "owned" by GnomePrint.
* src/dialogs/dialog-cell-format.c (cb_set_row_height): Only
autofit when growing, not shrinking.
* src/cell-draw.c (cell_draw): Remove margin from here.
* src/widgets/widget-font-selector.c (size_selected): Set the size
here.
(font_selector_set): Set the size here too.
* src/dialogs/dialog-cell-format.c (apply_font_format): Use the
font dimension from the font selector, not from the GnomeFont.
1999-10-21 Miguel de Icaza <miguel@gnu.org>
* src/sheet.c (sheet_accept_pending_input): Focus current sheet
......
1999-10-22 Miguel de Icaza <miguel@gnu.org>
* src/workbook.c (workbook_can_close): Do not let the can-close
dialog box to be run twice (one from the C-w dialog, another from
the Window Manager request).
* src/widgets/widget-font-selector.c (fs_destroy): display_font is
not a GtkObject, but a pointer to a GnomeDisplayFont which is just
a structure "owned" by GnomePrint.
* src/dialogs/dialog-cell-format.c (cb_set_row_height): Only
autofit when growing, not shrinking.
* src/cell-draw.c (cell_draw): Remove margin from here.
* src/widgets/widget-font-selector.c (size_selected): Set the size
here.
(font_selector_set): Set the size here too.
* src/dialogs/dialog-cell-format.c (apply_font_format): Use the
font dimension from the font selector, not from the GnomeFont.
1999-10-21 Miguel de Icaza <miguel@gnu.org>
* src/sheet.c (sheet_accept_pending_input): Focus current sheet
......
module GNOME {
module Gnumeric {
struct CellRange {
string cell_a;
string cell_b;
};
const short VALUE_STRING = 0;
const short VALUE_INTEGER = 1;
const short VALUE_FLOAT = 2;
const short VALUE_CELLRANGE = 3;
const short VALUE_ARRAY = 4;
const short VALUE_BOOLEAN = 5;
const short VALUE_ERROR = 6;
const short VALUE_EMPTY = 7;
union Value switch(short) {
case VALUE_BOOLEAN: boolean v_bool;
case VALUE_FLOAT: double v_float;
case VALUE_INTEGER: long v_int;
case VALUE_STRING: string str;
case VALUE_ERROR: string error;
case VALUE_ARRAY: string array;
case VALUE_CELLRANGE: CellRange cell_range;
};
union VecValue switch (short) {
case VALUE_FLOAT: double v_float;
case VALUE_STRING: string str;
};
typedef sequence<VecValue> VecValueVec;
typedef sequence<double> DoubleVec;
};
};
#include <bonobo.idl>
#include "Gnumeric-value.idl"
module GNOME {
module Gnumeric {
struct CellRange {
string cell_a;
string cell_b;
};
const short VALUE_STRING = 0;
const short VALUE_INTEGER = 1;
const short VALUE_FLOAT = 2;
const short VALUE_CELLRANGE = 3;
const short VALUE_ARRAY = 4;
const short VALUE_BOOLEAN = 5;
const short VALUE_ERROR = 6;
const short VALUE_EMPTY = 7;
union Value switch(short) {
case VALUE_BOOLEAN: boolean v_bool;
case VALUE_FLOAT: double v_float;
case VALUE_INTEGER: long v_int;
case VALUE_STRING: string str;
case VALUE_ERROR: string error;
case VALUE_ARRAY: string array;
case VALUE_CELLRANGE: CellRange cell_range;
};
union VecValue switch (short) {
case VALUE_FLOAT: double v_float;
case VALUE_STRING: string str;
};
typedef sequence<VecValue> VecValueVec;
typedef sequence<double> DoubleVec;
interface Sheet {
exception OutOfRange {};
exception ParseError {};
......
......@@ -183,7 +183,7 @@ CLEANFILES = my_gnumeric_idl
$(GNUMERIC_CORBA_GENERATED): my_gnumeric_idl
my_gnumeric_idl: Gnumeric.idl Gnumeric-value.idl
my_gnumeric_idl: Gnumeric.idl
orbit-idl -I`$(GNOME_CONFIG) --datadir`/idl -I$(srcdir) $(srcdir)/Gnumeric.idl
touch my_gnumeric_idl
......
......@@ -124,7 +124,7 @@ cell_draw (Cell *cell, SheetView *sheet_view, GdkGC *gc, GdkDrawable *drawable,
char *text;
font = sheet_view_font (sheet_view, cell);
text_base = y1 + cell->row->pixels - cell->row->margin_b - font->descent;
text_base = y1 + cell->row->pixels - font->descent;
cell_get_span (cell, &start_col, &end_col);
......
......@@ -535,9 +535,13 @@ create_font_page (GtkWidget *prop_win, CellList *cells)
}
static gboolean
cb_set_row_height(Sheet *sheet, ColRowInfo *info, void *height)
cb_set_row_height(Sheet *sheet, ColRowInfo *info, void *_height)
{
sheet_row_set_internal_height (sheet, info, *((double *)height));
double height = * (double *) _height;
if (info->units < height)
sheet_row_set_internal_height (sheet, info, height);
return FALSE;
}
......@@ -557,12 +561,13 @@ apply_font_format (Style *style, Sheet *sheet, CellList *cells)
gnome_font = gnome_display_font->gnome_font;
family_name = gnome_font->fontmap_entry->familyname;
height = gnome_display_font->gnome_font->size;
height = font_sel->size;
style->valid_flags |= STYLE_FONT;
style->font = style_font_new (
family_name,
gnome_font->size,
height,
sheet->last_zoom_factor_used,
gnome_font->fontmap_entry->weight_code >= GNOME_FONT_BOLD,
gnome_font->fontmap_entry->italic);
......
......@@ -85,7 +85,7 @@ item_edit_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
*/
gdk_draw_text (drawable, font, canvas->style->black_gc,
dx, dy + hd - font->descent - 1, text, cursor_pos);
dx, dy + hd - font->descent, text, cursor_pos);
gdk_draw_line (drawable, canvas->style->black_gc,
first_part_len + dx,
dy + hd - font->descent,
......@@ -93,7 +93,7 @@ item_edit_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
dy + hd - (font->ascent + font->descent));
gdk_draw_text (drawable, font, canvas->style->black_gc,
dx + first_part_len,
dy + hd - font->descent - 1,
dy + hd - font->descent,
text + cursor_pos, text_len - cursor_pos);
}
......
......@@ -166,6 +166,7 @@ size_selected (GtkCList *size_list, int col, int row, GdkEvent *event, FontSelec
row = GPOINTER_TO_INT (size_list->selection->data);
gtk_clist_get_text (size_list, row, 0, &text);
gtk_entry_set_text (GTK_ENTRY (fs->font_size_entry), text);
fs->size = atof (text);
}
static void
......@@ -221,6 +222,7 @@ fs_init (FontSelector *fs)
gtk_widget_destroy (old_parent);
gtk_widget_queue_resize (toplevel);
fs->size = 10;
fs->font_name_entry = glade_xml_get_widget (fs->gui, "font-name-entry");
fs->font_style_entry = glade_xml_get_widget (fs->gui, "font-style-entry");
fs->font_size_entry = glade_xml_get_widget (fs->gui, "font-size-entry");
......@@ -240,9 +242,6 @@ fs_destroy (GtkObject *object)
if (fs->gnome_font)
gtk_object_unref (GTK_OBJECT (fs->gnome_font));
if (fs->display_font)
gtk_object_unref (GTK_OBJECT (fs->display_font));
((GtkObjectClass *)fs_parent_class)->destroy (object);
}
......@@ -342,5 +341,6 @@ font_selector_set (FontSelector *fs,
gtk_entry_set_text (GTK_ENTRY (fs->font_size_entry), buffer);
}
fs->size = size;
}
......@@ -458,13 +458,20 @@ static int
workbook_can_close (Workbook *wb)
{
CloseAction allow_close;
static int in_can_close;
if (in_can_close)
return FALSE;
in_can_close = TRUE;
do {
allow_close = CLOSE_ALLOW;
g_hash_table_foreach (
wb->sheets, cb_sheet_check_dirty, &allow_close);
} while (allow_close == CLOSE_RECHECK);
in_can_close = FALSE;
g_assert (allow_close == CLOSE_ALLOW || allow_close == CLOSE_DENY);
return allow_close == CLOSE_ALLOW;
}
......
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