[gnumeric] SheetFilter: fix insert col/row problem.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] SheetFilter: fix insert col/row problem.
- Date: Thu, 4 Oct 2018 19:21:49 +0000 (UTC)
commit df2329602c706a0b9b572bb5706bebe66aacd9bc
Author: Morten Welinder <terra gnome org>
Date: Thu Oct 4 15:21:22 2018 -0400
SheetFilter: fix insert col/row problem.
ChangeLog | 6 ++++++
NEWS | 1 +
src/sheet-filter.c | 8 ++++++--
3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7acc3c5f5..afaba788d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-10-04 Morten Welinder <terra gnome org>
+
+ * src/sheet-filter.c (gnm_sheet_filter_insdel_colrow): Shorten
+ filter if it would otherwise go beyond the end of the sheet.
+ Fixes #359.
+
2018-10-02 Morten Welinder <terra gnome org>
* src/sheet-view.c (sv_real_dispose): Fix typo.
diff --git a/NEWS b/NEWS
index 0f4b5e887..bc0e66632 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ Morten:
* Fix SWITCH's default argument. [#354]
* Fix problem with setting auto-func. [#357]
* Fix problem reading really old xls format.
+ * Fix sheet filter problem. [#359]
--------------------------------------------------------------------------
Gnumeric 1.12.43
diff --git a/src/sheet-filter.c b/src/sheet-filter.c
index 4d4e0e49e..fb9029ec4 100644
--- a/src/sheet-filter.c
+++ b/src/sheet-filter.c
@@ -1095,7 +1095,9 @@ gnm_sheet_filter_insdel_colrow (Sheet *sheet,
if (is_insert) {
/* INSERTING COLUMNS */
- filter->r.end.col += count;
+ filter->r.end.col
+ MIN (gnm_sheet_get_last_col (sheet),
+ filter->r.end.col + count);
/* inserting in the middle of a filter adds
* fields. Everything else just moves it */
if (start > filter->r.start.col &&
@@ -1142,7 +1144,9 @@ gnm_sheet_filter_insdel_colrow (Sheet *sheet,
if (is_insert) {
/* INSERTING ROWS */
- filter->r.end.row += count;
+ filter->r.end.row =
+ MIN (gnm_sheet_get_last_row (sheet),
+ filter->r.end.row + count);
if (start < filter->r.start.row)
filter->r.start.row += count;
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]