Fix inline collapsable inset set focus crash

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16720 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2007-01-17 02:53:33 +00:00
parent 3dca136795
commit 104051c151

View File

@ -306,7 +306,7 @@ void InsetCollapsable::edit(LCursor & cur, bool left)
InsetBase * InsetCollapsable::editXY(LCursor & cur, int x, int y) InsetBase * InsetCollapsable::editXY(LCursor & cur, int x, int y)
{ {
//lyxerr << "InsetCollapsable: edit xy" << endl; //lyxerr << "InsetCollapsable: edit xy" << endl;
if (status() == Collapsed || button_dim.contains(x, y)) if (status() == Collapsed || (button_dim.contains(x, y) && status() != Inlined))
return this; return this;
cur.push(*this); cur.push(*this);
return InsetText::editXY(cur, x, y); return InsetText::editXY(cur, x, y);
@ -320,7 +320,7 @@ void InsetCollapsable::doDispatch(LCursor & cur, FuncRequest & cmd)
switch (cmd.action) { switch (cmd.action) {
case LFUN_MOUSE_PRESS: case LFUN_MOUSE_PRESS:
if (cmd.button() == mouse_button::button1 && hitButton(cmd)) { if (cmd.button() == mouse_button::button1 && hitButton(cmd) && status() != Inlined) {
// reset selection if necessary (see bug 3060) // reset selection if necessary (see bug 3060)
if (cur.selection()) if (cur.selection())
cur.bv().cursor().clearSelection(); cur.bv().cursor().clearSelection();