[gnumeric] Fix spanning of long centered cell content. [#662331]



commit 8a24142d1f2c533dc2487d61115f469734473fd7
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu Oct 20 22:16:04 2011 -0600

    Fix spanning of long centered cell content. [#662331]
    
    2011-10-20 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/cellspan.c (cell_calc_span): we need to stop extending in
    	a direction on the first failure in that direction

 ChangeLog      |    5 +++++
 NEWS           |    3 ++-
 src/cellspan.c |   10 ++++------
 3 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4ca3724..31c1271 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-20 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* src/cellspan.c (cell_calc_span): we need to stop extending in
+	a direction on the first failure in that direction
+
 2011-10-19 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* src/print.c (gnm_paginate_cb): set the total number of pages
diff --git a/NEWS b/NEWS
index 75091a3..d72e3d8 100644
--- a/NEWS
+++ b/NEWS
@@ -147,7 +147,8 @@ Andreas:
 	* Fix printing of background colours. [#650261]
 	* From ODF also import named expressions with illegal name. [#650125]
 	* Handle [#REF!] and friends on ODF import. [#650639][#650640]
-	* Handle some invalid expressions in ODF import. [#650625] 
+	* Handle some invalid expressions in ODF import. [#650625]
+	* Fix spanning of long centered cell content. [#662331]
 
 Jean:
 	* Fixed critical. [#649901]
diff --git a/src/cellspan.c b/src/cellspan.c
index 22f054f..a36c614 100644
--- a/src/cellspan.c
+++ b/src/cellspan.c
@@ -317,11 +317,9 @@ cell_calc_span (GnmCell const *cell, int *col1, int *col2)
 		remain_left  = left / 2 + (left % 2);
 		remain_right = left / 2;
 
-		for (; remain_left > 0 || remain_right > 0;){
-			ColRowInfo const *ci;
-
+		for (; remain_left > 0;)
 			if (--pos_l > min_col){
-				ci = sheet_col_get_info (sheet, pos_l);
+				ColRowInfo const *ci = sheet_col_get_info (sheet, pos_l);
 
 				if (ci->visible) {
 					if (cellspan_is_empty (pos_l, cell)) {
@@ -333,8 +331,9 @@ cell_calc_span (GnmCell const *cell, int *col1, int *col2)
 			} else
 				remain_left = 0;
 
+		for (; remain_right > 0;)
 			if (++pos_r < max_col){
-				ci = sheet_col_get_info (sheet, pos_r);
+				ColRowInfo const *ci = sheet_col_get_info (sheet, pos_r);
 
 				if (ci->visible) {
 					if (cellspan_is_empty (pos_r, cell)) {
@@ -345,7 +344,6 @@ cell_calc_span (GnmCell const *cell, int *col1, int *col2)
 				}
 			} else
 				remain_right = 0;
-		} /* for */
 		break;
 	} /* case HALIGN_CENTER */
 



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