Commit 77cadcab authored by Almer S. Tigelaar's avatar Almer S. Tigelaar Committed by Almer S. Tigelaar

New, converts a row number to a string. (rows_name): Idem, but for a

2001-06-03  Almer S. Tigelaar  <almer@gnome.org>

 	* src/parse-util.[ch] (row_name): New, converts
 	a row number to a string.
 	(rows_name): Idem, but for a start/end range.
 	(row_name_internal): Utility routine.

 	* src/colrow.c (colrow_string_build): Remove.
 	(colrow_index_list_to_string): Use rows_name
 	and cols_name.

 	* src/cmd-edit.c (cmd_shift_rows): Use rows_name.

 	* src/commands.c (cmd_insert_rows): Idem.
 	(cmd_delete_cols): Beautify.
 	(cmd_delete_rows): Beautify and use rows_name.

 	* src/eval.c (dump_range_dep): Use row_name.

 	* src/item-bar.c (get_row_name): Deprecated, remove.
 	(item_bar_draw): Use row_name.

 	* src/item-cursor.c (item_cursor_tip_setlabel): Idem.

 	* src/item-grid.c (item_grid_draw): Idem.

 	* src/ranges.c (range_name): Idem.
 	(range_dump): Idem.

 	* src/selection.c (reference_append): Idem.
 	(selection_get_ranges): Idem.
 	(cb_range_to_string): Idem.

 	* src/sheet-control-gui.c (scg_redraw_cell_region): Idem.
 	(vertical_scroll_offset_changed): Idem.

 	* src/value-sheet.c (value_dump): Idem.
 	(encode_cellref): Idem.

2001-06-03  Almer S. Tigelaar  <almer@gnome.org>

 	* dialog-cell-sort.c (col_row_name):
 	Use row_name.
parent fc1912f7
2001-06-03 Almer S. Tigelaar <almer@gnome.org>
* src/parse-util.[ch] (row_name): New, converts
a row number to a string.
(rows_name): Idem, but for a start/end range.
(row_name_internal): Utility routine.
* src/colrow.c (colrow_string_build): Remove.
(colrow_index_list_to_string): Use rows_name
and cols_name.
* src/cmd-edit.c (cmd_shift_rows): Use rows_name.
* src/commands.c (cmd_insert_rows): Idem.
(cmd_delete_cols): Beautify.
(cmd_delete_rows): Beautify and use rows_name.
* src/eval.c (dump_range_dep): Use row_name.
* src/item-bar.c (get_row_name): Deprecated, remove.
(item_bar_draw): Use row_name.
* src/item-cursor.c (item_cursor_tip_setlabel): Idem.
* src/item-grid.c (item_grid_draw): Idem.
* src/ranges.c (range_name): Idem.
(range_dump): Idem.
* src/selection.c (reference_append): Idem.
(selection_get_ranges): Idem.
(cb_range_to_string): Idem.
* src/sheet-control-gui.c (scg_redraw_cell_region): Idem.
(vertical_scroll_offset_changed): Idem.
* src/value-sheet.c (value_dump): Idem.
(encode_cellref): Idem.
2001-06-03 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.[ch] (stf_cache_options_new): Burn.
......
......@@ -2,7 +2,9 @@ Gnumeric 0.66
Almer:
* Some work on the SAX importer.
* Finish Group/Ungroup
* Finish Group/Ungroup.
* Clean-up the STF.
* Clean-up row naming.
Jody:
* Fix ctrl-enter filling.
......
2001-06-03 Almer S. Tigelaar <almer@gnome.org>
* src/parse-util.[ch] (row_name): New, converts
a row number to a string.
(rows_name): Idem, but for a start/end range.
(row_name_internal): Utility routine.
* src/colrow.c (colrow_string_build): Remove.
(colrow_index_list_to_string): Use rows_name
and cols_name.
* src/cmd-edit.c (cmd_shift_rows): Use rows_name.
* src/commands.c (cmd_insert_rows): Idem.
(cmd_delete_cols): Beautify.
(cmd_delete_rows): Beautify and use rows_name.
* src/eval.c (dump_range_dep): Use row_name.
* src/item-bar.c (get_row_name): Deprecated, remove.
(item_bar_draw): Use row_name.
* src/item-cursor.c (item_cursor_tip_setlabel): Idem.
* src/item-grid.c (item_grid_draw): Idem.
* src/ranges.c (range_name): Idem.
(range_dump): Idem.
* src/selection.c (reference_append): Idem.
(selection_get_ranges): Idem.
(cb_range_to_string): Idem.
* src/sheet-control-gui.c (scg_redraw_cell_region): Idem.
(vertical_scroll_offset_changed): Idem.
* src/value-sheet.c (value_dump): Idem.
(encode_cellref): Idem.
2001-06-03 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.[ch] (stf_cache_options_new): Burn.
......
2001-06-03 Almer S. Tigelaar <almer@gnome.org>
* src/parse-util.[ch] (row_name): New, converts
a row number to a string.
(rows_name): Idem, but for a start/end range.
(row_name_internal): Utility routine.
* src/colrow.c (colrow_string_build): Remove.
(colrow_index_list_to_string): Use rows_name
and cols_name.
* src/cmd-edit.c (cmd_shift_rows): Use rows_name.
* src/commands.c (cmd_insert_rows): Idem.
(cmd_delete_cols): Beautify.
(cmd_delete_rows): Beautify and use rows_name.
* src/eval.c (dump_range_dep): Use row_name.
* src/item-bar.c (get_row_name): Deprecated, remove.
(item_bar_draw): Use row_name.
* src/item-cursor.c (item_cursor_tip_setlabel): Idem.
* src/item-grid.c (item_grid_draw): Idem.
* src/ranges.c (range_name): Idem.
(range_dump): Idem.
* src/selection.c (reference_append): Idem.
(selection_get_ranges): Idem.
(cb_range_to_string): Idem.
* src/sheet-control-gui.c (scg_redraw_cell_region): Idem.
(vertical_scroll_offset_changed): Idem.
* src/value-sheet.c (value_dump): Idem.
(encode_cellref): Idem.
2001-06-03 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.[ch] (stf_cache_options_new): Burn.
......
2001-06-03 Almer S. Tigelaar <almer@gnome.org>
* src/parse-util.[ch] (row_name): New, converts
a row number to a string.
(rows_name): Idem, but for a start/end range.
(row_name_internal): Utility routine.
* src/colrow.c (colrow_string_build): Remove.
(colrow_index_list_to_string): Use rows_name
and cols_name.
* src/cmd-edit.c (cmd_shift_rows): Use rows_name.
* src/commands.c (cmd_insert_rows): Idem.
(cmd_delete_cols): Beautify.
(cmd_delete_rows): Beautify and use rows_name.
* src/eval.c (dump_range_dep): Use row_name.
* src/item-bar.c (get_row_name): Deprecated, remove.
(item_bar_draw): Use row_name.
* src/item-cursor.c (item_cursor_tip_setlabel): Idem.
* src/item-grid.c (item_grid_draw): Idem.
* src/ranges.c (range_name): Idem.
(range_dump): Idem.
* src/selection.c (reference_append): Idem.
(selection_get_ranges): Idem.
(cb_range_to_string): Idem.
* src/sheet-control-gui.c (scg_redraw_cell_region): Idem.
(vertical_scroll_offset_changed): Idem.
* src/value-sheet.c (value_dump): Idem.
(encode_cellref): Idem.
2001-06-03 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.[ch] (stf_cache_options_new): Burn.
......
2001-06-03 Almer S. Tigelaar <almer@gnome.org>
* src/parse-util.[ch] (row_name): New, converts
a row number to a string.
(rows_name): Idem, but for a start/end range.
(row_name_internal): Utility routine.
* src/colrow.c (colrow_string_build): Remove.
(colrow_index_list_to_string): Use rows_name
and cols_name.
* src/cmd-edit.c (cmd_shift_rows): Use rows_name.
* src/commands.c (cmd_insert_rows): Idem.
(cmd_delete_cols): Beautify.
(cmd_delete_rows): Beautify and use rows_name.
* src/eval.c (dump_range_dep): Use row_name.
* src/item-bar.c (get_row_name): Deprecated, remove.
(item_bar_draw): Use row_name.
* src/item-cursor.c (item_cursor_tip_setlabel): Idem.
* src/item-grid.c (item_grid_draw): Idem.
* src/ranges.c (range_name): Idem.
(range_dump): Idem.
* src/selection.c (reference_append): Idem.
(selection_get_ranges): Idem.
(cb_range_to_string): Idem.
* src/sheet-control-gui.c (scg_redraw_cell_region): Idem.
(vertical_scroll_offset_changed): Idem.
* src/value-sheet.c (value_dump): Idem.
(encode_cellref): Idem.
2001-06-03 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.[ch] (stf_cache_options_new): Burn.
......
......@@ -404,9 +404,10 @@ cmd_shift_rows (WorkbookControl *wbc, Sheet *sheet,
if (count > 0)
rinfo.origin.end.col -= count;
desc = (start_row != end_row)
? g_strdup_printf (_("Shift rows %d:%d"), start_row+1, end_row+1)
: g_strdup_printf (_("Shift row %d"), start_row+1);
desc = g_strdup_printf ((start_row != end_row)
? _("Shift rows %s")
: _("Shift row %s"),
rows_name (start_row, end_row));
cmd_paste_cut (wbc, &rinfo, FALSE, desc);
}
......@@ -441,8 +442,9 @@ cmd_shift_cols (WorkbookControl *wbc, Sheet *sheet,
if (count > 0)
rinfo.origin.end.row -= count;
desc = (start_col != end_col)
? g_strdup_printf (_("Shift columns %s"), cols_name (start_col, end_col))
: g_strdup_printf (_("Shift column %s"), col_name (start_col));
desc = g_strdup_printf ((start_col != end_col)
? _("Shift columns %s")
: _("Shift column %s"),
cols_name (start_col, end_col));
cmd_paste_cut (wbc, &rinfo, FALSE, desc);
}
......@@ -155,19 +155,6 @@ colrow_index_compare (ColRowIndex const * a, ColRowIndex const * b)
return a->first - b->first;
}
static void
colrow_string_build (GString *str, int index, gboolean const is_cols)
{
if (is_cols)
g_string_append (str, col_name (index));
else {
char *s = g_strdup_printf ("%d", index + 1);
g_string_append (str, s);
g_free (s);
}
}
/*
* colrow_index_list_to_string: Convert an index list into a string.
* The result must be freed by the caller.
......@@ -189,13 +176,14 @@ colrow_index_list_to_string (ColRowIndexList *list, gboolean const is_cols, gboo
result = g_string_new ("");
for (ptr = list; ptr != NULL; ptr = ptr->next) {
ColRowIndex *index = ptr->data;
colrow_string_build (result, index->first, is_cols);
if (index->last != index->first) {
g_string_append (result, "-");
colrow_string_build (result, index->last, is_cols);
if (is_cols)
g_string_append (result, cols_name (index->first, index->last));
else
g_string_append (result, rows_name (index->first, index->last));
if (index->last != index->first)
single = FALSE;
}
if (ptr->next) {
g_string_append (result, ", ");
......
......@@ -1097,8 +1097,8 @@ cmd_insert_cols (WorkbookControl *wbc,
{
char *mesg = g_strdup_printf ((count > 1)
? _("Inserting %d columns before %s")
: _("Inserting %d column before %s"), count,
col_name (start_col));
: _("Inserting %d column before %s"),
count, col_name (start_col));
return cmd_ins_del_colrow (wbc, sheet, TRUE, TRUE, mesg,
start_col, count);
}
......@@ -1108,9 +1108,9 @@ cmd_insert_rows (WorkbookControl *wbc,
Sheet *sheet, int start_row, int count)
{
char *mesg = g_strdup_printf ((count > 1)
? _("Inserting %d rows before %d")
: _("Inserting %d row before %d"),
count, start_row+1);
? _("Inserting %d rows before %s")
: _("Inserting %d row before %s"),
count, row_name (start_row));
return cmd_ins_del_colrow (wbc, sheet, FALSE, TRUE, mesg,
start_row, count);
}
......@@ -1119,17 +1119,10 @@ gboolean
cmd_delete_cols (WorkbookControl *wbc,
Sheet *sheet, int start_col, int count)
{
char *mesg;
if (count > 1) {
/* col_name uses a static buffer */
char *temp = g_strdup_printf (_("Deleting %d columns %s:"),
count, col_name (start_col));
mesg = g_strconcat (temp, col_name (start_col+count-1), NULL);
g_free (temp);
} else
mesg = g_strdup_printf (_("Deleting column %s"),
col_name (start_col));
char *mesg = g_strdup_printf ((count > 1)
? _("Deleting columns %s")
: _("Deleting column %s"),
cols_name (start_col, start_col + count - 1));
return cmd_ins_del_colrow (wbc, sheet, TRUE, FALSE, mesg, start_col, count);
}
......@@ -1137,11 +1130,10 @@ gboolean
cmd_delete_rows (WorkbookControl *wbc,
Sheet *sheet, int start_row, int count)
{
char *mesg = (count > 1)
? g_strdup_printf (_("Deleting %d rows %d:%d"), count, start_row,
start_row+count-1)
: g_strdup_printf (_("Deleting row %d"), start_row);
char *mesg = g_strdup_printf ((count > 1)
? _("Deleting rows %s")
: _("Deleting row %s"),
rows_name (start_row, start_row + count - 1));
return cmd_ins_del_colrow (wbc, sheet, FALSE, FALSE, mesg, start_row, count);
}
......
......@@ -1249,11 +1249,11 @@ dump_range_dep (gpointer key, gpointer value, gpointer closure)
DependencyRange const *deprange = key;
Range const *range = &(deprange->range);
/* 2 calls to col_name. It uses a static buffer */
printf ("\t%s%d:",
col_name (range->start.col), range->start.row + 1);
printf ("%s%d -> ",
col_name (range->end.col), range->end.row + 1);
/* 2 calls to col_name and row_name. It uses a static buffer */
printf ("\t%s%s:",
col_name (range->start.col), row_name (range->start.row));
printf ("%s%s -> ",
col_name (range->end.col), row_name (range->end.row));
dump_dependent_list (deprange->dependent_list);
}
......@@ -1263,7 +1263,6 @@ dump_single_dep (gpointer key, gpointer value, gpointer closure)
{
DependencySingle *dep = key;
/* 2 calls to col_name. It uses a static buffer */
printf ("\t%s -> ", cell_pos_name (&dep->pos));
dump_dependent_list (dep->dependent_list);
......
2001-06-03 Almer S. Tigelaar <almer@gnome.org>
* dialog-cell-sort.c (col_row_name):
Use row_name.
2001-06-03 Almer S. Tigelaar <almer@gnome.org>
* dialog-stf.c (stf_dialog_druid_page_next): Remove cacheoptions.
......
......@@ -81,12 +81,12 @@ col_row_name (Sheet *sheet, int col, int row, gboolean header, gboolean is_cols)
else if (is_cols)
str = g_strdup (col_name (col));
else
str = g_strdup_printf (_("Row %d"), row + 1);
str = g_strdup_printf (_("Row %s"), row_name (row));
} else {
if (is_cols)
str = g_strdup (col_name (col));
else
str = g_strdup_printf (_("Row %d"), row + 1);
str = g_strdup_printf (_("Row %s"), row_name (row));
}
return str;
......
......@@ -1249,11 +1249,11 @@ dump_range_dep (gpointer key, gpointer value, gpointer closure)
DependencyRange const *deprange = key;
Range const *range = &(deprange->range);
/* 2 calls to col_name. It uses a static buffer */
printf ("\t%s%d:",
col_name (range->start.col), range->start.row + 1);
printf ("%s%d -> ",
col_name (range->end.col), range->end.row + 1);
/* 2 calls to col_name and row_name. It uses a static buffer */
printf ("\t%s%s:",
col_name (range->start.col), row_name (range->start.row));
printf ("%s%s -> ",
col_name (range->end.col), row_name (range->end.row));
dump_dependent_list (deprange->dependent_list);
}
......@@ -1263,7 +1263,6 @@ dump_single_dep (gpointer key, gpointer value, gpointer closure)
{
DependencySingle *dep = key;
/* 2 calls to col_name. It uses a static buffer */
printf ("\t%s -> ", cell_pos_name (&dep->pos));
dump_dependent_list (dep->dependent_list);
......
......@@ -204,17 +204,6 @@ item_bar_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int f
(*GNOME_CANVAS_ITEM_CLASS (item_bar_parent_class)->update)(item, affine, clip_path, flags);
}
static const char *
get_row_name (int n)
{
static char x [4 * sizeof (int)];
g_return_val_if_fail (n >= 0 && n < SHEET_MAX_ROWS, "0");
snprintf (x, sizeof (x)-1, "%d", n + 1);
return x;
}
static void
bar_draw_cell (ItemBar const * const item_bar,
GdkDrawable *drawable, ColRowSelectionType const type,
......@@ -442,7 +431,6 @@ item_bar_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int w
if (cri->visible) {
total += pixels;
if (total >= 0) {
char const * const str = get_row_name (row);
int level, i = 0, pos = base_pos;
int top = total - pixels;
......@@ -451,7 +439,7 @@ item_bar_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int w
bar_draw_cell (item_bar, drawable,
has_object ? COL_ROW_NO_SELECTION
: sheet_row_selection_type (sheet, row),
str, &rect);
row_name (row), &rect);
if (len > 0) {
for (level = cri->outline_level; i++ < level ; pos += inc) {
......@@ -489,7 +477,7 @@ item_bar_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int w
left+size/2, top+3,
left+size/2, top+size-4);
if (!cri->is_collapsed)
g_warning ("expected collapsed %d", row+1);
g_warning ("expected collapsed %s", row_name (row));
}
gdk_draw_line (drawable, item_bar->lines,
left+3, top+size/2,
......
......@@ -1022,7 +1022,7 @@ item_cursor_set_visibility (ItemCursor *item_cursor, gboolean visible)
static void
item_cursor_tip_setlabel (ItemCursor *item_cursor)
{
char buffer [32];
char buffer [32]; /* What if SHEET_MAX_ROWS or SHEET_MAX_COLS changes? */
int tmp;
Range const * src = &item_cursor->pos;
......@@ -1038,14 +1038,14 @@ item_cursor_tip_setlabel (ItemCursor *item_cursor)
* keep these as 2 print statements, because
* col_name uses a static buffer
*/
tmp = snprintf (buffer, sizeof (buffer), "%s%d",
tmp = snprintf (buffer, sizeof (buffer), "%s%s",
col_name (src->start.col),
src->start.row + 1);
row_name (src->start.row));
if (src->start.col != src->end.col || src->start.row != src->end.row)
snprintf (buffer+tmp, sizeof (buffer)-tmp, ":%s%d",
snprintf (buffer+tmp, sizeof (buffer)-tmp, ":%s%s",
col_name (src->end.col),
src->end.row + 1);
row_name (src->end.row));
gtk_label_set_text (GTK_LABEL (item_cursor->tip), buffer);
}
......
......@@ -284,8 +284,8 @@ item_grid_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
int *colwidths = NULL;
#if 0
printf ("%s%d:", col_name(start_col), start_row+1);
printf ("%s%d <= %d vs %d\n", col_name(end_col), end_row+1, y, draw_y);
printf ("%s%s:", col_name(start_col), row_name(start_row));
printf ("%s%s <= %d vs %d\n", col_name(end_col), row_name(end_row), y, draw_y);
#endif
/* Skip any hidden cols/rows at the start */
......
......@@ -294,7 +294,7 @@ col_name_internal (char *buf, int col)
char const *
col_name (int col)
{
static char buffer [3];
static char buffer [3]; /* What if SHEET_MAX_COLS is changed ? */
char *res = col_name_internal (buffer, col);
*res = '\0';
return buffer;
......@@ -303,12 +303,42 @@ col_name (int col)
char const *
cols_name (int start_col, int end_col)
{
static char buffer [16];
static char buffer [16]; /* Why is this 16 ? */
char *res = col_name_internal (buffer, start_col);
if (start_col != end_col) {
*res = ':';
res = col_name_internal (res+1, end_col);
res = col_name_internal (res + 1, end_col);
}
*res = '\0';
return buffer;
}
static char *
row_name_internal (char *buf, int row)
{
int len = g_snprintf (buf, 6, "%d", row + 1); /* The 6 is hardcoded, see comments in row{s}_name */
return buf + len;
}
char const *
row_name (int row)
{
static char buffer [6]; /* What if SHEET_MAX_ROWS changes? */
char *res = row_name_internal (buffer, row);
*res = '\0';
return buffer;
}
char const *
rows_name (int start_row, int end_row)
{
static char buffer [13]; /* What if SHEET_MAX_ROWS changes? */
char *res = row_name_internal (buffer, start_row);
if (start_row != end_row) {
*res = ':';
res = row_name_internal (res + 1, end_row);
}
*res = '\0';
return buffer;
......
......@@ -5,6 +5,8 @@
char const *col_name (int col);
char const *cols_name (int start_col, int end_col);
char const *row_name (int row);
char const *rows_name (int start_row, int end_col);
char *cellref_name (CellRef const *cell_ref,
ParsePos const *pp, gboolean no_sheetname);
......
......@@ -372,18 +372,19 @@ char const *
range_name (Range const *src)
{
static char buffer [(2 + 4 * sizeof (long)) * 2 + 1];
char *name;
if (src->start.col != src->end.col ||
src->start.row != src->end.row) {
name = g_strdup (col_name (src->start.col));
sprintf (buffer, "%s%d:%s%d", name, src->start.row + 1,
col_name (src->end.col), src->end.row + 1);
g_free (name);
char *name_col = g_strdup (col_name (src->start.col));
char *name_row = g_strdup (row_name (src->start.row));
sprintf (buffer, "%s%s:%s%s", name_col, name_row,
col_name (src->end.col), row_name (src->end.row));
g_free (name_row);
g_free (name_col);
} else {
sprintf (buffer, "%s%d",
sprintf (buffer, "%s%s",
col_name (src->start.col),
src->start.row + 1);
row_name (src->start.row));
}
return buffer;
......@@ -470,17 +471,17 @@ range_dump (Range const *src, char const *suffix)
{
/*
* keep these as 2 print statements, because
* col_name uses a static buffer
* col_name and row_name use a static buffer
*/
fprintf (stderr, "%s%d",
fprintf (stderr, "%s%s",
col_name (src->start.col),
src->start.row + 1);
row_name (src->start.row));
if (src->start.col != src->end.col ||
src->start.row != src->end.row)
fprintf (stderr, ":%s%d",
fprintf (stderr, ":%s%s",
col_name (src->end.col),
src->end.row + 1);
row_name (src->end.row));
fprintf (stderr, suffix);
}
......
......@@ -489,14 +489,10 @@ sheet_selection_reset (Sheet *sheet)
static void
reference_append (GString *result_str, CellPos const *pos)
{
char *row_string = g_strdup_printf ("%d", pos->row);
g_string_append_c (result_str, '$');
g_string_append (result_str, col_name (pos->col));
g_string_append_c (result_str, '$');
g_string_append (result_str, row_string);
g_free (row_string);
g_string_append (result_str, row_name (pos->row));
}
char *
......@@ -658,12 +654,12 @@ selection_get_ranges (Sheet const *sheet, gboolean allow_intersection)
segments_intersect (a->start.row, a->end.row,
b->start.row, b->end.row);
#ifdef DEBUG_SELECTION
fprintf (stderr, "row = %d\na = %d", row_intersect, a->start.row +1);
fprintf (stderr, "row = %d\na = %s", row_intersect, row_name (a->start.row));
if (a->start.row != a->end.row)
fprintf (stderr, " -> %d", a->end.row +1);
fprintf (stderr, "\nb = %d", b->start.row +1);
fprintf (stderr, " -> %s", row_name (a->end.row));
fprintf (stderr, "\nb = %s", row_name (b->start.row));
if (b->start.row != b->end.row)
fprintf (stderr, " -> %d\n", b->end.row +1);
fprintf (stderr, " -> %s\n", row_name (b->end.row));
else
fputc ('\n', stderr);
#endif
......@@ -924,11 +920,11 @@ cb_range_to_string (Sheet *sheet, Range const *r, void *closure)
if (res->include_sheet_name_prefix)
g_string_sprintfa (res->str, "%s!", sheet->name_quoted);
g_string_sprintfa (res->str, "$%s$%d",
col_name (r->start.col), r->start.row+1);
g_string_sprintfa (res->str, "$%s$%s",
col_name (r->start.col), row_name (r->start.row));
if ((r->start.col != r->end.col) || (r->start.row != r->end.row))
g_string_sprintfa (res->str, ":$%s$%d",
col_name (r->end.col), r->end.row+1);
g_string_sprintfa (res->str, ":$%s$%s",
col_name (r->end.col), row_name (r->end.row));
}
char *
......
......@@ -121,8 +121,8 @@ scg_redraw_cell_region (SheetControl *sc,
: INT_MAX;
#if 0
fprintf (stderr, "%s%d:", col_name(min_col), first_row+1);
fprintf (stderr, "%s%d\n", col_name(max_col), last_row+1);
fprintf (stderr, "%s%s:", col_name (min_col), row_name (first_row));
fprintf (stderr, "%s%s\n", col_name (max_col), row_name (last_row));
#endif
gnome_canvas_request_redraw (GNOME_CANVAS (gsheet), x1-2, y1-2, x2, y2);
......@@ -501,7 +501,7 @@ vertical_scroll_offset_changed (GtkAdjustment *adj, int top, int is_hint,
GnumericSheet *gsheet = GNUMERIC_SHEET (scg->canvas);
if (is_hint) {
char *buffer = g_strdup_printf (_("Row: %d"), top + 1);
char *buffer = g_strdup_printf (_("Row: %s"), row_name (top));
wb_control_gui_set_status_text (scg->wbcg, buffer);
g_free (buffer);
} else {
......
......@@ -67,17 +67,17 @@ value_dump (Value const *value)
printf ("%s:", sheet->name_quoted);
else
printf ("%p :", sheet);
printf ("%s%s%s%d\n",
printf ("%s%s%s%s\n",
(c->col_relative ? "":"$"), col_name(c->col),
(c->row_relative ? "":"$"), c->row+1);
(c->row_relative ? "":"$"), row_name(c->row));
c = &value->v_range.cell.b;
if (sheet && sheet->name_quoted)
printf ("%s:", sheet->name_unquoted);
else
printf ("%p :", sheet);
printf ("%s%s%s%d\n",
printf ("%s%s%s%s\n",
(c->col_relative ? "":"$"), col_name(c->col),
(c->row_relative ? "":"$"), c->row+1);
(c->row_relative ? "":"$"), row_name(c->row));
break;
}
default:
......@@ -98,7 +98,7 @@ encode_cellref (GString *dest, CellRef const *ref, gboolean use_relative_syntax)
if (use_relative_syntax && !ref->row_relative)
g_string_append_c (dest, '$');
g_string_sprintfa (dest, "%d", ref->row+1);
g_string_append (dest, row_name (ref->row));
}
......
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