projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug which manifested itself in the text import dialog
[pspp]
/
lib
/
gtksheet
/
psppire-axis-impl.c
diff --git
a/lib/gtksheet/psppire-axis-impl.c
b/lib/gtksheet/psppire-axis-impl.c
index 619e8238dab5c66a5f6d10c738c1351a4fa0de4d..1fb00d2d8435df76be0b9b1e3d8c4b5fdbfc8147 100644
(file)
--- a/
lib/gtksheet/psppire-axis-impl.c
+++ b/
lib/gtksheet/psppire-axis-impl.c
@@
-331,12
+331,10
@@
psppire_axis_impl_insert (PsppireAxisImpl *a, gint posn, gint size)
struct axis_node *before = NULL;
struct axis_node *new_node;
struct axis_node *before = NULL;
struct axis_node *new_node;
- g_return_if_fail ( posn < tower_height (&a->unit_tower));
g_return_if_fail ( posn >= 0);
g_return_if_fail ( posn >= 0);
+ g_return_if_fail ( posn <= tower_height (&a->unit_tower));
- new_node = pool_malloc (a->pool, sizeof (*new_node));
-
- if ( posn > 0)
+ if ( posn < tower_height (&a->unit_tower))
{
unsigned long int start = 0;
struct tower_node *n;
{
unsigned long int start = 0;
struct tower_node *n;
@@
-349,6
+347,8
@@
psppire_axis_impl_insert (PsppireAxisImpl *a, gint posn, gint size)
before = tower_data (n, struct axis_node, unit_node);
}
before = tower_data (n, struct axis_node, unit_node);
}
+ new_node = pool_malloc (a->pool, sizeof (*new_node));
+
tower_insert (&a->unit_tower,
1,
&new_node->unit_node,
tower_insert (&a->unit_tower,
1,
&new_node->unit_node,
@@
-437,12
+437,13
@@
psppire_axis_impl_delete (PsppireAxisImpl *a, gint first, gint n_units)
{
gint units_to_delete = n_units;
unsigned long int start;
{
gint units_to_delete = n_units;
unsigned long int start;
+ struct tower_node *unit_node ;
g_return_if_fail (first + n_units < tower_height (&a->unit_tower));
split (a, first);
split (a, first + n_units);
g_return_if_fail (first + n_units < tower_height (&a->unit_tower));
split (a, first);
split (a, first + n_units);
-
struct tower_node *
unit_node = tower_lookup (&a->unit_tower, first, &start);
+ unit_node = tower_lookup (&a->unit_tower, first, &start);
g_assert (start == first);
while (units_to_delete > 0)
g_assert (start == first);
while (units_to_delete > 0)