gnumeric r17284 - in trunk: . plugins/xbase src
- From: mortenw svn gnome org
- To: svn-commits-list gnome org
- Subject: gnumeric r17284 - in trunk: . plugins/xbase src
- Date: Thu, 2 Apr 2009 13:09:18 +0000 (UTC)
Author: mortenw
Date: Thu Apr 2 13:09:18 2009
New Revision: 17284
URL: http://svn.gnome.org/viewvc/gnumeric?rev=17284&view=rev
Log:
2009-04-02 Morten Welinder <terra gnome org>
* src/ranges.c (range_init_full_sheet, range_init_cols,
range_init_rows): Take a sheet argument. All callers changed.
Fixes #577675.
Modified:
trunk/ChangeLog
trunk/plugins/xbase/boot.c
trunk/src/commands.c
trunk/src/ranges.c
trunk/src/ranges.h
trunk/src/selection.c
trunk/src/sheet-style.c
trunk/src/sheet.c
Modified: trunk/plugins/xbase/boot.c
==============================================================================
--- trunk/plugins/xbase/boot.c (original)
+++ trunk/plugins/xbase/boot.c Thu Apr 2 13:09:18 2009
@@ -176,7 +176,7 @@
gboolean deleted = record_deleted (record);
if (deleted)
continue;
- if (row >= gnm_sheet_get_max_rows (sheet)) {
+ if (row >= (unsigned)gnm_sheet_get_max_rows (sheet)) {
/* FIXME: either we need to add new rows, if posible
or create a larger sheet*/
break;
Modified: trunk/src/commands.c
==============================================================================
--- trunk/src/commands.c (original)
+++ trunk/src/commands.c Thu Apr 2 13:09:18 2009
@@ -1424,7 +1424,7 @@
? colrow_max (is_cols, sheet) - count
: index;
last = first + count - 1;
- (is_cols ? range_init_cols : range_init_rows) (&r, first, last);
+ (is_cols ? range_init_cols : range_init_rows) (&r, sheet, first, last);
/* Check for array subdivision */
if (sheet_range_splits_region (sheet, &r, NULL, GO_CMD_CONTEXT (wbc),
Modified: trunk/src/ranges.c
==============================================================================
--- trunk/src/ranges.c (original)
+++ trunk/src/ranges.c Thu Apr 2 13:09:18 2009
@@ -33,7 +33,7 @@
#undef RANGE_DEBUG
GnmRange *
-range_init_full_sheet (GnmRange *r, Sheet *sheet)
+range_init_full_sheet (GnmRange *r, Sheet const *sheet)
{
r->start.col = 0;
r->start.row = 0;
@@ -43,21 +43,21 @@
}
GnmRange *
-range_init_cols (GnmRange *r, int start_col, int end_col)
+range_init_cols (GnmRange *r, Sheet const *sheet, int start_col, int end_col)
{
r->start.col = start_col;
r->start.row = 0;
r->end.col = end_col;
- r->end.row = gnm_sheet_get_max_rows (NULL) - 1;
+ r->end.row = gnm_sheet_get_last_row (sheet);
return r;
}
GnmRange *
-range_init_rows (GnmRange *r, int start_row, int end_row)
+range_init_rows (GnmRange *r, Sheet const *sheet, int start_row, int end_row)
{
r->start.col = 0;
r->start.row = start_row;
- r->end.col = gnm_sheet_get_max_cols (NULL) - 1;
+ r->end.col = gnm_sheet_get_last_col (sheet);
r->end.row = end_row;
return r;
}
Modified: trunk/src/ranges.h
==============================================================================
--- trunk/src/ranges.h (original)
+++ trunk/src/ranges.h Thu Apr 2 13:09:18 2009
@@ -58,9 +58,11 @@
#define range_valid(r) ((r)->start.col <= (r)->end.col && \
(r)->start.row <= (r)->end.row)
-GnmRange *range_init_full_sheet (GnmRange *r, Sheet *sheet);
-GnmRange *range_init_cols (GnmRange *r, int start_col, int end_col);
-GnmRange *range_init_rows (GnmRange *r, int start_row, int end_row);
+GnmRange *range_init_full_sheet (GnmRange *r, Sheet const *sheet);
+GnmRange *range_init_cols (GnmRange *r, Sheet const *sheet,
+ int start_col, int end_col);
+GnmRange *range_init_rows (GnmRange *r, Sheet const *sheet,
+ int start_row, int end_row);
GnmRange *range_init_rangeref (GnmRange *r, GnmRangeRef const *rr);
GnmRange *range_init_value (GnmRange *r, GnmValue const *v);
GnmRange *range_init_cellpos (GnmRange *r, GnmCellPos const *pos);
Modified: trunk/src/selection.c
==============================================================================
--- trunk/src/selection.c (original)
+++ trunk/src/selection.c Thu Apr 2 13:09:18 2009
@@ -1258,9 +1258,9 @@
sv->sheet->protected_allow.select_unlocked_cells))
range_init_full_sheet (&bound, sv->sheet);
else if (horizontal)
- range_init_rows (&bound, ss->start.row, ss->start.row);
+ range_init_rows (&bound, sv->sheet, ss->start.row, ss->start.row);
else
- range_init_cols (&bound, ss->start.col, ss->start.col);
+ range_init_cols (&bound, sv->sheet, ss->start.col, ss->start.col);
/* Ignore attempts to move outside the boundary region */
if (!walk_boundaries (sv, &bound, forward, horizontal,
Modified: trunk/src/sheet-style.c
==============================================================================
--- trunk/src/sheet-style.c (original)
+++ trunk/src/sheet-style.c Thu Apr 2 13:09:18 2009
@@ -1088,7 +1088,8 @@
sheet_style_set_col (Sheet *sheet, int col, GnmStyle *style)
{
GnmRange r;
- sheet_style_set_range (sheet, range_init_cols (&r, col, col), style);
+ range_init_cols (&r, sheet, col, col);
+ sheet_style_set_range (sheet, &r, style);
}
/**
@@ -1107,7 +1108,8 @@
sheet_style_apply_col (Sheet *sheet, int col, GnmStyle *pstyle)
{
GnmRange r;
- sheet_style_apply_range (sheet, range_init_cols (&r, col, col), pstyle);
+ range_init_cols (&r, sheet, col, col);
+ sheet_style_apply_range (sheet, &r, pstyle);
}
/**
@@ -1126,7 +1128,8 @@
sheet_style_set_row (Sheet *sheet, int row, GnmStyle *style)
{
GnmRange r;
- sheet_style_set_range (sheet, range_init_rows (&r, row, row), style);
+ range_init_rows (&r, sheet, row, row);
+ sheet_style_set_range (sheet, &r, style);
}
/**
@@ -1145,7 +1148,8 @@
sheet_style_apply_row (Sheet *sheet, int row, GnmStyle *pstyle)
{
GnmRange r;
- sheet_style_apply_range (sheet, range_init_rows (&r, row, row), pstyle);
+ range_init_rows (&r, sheet, row, row);
+ sheet_style_apply_range (sheet, &r, pstyle);
}
/**
@@ -1861,8 +1865,8 @@
if (row < 0)
row = 0;
corner.col = 0;
- styles = sheet_style_get_list (rinfo->origin_sheet,
- range_init_rows (&r, row, row));
+ range_init_rows (&r, rinfo->origin_sheet, row, row);
+ styles = sheet_style_get_list (rinfo->origin_sheet, &r);
if (o > 0)
for (ptr = styles ; ptr != NULL ; ptr = ptr->next)
((GnmStyleRegion *)ptr->data)->range.end.row = o;
@@ -2448,7 +2452,7 @@
GHashTable *accumulator;
GnmRange r;
- range_init_cols (&r, col, col);
+ range_init_cols (&r, sheet, col, col);
accumulator = g_hash_table_new (gnm_style_hash, (GCompareFunc) gnm_style_equal);
foreach_tile (sheet->style_data->styles,
sheet->tile_top_level, 0, 0, &r,
Modified: trunk/src/sheet.c
==============================================================================
--- trunk/src/sheet.c (original)
+++ trunk/src/sheet.c Thu Apr 2 13:09:18 2009
@@ -4168,7 +4168,7 @@
if (pundo) {
int last = first + (count - 1);
GnmRange r;
- range_init_cols (&r, first, last);
+ range_init_cols (&r, sheet, first, last);
combine_undo (pundo, clipboard_copy_range_undo (sheet, &r));
states = colrow_get_states (sheet, TRUE, first, last);
}
@@ -4239,7 +4239,7 @@
if (pundo) {
int last = col + (count - 1);
GnmRange r;
- range_init_cols (&r, col, last);
+ range_init_cols (&r, sheet, col, last);
combine_undo (pundo, clipboard_copy_range_undo (sheet, &r));
states = colrow_get_states (sheet, TRUE, col, last);
}
@@ -4326,7 +4326,7 @@
if (pundo) {
int last = first + (count - 1);
GnmRange r;
- range_init_rows (&r, first, last);
+ range_init_rows (&r, sheet, first, last);
combine_undo (pundo, clipboard_copy_range_undo (sheet, &r));
states = colrow_get_states (sheet, FALSE, first, last);
}
@@ -4397,7 +4397,7 @@
if (pundo) {
int last = row + (count - 1);
GnmRange r;
- range_init_rows (&r, row, last);
+ range_init_rows (&r, sheet, row, last);
combine_undo (pundo, clipboard_copy_range_undo (sheet, &r));
states = colrow_get_states (sheet, FALSE, row, last);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]