From: Alfredo Braunstein Date: Wed, 4 Feb 2004 09:14:27 +0000 (+0000) Subject: fix crash when opening collapsables X-Git-Tag: 1.6.10~15533 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=982344dc61482e7f937ee974f09f4669704c1506;p=features.git fix crash when opening collapsables git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8399 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 3451fd64e9..6ce68cdc4b 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,10 @@ + +2004-02-04 Alfredo Braunstein + + * insettext.C (edit): + (updateLocal): use the cur argument instead of the global cursor + * insetcollapsable.C (edit): dont call inset.edit(x,y) when opening + 2004-02-01 Lars Gullik Bjonnes * insetlatexaccent.C (checkContents): "c" -> 'c' in calls to contains diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index 59857a0a1b..cbea996dcb 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -299,13 +299,18 @@ void InsetCollapsable::edit(LCursor & cur, int x, int y) //lyxerr << "InsetCollapsable: edit xy" << endl; if (status_ == Collapsed) { setStatus(Open); + inset.edit(cur, true); +#warning look here +//we are not calling edit(x,y) because there are no coordinates in the +//inset yet. I personally think it's ok. (ab) } else { if (y <= button_dim.y2) y = 0; else y += inset.ascent() - height_collapsed(); + + inset.edit(cur, x, y); } - inset.edit(cur, x, y); } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index f06f56b0e0..195a2e31e0 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -253,7 +253,7 @@ void InsetText::updateLocal(LCursor & cur) lv->updateMenubar(); lv->updateToolbar(); if (old_par != cur.par()) { - lv->setLayout(text_.cursorPar()->layout()->name()); + lv->setLayout(text_.getPar(cur.par())->layout()->name()); old_par = cur.par(); } } @@ -287,7 +287,7 @@ void InsetText::edit(LCursor & cur, bool left) setViewCache(&cur.bv()); int const par = left ? 0 : paragraphs().size() - 1; int const pos = left ? 0 : paragraphs().back().size(); - text_.setCursor(par, pos); + text_.setCursor(cur.current(), par, pos); cur.clearSelection(); finishUndo(); sanitizeEmptyText(cur.bv());