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

Two things that have been on my hard disk for a long time:



Two things that have been on my hard disk for a long time:

1. Comments-on-cells code is working.  We just need the nice dialog to
actually type something in.

It needs xml-io.c support though, hopefully Daniel will add this soon.

2. Dropped cell->entered_text.  We now only store the parsed version
of the cell (either as an ExprTree or as a Value).  This should help
mmeeks with his Excel-formula importing code, it should be possible
to do the right thing now instead of constructing a string representation
of the formula and re-parsing it.

Various fixes here and there as well.

Miguel

1998-11-10  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/sheet-view.c (sheet_view_comment_get_points): Scale properly
	the points to be in window cordinates.

	* src/sheet.c (sheet_col_set_width): Move comments on column
	change.

	* src/cell.c (cell_copy): Duplicated cells get col, row and sheet
	values set to NULL.

1998-11-05  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/fn-misc.c: Add ctype.h

	* src/sheet-view.c (sheet_view_comment_get_points): New utility
	routine used.
	(sheet_view_comment_relocate): New function used to relocate a
	comment canvas item in a cell to its new location.

	* src/cell.c (cell_relocate): Move the comments with the cell.
	(cell_realize, cell_unrealize, cell_comment_realize,
	cell_comment_unrealize): New functions used to create and destroy
	view-specific cell components (the comments are canvas objects
	that need to be created on a per-view basis).
parent 25bec6fa
1998-11-10 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet-view.c (sheet_view_comment_get_points): Scale properly
the points to be in window cordinates.
* src/sheet.c (sheet_col_set_width): Move comments on column
change.
* src/cell.c (cell_copy): Duplicated cells get col, row and sheet
values set to NULL.
1998-11-05 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-misc.c: Add ctype.h
* src/sheet-view.c (sheet_view_comment_get_points): New utility
routine used.
(sheet_view_comment_relocate): New function used to relocate a
comment canvas item in a cell to its new location.
* src/cell.c (cell_relocate): Move the comments with the cell.
(cell_realize, cell_unrealize, cell_comment_realize,
cell_comment_unrealize): New functions used to create and destroy
view-specific cell components (the comments are canvas objects
that need to be created on a per-view basis).
1998-11-10 Michael Meeks <michael@imaginator.com>
* plugins/excel/ms-ole.h: Added unsigned to WORD, LONG
......
1998-11-10 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet-view.c (sheet_view_comment_get_points): Scale properly
the points to be in window cordinates.
* src/sheet.c (sheet_col_set_width): Move comments on column
change.
* src/cell.c (cell_copy): Duplicated cells get col, row and sheet
values set to NULL.
1998-11-05 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-misc.c: Add ctype.h
* src/sheet-view.c (sheet_view_comment_get_points): New utility
routine used.
(sheet_view_comment_relocate): New function used to relocate a
comment canvas item in a cell to its new location.
* src/cell.c (cell_relocate): Move the comments with the cell.
(cell_realize, cell_unrealize, cell_comment_realize,
cell_comment_unrealize): New functions used to create and destroy
view-specific cell components (the comments are canvas objects
that need to be created on a per-view basis).
1998-11-10 Michael Meeks <michael@imaginator.com>
* plugins/excel/ms-ole.h: Added unsigned to WORD, LONG
......
1998-11-10 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet-view.c (sheet_view_comment_get_points): Scale properly
the points to be in window cordinates.
* src/sheet.c (sheet_col_set_width): Move comments on column
change.
* src/cell.c (cell_copy): Duplicated cells get col, row and sheet
values set to NULL.
1998-11-05 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-misc.c: Add ctype.h
* src/sheet-view.c (sheet_view_comment_get_points): New utility
routine used.
(sheet_view_comment_relocate): New function used to relocate a
comment canvas item in a cell to its new location.
* src/cell.c (cell_relocate): Move the comments with the cell.
(cell_realize, cell_unrealize, cell_comment_realize,
cell_comment_unrealize): New functions used to create and destroy
view-specific cell components (the comments are canvas objects
that need to be created on a per-view basis).
1998-11-10 Michael Meeks <michael@imaginator.com>
* plugins/excel/ms-ole.h: Added unsigned to WORD, LONG
......
1998-11-10 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/sheet-view.c (sheet_view_comment_get_points): Scale properly
the points to be in window cordinates.
* src/sheet.c (sheet_col_set_width): Move comments on column
change.
* src/cell.c (cell_copy): Duplicated cells get col, row and sheet
values set to NULL.
1998-11-05 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-misc.c: Add ctype.h
* src/sheet-view.c (sheet_view_comment_get_points): New utility
routine used.
(sheet_view_comment_relocate): New function used to relocate a
comment canvas item in a cell to its new location.
* src/cell.c (cell_relocate): Move the comments with the cell.
(cell_realize, cell_unrealize, cell_comment_realize,
cell_comment_unrealize): New functions used to create and destroy
view-specific cell components (the comments are canvas objects
that need to be created on a per-view basis).
1998-11-10 Michael Meeks <michael@imaginator.com>
* plugins/excel/ms-ole.h: Added unsigned to WORD, LONG
......
......@@ -6,8 +6,6 @@ GNOME Spread Sheet task list
Comments location needs to be reset on col/row dimenssion changes.
cell_relocate should also relocate the comment.
* Cell range naming
Finish implementing.
......
......@@ -6,6 +6,7 @@
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include "math.h"
#include "gnumeric.h"
#include "gnumeric-sheet.h"
......
......@@ -263,10 +263,69 @@ cell_comment_clicked (GnomeCanvasItem *item, GdkEvent *event, Cell *cell)
return TRUE;
}
static void
cell_comment_realize (Cell *cell)
{
GList *l;
g_return_if_fail (cell->comment != NULL);
sheet_cell_comment_link (cell);
for (l = ((Sheet *)cell->sheet)->sheet_views; l; l = l->next){
SheetView *sheet_view = SHEET_VIEW (l->data);
GnomeCanvasItem *o;
o = sheet_view_comment_create_marker (
sheet_view,
cell->col->pos, cell->row->pos);
cell->comment->realized_list = g_list_prepend (
cell->comment->realized_list, o);
gtk_signal_connect (GTK_OBJECT (o), "event",
GTK_SIGNAL_FUNC (cell_comment_clicked), cell);
}
}
static void
cell_comment_unrealize (Cell *cell)
{
GList *l;
g_return_if_fail (cell->comment != NULL);
sheet_cell_comment_unlink (cell);
for (l = cell->comment->realized_list; l; l = l->next){
GnomeCanvasItem *o = l->data;
printf ("Destruyendo: %p\n", o);
gtk_object_destroy (GTK_OBJECT (o));
}
g_list_free (cell->comment->realized_list);
cell->comment->realized_list = NULL;
}
void
cell_realize (Cell *cell)
{
g_return_if_fail (cell != NULL);
if (cell->comment)
cell_comment_realize (cell);
}
void
cell_unrealize (Cell *cell)
{
g_return_if_fail (cell != NULL);
if (cell->comment)
cell_comment_unrealize (cell);
}
void
cell_set_comment (Cell *cell, char *str)
{
GList *l;
int had_comments = FALSE;
g_return_if_fail (cell != NULL);
......@@ -286,20 +345,8 @@ cell_set_comment (Cell *cell, char *str)
if (had_comments)
cell_queue_redraw (cell);
for (l = ((Sheet *)cell->sheet)->sheet_views; l; l = l->next){
SheetView *sheet_view = SHEET_VIEW (l->data);
GnomeCanvasItem *o;
o = sheet_view_create_comment_marker (
sheet_view,
cell->col->pos, cell->row->pos);
cell->comment->realized_list = g_list_prepend (
cell->comment->realized_list, o);
gtk_signal_connect (GTK_OBJECT (o), "event",
GTK_SIGNAL_FUNC (cell_comment_clicked), cell);
}
if (cell->sheet)
cell_comment_realize (cell);
}
void
......@@ -421,15 +468,10 @@ cell_set_text_simple (Cell *cell, char *text)
cell_modified (cell);
/* The value entered */
if (cell->entered_text)
string_unref (cell->entered_text);
if (cell->value){
value_release (cell->value);
cell->value = NULL;
}
cell->entered_text = string_get (text);
if (cell->parsed_node){
sheet_cell_formula_unlink (cell);
......@@ -443,11 +485,13 @@ cell_set_text_simple (Cell *cell, char *text)
} else {
Value *v = g_new (Value, 1);
int is_text, is_float, maybe_float, has_digits;
int seen_exp;
char *p;
lconv = localeconv ();
is_text = is_float = maybe_float = has_digits = FALSE;
seen_exp = FALSE;
for (p = text; *p && !is_text; p++){
switch (*p){
case '0': case '1': case '2': case '3': case '4':
......@@ -458,9 +502,14 @@ cell_set_text_simple (Cell *cell, char *text)
case '-':
if (p == text)
break;
if (seen_exp)
is_text = TRUE;
/* falldown */
case 'E': case 'e': case '+': case ':': case '.': case ',':
if (*p == 'e' || *p == 'E')
seen_exp = TRUE;
if (*p == ',' || *p == '.')
if (*lconv->decimal_point != *p){
is_text = TRUE;
......@@ -533,14 +582,63 @@ cell_set_text (Cell *cell, char *text)
cell_queue_redraw (cell);
cell_set_text_simple (cell, text);
cell_content_changed (cell);
cell_queue_redraw (cell);
}
/**
* cell_set_formula_tree_simple:
* @cell: the cell to set the formula to
* @formula: an expression tree with the formula
*
* This is an internal function. It should be only called by routines that
* know what they are doing. These are the important differences from
* cell_set_formula:
*
* - It does not queue redraws (so you have to queue the redraw yourself
* or queue a full redraw).
*
* - It does not queue any recomputations. YOu have to queue the
* recompute yourself.
*/
void
cell_set_formula_tree_simple (Cell *cell, ExprTree *formula)
{
g_return_if_fail (cell != NULL);
g_return_if_fail (formula != NULL);
cell_modified (cell);
if (cell->parsed_node)
expr_tree_unref (cell->parsed_node);
cell->parsed_node = formula;
expr_tree_ref (formula);
cell_formula_changed (cell);
}
void
cell_set_formula_tree (Cell *cell, ExprTree *formula)
{
g_return_if_fail (cell != NULL);
cell_queue_redraw (cell);
cell_set_formula_tree_simple (cell, formula);
cell_content_changed (cell);
cell_queue_redraw (cell);
}
/*
* Makes a copy of a Cell
/**
* cell_copy:
* @cell: existing cell to duplicate
*
* Makes a copy of a Cell.
*
* Returns a copy of the cell. Note that the col, row and sheet
* fields are set to NULL.
*/
Cell *
cell_copy (Cell *cell)
......@@ -554,8 +652,11 @@ cell_copy (Cell *cell)
/* bitmap copy first */
*new_cell = *cell;
new_cell->col = NULL;
new_cell->row = NULL;
new_cell->sheet = NULL;
/* now copy propertly the rest */
string_ref (new_cell->entered_text);
if (new_cell->parsed_node)
expr_tree_ref (new_cell->parsed_node);
string_ref (new_cell->text);
......@@ -564,7 +665,8 @@ cell_copy (Cell *cell)
new_cell->value = value_duplicate (new_cell->value);
new_cell->comment = NULL;
cell_set_comment (new_cell, cell->comment->comment->str);
if (cell->comment)
cell_set_comment (new_cell, cell->comment->comment->str);
return new_cell;
}
......@@ -585,10 +687,11 @@ cell_destroy (Cell *cell)
cell_comment_destroy (cell);
string_unref (cell->entered_text);
string_unref (cell->text);
style_destroy (cell->style);
value_release (cell->value);
g_free (cell);
}
void
......@@ -696,6 +799,22 @@ cell_set_format (Cell *cell, char *format)
cell_queue_redraw (cell);
}
void
cell_comment_reposition (Cell *cell)
{
GList *l;
g_return_if_fail (cell != NULL);
g_return_if_fail (cell->comment != NULL);
for (l = cell->comment->realized_list; l; l = l->next){
GnomeCanvasItem *o = l->data;
SheetView *sheet_view = GNUMERIC_SHEET (o->canvas)->sheet_view;
sheet_view_comment_relocate (sheet_view, cell->col->pos, cell->row->pos, o);
}
}
/*
* cell_relocate:
* @cell: The cell that is changing position
......@@ -704,17 +823,12 @@ cell_set_format (Cell *cell, char *format)
*
* This routine is used to move a cell to a different location:
*
* The parsed tree is decoded as if it were evaluated at the new position
* and then it is reparsed (important only for keeping the ->entered_text
* information syncronized).
*
* Auxiliary items canvas items attached to the cell are moved.
*/
void
cell_relocate (Cell *cell, int target_col, int target_row)
{
g_return_if_fail (cell != NULL);
g_return_if_fail (cell->entered_text);
g_return_if_fail (cell->parsed_node);
/* 1. Tag the cell as modified */
......@@ -723,23 +837,13 @@ cell_relocate (Cell *cell, int target_col, int target_row)
/* 2. If the cell contains a formula, relocate the formula */
if (cell->parsed_node){
char *text, *formula;
string_unref (cell->entered_text);
text = expr_decode_tree (cell->parsed_node, target_col, target_row);
formula = g_copy_strings ("=", text, NULL);
cell->entered_text = string_get (formula);
cell_set_formula (cell, formula);
g_free (formula);
g_free (text);
expr_tree_ref (cell->parsed_node);
cell_formula_changed (cell);
}
/* 3. Move any auxiliary canvas items */
cell_comment_reposition (cell);
}
/*
......@@ -752,11 +856,6 @@ cell_make_value (Cell *cell)
g_return_if_fail (cell->parsed_node != NULL);
cell_modified (cell);
expr_tree_unref (cell->parsed_node);
cell->parsed_node = NULL;
string_unref (cell->entered_text);
cell->entered_text = string_ref (cell->text);
}
int
......@@ -1031,8 +1130,8 @@ calc_text_dimensions (int is_number, Style *style, char *text, int cell_w, int c
void
cell_calc_dimensions (Cell *cell)
{
char *rendered_text;
int left, right;
char *rendered_text;
int left, right;
g_return_if_fail (cell != NULL);
......@@ -1042,14 +1141,13 @@ cell_calc_dimensions (Cell *cell)
Style *style = cell->style;
int h, w;
rendered_text = CELL_TEXT_GET (cell);
rendered_text = cell->text->str;
calc_text_dimensions (cell_is_number (cell),
style, rendered_text,
COL_INTERNAL_WIDTH (cell->col),
ROW_INTERNAL_HEIGHT (cell->row),
&h, &w);
cell->width = cell->col->margin_a + cell->col->margin_b + w;
cell->height = cell->row->margin_a + cell->row->margin_b + h;
......@@ -1200,7 +1298,6 @@ cell_draw (Cell *cell, void *sv, GdkGC *gc, GdkDrawable *drawable, int x1, int y
font_height = font->ascent + font->descent;
halign = cell_get_horizontal_align (cell);
text = CELL_TEXT_GET (cell);
/* if a number overflows, do special drawing */
if (width < cell->width && cell_is_number (cell)){
......@@ -1214,6 +1311,7 @@ cell_draw (Cell *cell, void *sv, GdkGC *gc, GdkDrawable *drawable, int x1, int y
else
do_multi_line = FALSE;
text = cell->text->str;
if (do_multi_line){
GList *lines, *l;
int cell_pixel_height = ROW_INTERNAL_HEIGHT (cell->row);
......@@ -1354,4 +1452,21 @@ cell_draw (Cell *cell, void *sv, GdkGC *gc, GdkDrawable *drawable, int x1, int y
return end_col - start_col + 1;
}
char *
cell_get_text (Cell *cell)
{
g_return_val_if_fail (cell != NULL, NULL);
if (cell->parsed_node){
char *func, *ret;
func = expr_decode_tree (cell->parsed_node, cell->col->pos, cell->row->pos);
ret = g_copy_strings ("=", func, NULL);
g_free (func);
return ret;
}
return value_string (cell->value);
}
......@@ -50,7 +50,7 @@ typedef struct {
ColRowInfo *row;
/* Text as entered by the user */
String *entered_text;
/* String *entered_text; */
/* Type of the content and the actual parsed content */
ExprTree *parsed_node; /* Parse tree with the expression */
......@@ -71,8 +71,7 @@ typedef struct {
typedef GList CellList;
#define CELL_TEXT_GET(cell) ((cell)->text ? cell->text->str : cell->entered_text->str)
#define CELL_IS_FORMULA(cell) ((cell)->entered_text->str [0] == '=')
/* #define CELL_TEXT_GET(cell) ((cell)->text ? cell->text->str : cell->entered_text->str) */
#define CELL_IS_FORMAT_SET(cell) ((cell)->flags & CELL_FORMAT_SET)
typedef enum {
......@@ -108,6 +107,7 @@ void cell_set_font (Cell *cell, char *font_name);
void cell_set_style (Cell *cell, Style *reference_style);
void cell_set_comment (Cell *cell, char *str);
void cell_comment_destroy (Cell *cell);
void cell_comment_reposition (Cell *cell);
void cell_set_font_from_style (Cell *cell, StyleFont *style_font);
void cell_set_foreground (Cell *cell, gushort red, gushort green, gushort blue);
void cell_set_background (Cell *cell, gushort red, gushort green, gushort blue);
......@@ -117,6 +117,7 @@ void cell_set_halign (Cell *cell, StyleHAlignFlags halign);
void cell_set_rendered_text (Cell *cell, char *rendered_text);
void cell_relocate (Cell *cell, int target_col, int target_row);
void cell_get_span (Cell *cell, int *col1, int *col2);
char *cell_get_text (Cell *cell);
void cell_make_value (Cell *cell);
void cell_render_value (Cell *cell);
void cell_calc_dimensions (Cell *cell);
......@@ -133,6 +134,9 @@ int cell_draw (Cell *cell, void *sheet_view,
void calc_text_dimensions (int is_number, Style *style, char *text,
int cell_w, int cell_h, int *h, int *w);
void cell_realize (Cell *cell);
void cell_unrealize (Cell *cell);
/*
* Optimizations to stop cell_queue_redraw to be invoked
*/
......
......@@ -54,11 +54,6 @@ paste_cell (Sheet *dest_sheet, Cell *new_cell, int target_col, int target_row, i
cell_render_value (new_cell);
if (!(paste_flags & PASTE_FORMULAS)){
string_unref (new_cell->entered_text);
new_cell->entered_text = string_ref (new_cell->text);
}
sheet_redraw_cell_region (dest_sheet,
target_col, target_row,
target_col, target_row);
......@@ -329,7 +324,7 @@ x_selection_handler (GtkWidget *widget, GtkSelectionData *selection_data, gpoint
rendered_selection, strlen (rendered_selection));
}
/*
/**
* x_selection_clear:
*
* Callback for the "we lost the X selection" signal
......@@ -342,8 +337,8 @@ x_selection_clear (GtkWidget *widget, GdkEventSelection *event, Workbook *wb)
return TRUE;
}
/*
* x_clipboard_bind_workbook
/**
* x_clipboard_bind_workbook:
*
* Binds the signals related to the X selection to the Workbook
*/
......@@ -376,7 +371,7 @@ x_clipboard_bind_workbook (Workbook *wb)
#endif
}
/*
/**
* clipboard_export_cell_region:
*
* This routine exports a CellRegion to the X selection
......@@ -409,17 +404,12 @@ clipboard_append_cell (Sheet *sheet, int col, int row, Cell *cell, void *user_da
copy->col_offset = col - c->base_col;
copy->row_offset = row - c->base_row;
/* Now clear the traces and dependencies on the copied Cell */
copy->u.cell->col = NULL;
copy->u.cell->row = NULL;
copy->u.cell->sheet = NULL;
c->r->list = g_list_prepend (c->r->list, copy);
return TRUE;
}
/*
/**
* clipboard_copy_cell_range:
*
* Entry point to the clipboard copy code
......@@ -450,7 +440,15 @@ clipboard_copy_cell_range (Sheet *sheet, int start_col, int start_row, int end_c
return c.r;
}
/*
/**
* clipboard_paste_region:
* @region: A cell region
* @dest_sheet: Destination sheet
* @dest_col: Column where we should paste the region in dest_sheet
* @dest_row: Row where we should paste the region in dest_sheet
* @paste_flags: Paste flags
* @time: Time at which the event happened.
*
* Main entry point for the paste code
*/
void
......
......@@ -7,6 +7,7 @@
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include "math.h"
#include "gnumeric.h"
#include "gnumeric-sheet.h"
......
......@@ -6,6 +6,7 @@
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include "math.h"
#include "gnumeric.h"
#include "gnumeric-sheet.h"
......
......@@ -7,6 +7,7 @@
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include "math.h"
#include "gnumeric.h"
#include "gnumeric-sheet.h"
......
......@@ -6,6 +6,7 @@
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include "math.h"
#include "gnumeric.h"
#include "gnumeric-sheet.h"
......
......@@ -711,7 +711,8 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
if ((event->state & GDK_CONTROL_MASK) != 0){
if (gsheet->item_editor){
Cell *cell;
char *text;
sheet_accept_pending_input (sheet);
cell = sheet_cell_get (sheet,
sheet->cursor_col,
......@@ -724,9 +725,9 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
* part of the code
*/
g_return_val_if_fail (cell != NULL, 1);
g_return_val_if_fail (cell->entered_text != NULL, 1);
sheet_fill_selection_with (
sheet, cell->entered_text->str);
text = cell_get_text (cell);
sheet_fill_selection_with (sheet, text);
g_free (text);
}
return 1;
}
......
......@@ -711,7 +711,8 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
if ((event->state & GDK_CONTROL_MASK) != 0){
if (gsheet->item_editor){
Cell *cell;
char *text;
sheet_accept_pending_input (sheet);
cell = sheet_cell_get (sheet,
sheet->cursor_col,
......@@ -724,9 +725,9 @@ gnumeric_sheet_key_mode_sheet (GnumericSheet *gsheet, GdkEventKey *event)
* part of the code
*/
g_return_val_if_fail (cell != NULL, 1);
g_return_val_if_fail (cell->entered_text != NULL, 1);
sheet_fill_selection_with (
sheet, cell->entered_text->str);
text = cell_get_text (cell);
sheet_fill_selection_with (sheet, text);
g_free (text);
}
return 1;
}
......
......@@ -36,11 +36,12 @@ cell_region_render_ascii (CellRegion *cr)
char *v;
if (c_copy->type == CELL_COPY_TYPE_CELL)
v = CELL_TEXT_GET (c_copy->u.cell);
v = cell_get_text (c_copy->u.cell);
else
v = c_copy->u.text;
v = g_strdup (c_copy->u.text);
data [c_copy->row_offset][c_copy->col_offset] = v;
g_free (v);
}
all = g_string_new (NULL);
......
......@@ -217,7 +217,7 @@ fill_item_new (Cell *cell)
value = cell->value;
value_type = value->type;
if (CELL_IS_FORMULA (cell)){
if (cell->parsed_node){
fi->type = FILL_FORMULA;
fi->v.formula = cell->parsed_node;
......
......@@ -618,21 +618,14 @@ sheet_view_show_cursor (SheetView *sheet_view)
item_cursor_set_visibility (gsheet->item_cursor, TRUE);
}
#define TRIANGLE_WIDTH 6
GnomeCanvasItem *
sheet_view_create_comment_marker (SheetView *sheet_view, int col, int row)
static GnomeCanvasPoints *
sheet_view_comment_get_points (SheetView *sheet_view, int col, int row)
{
GnomeCanvasPoints *points;
GnomeCanvasGroup *group;
GnomeCanvasItem *i;
int x, y;
g_return_val_if_fail (sheet_view != NULL, NULL);