[gnumeric] Fix ctrl-end in presence of hidden rows. [#643971]



commit cdb9d264fd73733ab905e4d665f5a37069dcc57b
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon Mar 7 18:30:57 2011 -0700

    Fix ctrl-end in presence of hidden rows. [#643971]
    
    2011-03-07  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/sheet-control-gui.c (scg_cursor_move): check one row at a time.

 ChangeLog               |    4 ++++
 NEWS                    |    1 +
 src/sheet-control-gui.c |   15 +++++++++------
 3 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3b8a0a5..0322ee3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-07  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* src/sheet-control-gui.c (scg_cursor_move): check one row at a time.
+	
 2011-03-04  Morten Welinder  <terra gnome org>
 
 	* src/parse-util.c (std_external_wb): New function.
diff --git a/NEWS b/NEWS
index c5eddff..bc5cc68 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ Andreas:
 	* Fix crash on resaving LibreOffice created xlsx files with unauthored 
 	  comments. [#642850]
 	* Trigger configurable text importer on paste of tabs. [#395631]
+	* Fix ctrl-end in presence of hidden rows. [#643971]
 
 Jean:
 	* Fix cursor position inside a cell edited in a zoomed sheet. [#641709]
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index 046936e..21bc0b2 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -3347,7 +3347,7 @@ scg_rangesel_extend (SheetControlGUI *scg, int n,
  * scg_cursor_move:
  *
  * @scg    : The scg
- * @count  : Number of units to move the cursor vertically
+ * @count  : Number of units to move the cursor 
  * @jump_to_bound: skip from the start to the end of ranges
  *                 of filled or unfilled cells.
  * @horiz  : is the movement horizontal or vertical
@@ -3360,18 +3360,21 @@ scg_cursor_move (SheetControlGUI *scg, int n,
 {
 	SheetView *sv = scg_view (scg);
 	GnmCellPos tmp = sv->edit_pos_real;
+	int step = (n>0) ? 1 : -1;
 
 	if (!wbcg_edit_finish (scg->wbcg, WBC_EDIT_ACCEPT, NULL))
 		return;
 
 	if (horiz)
 		tmp.col = sheet_find_boundary_horizontal (sv->sheet,
-			tmp.col, tmp.row, tmp.row,
-			n, jump_to_bound);
+			tmp.col + n - step, tmp.row, tmp.row,
+			step, jump_to_bound);
 	else
-		tmp.row = sheet_find_boundary_vertical (sv->sheet,
-			tmp.col, tmp.row, tmp.col,
-			n, jump_to_bound);
+		tmp.row = sheet_find_boundary_vertical 
+			(sv->sheet,
+			 tmp.col, tmp.row + n - step, 
+			 tmp.col,
+			 step, jump_to_bound);
 
 	sv_selection_reset (sv);
 	sv_cursor_set (sv, &tmp,



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