]> git.lyx.org Git - features.git/commitdiff
bookmarks: allow go to bookmark at any time (new window without buffer)
authorBo Peng <bpeng@lyx.org>
Wed, 1 Nov 2006 23:20:53 +0000 (23:20 +0000)
committerBo Peng <bpeng@lyx.org>
Wed, 1 Nov 2006 23:20:53 +0000 (23:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15687 a592a061-630c-0410-9148-cb99ea01b6c8

src/lyxfunc.C

index 44c8419bd317ee0958a20850e135d7065ca02568..b290a637a07b3e00191b42b57d0d67d7f769bb38 100644 (file)
@@ -352,8 +352,16 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                flag.message(from_utf8(N_("Exiting")));
                flag.enabled(true);
                return flag;
+       }  else if (cmd.action == LFUN_BOOKMARK_GOTO) {
+               // bookmarks can be valid even if there is no opened buffer
+               flag.enabled(LyX::ref().session().bookmarks().isValid(convert<unsigned int>(to_utf8(cmd.argument()))));
+               return flag;
+       } else if (cmd.action == LFUN_BOOKMARK_CLEAR) {
+               flag.enabled(LyX::ref().session().bookmarks().size() > 0);
+               return flag;
        }
 
+
        LCursor & cur = view()->cursor();
 
        /* In LyX/Mac, when a dialog is open, the menus of the
@@ -630,19 +638,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                // these are handled in our dispatch()
                break;
 
-       // FIXME: will move to the front of this function when SWITCH_TO_BUFFER
-       // is valid for a newly created window 
-       case LFUN_BOOKMARK_GOTO:
-               // bookmarks can be valid even if there is no opened buffer
-               flag.enabled(LyX::ref().session().bookmarks().isValid(convert<unsigned int>(to_utf8(cmd.argument()))));
-               break;
-
-       // FIXME: will move to the front of this function when SWITCH_TO_BUFFER
-       // is valid for a newly created window 
-       case LFUN_BOOKMARK_CLEAR:
-               flag.enabled(LyX::ref().session().bookmarks().size() > 0);
-               break;
-
        default:
                if (!getLocalStatus(cur, cmd, flag))
                        flag = view()->getStatus(cmd);
@@ -1683,8 +1678,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        // open may fail, so we need to test it again
                        if (theBufferList().exists(bm.filename)) {
                                // if the current buffer is not that one, switch to it.
-                               // FIXME: swtich buffer to a newly created window will crash lyx
-                               // because of invalid view.
                                if (lyx_view_->buffer()->fileName() != bm.filename)
                                        dispatch(FuncRequest(LFUN_BUFFER_SWITCH, bm.filename));
                                // BOOST_ASSERT(lyx_view_->buffer()->fileName() != bm.filename);