mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 17:20:55 +00:00
Fix bug 2756:
* src/BufferView_pimpl.C (dispatch/LFUN_NEXT_INSET_TOGGLE): moved from LyXText. * src/text3.C (dispatch/LFUN_NEXT_INSET_TOGGLE): moved to BufferView::Pimpl, since this should work in mathed too. * src/mathed/math_nestinset.C (doDispatch/LFUN_INSET_TOGGLE): do not try to do the work which belongs to LFUN_NEXT_INSET_TOGGLE (bug 2756). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@14616 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8d7df59e74
commit
84e22d209e
@ -1054,6 +1054,7 @@ FuncStatus BufferView::Pimpl::getStatus(FuncRequest const & cmd)
|
||||
case LFUN_BIBDB_ADD:
|
||||
case LFUN_BIBDB_DEL:
|
||||
case LFUN_WORDS_COUNT:
|
||||
case LFUN_NEXT_INSET_TOGGLE:
|
||||
flag.enabled(true);
|
||||
break;
|
||||
|
||||
@ -1351,6 +1352,30 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & cmd)
|
||||
buffer_->params().compressed = !buffer_->params().compressed;
|
||||
break;
|
||||
|
||||
case LFUN_NEXT_INSET_TOGGLE: {
|
||||
// this is the real function we want to invoke
|
||||
FuncRequest tmpcmd = FuncRequest(LFUN_INSET_TOGGLE, cmd.origin);
|
||||
// if there is an inset at cursor, see whether it
|
||||
// wants to toggle.
|
||||
InsetBase * inset = cur.nextInset();
|
||||
if (inset && inset->isActive()) {
|
||||
LCursor tmpcur = cur;
|
||||
tmpcur.pushLeft(*inset);
|
||||
inset->dispatch(tmpcur, tmpcmd);
|
||||
if (tmpcur.result().dispatched()) {
|
||||
cur.dispatched();
|
||||
}
|
||||
}
|
||||
// if it did not work, try the underlying inset.
|
||||
if (!cur.result().dispatched())
|
||||
cur.dispatch(tmpcmd);
|
||||
|
||||
if (cur.result().dispatched())
|
||||
cur.clearSelection();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -1,3 +1,11 @@
|
||||
2006-08-09 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||
|
||||
* BufferView_pimpl.C (dispatch/LFUN_NEXT_INSET_TOGGLE): moved from
|
||||
LyXText.
|
||||
|
||||
* text3.C (dispatch/LFUN_NEXT_INSET_TOGGLE): moved to
|
||||
BufferView::Pimpl, since this should work in mathed too.
|
||||
|
||||
2006-08-10 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||
|
||||
* buffer.C (save): fix logic error in fix to bug 2740.
|
||||
|
@ -1,3 +1,8 @@
|
||||
2006-08-09 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||
|
||||
* math_nestinset.C (doDispatch/LFUN_INSET_TOGGLE): do not try to
|
||||
do the work which belongs to LFUN_NEXT_INSET_TOGGLE (bug 2756).
|
||||
|
||||
2006-08-09 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||
|
||||
* math_nestinset.C (script):
|
||||
|
@ -649,15 +649,8 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd)
|
||||
|
||||
case LFUN_INSET_TOGGLE:
|
||||
recordUndo(cur);
|
||||
//lockToggle();
|
||||
if (cur.pos() != cur.lastpos()) {
|
||||
// toggle previous inset ...
|
||||
cur.nextAtom().nucleus()->lock(!cur.nextAtom()->lock());
|
||||
} else if (cur.popLeft() && cur.pos() != cur.lastpos()) {
|
||||
// ... or enclosing inset if we are in the last inset position
|
||||
cur.nextAtom().nucleus()->lock(!cur.nextAtom()->lock());
|
||||
++cur.pos();
|
||||
}
|
||||
lock(!lock());
|
||||
cur.popRight();
|
||||
break;
|
||||
|
||||
case LFUN_SELFINSERT:
|
||||
|
23
src/text3.C
23
src/text3.C
@ -674,28 +674,6 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
||||
cur.inset().showInsetDialog(bv);
|
||||
break;
|
||||
|
||||
case LFUN_NEXT_INSET_TOGGLE: {
|
||||
InsetBase * inset = cur.nextInset();
|
||||
// this is the real function we want to invoke
|
||||
cmd = FuncRequest(LFUN_INSET_TOGGLE);
|
||||
cur.undispatched();
|
||||
// if there is an inset at cursor, see whether it
|
||||
// wants to toggle.
|
||||
if (inset) {
|
||||
LCursor tmpcur = cur;
|
||||
tmpcur.pushLeft(*inset);
|
||||
inset->dispatch(tmpcur, cmd);
|
||||
if (tmpcur.result().dispatched()) {
|
||||
cur.clearSelection();
|
||||
cur.dispatched();
|
||||
}
|
||||
}
|
||||
// if it did not work, try the underlying inset.
|
||||
if (!cur.result().dispatched())
|
||||
cur.inset().dispatch(cur, cmd);
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_SPACE_INSERT:
|
||||
if (cur.paragraph().layout()->free_spacing)
|
||||
insertChar(cur, ' ');
|
||||
@ -1719,7 +1697,6 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
|
||||
case LFUN_BREAKPARAGRAPH_SKIP:
|
||||
case LFUN_PARAGRAPH_SPACING:
|
||||
case LFUN_INSET_INSERT:
|
||||
case LFUN_NEXT_INSET_TOGGLE:
|
||||
case LFUN_UPCASE_WORD:
|
||||
case LFUN_LOWCASE_WORD:
|
||||
case LFUN_CAPITALIZE_WORD:
|
||||
|
@ -24,12 +24,16 @@ What's new
|
||||
|
||||
- New Czech translation; update Italian localization.
|
||||
|
||||
- Updated Czech translation of the Tutorial.
|
||||
- Updated Czech translation of the Tutorial; new Czech translation of
|
||||
the splash document.
|
||||
|
||||
** Bug fixes:
|
||||
|
||||
* Document Input/Output
|
||||
|
||||
- Fix crash when using next-inset-toggle (Ctrl+I) inside mathed; make
|
||||
inset locking in mathed generally work (bug 2756).
|
||||
|
||||
- Fix crash on save (including dataloss) when the backup directory
|
||||
was invalid or not writeable(bug 2740).
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user