gnumeric r17293 - in trunk: . src src/dialogs src/tools src/widgets
- From: mortenw svn gnome org
- To: svn-commits-list gnome org
- Subject: gnumeric r17293 - in trunk: . src src/dialogs src/tools src/widgets
- Date: Fri, 3 Apr 2009 14:17:42 +0000 (UTC)
Author: mortenw
Date: Fri Apr 3 14:17:41 2009
New Revision: 17293
URL: http://svn.gnome.org/viewvc/gnumeric?rev=17293&view=rev
Log:
2009-04-03 Morten Welinder <terra gnome org>
* src/ranges.c (range_make_full, range_ensure_sanity,
range_transpose, range_is_full, range_translate): Take sheet
argument for size. All callers changed.
* src/xml-io.c (xml_node_get_range): Take sheet argument for size.
All caller changeds.
Modified:
trunk/ChangeLog
trunk/src/clipboard.c
trunk/src/commands.c
trunk/src/dialogs/dialog-delete-cells.c
trunk/src/dialogs/dialog-insert-cells.c
trunk/src/expr.c
trunk/src/ranges.c
trunk/src/ranges.h
trunk/src/selection.c
trunk/src/sheet-autofill.c
trunk/src/sheet-merge.c
trunk/src/sheet-object.c
trunk/src/sheet-style.c
trunk/src/sheet.c
trunk/src/stf.c
trunk/src/tools/scenarios.c
trunk/src/tools/scenarios.h
trunk/src/wbc-gtk-actions.c
trunk/src/widgets/gnumeric-expr-entry.c
trunk/src/xml-io.c
Modified: trunk/src/clipboard.c
==============================================================================
--- trunk/src/clipboard.c (original)
+++ trunk/src/clipboard.c Fri Apr 3 14:17:41 2009
@@ -287,9 +287,9 @@
GnmCellPos origin;
origin.col = 0;
origin.row = 0;
- range_transpose (&tmp.cell_bound, &origin);
+ range_transpose (&tmp.cell_bound, pt->sheet, &origin);
}
- range_translate (&tmp.cell_bound, left, top);
+ range_translate (&tmp.cell_bound, pt->sheet, left, top);
sheet_object_set_anchor (dst, &tmp);
sheet_object_set_sheet (dst, pt->sheet);
g_object_unref (dst);
@@ -494,7 +494,7 @@
x = tmp.start.col; tmp.start.col = tmp.start.row; tmp.start.row = x;
x = tmp.end.col; tmp.end.col = tmp.end.row; tmp.end.row = x;
}
- if (!range_translate (&tmp, left, top))
+ if (!range_translate (&tmp, pt->sheet, left, top))
gnm_sheet_merge_add (pt->sheet, &tmp, TRUE, cc);
}
}
@@ -566,7 +566,8 @@
if (dst != NULL) {
SheetObjectAnchor tmp;
sheet_object_anchor_assign (&tmp, sheet_object_get_anchor (src));
- range_translate (&tmp.cell_bound, - cr->base.col, - cr->base.row);
+ range_translate (&tmp.cell_bound, sheet_object_get_sheet (src),
+ - cr->base.col, - cr->base.row);
sheet_object_set_anchor (dst, &tmp);
cr->objects = g_slist_prepend (cr->objects, dst);
}
@@ -591,7 +592,6 @@
cr->base = r->start;
cr->cols = range_width (r);
cr->rows = range_height (r);
- cr->rows = range_height (r);
cr->col_state = colrow_get_states (sheet,
TRUE, r->start.col, r->end.col);
cr->row_state = colrow_get_states (sheet,
@@ -610,7 +610,7 @@
merged = gnm_sheet_merge_get_overlap (sheet, r);
for (ptr = merged ; ptr != NULL ; ptr = ptr->next) {
GnmRange *tmp = range_dup (ptr->data);
- range_translate (tmp, -r->start.col, -r->start.row);
+ range_translate (tmp, sheet, -r->start.col, -r->start.row);
cr->merged = g_slist_prepend (cr->merged, tmp);
}
g_slist_free (merged);
@@ -689,7 +689,7 @@
sheet_object_anchor_assign (&tmp_anchor, anchor);
r = &tmp_anchor.cell_bound;
- range_translate (r,
+ range_translate (r, sheet,
-MIN (r->start.col, r->end.col),
-MIN (r->start.row, r->end.row));
sheet_object_set_anchor (so, &tmp_anchor);
Modified: trunk/src/commands.c
==============================================================================
--- trunk/src/commands.c (original)
+++ trunk/src/commands.c Fri Apr 3 14:17:41 2009
@@ -2562,6 +2562,7 @@
reverse.origin_sheet = me->info.target_sheet;
reverse.origin = me->info.origin;
range_translate (&reverse.origin,
+ me->info.origin_sheet, /* FIXME: What sheet? */
me->info.col_offset,
me->info.row_offset);
reverse.col_offset = -me->info.col_offset;
@@ -2619,7 +2620,8 @@
g_return_val_if_fail (me->paste_contents == NULL, TRUE);
tmp = me->info.origin;
- range_translate (&tmp, me->info.col_offset, me->info.row_offset);
+ range_translate (&tmp, me->info.origin_sheet, /* FIXME: What sheet? */
+ me->info.col_offset, me->info.row_offset);
range_normalize (&tmp);
g_return_val_if_fail (range_is_sane (&tmp), TRUE);
@@ -2726,7 +2728,8 @@
g_return_val_if_fail (info != NULL, TRUE);
r = info->origin;
- if (range_translate (&r, info->col_offset, info->row_offset)) {
+ if (range_translate (&r, info->target_sheet,
+ info->col_offset, info->row_offset)) {
go_cmd_context_error_invalid (GO_CMD_CONTEXT (wbc), descriptor,
_("is beyond sheet boundaries"));
@@ -3053,7 +3056,7 @@
}
/* Use translate to do a quiet sanity check */
- if (range_translate (&me->dst.range, 0, 0)) {
+ if (range_translate (&me->dst.range, pt->sheet, 0, 0)) {
go_cmd_context_error_invalid (GO_CMD_CONTEXT (wbc),
me->cmd.cmd_descriptor,
_("is beyond sheet boundaries"));
Modified: trunk/src/dialogs/dialog-delete-cells.c
==============================================================================
--- trunk/src/dialogs/dialog-delete-cells.c (original)
+++ trunk/src/dialogs/dialog-delete-cells.c Fri Apr 3 14:17:41 2009
@@ -114,6 +114,7 @@
DeleteCellState *state;
WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
SheetView *sv = wb_control_cur_sheet_view (wbc);
+ Sheet *sheet = sv_sheet (sv);
GnmRange const *sel;
GladeXML *gui;
GtkWidget *w;
@@ -126,12 +127,12 @@
cols = sel->end.col - sel->start.col + 1;
rows = sel->end.row - sel->start.row + 1;
- if (range_is_full (sel, FALSE)) {
- cmd_delete_cols (wbc, sv_sheet (sv), sel->start.col, cols);
+ if (range_is_full (sel, sheet, FALSE)) {
+ cmd_delete_cols (wbc, sheet, sel->start.col, cols);
return;
}
- if (range_is_full (sel, TRUE)) {
- cmd_delete_rows (wbc, sv_sheet (sv), sel->start.row, rows);
+ if (range_is_full (sel, sheet, TRUE)) {
+ cmd_delete_rows (wbc, sheet, sel->start.row, rows);
return;
}
Modified: trunk/src/dialogs/dialog-insert-cells.c
==============================================================================
--- trunk/src/dialogs/dialog-insert-cells.c (original)
+++ trunk/src/dialogs/dialog-insert-cells.c Fri Apr 3 14:17:41 2009
@@ -117,6 +117,7 @@
InsertCellState *state;
WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
SheetView *sv = wb_control_cur_sheet_view (wbc);
+ Sheet *sheet = sv_sheet (sv);
GnmRange const *sel;
int cols, rows;
@@ -127,12 +128,12 @@
cols = sel->end.col - sel->start.col + 1;
rows = sel->end.row - sel->start.row + 1;
- if (range_is_full (sel, FALSE)) {
- cmd_insert_cols (wbc, sv_sheet (sv), sel->start.col, cols);
+ if (range_is_full (sel, sheet, FALSE)) {
+ cmd_insert_cols (wbc, sheet, sel->start.col, cols);
return;
}
- if (range_is_full (sel, TRUE)) {
- cmd_insert_rows (wbc, sv_sheet (sv), sel->start.row, rows);
+ if (range_is_full (sel, sheet, TRUE)) {
+ cmd_insert_rows (wbc, sheet, sel->start.row, rows);
return;
}
Modified: trunk/src/expr.c
==============================================================================
--- trunk/src/expr.c (original)
+++ trunk/src/expr.c Fri Apr 3 14:17:41 2009
@@ -1919,8 +1919,8 @@
if (NULL == v->cell.b.sheet)
end_sheet = start_sheet;
- full_col = range_is_full (&r, FALSE);
- full_row = range_is_full (&r, TRUE);
+ full_col = range_is_full (&r, start_sheet, FALSE);
+ full_row = range_is_full (&r, start_sheet, TRUE);
if (reloc_range (rinfo->details, start_sheet, end_sheet, &r) ||
rinfo->from_inside) {
Modified: trunk/src/ranges.c
==============================================================================
--- trunk/src/ranges.c (original)
+++ trunk/src/ranges.c Fri Apr 3 14:17:41 2009
@@ -567,6 +567,7 @@
/**
* range_is_full :
* @r : the range.
+ * @sheet : the sheet in which @r lives
* @horiz : TRUE to check for a horizontal full ref (_cols_ [0..MAX))
*
* This determines whether @r completely spans a sheet
@@ -575,17 +576,20 @@
* Return value: TRUE if it is infinite else FALSE
**/
gboolean
-range_is_full (GnmRange const *r, gboolean horiz)
+range_is_full (GnmRange const *r, Sheet const *sheet, gboolean horiz)
{
if (horiz)
- return (r->start.col <= 0 && r->end.col >= gnm_sheet_get_max_cols (NULL) - 1);
+ return (r->start.col <= 0 &&
+ r->end.col >= gnm_sheet_get_last_col (sheet));
else
- return (r->start.row <= 0 && r->end.row >= gnm_sheet_get_max_rows (NULL) - 1);
+ return (r->start.row <= 0 &&
+ r->end.row >= gnm_sheet_get_last_row (sheet));
}
/**
* range_make_full:
* @r: the range.
+ * @sheet : the sheet in which @r lives
* @full_col : Make @r a full column ref (_row_ [0..MAX))
* @full_row : Make @r a full row ref (_column_ [0..MAX))
**/
@@ -602,7 +606,7 @@
/**
* range_clip_to_finite :
* @range :
- * @sheet :
+ * @sheet : the sheet in which @range lives
*
* Clip the range to the area of the sheet with content.
* WARNING THIS IS EXPENSIVE!
@@ -640,6 +644,7 @@
/**
* range_translate:
* @range:
+ * @sheet : the sheet in which @range lives
* @col_offset:
* @row_offset:
*
@@ -648,7 +653,7 @@
* return TRUE if the range is no longer valid.
**/
gboolean
-range_translate (GnmRange *range, int col_offset, int row_offset)
+range_translate (GnmRange *range, Sheet const *sheet, int col_offset, int row_offset)
{
/*
* FIXME: we should probably check for overflow without actually
@@ -660,10 +665,10 @@
range->end.row += row_offset;
/* check for completely out of bounds */
- if (range->start.col >= gnm_sheet_get_max_cols (NULL) || range->start.col < 0 ||
- range->start.row >= gnm_sheet_get_max_rows (NULL) || range->start.row < 0 ||
- range->end.col >= gnm_sheet_get_max_cols (NULL) || range->end.col < 0 ||
- range->end.row >= gnm_sheet_get_max_rows (NULL) || range->end.row < 0)
+ if (range->start.col >= gnm_sheet_get_max_cols (sheet) || range->start.col < 0 ||
+ range->start.row >= gnm_sheet_get_max_rows (sheet) || range->start.row < 0 ||
+ range->end.col >= gnm_sheet_get_max_cols (sheet) || range->end.col < 0 ||
+ range->end.row >= gnm_sheet_get_max_rows (sheet) || range->end.row < 0)
return TRUE;
return FALSE;
@@ -672,21 +677,19 @@
/**
* range_ensure_sanity :
* @range : the range to check
+ * @sheet : the sheet in which @range lives
*
* Silently clip a range to ensure that it does not contain areas
* outside the valid bounds. Does NOT fix inverted ranges.
**/
void
-range_ensure_sanity (GnmRange *range)
+range_ensure_sanity (GnmRange *range, Sheet const *sheet)
{
- if (range->start.col < 0)
- range->start.col = 0;
- if (range->end.col >= gnm_sheet_get_max_cols (NULL))
- range->end.col = gnm_sheet_get_max_cols (NULL)-1;
- if (range->start.row < 0)
- range->start.row = 0;
- if (range->end.row >= gnm_sheet_get_max_rows (NULL))
- range->end.row = gnm_sheet_get_max_rows (NULL)-1;
+ range->start.col = MAX (0, range->start.col);
+ range->end.col = MIN (range->end.col, gnm_sheet_get_last_col (sheet));
+
+ range->start.row = MAX (0, range->start.row);
+ range->end.row = MIN (range->end.row, gnm_sheet_get_last_row (sheet));
}
/**
@@ -712,6 +715,7 @@
/**
* range_transpose:
* @range: The range.
+ * @sheet : the sheet in which @range lives
* @boundary: The box to transpose inside
*
* Effectively mirrors the ranges in 'boundary' around a
@@ -720,11 +724,13 @@
* Return value: whether we clipped the range.
**/
gboolean
-range_transpose (GnmRange *range, GnmCellPos const *origin)
+range_transpose (GnmRange *range, Sheet const *sheet, GnmCellPos const *origin)
{
gboolean clipped = FALSE;
- GnmRange src;
- int t;
+ GnmRange src;
+ int t;
+ int last_col = gnm_sheet_get_last_col (sheet);
+ int last_row = gnm_sheet_get_last_row (sheet);
g_return_val_if_fail (range != NULL, TRUE);
@@ -732,9 +738,9 @@
/* Start col */
t = origin->col + (src.start.row - origin->row);
- if (t > gnm_sheet_get_max_cols (NULL) - 1) {
+ if (t > last_col) {
clipped = TRUE;
- range->start.col = gnm_sheet_get_max_cols (NULL) - 1;
+ range->start.col = last_col;
} else if (t < 0) {
clipped = TRUE;
range->start.col = 0;
@@ -743,9 +749,9 @@
/* Start row */
t = origin->row + (src.start.col - origin->col);
- if (t > gnm_sheet_get_max_cols (NULL) - 1) {
+ if (t > last_row) {
clipped = TRUE;
- range->start.row = gnm_sheet_get_max_rows (NULL) - 1;
+ range->start.row = last_row;
} else if (t < 0) {
clipped = TRUE;
range->start.row = 0;
@@ -755,9 +761,9 @@
/* End col */
t = origin->col + (src.end.row - origin->row);
- if (t > gnm_sheet_get_max_cols (NULL) - 1) {
+ if (t > last_col) {
clipped = TRUE;
- range->end.col = gnm_sheet_get_max_cols (NULL) - 1;
+ range->end.col = last_col;
} else if (t < 0) {
clipped = TRUE;
range->end.col = 0;
@@ -766,9 +772,9 @@
/* End row */
t = origin->row + (src.end.col - origin->col);
- if (t > gnm_sheet_get_max_cols (NULL) - 1) {
+ if (t > last_row) {
clipped = TRUE;
- range->end.row = gnm_sheet_get_max_rows (NULL) - 1;
+ range->end.row = last_row;
} else if (t < 0) {
clipped = TRUE;
range->end.row = 0;
Modified: trunk/src/ranges.h
==============================================================================
--- trunk/src/ranges.h (original)
+++ trunk/src/ranges.h Fri Apr 3 14:17:41 2009
@@ -77,7 +77,7 @@
int range_width (GnmRange const *r);
int range_height (GnmRange const *r);
gboolean range_is_singleton (GnmRange const *r);
-gboolean range_is_full (GnmRange const *r, gboolean horiz);
+gboolean range_is_full (GnmRange const *r, Sheet const *sheet, gboolean horiz);
void range_make_full (GnmRange *r, Sheet const *sheet,
gboolean full_col, gboolean full_row);
void range_clip_to_finite(GnmRange *range, Sheet *sheet);
@@ -87,10 +87,12 @@
GnmRange const *b);
void range_normalize (GnmRange *src);
GnmRange range_union (GnmRange const *a, GnmRange const *b);
-void range_ensure_sanity (GnmRange *range);
+void range_ensure_sanity (GnmRange *range, Sheet const *sheet);
gboolean range_is_sane (GnmRange const *range);
-gboolean range_translate (GnmRange *range, int col_offset, int row_offset);
-gboolean range_transpose (GnmRange *range, GnmCellPos const *origin);
+gboolean range_translate (GnmRange *range, Sheet const *sheet,
+ int col_offset, int row_offset);
+gboolean range_transpose (GnmRange *range, Sheet const *sheet,
+ GnmCellPos const *origin);
char const *range_as_string (GnmRange const *r);
void range_dump (GnmRange const *r, char const *suffix);
Modified: trunk/src/selection.c
==============================================================================
--- trunk/src/selection.c (original)
+++ trunk/src/selection.c Fri Apr 3 14:17:41 2009
@@ -538,9 +538,9 @@
for (list = sv->selections; list && (do_cols || do_rows); list = list->next) {
GnmRange const *r = list->data;
- if (do_cols && range_is_full (r, TRUE))
+ if (do_cols && range_is_full (r, sv->sheet, TRUE))
do_cols = FALSE;
- if (do_rows && range_is_full (r, FALSE))
+ if (do_rows && range_is_full (r, sv->sheet, FALSE))
do_rows = FALSE;
}
sv_menu_enable_insert (sv, do_cols, do_rows);
Modified: trunk/src/sheet-autofill.c
==============================================================================
--- trunk/src/sheet-autofill.c (original)
+++ trunk/src/sheet-autofill.c Fri Apr 3 14:17:41 2009
@@ -1143,7 +1143,7 @@
if (merges[k]) {
GnmRange r = *merges[k];
int ofs = (i / region_size) * region_size;
- range_translate (&r,
+ range_translate (&r, sheet,
ofs * col_inc,
ofs * row_inc);
gnm_sheet_merge_add (sheet, &r, FALSE, NULL);
Modified: trunk/src/sheet-merge.c
==============================================================================
--- trunk/src/sheet-merge.c (original)
+++ trunk/src/sheet-merge.c Fri Apr 3 14:17:41 2009
@@ -315,7 +315,7 @@
g_return_if_fail (IS_SHEET (ri->target_sheet));
dest = ri->origin;
- range_translate (&dest, ri->col_offset, ri->row_offset);
+ range_translate (&dest, ri->target_sheet, ri->col_offset, ri->row_offset);
change_sheets = (ri->origin_sheet != ri->target_sheet);
/* Clear the destination range on the target sheet */
@@ -337,7 +337,8 @@
/* Toss any merges that would be clipped. */
gnm_sheet_merge_remove (ri->origin_sheet, r, NULL);
- if (!range_translate (&tmp, ri->col_offset, ri->row_offset))
+ if (!range_translate (&tmp, ri->target_sheet,
+ ri->col_offset, ri->row_offset))
to_move = g_slist_prepend (to_move, range_dup (&tmp));
} else if (!change_sheets &&
range_contains (&dest, r->start.col, r->start.row))
Modified: trunk/src/sheet-object.c
==============================================================================
--- trunk/src/sheet-object.c (original)
+++ trunk/src/sheet-object.c Fri Apr 3 14:17:41 2009
@@ -735,7 +735,8 @@
g_return_if_fail (IS_SHEET (rinfo->target_sheet));
dest = rinfo->origin;
- clear = range_translate (&dest, rinfo->col_offset, rinfo->row_offset);
+ clear = range_translate (&dest, rinfo->target_sheet,
+ rinfo->col_offset, rinfo->row_offset);
change_sheets = (rinfo->origin_sheet != rinfo->target_sheet);
/* Clear the destination range on the target sheet */
@@ -762,7 +763,8 @@
if (range_contains (&rinfo->origin, r.start.col, r.start.row)) {
/* FIXME : just moving the range is insufficent for all anchor types */
/* Toss any objects that would be clipped. */
- if (range_translate (&r, rinfo->col_offset, rinfo->row_offset)) {
+ if (range_translate (&r, rinfo->origin_sheet,
+ rinfo->col_offset, rinfo->row_offset)) {
clear_sheet (so, pundo);
continue;
}
Modified: trunk/src/sheet-style.c
==============================================================================
--- trunk/src/sheet-style.c (original)
+++ trunk/src/sheet-style.c Fri Apr 3 14:17:41 2009
@@ -2348,9 +2348,9 @@
GnmStyleRegion const *sr = l->data;
GnmRange r = sr->range;
- range_translate (&r, +corner->col, +corner->row);
+ range_translate (&r, sheet, +corner->col, +corner->row);
if (transpose)
- range_transpose (&r, corner);
+ range_transpose (&r, sheet, corner);
gnm_style_ref (sr->style);
sheet_style_set_range (sheet, &r, sr->style);
Modified: trunk/src/sheet.c
==============================================================================
--- trunk/src/sheet.c (original)
+++ trunk/src/sheet.c Fri Apr 3 14:17:41 2009
@@ -1860,7 +1860,7 @@
print_area.start.row = row;
}
- range_ensure_sanity (&print_area);
+ range_ensure_sanity (&print_area, sheet);
return print_area;
}
@@ -1877,7 +1877,8 @@
if (!ignore_printarea) {
r = sheet_get_nominal_printarea (sheet);
- if (!range_is_full (&r, TRUE) || !range_is_full (&r, FALSE))
+ if (!range_is_full (&r, sheet, TRUE) ||
+ !range_is_full (&r, sheet, FALSE))
return r;
}
@@ -4469,8 +4470,8 @@
rinfo->row_offset != 0);
dst = rinfo->origin;
- out_of_range = range_translate (&dst,
- rinfo->col_offset, rinfo->row_offset);
+ out_of_range = range_translate (&dst, rinfo->target_sheet,
+ rinfo->col_offset, rinfo->row_offset);
/* Redraw the src region in case anything was spanning */
sheet_redraw_range (rinfo->origin_sheet, &rinfo->origin);
@@ -4596,8 +4597,9 @@
/* 9. Update the data structures of the tools */
if (rinfo->origin_sheet == rinfo->target_sheet)
scenarios_move_range (rinfo->origin_sheet->scenarios,
- &rinfo->origin, rinfo->col_offset,
- rinfo->row_offset);
+ rinfo->origin_sheet,
+ &rinfo->origin, rinfo->col_offset,
+ rinfo->row_offset);
}
static void
Modified: trunk/src/stf.c
==============================================================================
--- trunk/src/stf.c (original)
+++ trunk/src/stf.c Fri Apr 3 14:17:41 2009
@@ -288,7 +288,7 @@
#warning Add UI for this
target_sheet = src_sheet;
target = *src;
- range_translate (&target, 1, 0);
+ range_translate (&target, target_sheet, 1, 0);
buf = gsf_output_memory_new ();
sheet_foreach_cell_in_range (src_sheet,
Modified: trunk/src/tools/scenarios.c
==============================================================================
--- trunk/src/tools/scenarios.c (original)
+++ trunk/src/tools/scenarios.c Fri Apr 3 14:17:41 2009
@@ -480,11 +480,12 @@
}
static void
-move_range (scenario_t *s, GnmRange const *origin, int col_offset, int row_offset)
+move_range (scenario_t *s, Sheet const *sheet, GnmRange const *origin,
+ int col_offset, int row_offset)
{
/* FIXME when multiple ranges are supported. */
if (range_equal (&s->range, origin)) {
- range_translate (&s->range, col_offset, row_offset);
+ range_translate (&s->range, sheet, col_offset, row_offset);
/* FIXME: What if we fell off the end? */
g_free (s->cell_sel_str);
s->cell_sel_str = g_strdup (range_as_string (&s->range));
@@ -492,11 +493,11 @@
}
void
-scenarios_move_range (GList *list, const GnmRange *origin,
+scenarios_move_range (GList *list, Sheet const *sheet, const GnmRange *origin,
int col_offset, int row_offset)
{
for ( ; list != NULL ; list = list->next)
- move_range (list->data, origin, col_offset, row_offset);
+ move_range (list->data, sheet, origin, col_offset, row_offset);
}
/* Scenario Manager: Ok/Cancel buttons************************************/
Modified: trunk/src/tools/scenarios.h
==============================================================================
--- trunk/src/tools/scenarios.h (original)
+++ trunk/src/tools/scenarios.h Fri Apr 3 14:17:41 2009
@@ -32,7 +32,8 @@
void scenarios_insert_cols (GList *list, int row, int count);
void scenarios_delete_rows (GList *list, int row, int count);
void scenarios_delete_cols (GList *list, int row, int count);
-void scenarios_move_range (GList *list, GnmRange const *origin,
+void scenarios_move_range (GList *list,
+ Sheet const *sheet, GnmRange const *origin,
int col_offset, int row_offset);
void scenario_manager_ok (Sheet *sheet);
Modified: trunk/src/wbc-gtk-actions.c
==============================================================================
--- trunk/src/wbc-gtk-actions.c (original)
+++ trunk/src/wbc-gtk-actions.c Fri Apr 3 14:17:41 2009
@@ -940,6 +940,7 @@
{
WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
SheetView *sv = wb_control_cur_sheet_view (wbc);
+ Sheet const *sheet = sv_sheet (sv);
char const *operation = show ? _("Show Detail") : _("Hide Detail");
GnmRange const *r = selection_first_range (sv,
GO_CMD_CONTEXT (wbc), operation);
@@ -950,8 +951,8 @@
return;
/* Do we need to ask the user what he/she wants to group/ungroup? */
- if (range_is_full (r, TRUE) ^ range_is_full (r, FALSE))
- is_cols = !range_is_full (r, TRUE);
+ if (range_is_full (r, sheet, TRUE) ^ range_is_full (r, sheet, FALSE))
+ is_cols = !range_is_full (r, sheet, TRUE);
else {
dialog_col_row (wbcg, operation,
(ColRowCallback_t) hide_show_detail_real,
@@ -967,6 +968,7 @@
{
WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
SheetView *sv = wb_control_cur_sheet_view (wbc);
+ Sheet const *sheet = sv_sheet (sv);
char const *operation = group ? _("Group") : _("Ungroup");
GnmRange const *r = selection_first_range (sv,
GO_CMD_CONTEXT (wbc), operation);
@@ -977,8 +979,8 @@
return;
/* Do we need to ask the user what he/she wants to group/ungroup? */
- if (range_is_full (r, TRUE) ^ range_is_full (r, FALSE))
- is_cols = !range_is_full (r, TRUE);
+ if (range_is_full (r, sheet, TRUE) ^ range_is_full (r, sheet, FALSE))
+ is_cols = !range_is_full (r, sheet, TRUE);
else {
dialog_col_row (wbcg, operation,
(ColRowCallback_t) cmd_selection_group,
Modified: trunk/src/widgets/gnumeric-expr-entry.c
==============================================================================
--- trunk/src/widgets/gnumeric-expr-entry.c (original)
+++ trunk/src/widgets/gnumeric-expr-entry.c Fri Apr 3 14:17:41 2009
@@ -1305,9 +1305,9 @@
g_return_val_if_fail (r != NULL, FALSE);
needs_change = (gee->flags & GNM_EE_FULL_COL &&
- !range_is_full (r, TRUE)) ||
+ !range_is_full (r, sheet, TRUE)) ||
(gee->flags & GNM_EE_FULL_ROW &&
- !range_is_full (r, FALSE));
+ !range_is_full (r, sheet, FALSE));
rs = &gee->rangesel;
ref = rs->ref;
Modified: trunk/src/xml-io.c
==============================================================================
--- trunk/src/xml-io.c (original)
+++ trunk/src/xml-io.c Fri Apr 3 14:17:41 2009
@@ -258,7 +258,7 @@
}
static gboolean
-xml_node_get_range (xmlNodePtr tree, GnmRange *r)
+xml_node_get_range (xmlNodePtr tree, GnmRange *r, Sheet const *sheet)
{
gboolean res =
xml_node_get_int (tree, "startCol", &r->start.col) &&
@@ -267,7 +267,7 @@
xml_node_get_int (tree, "endRow", &r->end.row);
/* Older versions of gnumeric had some boundary problems */
- range_ensure_sanity (r);
+ range_ensure_sanity (r, sheet);
return res;
}
@@ -288,7 +288,7 @@
sv_selection_reset (sv);
for (sel = selections->xmlChildrenNode; sel; sel = sel->next)
- if (!xmlIsBlankNode (sel) && xml_node_get_range (sel, &r))
+ if (!xmlIsBlankNode (sel) && xml_node_get_range (sel, &r, ctxt->sheet))
sv_selection_add_range (sv, &r);
if (xml_node_get_int (selections, "CursorCol", &pos.col) &&
@@ -1024,7 +1024,7 @@
tree->name);
return NULL;
}
- xml_node_get_range (tree, range);
+ xml_node_get_range (tree, range, ctxt->sheet);
child = e_xml_get_child_by_name (tree, CC2XML ("Style"));
if (child)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]