]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
Implement os::current_root for native Win32 builds.
[lyx.git] / src / lyxfunc.C
index 56a79f8ab69411f947b543d983fbac3ece7bace4..defb342f1bc95ca1edc1f8d55bf09371840176a9 100644 (file)
@@ -134,7 +134,6 @@ namespace biblio = lyx::biblio;
 
 extern BufferList bufferlist;
 extern LyXServer * lyxserver;
-extern bool selection_possible;
 
 extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
 
@@ -308,10 +307,11 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                return flag;
        }
 
-       // the default error message if we disable the command
-       flag.message(N_("Command disabled"));
-       if (!flag.enabled())
+       if (!flag.enabled()) {
+               if (flag.message().empty())
+                       flag.message(N_("Command disabled"));
                return flag;
+       }
 
        // Check whether we need a buffer
        if (!lyxaction.funcHasFlag(cmd.action, LyXAction::NoBuffer) && !buf) {
@@ -523,7 +523,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        default:
 
                if (!cur.getStatus(cmd, flag))
-                       flag = view()->getStatus(cmd);
+                       flag |= view()->getStatus(cmd);
        }
 
        if (!enable)
@@ -537,7 +537,10 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                flag.enabled(false);
        }
 
-       //lyxerr << "LyXFunc::getStatus: got: " << flag.enabled() << endl;
+       // the default error message if we disable the command
+       if (!flag.enabled() && flag.message().empty())
+               flag.message(N_("Command disabled"));
+
        return flag;
 }
 
@@ -611,7 +614,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
        // we have not done anything wrong yet.
        errorstat = false;
        dispatch_buffer.erase();
-       selection_possible = false;
 
        bool update = true;