[gnumeric] Always allow empty celles at end of areas selected as plot data.



commit 43f2dabcddce4faddc5671cb040b4e3d1fc48a8a
Author: Jean Brefort <jean brefort normalesup org>
Date:   Wed Sep 19 13:13:26 2012 +0200

    Always allow empty celles at end of areas selected as plot data.

 ChangeLog   |    6 ++++++
 src/graph.c |   14 +++++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d9e3663..b5962ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-09-19  Jean Brefort  <jean brefort normalesup org>
+
+	* src/graph.c (gnm_go_data_vector_load_len),
+	(gnm_go_data_vector_load_values): add 1 column/row to the clipped area
+	to allow empty cells at the end. Related to #684072.
+
 2012-09-09  Jean Brefort  <jean brefort normalesup org>
 
 	* src/gnm-so-path.c (gnm_so_path_write_xml_sax), (sop_sax_path),
diff --git a/src/graph.c b/src/graph.c
index 4b4975b..0e637c9 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -561,10 +561,12 @@ gnm_go_data_vector_load_len (GODataVector *dat)
 			gnm_rangeref_normalize (&vec->val->v_range.cell, &ep,
 				&start_sheet, &end_sheet, &r);
 
+			/* add +1 to max_used so that we can have matrices with
+			 * empty cells at the end, see #684072 */
 			if (r.end.col > start_sheet->cols.max_used)
-				r.end.col = start_sheet->cols.max_used;
+				r.end.col = start_sheet->cols.max_used + 1;
 			if (r.end.row > start_sheet->rows.max_used)
-				r.end.row = start_sheet->rows.max_used;
+				r.end.row = start_sheet->rows.max_used + 1;
 
 			if (r.end.col >= r.start.col && r.end.row >= r.start.row) {
 				w = range_width (&r);
@@ -682,11 +684,13 @@ gnm_go_data_vector_load_values (GODataVector *dat)
 			&start_sheet, &end_sheet, &r);
 
 		/* clip here rather than relying on sheet_foreach
-		 * because that only clips if we ignore blanks */
+		 * because that only clips if we ignore blanks 
+		 * but add +1 to max_used so that we can have matrices with
+		 * empty cells at the end, see #684072 */
 		if (r.end.row > start_sheet->rows.max_used)
-			r.end.row = start_sheet->rows.max_used;
+			r.end.row = start_sheet->rows.max_used + 1;
 		if (r.end.col > start_sheet->cols.max_used)
-			r.end.col = start_sheet->cols.max_used;
+			r.end.col = start_sheet->cols.max_used + 1;
 
 		/* In case the sheet is empty */
 		if (r.start.col <= r.end.col && r.start.row <= r.end.row) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]