[gnumeric] adjust range_clip_to_finite
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnumeric] adjust range_clip_to_finite
- Date: Wed, 10 Jun 2009 00:50:50 -0400 (EDT)
commit 8f00d102c2f4141a30b93511f04c6c76f91d4fd6
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date: Tue Jun 9 22:50:17 2009 -0600
adjust range_clip_to_finite
2009-06-09 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/ranges.c (range_clip_to_finite): adjust limits and add
explanatory comment
---
ChangeLog | 5 +++++
src/ranges.c | 11 +++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d5f5033..3f722e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2009-06-09 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * src/ranges.c (range_clip_to_finite): adjust limits and add
+ explanatory comment
+
+2009-06-09 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* src/sheet.h (sheet_get_nominal_printarea): change return type
* src/sheet.c (gnm_sheet_constructor): change initialization
of print area
diff --git a/src/ranges.c b/src/ranges.c
index e0e5205..62898e9 100644
--- a/src/ranges.c
+++ b/src/ranges.c
@@ -603,6 +603,13 @@ range_is_full (GnmRange const *r, Sheet const *sheet, gboolean horiz)
* @sheet : the sheet in which @range lives
*
* Clip the range to the area of the sheet with content.
+ * if the range reaches the edge
+ *
+ * The idea here is that users may select a whole column or ow when they
+ * really are only concerned with the extent of the sheet.
+ * On the otehr hand, if users select any smaller region they probably
+ * intend to selec tjust that.
+ *
* WARNING THIS IS EXPENSIVE!
**/
void
@@ -615,9 +622,9 @@ range_clip_to_finite (GnmRange *range, Sheet *sheet)
* using the current values as a cache
*/
extent = sheet_get_extent (sheet, FALSE);
- if (range->end.col >= gnm_sheet_get_max_cols (sheet) - 2)
+ if (range->end.col >= gnm_sheet_get_max_cols (sheet) - 1)
range->end.col = extent.end.col;
- if (range->end.row >= gnm_sheet_get_max_rows (sheet) - 2)
+ if (range->end.row >= gnm_sheet_get_max_rows (sheet) - 1)
range->end.row = extent.end.row;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]