]> git.lyx.org Git - features.git/commitdiff
Silence some clang warnings.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 17 Feb 2020 17:31:24 +0000 (12:31 -0500)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 17 Feb 2020 17:31:38 +0000 (12:31 -0500)
src/frontends/qt/TocModel.cpp

index e43b3df445e792650a531bd1b72342b7480817c5..1974422a8f2f408395196a6349fd8fb063a395df 100644 (file)
@@ -126,8 +126,8 @@ QModelIndex TocModel::modelIndex(DocIterator const & dit) const
        if (toc_->empty())
                return QModelIndex();
 
        if (toc_->empty())
                return QModelIndex();
 
-       unsigned int const toc_index = TocBackend::findItem(*toc_, dit) -
-                                      toc_->begin();
+       unsigned int const toc_index =
+               static_cast<unsigned int>(TocBackend::findItem(*toc_, dit) - toc_->begin());
 
        QModelIndexList list = model()->match(model()->index(0, 0), Qt::UserRole,
                QVariant(toc_index), 1,
 
        QModelIndexList list = model()->match(model()->index(0, 0), Qt::UserRole,
                QVariant(toc_index), 1,
@@ -283,7 +283,7 @@ QAbstractItemModel * TocModels::model(QString const & type)
        if (it != models_.end())
                return it.value()->model();
        LYXERR0("type not found: " << type);
        if (it != models_.end())
                return it.value()->model();
        LYXERR0("type not found: " << type);
-       return 0;
+       return nullptr;
 }
 
 
 }