summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <johannes.hofmann@gmx.de>2005-02-02 15:49:12 +0000
committerJohannes Hofmann <johannes.hofmann@gmx.de>2005-02-02 15:49:12 +0000
commit20d670d43dce0852dfdbab5ba1f744d712652add (patch)
tree8aeae80b2ded8bff78d1b71986f5cd2f6764ba48
parent280e14299ed380be0db84b383f73649f6423455e (diff)
fix segfault when moving (with arrow keys) in a doc without tags. Reported by: Arho Virkki <arho.virkki@utu.fi>
fix segfault when moving (with arrow keys) in a doc without tags. Reported by: Arho Virkki <arho.virkki@utu.fi>
-rw-r--r--src/PSEditWidget.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/PSEditWidget.cxx b/src/PSEditWidget.cxx
index 1286b15..7476ce7 100644
--- a/src/PSEditWidget.cxx
+++ b/src/PSEditWidget.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: PSEditWidget.cxx,v 1.33 2005/01/28 15:08:28 hofmann Exp $"
+// "$Id: PSEditWidget.cxx,v 1.34 2005/02/02 16:49:12 hofmann Exp $"
//
// PSEditWidget routines.
//
@@ -177,12 +177,10 @@ void PSEditWidget::move(int x1, int y1) {
old_bby = bb_y(t);
old_bbw = bb_w(t);
old_bbh = bb_h(t);
- }
- model->move(ps_x(x1), ps_y(y1));
- mod++;
+ model->move(ps_x(x1), ps_y(y1));
+ mod++;
- if (t) {
damage(4, old_bbx, old_bby, old_bbw, old_bbh);
damage(4, bb_x(t), bb_y(t), bb_w(t), bb_h(t));
}
@@ -198,12 +196,10 @@ void PSEditWidget::rel_move(int dx, int dy) {
old_bby = bb_y(t);
old_bbw = bb_w(t);
old_bbh = bb_h(t);
- }
- model->move(t->get_x() + dx, t->get_y() + dy);
- mod++;
+ model->move(t->get_x() + dx, t->get_y() + dy);
+ mod++;
- if (t) {
damage(4, old_bbx, old_bby, old_bbw, old_bbh);
damage(4, bb_x(t), bb_y(t), bb_w(t), bb_h(t));
}