I just stumbled over some remains of old code from the time when "local
dsipatching" was new to mathed. It's not needed anymore as the case they
were supposed to handle (mouseclicks on insets that are not "nest
insets") is now caught earlier in formulabase.C. As the code right leads
to crashs under certain circumstances I think it is _much better_ to remove
it.
Ok to apply the patch?
Andre'
--
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)
Index: math_cursor.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_cursor.C,v
retrieving revision 1.319
diff -u -p -r1.319 math_cursor.C
--- math_cursor.C 19 Sep 2002 06:52:13 -0000 1.319
+++ math_cursor.C 14 Oct 2002 17:32:24 -0000
@@ -1483,25 +1483,10 @@ MathCursorPos MathCursor::normalAnchor()
MathInset::result_type MathCursor::dispatch(FuncRequest const & cmd)
{
- // try to dispatch to adajcent items if they are not editable
- // actually, this should only happen for mouse clicks...
- idx_type d1;
- pos_type d2;
- if (hasNextAtom() && !openable(nextAtom(), false)) {
- MathInset::result_type res = nextAtom().nucleus()->dispatch(cmd, d1,
d2);
- if (res != MathInset::UNDISPATCHED)
- return res;
- }
- if (hasPrevAtom() && !openable(prevAtom(), false)) {
- MathInset::result_type res = prevAtom().nucleus()->dispatch(cmd, d1,
d2);
- if (res != MathInset::UNDISPATCHED)
- return res;
- }
-
for (int i = Cursor_.size() - 1; i >= 0; --i) {
MathCursorPos & pos = Cursor_[i];
- MathInset::result_type const res
- = pos.par_->dispatch(cmd, pos.idx_, pos.pos_);
+ MathInset::result_type
+ res = pos.par_->dispatch(cmd, pos.idx_, pos.pos_);
if (res != MathInset::UNDISPATCHED) {
if (res == MathInset::DISPATCHED_POP) {
Cursor_.shrink(i + 1);
Index: math_data.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_data.C,v
retrieving revision 1.20
diff -u -p -r1.20 math_data.C
--- math_data.C 11 Sep 2002 08:26:02 -0000 1.20
+++ math_data.C 14 Oct 2002 17:32:24 -0000
@@ -66,6 +66,7 @@ void MathArray::insert(size_type pos, Ma
void MathArray::insert(size_type pos, MathArray const & ar)
{
+ lyx::Assert(pos <= size());
base_type::insert(begin() + pos, ar.begin(), ar.end());
}
Index: math_nestinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_nestinset.C,v
retrieving revision 1.58
diff -u -p -r1.58 math_nestinset.C
--- math_nestinset.C 22 Aug 2002 13:02:14 -0000 1.58
+++ math_nestinset.C 14 Oct 2002 17:32:24 -0000
@@ -332,7 +332,8 @@ MathInset::result_type MathNestInset::di
case LFUN_PASTESELECTION:
return
- dispatch(FuncRequest(bv, LFUN_PASTE,
bv->getClipboard()), idx, pos);
+ dispatch(
+ FuncRequest(bv, LFUN_PASTE,
+bv->getClipboard()), idx, pos);
case LFUN_MOUSE_PRESS:
if (cmd.button() == mouse_button::button2)