On 04/17/2010 09:34 AM, rgh...@lyx.org wrote:
Author: rgheck
Date: Sat Apr 17 15:34:13 2010
New Revision: 34190
URL: http://www.lyx.org/trac/changeset/34190

Log:
Disable InsetInfo for VC when VC is not active.

It would probably be better to let the various backends tell us what they handle, but this is better than nothing.

rh

Modified:
    lyx-devel/trunk/src/insets/InsetInfo.cpp

Modified: lyx-devel/trunk/src/insets/InsetInfo.cpp
==============================================================================
--- lyx-devel/trunk/src/insets/InsetInfo.cpp    Sat Apr 17 15:29:00 2010        
(r34189)
+++ lyx-devel/trunk/src/insets/InsetInfo.cpp    Sat Apr 17 15:34:13 2010        
(r34190)
@@ -155,9 +155,11 @@
  {
        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 @@
                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;
  }


Reply via email to