aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-08-03 02:18:18 +0800
committerChris Lahey <clahey@src.gnome.org>2001-08-03 02:18:18 +0800
commit15b98319b3d007e31a5b55a0bc0f21a4c1498e1d (patch)
tree4ef0059ee282d076361ec8a4bd12bebdcb630262 /widgets
parentfe71cb35cf757ad5fb4900abe9b9c5bdf0eb5419 (diff)
downloadgsoc2013-evolution-15b98319b3d007e31a5b55a0bc0f21a4c1498e1d.tar
gsoc2013-evolution-15b98319b3d007e31a5b55a0bc0f21a4c1498e1d.tar.gz
gsoc2013-evolution-15b98319b3d007e31a5b55a0bc0f21a4c1498e1d.tar.bz2
gsoc2013-evolution-15b98319b3d007e31a5b55a0bc0f21a4c1498e1d.tar.lz
gsoc2013-evolution-15b98319b3d007e31a5b55a0bc0f21a4c1498e1d.tar.xz
gsoc2013-evolution-15b98319b3d007e31a5b55a0bc0f21a4c1498e1d.tar.zst
gsoc2013-evolution-15b98319b3d007e31a5b55a0bc0f21a4c1498e1d.zip
Don't do most of the work in this function if data->data is NULL. Fixes
2001-08-02 Christopher James Lahey <clahey@ximian.com> * e-table-header-item.c (ethi_drag_data_received): Don't do most of the work in this function if data->data is NULL. Fixes Ximian bug #6041. svn path=/trunk/; revision=11587
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/e-table-header-item.c48
1 files changed, 27 insertions, 21 deletions
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index c4ad630a9e..acaa1c1510 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -608,29 +608,35 @@ ethi_drag_data_received (GtkWidget *canvas,
ETableHeaderItem *ethi)
{
int found = FALSE;
- int count = e_table_header_count(ethi->eth);
- int column = atoi(data->data);
- int drop_col = ethi->drop_col;
+ int count;
+ int column;
+ int drop_col;
int i;
- ethi->drop_col = -1;
- if (column < 0)
- return;
- for (i = 0; i < count; i++) {
- ETableCol *ecol = e_table_header_get_column (ethi->eth, i);
- if (ecol->col_idx == column) {
- e_table_header_move(ethi->eth, i, drop_col);
- found = TRUE;
- break;
- }
- }
- if (!found) {
- count = e_table_header_count(ethi->full_header);
- for (i = 0; i < count; i++) {
- ETableCol *ecol = e_table_header_get_column (ethi->full_header, i);
- if (ecol->col_idx == column) {
- e_table_header_add_column (ethi->eth, ecol, drop_col);
- break;
+ if (data->data) {
+ count = e_table_header_count(ethi->eth);
+ column = atoi(data->data);
+ drop_col = ethi->drop_col;
+ ethi->drop_col = -1;
+
+ if (column >= 0) {
+ for (i = 0; i < count; i++) {
+ ETableCol *ecol = e_table_header_get_column (ethi->eth, i);
+ if (ecol->col_idx == column) {
+ e_table_header_move(ethi->eth, i, drop_col);
+ found = TRUE;
+ break;
+ }
+ }
+ if (!found) {
+ count = e_table_header_count(ethi->full_header);
+ for (i = 0; i < count; i++) {
+ ETableCol *ecol = e_table_header_get_column (ethi->full_header, i);
+ if (ecol->col_idx == column) {
+ e_table_header_add_column (ethi->eth, ecol, drop_col);
+ break;
+ }
+ }
}
}
}