[gnumeric] Singleton selections now cause the sort buttons to sort the whole sheet below teh selection. [#14131
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnumeric] Singleton selections now cause the sort buttons to sort the whole sheet below teh selection. [#14131
- Date: Tue, 29 Dec 2009 02:06:52 +0000 (UTC)
commit 53d8c2577d2afc1e2e00191d4a7b6c29c7567d1c
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date: Mon Dec 28 19:06:16 2009 -0700
Singleton selections now cause the sort buttons to sort the whole sheet below teh selection. [#141313]
2009-12-28 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/wbc-gtk-actions.c (sort_by_rows): consider singleton
selections to be a request to sort the whole sheet [#141313]
ChangeLog | 5 +++++
NEWS | 2 ++
src/wbc-gtk-actions.c | 35 +++++++++++++++++++++++++----------
3 files changed, 32 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ad94974..f5d5484 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2009-12-28 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * src/wbc-gtk-actions.c (sort_by_rows): consider singleton
+ selections to be a request to sort the whole sheet [#141313]
+
+2009-12-28 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* src/sheet-control-gui-priv.h (_SheetControlGUI): new fields
* src/sheet-control-gui.c (scg_gtk_paned_set_position): new
replace all calls to gtk_paned_set_position by
diff --git a/NEWS b/NEWS
index 76a43ec..ab8e421 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,8 @@ Andreas:
* Enable sheet tab menu when objects are selected. [#604496]
* Fix empty cell handling of the advanced filter. [#599064]
* Fix scroll bar problem with large frozen panes. [#68603]
+ * Singleton selections now cause the sort buttons to sort the
+ whole sheet below teh selection. [#141313]
Jean
* Fix import export of line type in scatter plots. [#605043]
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index b2001a7..5c9ea22 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -1125,16 +1125,31 @@ sort_by_rows (WBCGtk *wbcg, gboolean descending)
if (!(tmp = selection_first_range (sv, GO_CMD_CONTEXT (wbcg), _("Sort"))))
return;
- sel = gnm_range_dup (tmp);
- range_clip_to_finite (sel, sv_sheet (sv));
-
- numclause = range_width (sel);
- clause = g_new0 (GnmSortClause, numclause);
- for (i = 0; i < numclause; i++) {
- clause[i].offset = i;
- clause[i].asc = descending;
- clause[i].cs = gnm_conf_get_core_sort_default_by_case ();
- clause[i].val = TRUE;
+ if (range_is_singleton (tmp)) {
+ Sheet *sheet = sv_sheet (sv);
+
+ sel = g_new0 (GnmRange, 1);
+ range_init_full_sheet (sel, sheet);
+ sel->start.row = tmp->start.row;
+ range_clip_to_finite (sel, sheet);
+ numclause = 1;
+ clause = g_new0 (GnmSortClause, 1);
+ clause[0].offset = tmp->start.col - sel->start.col;
+ clause[0].asc = descending;
+ clause[0].cs = gnm_conf_get_core_sort_default_by_case ();
+ clause[0].val = TRUE;
+ } else {
+ sel = gnm_range_dup (tmp);
+ range_clip_to_finite (sel, sv_sheet (sv));
+
+ numclause = range_width (sel);
+ clause = g_new0 (GnmSortClause, numclause);
+ for (i = 0; i < numclause; i++) {
+ clause[i].offset = i;
+ clause[i].asc = descending;
+ clause[i].cs = gnm_conf_get_core_sort_default_by_case ();
+ clause[i].val = TRUE;
+ }
}
data = g_new (GnmSortData, 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]