From 6d1789d4db87a072915ccad15270233bbd3b4375 Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Sat, 25 Oct 2003 09:20:51 +0000 Subject: [PATCH] Partial fix to nav menu/branch inset problem reported by Kayvan git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7979 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 7 +++++++ src/MenuBackend.C | 12 +++++++----- src/lyxfunc.C | 8 ++++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b0b7519cf0..ea694eff78 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2003-10-25 Martin Vermeer + + * MenuBackend.C: + * lyxfunc.C: fix (at least partly) the problems + with the Nav menu and headers inside branch insets + reported by Kayvan + 2003-10-24 Alfredo Braunstein * paragraph.C (getChar): add strong asserts diff --git a/src/MenuBackend.C b/src/MenuBackend.C index dcd90ba517..b127b7fa99 100644 --- a/src/MenuBackend.C +++ b/src/MenuBackend.C @@ -536,8 +536,9 @@ void expandToc2(Menu & tomenu, string label(4 * max(0, toc_list[i].depth - depth),' '); label += limit_string_length(toc_list[i].str); if (toc_list[i].depth == depth - && ++shortcut_count <= 9) { - label += '|' + tostr(shortcut_count); + && shortcut_count < 9) { + if (label.find(tostr(shortcut_count + 1)) != string::npos) + label += '|' + tostr(++shortcut_count); } tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(toc_list[i].action()))); @@ -553,9 +554,10 @@ void expandToc2(Menu & tomenu, string label(4 * max(0, toc_list[pos].depth - depth), ' '); label += limit_string_length(toc_list[pos].str); if (toc_list[pos].depth == depth && - ++shortcut_count <= 9) - label += '|' + tostr(shortcut_count); - + shortcut_count < 9) { + if (label.find(tostr(shortcut_count + 1)) != string::npos) + label += '|' + tostr(++shortcut_count); + } if (new_pos == pos + 1) { tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(toc_list[pos].action()))); diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 10df86c028..fceba1cab1 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -814,7 +814,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const // solution, we consider only the first action of the sequence if (ev.action == LFUN_SEQUENCE) { // argument contains ';'-terminated commands -#warning LyXAction arguements not handled here. +#warning LyXAction arguments not handled here. flag = getStatus(FuncRequest(lyxaction.lookupFunc(token(ev.argument, ';', 0)))); } @@ -1416,12 +1416,16 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose) if (view()->theLockingInset()) view()->unlockInset(view()->theLockingInset()); + + LyXText * lt = view()->getLyXText(); if (par->inInset()) { FuncRequest cmd(view(), LFUN_INSET_EDIT, "left"); par->inInset()->dispatch(cmd); + lt = par->inInset()->getLyXText(view()); } + // Set the cursor - view()->getLyXText()->setCursor(par.pit(), 0); + lt->setCursor(par.pit(), 0); view()->switchKeyMap(); owner->view_state_changed(); -- 2.39.2