]> git.lyx.org Git - features.git/commitdiff
Remove useless test
authorJean-Marc <lasgouttes@lyx.org>
Sat, 12 Sep 2015 17:53:29 +0000 (19:53 +0200)
committerJean-Marc <lasgouttes@lyx.org>
Sat, 12 Sep 2015 17:53:29 +0000 (19:53 +0200)
Coverity issue 23300.

src/frontends/qt4/Menus.cpp

index a53b6bb8be8c30749cd31efac6c235d7601aafe9..d0b5d91bcb06752553c3628f9050eaf18dcb675c 100644 (file)
@@ -1122,12 +1122,10 @@ void MenuDefinition::expandFormats(MenuItem::Kind const kind, Buffer const * buf
                        label += '|' + shortcut;
 
                if (view_update) {
-                       if (buf)
-                               item.submenu().addWithStatusCheck(MenuItem(MenuItem::Command,
-                                       toqstr(label), FuncRequest(action, (*fit)->name())));
-                       else
-                               item.submenu().add(MenuItem(MenuItem::Command, toqstr(label),
-                                       FuncRequest(action, (*fit)->name())));
+                       // note that at this point, we know that buf is not null
+                       LATTEST(buf);
+                       item.submenu().addWithStatusCheck(MenuItem(MenuItem::Command,
+                               toqstr(label), FuncRequest(action, (*fit)->name())));
                } else {
                        if (buf)
                                addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(label),