]> git.lyx.org Git - features.git/commitdiff
Fix some clang warnings.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Sun, 23 Feb 2020 20:51:52 +0000 (15:51 -0500)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Sun, 23 Feb 2020 20:52:15 +0000 (15:52 -0500)
The first one, a comma instead of a semi-colon, is a weird one.

src/frontends/qt/GuiPrefs.cpp

index 6ba54e3d21428263b455891d8370e0ced399b58b..91aa3f67f9f91f569a057ce242bd1a1185261e1f 100644 (file)
@@ -224,7 +224,7 @@ static void parseFontName(QString const & mangled0,
                name = mangled;
                foundry.clear();
        } else {
-               name = mangled.substr(0, idx - 1),
+               name = mangled.substr(0, idx - 1);
                foundry = mangled.substr(idx + 1, mangled.size() - idx - 2);
        }
 }
@@ -2833,8 +2833,8 @@ GuiShortcutDialog::GuiShortcutDialog(QWidget * parent) : QDialog(parent)
 
 PrefShortcuts::PrefShortcuts(GuiPreferences * form)
        : PrefModule(catEditing, N_("Shortcuts"), form),
-         editItem_(0), mathItem_(0), bufferItem_(0), layoutItem_(0),
-         systemItem_(0)
+         editItem_(nullptr), mathItem_(nullptr), bufferItem_(nullptr), layoutItem_(nullptr),
+         systemItem_(nullptr)
 {
        setupUi(this);
 
@@ -2892,8 +2892,8 @@ void PrefShortcuts::applyRC(LyXRC & rc) const
        // The good thing is that the menus are updated automatically.
        theTopLevelKeymap().clear();
        theTopLevelKeymap().read("site");
-       theTopLevelKeymap().read(rc.bind_file, 0, KeyMap::Fallback);
-       theTopLevelKeymap().read("user", 0, KeyMap::MissingOK);
+       theTopLevelKeymap().read(rc.bind_file, nullptr, KeyMap::Fallback);
+       theTopLevelKeymap().read("user", nullptr, KeyMap::MissingOK);
 }
 
 
@@ -3009,7 +3009,7 @@ QTreeWidgetItem * PrefShortcuts::insertShortcutItem(FuncRequest const & lfun,
                        + ' ' + lfun.argument());
        QString const shortcut = toqstr(seq.print(KeySequence::ForGui));
 
-       QTreeWidgetItem * newItem = 0;
+       QTreeWidgetItem * newItem = nullptr;
        // for unbind items, try to find an existing item in the system bind list
        if (tag == KeyMap::UserUnbind) {
                QList<QTreeWidgetItem*> const items = shortcutsTW->findItems(lfun_name,
@@ -3024,13 +3024,13 @@ QTreeWidgetItem * PrefShortcuts::insertShortcutItem(FuncRequest const & lfun,
                // Such an item is not displayed to avoid confusion (what is
                // unmatched removed?).
                if (!newItem) {
-                       return 0;
+                       return nullptr;
                }
        }
        if (!newItem) {
                switch(lyxaction.getActionType(action)) {
                case LyXAction::Hidden:
-                       return 0;
+                       return nullptr;
                case LyXAction::Edit:
                        newItem = new QTreeWidgetItem(editItem_);
                        break;