]> git.lyx.org Git - lyx.git/commitdiff
Consider default output format
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 8 Aug 2018 13:50:04 +0000 (15:50 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 8 Aug 2018 13:50:04 +0000 (15:50 +0200)
src/insets/InsetInfo.cpp

index e959836dd3166409571dfb0bf15a2d23fef9c519..b532fe998f95e24dc2912929e3b51ea6d23962d8 100644 (file)
@@ -828,12 +828,17 @@ void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype) {
                if (initialized_)
                        break;
                docstring_list names;
-               FuncRequest const func = lyxaction.lookupFunc(params_.name);
+               FuncRequest func = lyxaction.lookupFunc(params_.name);
                if (func.action() == LFUN_UNKNOWN_ACTION) {
                        gui = _("Unknown action %1$s");
                        error(from_ascii("Unknown action %1$s"), params_.lang);
                        break;
                }
+               if (func.action() == LFUN_BUFFER_VIEW || func.action() == LFUN_BUFFER_UPDATE)
+                       // The default output format is in the menu without argument,
+                       // so strip it here.
+                       if (func.argument() == from_ascii(buffer().params().getDefaultOutputFormat()))
+                               func = FuncRequest(func.action());
                // iterate through the menubackend to find it
                if (!theApp()) {
                        gui = _("Can't determine menu entry for action %1$s in batch mode");