fix crash when opening collapsables

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8399 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Alfredo Braunstein 2004-02-04 09:14:27 +00:00
parent 001d4025e9
commit 982344dc61
3 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2004-02-04 Alfredo Braunstein <abraunst@lyx.org>
* 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 <larsbj@gullik.net>
* insetlatexaccent.C (checkContents): "c" -> 'c' in calls to contains

View File

@ -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);
}

View File

@ -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());