]> git.lyx.org Git - features.git/commitdiff
Partial fix to nav menu/branch inset problem reported by Kayvan
authorMartin Vermeer <martin.vermeer@hut.fi>
Sat, 25 Oct 2003 09:20:51 +0000 (09:20 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Sat, 25 Oct 2003 09:20:51 +0000 (09:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7979 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/MenuBackend.C
src/lyxfunc.C

index b0b7519cf0cb60821a42c2d7a97e2a99f705f39c..ea694eff7862b10ffe5aab9667c48150ce05aa31 100644 (file)
@@ -1,3 +1,10 @@
+2003-10-25  Martin Vermeer  <martin.vermeer@hut.fi>
+
+       * 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  <abraunst@libero.it>
 
        * paragraph.C (getChar): add strong asserts
index dcd90ba51766c5603a04fe3b3772dd5187fbf129..b127b7fa99af113dab191eaad6031eba5c73374b 100644 (file)
@@ -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())));
index 10df86c028bb15b4a529e64c44e1fe1cfe30a532..fceba1cab129148d1eb46c63b0a0a1ff8e967513 100644 (file)
@@ -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();