]> git.lyx.org Git - lyx.git/commitdiff
Disable InsetInfo for VC when VC is not active.
authorRichard Heck <rgheck@comcast.net>
Sat, 17 Apr 2010 13:34:13 +0000 (13:34 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 17 Apr 2010 13:34:13 +0000 (13:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34190 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetInfo.cpp

index f15f2a306b1145c9de332fd8fe6207f1c1a1c0ee..6693c4802112234a422b806d68d4b67367d6c21d 100644 (file)
@@ -155,9 +155,11 @@ bool InsetInfo::validateModifyArgument(docstring const & arg) const
 {
        string type;
        string const name = trim(split(to_utf8(arg), type, ' '));
+
        switch (nameTranslator().find(type)) {
        case UNKNOWN_INFO:
                return false;
+
        case SHORTCUT_INFO:
        case SHORTCUTS_INFO:
        case MENU_INFO:
@@ -165,21 +167,29 @@ bool InsetInfo::validateModifyArgument(docstring const & arg) const
                FuncRequest func = lyxaction.lookupFunc(name);
                return func.action() != LFUN_UNKNOWN_ACTION;
        }
+
        case LYXRC_INFO: {
                ostringstream oss;
                lyxrc.write(oss, true, name);
                return !oss.str().empty();
        }
+
        case PACKAGE_INFO:
        case TEXTCLASS_INFO:
                return true;
+
        case BUFFER_INFO:
-               return name == "name" || name == "path" || name == "class" ||
-                      name == "vcs-revision" || name == "vcs-tree-revision" ||
-                      name == "vcs-author" || name == "vcs-date" || name == "vcs-time";
+               if (name == "name" || name == "path" || name == "class")
+                       return true;
+               if (name == "vcs-revision" || name == "vcs-tree-revision" ||
+                      name == "vcs-author" || name == "vcs-date" || name == "vcs-time")
+                       return buffer().lyxvc().inUse();
+               return false;
+
        case LYX_INFO:
                return name == "version";
        }
+
        return false;
 }