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

Fix the silly edit bug tha was being reported.

Some major work on item-edit.

2000-03-31  Jody Goldberg <jgoldberg@home.com>

	* src/workbook.c : Switch over to useing GNOMEUIINFO_ITEM_ where
	  possible.
	(cb_editline_focus_in) : Do not start editing if we are already
	  editing.

	* src/utils.c (parse_cell_name) : constness.

	* src/style.c (style_font_gdk_font) : constness.
	(style_font_gdk_font) : ditto.
	(style_font_gnome_font) : ditto.
	(style_font_get_height) : ditto.

	* src/sheet.c (sheet_set_zoom_factor) : redimension all cells, rather
	  than the sparse sheet region.  Do not auto-resize.
	(sheet_cell_add) :  Adjust to new calling convention for
	  cell_calc_dimensions.
	(sheet_stop_editing) : Rename from sheet_destroy_edit_cursor.

	* src/sheet-view.c (sheet_view_get_style_font) : constness.

	* src/gnumeric-sheet.c (gnumeric_sheet_create_editing_cursor) :
	  No need to set all those arguments.
	(destroy_item_editor) : Merge into gnumeric_sheet_stop_editing.
	(gnumeric_sheet_stop_editing) : Renamed from
	  gnumeric_sheet_destroy_editing_cursor.

	* src/cell.[ch] (cell_set_rendered_text) : Adjust to new calling
	  convention for cell_calc_dimensions.
	(cell_calc_dimensions) : Adjust calling convetion to make auto
	  resizing optional.
	(calc_text_dimensions) : Adjust calling convention to directly set size.

	* src/sheet-style.c (re_dimension_cells_cb) :  Adjust to new calling
	  convention for cell_calc_dimensions.

	* src/item-edit.c : Major rework to behave better at margins,
	  correctly handle cells whose display contents span differently than
	  their displayed values, multi-line display mechanics, and a blinking
	  cursor :-)
parent 270e2714
2000-03-31 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c : Switch over to useing GNOMEUIINFO_ITEM_ where
possible.
(cb_editline_focus_in) : Do not start editing if we are already
editing.
* src/utils.c (parse_cell_name) : constness.
* src/style.c (style_font_gdk_font) : constness.
(style_font_gdk_font) : ditto.
(style_font_gnome_font) : ditto.
(style_font_get_height) : ditto.
* src/sheet.c (sheet_set_zoom_factor) : redimension all cells, rather
than the sparse sheet region. Do not auto-resize.
(sheet_cell_add) : Adjust to new calling convention for
cell_calc_dimensions.
(sheet_stop_editing) : Rename from sheet_destroy_edit_cursor.
* src/sheet-view.c (sheet_view_get_style_font) : constness.
* src/gnumeric-sheet.c (gnumeric_sheet_create_editing_cursor) :
No need to set all those arguments.
(destroy_item_editor) : Merge into gnumeric_sheet_stop_editing.
(gnumeric_sheet_stop_editing) : Renamed from
gnumeric_sheet_destroy_editing_cursor.
* src/cell.[ch] (cell_set_rendered_text) : Adjust to new calling
convention for cell_calc_dimensions.
(cell_calc_dimensions) : Adjust calling convetion to make auto
resizing optional.
(calc_text_dimensions) : Adjust calling convention to directly set size.
* src/sheet-style.c (re_dimension_cells_cb) : Adjust to new calling
convention for cell_calc_dimensions.
* src/item-edit.c : Major rework to behave better at margins,
correctly handle cells whose display contents span differently than
their displayed values, multi-line display mechanics, and a blinking
cursor :-)
2000-03-31 JP Rosevear <jpr@arcavia.com>
* src/xml-io.c (xml_read_attribute): Allow per type reading of
......@@ -46,7 +88,6 @@
* gnumeric.spec.in (Requires): Updated the requirements for
Gnumeric here.
>>>>>>> 1.123
2000-03-26 Miguel de Icaza <miguel@gnu.org>
* src/dialogs/Makefile.am (glade_msgs): Added a new missing file.
......@@ -141,7 +182,6 @@
* src/dialogs/workbook-attr.glade: Deflickerize + set initial focus.
>>>>>>> 1.117
2000-03-25 Jody Goldberg <jgoldberg@home.com>
* src/print.c (print_page) : Call setup_rotation unconditionally it
......
2000-03-31 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c : Switch over to useing GNOMEUIINFO_ITEM_ where
possible.
(cb_editline_focus_in) : Do not start editing if we are already
editing.
* src/utils.c (parse_cell_name) : constness.
* src/style.c (style_font_gdk_font) : constness.
(style_font_gdk_font) : ditto.
(style_font_gnome_font) : ditto.
(style_font_get_height) : ditto.
* src/sheet.c (sheet_set_zoom_factor) : redimension all cells, rather
than the sparse sheet region. Do not auto-resize.
(sheet_cell_add) : Adjust to new calling convention for
cell_calc_dimensions.
(sheet_stop_editing) : Rename from sheet_destroy_edit_cursor.
* src/sheet-view.c (sheet_view_get_style_font) : constness.
* src/gnumeric-sheet.c (gnumeric_sheet_create_editing_cursor) :
No need to set all those arguments.
(destroy_item_editor) : Merge into gnumeric_sheet_stop_editing.
(gnumeric_sheet_stop_editing) : Renamed from
gnumeric_sheet_destroy_editing_cursor.
* src/cell.[ch] (cell_set_rendered_text) : Adjust to new calling
convention for cell_calc_dimensions.
(cell_calc_dimensions) : Adjust calling convetion to make auto
resizing optional.
(calc_text_dimensions) : Adjust calling convention to directly set size.
* src/sheet-style.c (re_dimension_cells_cb) : Adjust to new calling
convention for cell_calc_dimensions.
* src/item-edit.c : Major rework to behave better at margins,
correctly handle cells whose display contents span differently than
their displayed values, multi-line display mechanics, and a blinking
cursor :-)
2000-03-31 JP Rosevear <jpr@arcavia.com>
* src/xml-io.c (xml_read_attribute): Allow per type reading of
......@@ -46,7 +88,6 @@
* gnumeric.spec.in (Requires): Updated the requirements for
Gnumeric here.
>>>>>>> 1.123
2000-03-26 Miguel de Icaza <miguel@gnu.org>
* src/dialogs/Makefile.am (glade_msgs): Added a new missing file.
......@@ -141,7 +182,6 @@
* src/dialogs/workbook-attr.glade: Deflickerize + set initial focus.
>>>>>>> 1.117
2000-03-25 Jody Goldberg <jgoldberg@home.com>
* src/print.c (print_page) : Call setup_rotation unconditionally it
......
......@@ -3,6 +3,12 @@ Gnumeric 0.52
Jon:
* Tearoff combo boxes
Jody:
* Bugs fixes.
* Rework canvas editor to behave nicely at boundaries and
span correctly.
--------------------------------------------------------------------------
Gnumeric 0.49
Jukka:
......
2000-03-31 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c : Switch over to useing GNOMEUIINFO_ITEM_ where
possible.
(cb_editline_focus_in) : Do not start editing if we are already
editing.
* src/utils.c (parse_cell_name) : constness.
* src/style.c (style_font_gdk_font) : constness.
(style_font_gdk_font) : ditto.
(style_font_gnome_font) : ditto.
(style_font_get_height) : ditto.
* src/sheet.c (sheet_set_zoom_factor) : redimension all cells, rather
than the sparse sheet region. Do not auto-resize.
(sheet_cell_add) : Adjust to new calling convention for
cell_calc_dimensions.
(sheet_stop_editing) : Rename from sheet_destroy_edit_cursor.
* src/sheet-view.c (sheet_view_get_style_font) : constness.
* src/gnumeric-sheet.c (gnumeric_sheet_create_editing_cursor) :
No need to set all those arguments.
(destroy_item_editor) : Merge into gnumeric_sheet_stop_editing.
(gnumeric_sheet_stop_editing) : Renamed from
gnumeric_sheet_destroy_editing_cursor.
* src/cell.[ch] (cell_set_rendered_text) : Adjust to new calling
convention for cell_calc_dimensions.
(cell_calc_dimensions) : Adjust calling convetion to make auto
resizing optional.
(calc_text_dimensions) : Adjust calling convention to directly set size.
* src/sheet-style.c (re_dimension_cells_cb) : Adjust to new calling
convention for cell_calc_dimensions.
* src/item-edit.c : Major rework to behave better at margins,
correctly handle cells whose display contents span differently than
their displayed values, multi-line display mechanics, and a blinking
cursor :-)
2000-03-31 JP Rosevear <jpr@arcavia.com>
* src/xml-io.c (xml_read_attribute): Allow per type reading of
......@@ -46,7 +88,6 @@
* gnumeric.spec.in (Requires): Updated the requirements for
Gnumeric here.
>>>>>>> 1.123
2000-03-26 Miguel de Icaza <miguel@gnu.org>
* src/dialogs/Makefile.am (glade_msgs): Added a new missing file.
......@@ -141,7 +182,6 @@
* src/dialogs/workbook-attr.glade: Deflickerize + set initial focus.
>>>>>>> 1.117
2000-03-25 Jody Goldberg <jgoldberg@home.com>
* src/print.c (print_page) : Call setup_rotation unconditionally it
......
2000-03-31 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c : Switch over to useing GNOMEUIINFO_ITEM_ where
possible.
(cb_editline_focus_in) : Do not start editing if we are already
editing.
* src/utils.c (parse_cell_name) : constness.
* src/style.c (style_font_gdk_font) : constness.
(style_font_gdk_font) : ditto.
(style_font_gnome_font) : ditto.
(style_font_get_height) : ditto.
* src/sheet.c (sheet_set_zoom_factor) : redimension all cells, rather
than the sparse sheet region. Do not auto-resize.
(sheet_cell_add) : Adjust to new calling convention for
cell_calc_dimensions.
(sheet_stop_editing) : Rename from sheet_destroy_edit_cursor.
* src/sheet-view.c (sheet_view_get_style_font) : constness.
* src/gnumeric-sheet.c (gnumeric_sheet_create_editing_cursor) :
No need to set all those arguments.
(destroy_item_editor) : Merge into gnumeric_sheet_stop_editing.
(gnumeric_sheet_stop_editing) : Renamed from
gnumeric_sheet_destroy_editing_cursor.
* src/cell.[ch] (cell_set_rendered_text) : Adjust to new calling
convention for cell_calc_dimensions.
(cell_calc_dimensions) : Adjust calling convetion to make auto
resizing optional.
(calc_text_dimensions) : Adjust calling convention to directly set size.
* src/sheet-style.c (re_dimension_cells_cb) : Adjust to new calling
convention for cell_calc_dimensions.
* src/item-edit.c : Major rework to behave better at margins,
correctly handle cells whose display contents span differently than
their displayed values, multi-line display mechanics, and a blinking
cursor :-)
2000-03-31 JP Rosevear <jpr@arcavia.com>
* src/xml-io.c (xml_read_attribute): Allow per type reading of
......@@ -46,7 +88,6 @@
* gnumeric.spec.in (Requires): Updated the requirements for
Gnumeric here.
>>>>>>> 1.123
2000-03-26 Miguel de Icaza <miguel@gnu.org>
* src/dialogs/Makefile.am (glade_msgs): Added a new missing file.
......@@ -141,7 +182,6 @@
* src/dialogs/workbook-attr.glade: Deflickerize + set initial focus.
>>>>>>> 1.117
2000-03-25 Jody Goldberg <jgoldberg@home.com>
* src/print.c (print_page) : Call setup_rotation unconditionally it
......
2000-03-31 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c : Switch over to useing GNOMEUIINFO_ITEM_ where
possible.
(cb_editline_focus_in) : Do not start editing if we are already
editing.
* src/utils.c (parse_cell_name) : constness.
* src/style.c (style_font_gdk_font) : constness.
(style_font_gdk_font) : ditto.
(style_font_gnome_font) : ditto.
(style_font_get_height) : ditto.
* src/sheet.c (sheet_set_zoom_factor) : redimension all cells, rather
than the sparse sheet region. Do not auto-resize.
(sheet_cell_add) : Adjust to new calling convention for
cell_calc_dimensions.
(sheet_stop_editing) : Rename from sheet_destroy_edit_cursor.
* src/sheet-view.c (sheet_view_get_style_font) : constness.
* src/gnumeric-sheet.c (gnumeric_sheet_create_editing_cursor) :
No need to set all those arguments.
(destroy_item_editor) : Merge into gnumeric_sheet_stop_editing.
(gnumeric_sheet_stop_editing) : Renamed from
gnumeric_sheet_destroy_editing_cursor.
* src/cell.[ch] (cell_set_rendered_text) : Adjust to new calling
convention for cell_calc_dimensions.
(cell_calc_dimensions) : Adjust calling convetion to make auto
resizing optional.
(calc_text_dimensions) : Adjust calling convention to directly set size.
* src/sheet-style.c (re_dimension_cells_cb) : Adjust to new calling
convention for cell_calc_dimensions.
* src/item-edit.c : Major rework to behave better at margins,
correctly handle cells whose display contents span differently than
their displayed values, multi-line display mechanics, and a blinking
cursor :-)
2000-03-31 JP Rosevear <jpr@arcavia.com>
* src/xml-io.c (xml_read_attribute): Allow per type reading of
......@@ -46,7 +88,6 @@
* gnumeric.spec.in (Requires): Updated the requirements for
Gnumeric here.
>>>>>>> 1.123
2000-03-26 Miguel de Icaza <miguel@gnu.org>
* src/dialogs/Makefile.am (glade_msgs): Added a new missing file.
......@@ -141,7 +182,6 @@
* src/dialogs/workbook-attr.glade: Deflickerize + set initial focus.
>>>>>>> 1.117
2000-03-25 Jody Goldberg <jgoldberg@home.com>
* src/print.c (print_page) : Call setup_rotation unconditionally it
......
2000-03-31 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c : Switch over to useing GNOMEUIINFO_ITEM_ where
possible.
(cb_editline_focus_in) : Do not start editing if we are already
editing.
* src/utils.c (parse_cell_name) : constness.
* src/style.c (style_font_gdk_font) : constness.
(style_font_gdk_font) : ditto.
(style_font_gnome_font) : ditto.
(style_font_get_height) : ditto.
* src/sheet.c (sheet_set_zoom_factor) : redimension all cells, rather
than the sparse sheet region. Do not auto-resize.
(sheet_cell_add) : Adjust to new calling convention for
cell_calc_dimensions.
(sheet_stop_editing) : Rename from sheet_destroy_edit_cursor.
* src/sheet-view.c (sheet_view_get_style_font) : constness.
* src/gnumeric-sheet.c (gnumeric_sheet_create_editing_cursor) :
No need to set all those arguments.
(destroy_item_editor) : Merge into gnumeric_sheet_stop_editing.
(gnumeric_sheet_stop_editing) : Renamed from
gnumeric_sheet_destroy_editing_cursor.
* src/cell.[ch] (cell_set_rendered_text) : Adjust to new calling
convention for cell_calc_dimensions.
(cell_calc_dimensions) : Adjust calling convetion to make auto
resizing optional.
(calc_text_dimensions) : Adjust calling convention to directly set size.
* src/sheet-style.c (re_dimension_cells_cb) : Adjust to new calling
convention for cell_calc_dimensions.
* src/item-edit.c : Major rework to behave better at margins,
correctly handle cells whose display contents span differently than
their displayed values, multi-line display mechanics, and a blinking
cursor :-)
2000-03-31 JP Rosevear <jpr@arcavia.com>
* src/xml-io.c (xml_read_attribute): Allow per type reading of
......@@ -46,7 +88,6 @@
* gnumeric.spec.in (Requires): Updated the requirements for
Gnumeric here.
>>>>>>> 1.123
2000-03-26 Miguel de Icaza <miguel@gnu.org>
* src/dialogs/Makefile.am (glade_msgs): Added a new missing file.
......@@ -141,7 +182,6 @@
* src/dialogs/workbook-attr.glade: Deflickerize + set initial focus.
>>>>>>> 1.117
2000-03-25 Jody Goldberg <jgoldberg@home.com>
* src/print.c (print_page) : Call setup_rotation unconditionally it
......
2000-03-31 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c : Switch over to useing GNOMEUIINFO_ITEM_ where
possible.
(cb_editline_focus_in) : Do not start editing if we are already
editing.
* src/utils.c (parse_cell_name) : constness.
* src/style.c (style_font_gdk_font) : constness.
(style_font_gdk_font) : ditto.
(style_font_gnome_font) : ditto.
(style_font_get_height) : ditto.
* src/sheet.c (sheet_set_zoom_factor) : redimension all cells, rather
than the sparse sheet region. Do not auto-resize.
(sheet_cell_add) : Adjust to new calling convention for
cell_calc_dimensions.
(sheet_stop_editing) : Rename from sheet_destroy_edit_cursor.
* src/sheet-view.c (sheet_view_get_style_font) : constness.
* src/gnumeric-sheet.c (gnumeric_sheet_create_editing_cursor) :
No need to set all those arguments.
(destroy_item_editor) : Merge into gnumeric_sheet_stop_editing.
(gnumeric_sheet_stop_editing) : Renamed from
gnumeric_sheet_destroy_editing_cursor.
* src/cell.[ch] (cell_set_rendered_text) : Adjust to new calling
convention for cell_calc_dimensions.
(cell_calc_dimensions) : Adjust calling convetion to make auto
resizing optional.
(calc_text_dimensions) : Adjust calling convention to directly set size.
* src/sheet-style.c (re_dimension_cells_cb) : Adjust to new calling
convention for cell_calc_dimensions.
* src/item-edit.c : Major rework to behave better at margins,
correctly handle cells whose display contents span differently than
their displayed values, multi-line display mechanics, and a blinking
cursor :-)
2000-03-31 JP Rosevear <jpr@arcavia.com>
* src/xml-io.c (xml_read_attribute): Allow per type reading of
......@@ -46,7 +88,6 @@
* gnumeric.spec.in (Requires): Updated the requirements for
Gnumeric here.
>>>>>>> 1.123
2000-03-26 Miguel de Icaza <miguel@gnu.org>
* src/dialogs/Makefile.am (glade_msgs): Added a new missing file.
......@@ -141,7 +182,6 @@
* src/dialogs/workbook-attr.glade: Deflickerize + set initial focus.
>>>>>>> 1.117
2000-03-25 Jody Goldberg <jgoldberg@home.com>
* src/print.c (print_page) : Call setup_rotation unconditionally it
......
......@@ -66,6 +66,8 @@ Gnumeric Spread Sheet task list
* Cell dimension computation is broken on font change for multi-lines.
* when copying and entire row or col we should also copy the row/col size.
* Number formatting
The formatting code should take the current GtkFont for the cell
......
......@@ -24,4 +24,4 @@ else
GB_DIR =
endif
SUBDIRS = sample excel lotus-123 oleo sc sylk ff-csv text xbase html dif $(PYTHON) $(GUILE_DIR) $(GB_DIR)
SUBDIRS = sample excel lotus-123 oleo sc sylk text xbase html dif $(PYTHON) $(GUILE_DIR) $(GB_DIR)
......@@ -22,6 +22,7 @@
#include "cellspan.h"
#include "gnumeric-util.h"
/* FIXME : Move this into workbook */
static int redraws_frozen = 0;
static int redraws_deep_frozen = 0;
static GHashTable *cell_hash_queue;
......@@ -357,7 +358,7 @@ cell_set_rendered_text (Cell *cell, const char *rendered_text)
if (oldtext)
string_unref (oldtext);
cell_calc_dimensions (cell);
cell_calc_dimensions (cell, TRUE);
}
char *
......@@ -1249,8 +1250,6 @@ cell_calculate_span (Cell const * const cell,
* @cell: The cell we are working on.
* @style: the style formatting constraints (font, alignments)
* @text: the string contents.
* @h: return value: the height used
* @w: return value: the width used.
*
* Computes the width and height used by the cell based on alignments
* constraints in the style using the font specified on the style.
......@@ -1259,22 +1258,21 @@ cell_calculate_span (Cell const * const cell,
* The line splitting code is VERY similar to cell-draw.c:cell_split_text
* please keep it that way.
*/
static void
calc_text_dimensions (Cell *cell, MStyle *mstyle,
const char *text, int *h, int *w)
void
calc_text_dimensions (Cell *cell,
MStyle const * const mstyle,
char const * const text)
{
gboolean const is_number = cell_is_number (cell);
StyleFont * const style_font =
sheet_view_get_style_font (cell->sheet, mstyle);
GdkFont * const gdk_font = style_font_gdk_font (style_font);
int const font_height = style_font_get_height (style_font);
int const text_width = gdk_string_measure (gdk_font, text);
int const cell_w = COL_INTERNAL_WIDTH (cell->col);
StyleFont *style_font = sheet_view_get_style_font (cell->sheet, mstyle);
GdkFont *gdk_font = style_font->dfont->gdk_font;
int text_width, font_height;
text_width = gdk_string_measure (gdk_font, text);
font_height = style_font_get_height (style_font);
if (text_width < cell_w || is_number){
*w = text_width;
*h = font_height;
if (text_width < cell_w || cell_is_number (cell)) {
cell->width_pixel = text_width;
cell->height_pixel = font_height;
} else if (mstyle_get_align_h (mstyle) == HALIGN_JUSTIFY ||
mstyle_get_align_v (mstyle) == VALIGN_JUSTIFY ||
mstyle_get_fit_in_cell (mstyle)) {
......@@ -1283,9 +1281,9 @@ calc_text_dimensions (Cell *cell, MStyle *mstyle,
char const *last_whitespace = NULL;
gboolean prev_was_space = FALSE;
int used = 0, used_last_space = 0;
int h = 0;
*w = cell_w;
*h = 0;
cell->width_pixel = cell_w;
for (line_begin = p = text; *p; p++){
int const len_current = gdk_text_width (gdk_font, p, 1);
......@@ -1312,7 +1310,7 @@ calc_text_dimensions (Cell *cell, MStyle *mstyle,
used = len_current;
}
*h += font_height;
h += font_height;
first_whitespace = last_whitespace = NULL;
prev_was_space = FALSE;
continue;
......@@ -1331,10 +1329,12 @@ calc_text_dimensions (Cell *cell, MStyle *mstyle,
/* Catch the final bit that did not wrap */
if (*line_begin)
*h += font_height;
h += font_height;
cell->height_pixel = h;
} else {
*w = text_width;
*h = font_height;
cell->width_pixel = text_width;
cell->height_pixel = font_height;
}
style_font_unref (style_font);
}
......@@ -1342,11 +1342,12 @@ calc_text_dimensions (Cell *cell, MStyle *mstyle,
/*
* cell_calc_dimensions
* @cell: The cell
* @auto_resize_height : If true the reow height should be resized if needed.
*
* This routine updates the dimensions of the the rendered text of a cell
*/
void
cell_calc_dimensions (Cell *cell)
cell_calc_dimensions (Cell *cell, gboolean const auto_resize_height)
{
int left, right;
......@@ -1359,17 +1360,16 @@ cell_calc_dimensions (Cell *cell)
MStyle *mstyle = sheet_style_compute (cell->sheet,
cell->col->pos,
cell->row->pos);
int h, w;
calc_text_dimensions (cell, mstyle, rendered_text, &h, &w);
cell->width_pixel = w;
cell->height_pixel = h;
calc_text_dimensions (cell, mstyle, rendered_text);
if (!cell->row->hard_size) {
if (auto_resize_height && !cell->row->hard_size) {
/* Text measurements do not include margins or grid line */
int const height_pixels =
h + cell->row->margin_a + cell->row->margin_b + 1;
/* FIXME : This never shrinks things. Switch to an async approach
* that will flag the need to update here, and will autofit later
*/
int const height_pixels = cell->height_pixel +
cell->row->margin_a + cell->row->margin_b + 1;
if (height_pixels > cell->row->size_pixels)
sheet_row_set_size_pixels (cell->sheet, cell->row->pos,
height_pixels, FALSE);
......
......@@ -117,7 +117,7 @@ char *cell_get_content (Cell *cell);
char *cell_get_value_as_text (Cell *cell);
void cell_make_value (Cell *cell);
void cell_render_value (Cell *cell);
void cell_calc_dimensions (Cell *cell);
void cell_calc_dimensions (Cell *cell, gboolean const auto_resize_height);
Cell *cell_copy (const Cell *cell);
void cell_destroy (Cell *cell);
void cell_queue_redraw (Cell *cell);
......
......@@ -275,7 +275,7 @@ cell_eval_content (Cell *cell)
cell->value = v;
cell_render_value (cell);
cell_calc_dimensions (cell);
cell_calc_dimensions (cell, TRUE);
sheet_redraw_cell_region (cell->sheet,
cell->col->pos, cell->row->pos,
......
......@@ -275,7 +275,7 @@ cell_eval_content (Cell *cell)
cell->value = v;
cell_render_value (cell);
cell_calc_dimensions (cell);
cell_calc_dimensions (cell, TRUE);
sheet_redraw_cell_region (cell->sheet,
cell->col->pos, cell->row->pos,
......
......@@ -348,59 +348,29 @@ gnumeric_sheet_create_editing_cursor (GnumericSheet *gsheet)
{
GnomeCanvas *canvas = GNOME_CANVAS (gsheet);
GnomeCanvasItem *item;
Sheet *sheet;
int col, row;
sheet = gsheet->sheet_view->sheet;
col = sheet->cursor.edit_pos.col;
row = sheet->cursor.edit_pos.row;
g_return_if_fail (gsheet->item_editor == NULL);
item = gnome_canvas_item_new (GNOME_CANVAS_GROUP (canvas->root),
item_edit_get_type (),
"ItemEdit::Sheet", sheet,
"ItemEdit::Grid", gsheet->item_grid,
"ItemEdit::Col", col,
"ItemEdit::Row", row,
"ItemEdit::GtkEntry", sheet->workbook->ea_input,
NULL);
gsheet->item_editor = ITEM_EDIT (item);
}
static void
destroy_item_editor (GnumericSheet *gsheet)
{
g_return_if_fail (gsheet->item_editor);
gtk_object_destroy (GTK_OBJECT (gsheet->item_editor));
gsheet->item_editor = NULL;
}
void
gnumeric_sheet_destroy_editing_cursor (GnumericSheet *gsheet)
{
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
gnumeric_sheet_stop_cell_selection (gsheet, FALSE);
if (!gsheet->item_editor)
return;
destroy_item_editor (gsheet);
}
void
gnumeric_sheet_stop_editing (GnumericSheet *gsheet)
{
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
if (!gsheet->item_editor)
return;
gnumeric_sheet_stop_cell_selection (gsheet, FALSE);
destroy_item_editor (gsheet);
if (gsheet->item_editor != NULL) {
gtk_object_destroy (GTK_OBJECT (gsheet->item_editor));
gsheet->item_editor = NULL;
}
}
/*
......
......@@ -65,7 +65,7 @@ void gnumeric_sheet_get_cell_bounds (GnumericSheet *gsheet,
int col, int row,
int *x, int *y, int *w, int *h);
void gnumeric_sheet_create_editing_cursor (GnumericSheet *gsheet);
void gnumeric_sheet_destroy_editing_cursor (GnumericSheet *gsheet);
void gnumeric_sheet_stop_editing (GnumericSheet *gsheet);
/* Managing the selection of cell ranges when editing a formula */
......@@ -79,7 +79,6 @@ void gnumeric_sheet_selection_cursor_base (GnumericSheet *gsheet,
int col, int row);
void gnumeric_sheet_selection_extend (GnumericSheet *gsheet,
int col, int row);
void gnumeric_sheet_stop_editing (GnumericSheet *sheet);
typedef struct {
GnomeCanvasClass parent_class;
......
......@@ -348,59 +348,29 @@ gnumeric_sheet_create_editing_cursor (GnumericSheet *gsheet)
{
GnomeCanvas *canvas = GNOME_CANVAS (gsheet);
GnomeCanvasItem *item;
Sheet *sheet;
int col, row;
sheet = gsheet->sheet_view->sheet;
col = sheet->cursor.edit_pos.col;
row = sheet->cursor.edit_pos.row;
g_return_if_fail (gsheet->item_editor == NULL);
item = gnome_canvas_item_new (GNOME_CANVAS_GROUP (canvas->root),
item_edit_get_type (),
"ItemEdit::Sheet", sheet,
"ItemEdit::Grid", gsheet->item_grid,
"ItemEdit::Col", col,
"ItemEdit::Row", row,
"ItemEdit::GtkEntry", sheet->workbook->ea_input,
NULL);
gsheet->item_editor = ITEM_EDIT (item);
}
static void
destroy_item_editor (GnumericSheet *gsheet)
{
g_return_if_fail (gsheet->item_editor);
gtk_object_destroy (GTK_OBJECT (gsheet->item_editor));
gsheet->item_editor = NULL;
}
void
gnumeric_sheet_destroy_editing_cursor (GnumericSheet *gsheet)
{
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
gnumeric_sheet_stop_cell_selection (gsheet, FALSE);
if (!gsheet->item_editor)
return;
destroy_item_editor (gsheet);
}
void
gnumeric_sheet_stop_editing (GnumericSheet *gsheet)
{
g_return_if_fail (gsheet != NULL);
g_return_if_fail (GNUMERIC_IS_SHEET (gsheet));
if (!gsheet->item_editor)
return;
gnumeric_sheet_stop_cell_selection (gsheet, FALSE);
destroy_item_editor (gsheet);
if (gsheet->item_editor != NULL) {