Commit 13960fdc authored by JP Rosevear's avatar JP Rosevear Committed by JP Rosevear

Call sort_permute with the given permutation index (sort_contents): Call

2000-06-06  JP Rosevear  <jpr@arcavia.com>

	* src/sort.c (sort_position): Call sort_permute with the given
	permutation index
	(sort_contents): Call sort_qsort to get a permutation index and
	then use sort_permute to actually move the rows
	(sort_permute): Use copy and paste to move rows/cols around
	(sort_permute_next): Find next row/col the hasn't been set based
	on the permutation array
	(sort_permute_is_set): Find if a a bit in a bit array is set
	(sort_permute_set): Set a bit in a bit array
	(sort_permute_find): Find a given number in a permutation array
	(sort_qsort): Produce a permutation index for sorting rows or cols
	(sort_swap): Swap two entries in the permutation index
	(sort_compare_sets): Compare two sets of cells
	(sort_compare_cells): Compare two cells
	(sort_data_destroy): Destroy SortData struct

	* src/commands.c (cmd_sort): Store the new sort data structure
	(cmd_sort_redo): Call sort_contents only if a permutation index
	does not already exist, otherwise use the index with sort_postion
	(cmd_sort_undo): Create an inverse of the permutation index
	if it doesn't already exit to call sort_positon with

	* src/commands.h: New cmd_sort prototype.

	* src/workbook.c (sort_cmd): Reflecting sorting API changes

2000-06-06  JP Rosevear  <jpr@arcavia.com>

	* cell-sort.glade: GUI tidying

	* dialog-cell-sort.c (dialog_cell_sort_ok): Reflect sorting
changes
	(dialog_cell_sort_del_clause): ditto
	(dialog_cell_sort_header_toggled): ditto
	(dialog_cell_sort): ditto
parent 8adf2128
2000-06-06 JP Rosevear <jpr@arcavia.com>
* src/sort.c (sort_position): Call sort_permute with the given
permutation index
(sort_contents): Call sort_qsort to get a permutation index and
then use sort_permute to actually move the rows
(sort_permute): Use copy and paste to move rows/cols around
(sort_permute_next): Find next row/col the hasn't been set based
on the permutation array
(sort_permute_is_set): Find if a a bit in a bit array is set
(sort_permute_set): Set a bit in a bit array
(sort_permute_find): Find a given number in a permutation array
(sort_qsort): Produce a permutation index for sorting rows or cols
(sort_swap): Swap two entries in the permutation index
(sort_compare_sets): Compare two sets of cells
(sort_compare_cells): Compare two cells
(sort_data_destroy): Destroy SortData struct
* src/commands.c (cmd_sort): Store the new sort data structure
(cmd_sort_redo): Call sort_contents only if a permutation index
does not already exist, otherwise use the index with sort_postion
(cmd_sort_undo): Create an inverse of the permutation index
if it doesn't already exit to call sort_positon with
* src/commands.h: New cmd_sort prototype.
* src/workbook.c (sort_cmd): Reflecting sorting API changes
2000-06-05 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_relocate) : when relocating the expression
......
2000-06-06 JP Rosevear <jpr@arcavia.com>
* src/sort.c (sort_position): Call sort_permute with the given
permutation index
(sort_contents): Call sort_qsort to get a permutation index and
then use sort_permute to actually move the rows
(sort_permute): Use copy and paste to move rows/cols around
(sort_permute_next): Find next row/col the hasn't been set based
on the permutation array
(sort_permute_is_set): Find if a a bit in a bit array is set
(sort_permute_set): Set a bit in a bit array
(sort_permute_find): Find a given number in a permutation array
(sort_qsort): Produce a permutation index for sorting rows or cols
(sort_swap): Swap two entries in the permutation index
(sort_compare_sets): Compare two sets of cells
(sort_compare_cells): Compare two cells
(sort_data_destroy): Destroy SortData struct
* src/commands.c (cmd_sort): Store the new sort data structure
(cmd_sort_redo): Call sort_contents only if a permutation index
does not already exist, otherwise use the index with sort_postion
(cmd_sort_undo): Create an inverse of the permutation index
if it doesn't already exit to call sort_positon with
* src/commands.h: New cmd_sort prototype.
* src/workbook.c (sort_cmd): Reflecting sorting API changes
2000-06-05 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_relocate) : when relocating the expression
......
2000-06-06 JP Rosevear <jpr@arcavia.com>
* src/sort.c (sort_position): Call sort_permute with the given
permutation index
(sort_contents): Call sort_qsort to get a permutation index and
then use sort_permute to actually move the rows
(sort_permute): Use copy and paste to move rows/cols around
(sort_permute_next): Find next row/col the hasn't been set based
on the permutation array
(sort_permute_is_set): Find if a a bit in a bit array is set
(sort_permute_set): Set a bit in a bit array
(sort_permute_find): Find a given number in a permutation array
(sort_qsort): Produce a permutation index for sorting rows or cols
(sort_swap): Swap two entries in the permutation index
(sort_compare_sets): Compare two sets of cells
(sort_compare_cells): Compare two cells
(sort_data_destroy): Destroy SortData struct
* src/commands.c (cmd_sort): Store the new sort data structure
(cmd_sort_redo): Call sort_contents only if a permutation index
does not already exist, otherwise use the index with sort_postion
(cmd_sort_undo): Create an inverse of the permutation index
if it doesn't already exit to call sort_positon with
* src/commands.h: New cmd_sort prototype.
* src/workbook.c (sort_cmd): Reflecting sorting API changes
2000-06-05 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_relocate) : when relocating the expression
......
2000-06-06 JP Rosevear <jpr@arcavia.com>
* src/sort.c (sort_position): Call sort_permute with the given
permutation index
(sort_contents): Call sort_qsort to get a permutation index and
then use sort_permute to actually move the rows
(sort_permute): Use copy and paste to move rows/cols around
(sort_permute_next): Find next row/col the hasn't been set based
on the permutation array
(sort_permute_is_set): Find if a a bit in a bit array is set
(sort_permute_set): Set a bit in a bit array
(sort_permute_find): Find a given number in a permutation array
(sort_qsort): Produce a permutation index for sorting rows or cols
(sort_swap): Swap two entries in the permutation index
(sort_compare_sets): Compare two sets of cells
(sort_compare_cells): Compare two cells
(sort_data_destroy): Destroy SortData struct
* src/commands.c (cmd_sort): Store the new sort data structure
(cmd_sort_redo): Call sort_contents only if a permutation index
does not already exist, otherwise use the index with sort_postion
(cmd_sort_undo): Create an inverse of the permutation index
if it doesn't already exit to call sort_positon with
* src/commands.h: New cmd_sort prototype.
* src/workbook.c (sort_cmd): Reflecting sorting API changes
2000-06-05 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_relocate) : when relocating the expression
......
2000-06-06 JP Rosevear <jpr@arcavia.com>
* src/sort.c (sort_position): Call sort_permute with the given
permutation index
(sort_contents): Call sort_qsort to get a permutation index and
then use sort_permute to actually move the rows
(sort_permute): Use copy and paste to move rows/cols around
(sort_permute_next): Find next row/col the hasn't been set based
on the permutation array
(sort_permute_is_set): Find if a a bit in a bit array is set
(sort_permute_set): Set a bit in a bit array
(sort_permute_find): Find a given number in a permutation array
(sort_qsort): Produce a permutation index for sorting rows or cols
(sort_swap): Swap two entries in the permutation index
(sort_compare_sets): Compare two sets of cells
(sort_compare_cells): Compare two cells
(sort_data_destroy): Destroy SortData struct
* src/commands.c (cmd_sort): Store the new sort data structure
(cmd_sort_redo): Call sort_contents only if a permutation index
does not already exist, otherwise use the index with sort_postion
(cmd_sort_undo): Create an inverse of the permutation index
if it doesn't already exit to call sort_positon with
* src/commands.h: New cmd_sort prototype.
* src/workbook.c (sort_cmd): Reflecting sorting API changes
2000-06-05 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_relocate) : when relocating the expression
......
2000-06-06 JP Rosevear <jpr@arcavia.com>
* src/sort.c (sort_position): Call sort_permute with the given
permutation index
(sort_contents): Call sort_qsort to get a permutation index and
then use sort_permute to actually move the rows
(sort_permute): Use copy and paste to move rows/cols around
(sort_permute_next): Find next row/col the hasn't been set based
on the permutation array
(sort_permute_is_set): Find if a a bit in a bit array is set
(sort_permute_set): Set a bit in a bit array
(sort_permute_find): Find a given number in a permutation array
(sort_qsort): Produce a permutation index for sorting rows or cols
(sort_swap): Swap two entries in the permutation index
(sort_compare_sets): Compare two sets of cells
(sort_compare_cells): Compare two cells
(sort_data_destroy): Destroy SortData struct
* src/commands.c (cmd_sort): Store the new sort data structure
(cmd_sort_redo): Call sort_contents only if a permutation index
does not already exist, otherwise use the index with sort_postion
(cmd_sort_undo): Create an inverse of the permutation index
if it doesn't already exit to call sort_positon with
* src/commands.h: New cmd_sort prototype.
* src/workbook.c (sort_cmd): Reflecting sorting API changes
2000-06-05 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_relocate) : when relocating the expression
......
2000-06-06 JP Rosevear <jpr@arcavia.com>
* src/sort.c (sort_position): Call sort_permute with the given
permutation index
(sort_contents): Call sort_qsort to get a permutation index and
then use sort_permute to actually move the rows
(sort_permute): Use copy and paste to move rows/cols around
(sort_permute_next): Find next row/col the hasn't been set based
on the permutation array
(sort_permute_is_set): Find if a a bit in a bit array is set
(sort_permute_set): Set a bit in a bit array
(sort_permute_find): Find a given number in a permutation array
(sort_qsort): Produce a permutation index for sorting rows or cols
(sort_swap): Swap two entries in the permutation index
(sort_compare_sets): Compare two sets of cells
(sort_compare_cells): Compare two cells
(sort_data_destroy): Destroy SortData struct
* src/commands.c (cmd_sort): Store the new sort data structure
(cmd_sort_redo): Call sort_contents only if a permutation index
does not already exist, otherwise use the index with sort_postion
(cmd_sort_undo): Create an inverse of the permutation index
if it doesn't already exit to call sort_positon with
* src/commands.h: New cmd_sort prototype.
* src/workbook.c (sort_cmd): Reflecting sorting API changes
2000-06-05 Jody Goldberg <jgoldberg@home.com>
* src/cell.c (cell_relocate) : when relocating the expression
......
......@@ -1501,14 +1501,9 @@ typedef struct
{
GnumericCommand parent;
Sheet *sheet;
Range *range;
SortData *data;
SortClause *clauses;
gint num_clause;
gboolean columns;
int *perm;
int *inv;
} CmdSort;
GNUMERIC_MAKE_COMMAND (CmdSort, cmd_sort);
......@@ -1518,15 +1513,7 @@ cmd_sort_destroy (GtkObject *cmd)
{
CmdSort *me = CMD_SORT (cmd);
sort_clause_destroy (me->clauses);
if (me->data) {
g_free (me->data);
me->data = NULL;
}
if (me->range) {
g_free (me->range);
me->range = NULL;
}
sort_data_destroy (me->data);
gnumeric_command_destroy (cmd);
}
......@@ -1535,14 +1522,31 @@ static gboolean
cmd_sort_undo (GnumericCommand *cmd, CommandContext *context)
{
CmdSort *me = CMD_SORT (cmd);
int length, i;
int *inv;
g_return_val_if_fail (me != NULL, TRUE);
sort_position (me->sheet, me->range, me->data, me->columns);
if (!me->inv) {
if (me->data->top) {
length = me->data->range->end.row -
me->data->range->start.row + 1;
} else {
length = me->data->range->end.col -
me->data->range->start.col + 1;
}
sheet_set_dirty (me->sheet, TRUE);
workbook_recalc (me->sheet->workbook);
sheet_update (me->sheet);
me->inv = g_new (int, length);
for (i=0; i <length; i++) {
me->inv[me->perm[i]] = i;
}
}
sort_position (context, me->data, me->inv);
sheet_set_dirty (me->data->sheet, TRUE);
workbook_recalc (me->data->sheet->workbook);
sheet_update (me->data->sheet);
return FALSE;
}
......@@ -1554,56 +1558,39 @@ cmd_sort_redo (GnumericCommand *cmd, CommandContext *context)
g_return_val_if_fail (me != NULL, TRUE);
sort_contents (me->sheet, me->range, me->data, me->columns);
if (!me->perm) {
me->perm = sort_contents (context, me->data);
} else {
sort_position (context, me->data, me->perm);
}
sheet_set_dirty (me->sheet, TRUE);
workbook_recalc (me->sheet->workbook);
sheet_update (me->sheet);
sheet_set_dirty (me->data->sheet, TRUE);
workbook_recalc (me->data->sheet->workbook);
sheet_update (me->data->sheet);
return FALSE;
}
gboolean
cmd_sort (CommandContext *context, Sheet *sheet,
Range *range, SortClause *clauses,
gint num_clause, gboolean columns)
cmd_sort (CommandContext *context, SortData *data)
{
GtkObject *obj;
CmdSort *me;
int length, lp;
g_return_val_if_fail (sheet != NULL, TRUE);
g_return_val_if_fail (data != NULL, TRUE);
obj = gtk_type_new (CMD_SORT_TYPE);
me = CMD_SORT (obj);
me->sheet = sheet;
me->range = range;
me->clauses = clauses;
me->num_clause = num_clause;
me->columns = columns;
if (columns)
length = me->range->end.row - me->range->start.row + 1;
else
length = me->range->end.col - me->range->start.col + 1;
me->data = g_new (SortData, length);
for (lp = 0; lp < length; lp++) {
me->data [lp].clauses = me->clauses;
me->data [lp].num_clause = me->num_clause;
if (me->columns)
me->data [lp].pos = me->range->start.row + lp;
else
me->data [lp].pos = me->range->start.col + lp;
}
me->data = data;
me->perm = NULL;
me->inv = NULL;
me->parent.cmd_descriptor =
g_strdup_printf (_("Sorting %s"), range_name(me->range));
g_strdup_printf (_("Sorting %s"), range_name(me->data->range));
/* Register the command object */
return command_push_undo (context, sheet->workbook, obj);
return command_push_undo (context, me->data->sheet->workbook, obj);
}
/******************************************************************/
......
......@@ -38,9 +38,7 @@ gboolean cmd_paste_copy (CommandContext *context,
gboolean cmd_rename_sheet (CommandContext *context, Workbook *wb,
const char *old_name, const char *new_name);
gboolean cmd_sort (CommandContext *context, Sheet *sheet,
Range *range, SortClause *clauses,
gint num_clause, gboolean columns);
gboolean cmd_sort (CommandContext *context, SortData *data);
gboolean cmd_format (CommandContext *context, Sheet *sheet,
MStyle *style, MStyleBorder **borders);
......
2000-06-06 JP Rosevear <jpr@arcavia.com>
* cell-sort.glade: GUI tidying
* dialog-cell-sort.c (dialog_cell_sort_ok): Reflect sorting changes
(dialog_cell_sort_del_clause): ditto
(dialog_cell_sort_header_toggled): ditto
(dialog_cell_sort): ditto
2000-06-04 Miguel de Icaza <miguel@helixcode.com>
* dialog-function-wizard.c (dialog_function_druid): Use
......
......@@ -10,17 +10,11 @@
<language>C</language>
<gnome_support>True</gnome_support>
<gettext_support>True</gettext_support>
<use_widget_names>False</use_widget_names>
<output_main_file>False</output_main_file>
<output_support_files>True</output_support_files>
<output_build_files>True</output_build_files>
<backup_source_files>True</backup_source_files>
<main_source_file>gladesource.c</main_source_file>
<main_header_file>gladesource.h</main_header_file>
<handler_source_file>gladesig.c</handler_source_file>
<handler_header_file>gladesig.h</handler_header_file>
<support_source_file>support.c</support_source_file>
<support_header_file>support.h</support_header_file>
<output_translatable_strings>True</output_translatable_strings>
<translatable_strings_file>cell-sort.glade.h</translatable_strings_file>
</project>
......@@ -51,6 +45,58 @@
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area2</name>
<layout_style>GTK_BUTTONBOX_START</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>button4</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<widget>
<class>GtkButton</class>
<name>cell_sort_add</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Add</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_ADD</stock_pixmap>
</widget>
<widget>
<class>GtkButton</class>
<name>cell_sort_remove</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Remove</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_REMOVE</stock_pixmap>
</widget>
<widget>
<class>GtkButton</class>
<name>button8</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
</widget>
<widget>
<class>GtkTable</class>
<name>cell_sort_table</name>
......@@ -129,7 +175,7 @@
<class>GtkRadioButton</class>
<name>cell_sort_row_rb</name>
<can_focus>True</can_focus>
<label>Rows</label>
<label>Right-Left</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<group>row_col</group>
......@@ -144,7 +190,7 @@
<class>GtkRadioButton</class>
<name>cell_sort_col_rb</name>
<can_focus>True</can_focus>
<label>Columns</label>
<label>Top-Bottom</label>
<active>True</active>
<draw_indicator>True</draw_indicator>
<group>row_col</group>
......@@ -158,11 +204,39 @@
</widget>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDialog</class>
<name>CellSortAdvanced</name>
<visible>False</visible>
<title>Advanced Sort Options</title>
<type>GTK_WINDOW_DIALOG</type>
<position>GTK_WIN_POS_CENTER</position>
<modal>True</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>False</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>False</auto_close>
<hide_on_close>False</hide_on_close>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>dialog-vbox3</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area2</name>
<name>dialog-action_area3</name>
<layout_style>GTK_BUTTONBOX_START</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
......@@ -178,7 +252,7 @@
<widget>
<class>GtkButton</class>
<name>button4</name>
<name>button9</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
......@@ -186,58 +260,12 @@
<widget>
<class>GtkButton</class>
<name>cell_sort_add</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Add</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_ADD</stock_pixmap>
</widget>
<widget>
<class>GtkButton</class>
<name>cell_sort_remove</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Remove</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_REMOVE</stock_pixmap>
</widget>
<widget>
<class>GtkButton</class>
<name>button8</name>
<name>button10</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDialog</class>
<name>CellSortAdvanced</name>
<visible>False</visible>
<title>Advanced Sort Options</title>
<type>GTK_WINDOW_DIALOG</type>
<position>GTK_WIN_POS_CENTER</position>
<modal>True</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>False</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>False</auto_close>
<hide_on_close>False</hide_on_close>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>dialog-vbox3</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkTable</class>
......@@ -344,40 +372,6 @@
</widget>
</widget>
</widget>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area3</name>
<layout_style>GTK_BUTTONBOX_START</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>button9</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<widget>
<class>GtkButton</class>
<name>button10</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
</widget>
</widget>
</widget>
......
......@@ -5,13 +5,13 @@
*/
gchar *s = N_("Sort...");
gchar *s = N_("Add");
gchar *s = N_("Remove");
gchar *s = N_("Selection has");
gchar *s = N_("A header");
gchar *s = N_("Sort");
gchar *s = N_("Rows");
gchar *s = N_("Columns");
gchar *s = N_("Add");
gchar *s = N_("Remove");
gchar *s = N_("Right-Left");
gchar *s = N_("Top-Bottom");
gchar *s = N_("Advanced Sort Options");
gchar *s = N_("Sort by");
gchar *s = N_("Value");
......
......@@ -41,8 +41,8 @@ typedef struct {
int asc;
GtkWidget *asc_desc;
GSList *group;
gboolean cs;
gboolean val;
gboolean cs;
gboolean val;
GtkWidget *adv_button;
Workbook *wb;
} OrderBox;
......@@ -58,7 +58,7 @@ typedef struct {
GtkWidget *dialog;
GtkWidget *clause_box;
gboolean header;
gboolean columns;
gboolean top;
GList *colnames_plain;
GList *colnames_header;
GList *rownames_plain;
......@@ -300,11 +300,12 @@ order_box_destroy (OrderBox *orderbox)
static gboolean
dialog_cell_sort_ok (SortFlow *sf)
{
SortData *data;
SortClause *array;
gint divstart, divend;
int lp;
if (sf->columns) {
if (sf->top) {
divstart = sf->sel->start.col;
divend = sf->sel->end.col;
} else {
......@@ -320,7 +321,7 @@ dialog_cell_sort_ok (SortFlow *sf)
order_box_get_clause (sf->clauses [lp], &array [lp]);
if (strlen (txt)) {
division = -1;
if (sf->columns) {
if (sf->top) {
if (sf->header) {
division = divstart + string_pos_in_list(txt, sf->colnames_header);
} else {
......@@ -336,14 +337,14 @@ dialog_cell_sort_ok (SortFlow *sf)
if (division < divstart || division > divend) {
gnumeric_notice (sf->wb,
GNOME_MESSAGE_BOX_ERROR,
sf->columns ?
sf->top ?