[LyX/master] Avoid value shadowing
Juergen Spitzmueller <[email protected]> Sun, 19 Jul 2026 14:54:22 +0000
| Newsgroups | gmane.editors.lyx.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 27681f616c86711064d9e5c6c850a936fb639fdf Author: Juergen Spitzmueller <[email protected]> Date: Sun Jul 19 16:54:05 2026 +0200 Avoid value shadowing --- src/frontends/qt/GuiDocument.cpp | 74 ++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp index 1df7446615..908b3f855f 100644 --- a/src/frontends/qt/GuiDocument.cpp +++ b/src/frontends/qt/GuiDocument.cpp @@ -5242,120 +5242,120 @@ void GuiDocument::paramsToDialog() fontSpecialModule->scriptFontsTW->clear(); QList<QTreeWidgetItem *> specialLangFontItems; QList<QTreeWidgetItem *> specialScriptFontItems; - for (auto const & it : bp_.special_fonts_roman) { - QString const scname = toqstr(it.first); + for (auto const & itt : bp_.special_fonts_roman) { + QString const scname = toqstr(itt.first); if (scname.isLower()) { QTreeWidgetItem * item = new QTreeWidgetItem(fontSpecialModule->langFontsTW); - Language const * l = languages.getLanguage(it.first); + Language const * l = languages.getLanguage(itt.first); if (l == nullptr) continue; item->setText(0, qt_(l->display())); item->setData(0, Qt::UserRole, scname); item->setText(1, qt_("Roman")); item->setData(1, Qt::UserRole, "rm"); - item->setText(2, toqstr(it.second)); + item->setText(2, toqstr(itt.second)); // no scale here - if (auto res = bp_.special_fonts_roman_osf.find(it.first); res != bp_.special_fonts_roman_osf.end() + if (auto res = bp_.special_fonts_roman_osf.find(itt.first); res != bp_.special_fonts_roman_osf.end() && res->second) item->setCheckState(4, Qt::Checked); - if (auto res = bp_.special_fonts_roman_opts.find(it.first); res != bp_.special_fonts_roman_opts.end() + if (auto res = bp_.special_fonts_roman_opts.find(itt.first); res != bp_.special_fonts_roman_opts.end() && !res->second.empty()) item->setText(5, toqstr(res->second)); specialLangFontItems.append(item); } else { QTreeWidgetItem * item = new QTreeWidgetItem(fontSpecialModule->scriptFontsTW); - item->setText(0, qt_(it.first)); - item->setData(0, Qt::UserRole, toqstr(it.first)); + item->setText(0, qt_(itt.first)); + item->setData(0, Qt::UserRole, toqstr(itt.first)); item->setText(1, qt_("Roman")); item->setData(1, Qt::UserRole, "rm"); - item->setText(2, toqstr(it.second)); + item->setText(2, toqstr(itt.second)); // no scale here - if (auto res = bp_.special_fonts_roman_osf.find(it.first); res != bp_.special_fonts_roman_osf.end() + if (auto res = bp_.special_fonts_roman_osf.find(itt.first); res != bp_.special_fonts_roman_osf.end() && res->second) item->setCheckState(4, Qt::Checked); - if (auto res = bp_.special_fonts_roman_opts.find(it.first); res != bp_.special_fonts_roman_opts.end() + if (auto res = bp_.special_fonts_roman_opts.find(itt.first); res != bp_.special_fonts_roman_opts.end() && !res->second.empty()) item->setText(5, toqstr(res->second)); specialScriptFontItems.append(item); } } - for (auto const & it : bp_.special_fonts_sans) { - QString const scname = toqstr(it.first); + for (auto const & itt : bp_.special_fonts_sans) { + QString const scname = toqstr(itt.first); if (scname.isLower()) { QTreeWidgetItem * item = new QTreeWidgetItem(fontSpecialModule->langFontsTW); - Language const * l = languages.getLanguage(it.first); + Language const * l = languages.getLanguage(itt.first); if (l == nullptr) continue; item->setText(0, qt_(l->display())); item->setData(0, Qt::UserRole, scname); item->setText(1, qt_("Sans Serif")); item->setData(1, Qt::UserRole, "sf"); - item->setText(2, toqstr(it.second)); - if (auto res = bp_.special_fonts_sans_scale.find(it.first); res != bp_.special_fonts_sans_scale.end() + item->setText(2, toqstr(itt.second)); + if (auto res = bp_.special_fonts_sans_scale.find(itt.first); res != bp_.special_fonts_sans_scale.end() && res->second != 100) item->setText(3, toqstr(res->second)); - if (auto res = bp_.special_fonts_sans_osf.find(it.first); res != bp_.special_fonts_sans_osf.end() + if (auto res = bp_.special_fonts_sans_osf.find(itt.first); res != bp_.special_fonts_sans_osf.end() && res->second) item->setCheckState(4, Qt::Checked); - if (auto res = bp_.special_fonts_sans_opts.find(it.first); res != bp_.special_fonts_sans_opts.end() + if (auto res = bp_.special_fonts_sans_opts.find(itt.first); res != bp_.special_fonts_sans_opts.end() && !res->second.empty()) item->setText(5, toqstr(res->second)); specialLangFontItems.append(item); } else { QTreeWidgetItem * item = new QTreeWidgetItem(fontSpecialModule->scriptFontsTW); - item->setText(0, qt_(it.first)); - item->setData(0, Qt::UserRole, toqstr(it.first)); + item->setText(0, qt_(itt.first)); + item->setData(0, Qt::UserRole, toqstr(itt.first)); item->setText(1, qt_("Sans Serif")); item->setData(1, Qt::UserRole, "sf"); - item->setText(2, toqstr(it.second)); - if (auto res = bp_.special_fonts_sans_scale.find(it.first); res != bp_.special_fonts_sans_scale.end() + item->setText(2, toqstr(itt.second)); + if (auto res = bp_.special_fonts_sans_scale.find(itt.first); res != bp_.special_fonts_sans_scale.end() && res->second != 100) item->setText(3, toqstr(res->second)); - if (auto res = bp_.special_fonts_sans_osf.find(it.first); res != bp_.special_fonts_sans_osf.end() + if (auto res = bp_.special_fonts_sans_osf.find(itt.first); res != bp_.special_fonts_sans_osf.end() && res->second) item->setCheckState(4, Qt::Checked); - if (auto res = bp_.special_fonts_sans_opts.find(it.first); res != bp_.special_fonts_sans_opts.end() + if (auto res = bp_.special_fonts_sans_opts.find(itt.first); res != bp_.special_fonts_sans_opts.end() && !res->second.empty()) item->setText(5, toqstr(res->second)); specialScriptFontItems.append(item); } } - for (auto const & it : bp_.special_fonts_typewriter) { - QString const scname = toqstr(it.first); + for (auto const & itt : bp_.special_fonts_typewriter) { + QString const scname = toqstr(itt.first); if (scname.isLower()) { QTreeWidgetItem * item = new QTreeWidgetItem(fontSpecialModule->langFontsTW); - Language const * l = languages.getLanguage(it.first); + Language const * l = languages.getLanguage(itt.first); if (l == nullptr) continue; item->setText(0, qt_(l->display())); item->setData(0, Qt::UserRole, scname); item->setText(1, qt_("Typewriter")); item->setData(1, Qt::UserRole, "sf"); - item->setText(2, toqstr(it.second)); - if (auto res = bp_.special_fonts_typewriter_scale.find(it.first); res != bp_.special_fonts_typewriter_scale.end() + item->setText(2, toqstr(itt.second)); + if (auto res = bp_.special_fonts_typewriter_scale.find(itt.first); res != bp_.special_fonts_typewriter_scale.end() && res->second != 100) item->setText(3, toqstr(res->second)); - if (auto res = bp_.special_fonts_typewriter_osf.find(it.first); res != bp_.special_fonts_typewriter_osf.end() + if (auto res = bp_.special_fonts_typewriter_osf.find(itt.first); res != bp_.special_fonts_typewriter_osf.end() && res->second) item->setCheckState(4, Qt::Checked); - if (auto res = bp_.special_fonts_typewriter_opts.find(it.first); res != bp_.special_fonts_typewriter_opts.end() + if (auto res = bp_.special_fonts_typewriter_opts.find(itt.first); res != bp_.special_fonts_typewriter_opts.end() && !res->second.empty()) item->setText(5, toqstr(res->second)); specialLangFontItems.append(item); } else { QTreeWidgetItem * item = new QTreeWidgetItem(fontSpecialModule->scriptFontsTW); - item->setText(0, qt_(it.first)); - item->setData(0, Qt::UserRole, toqstr(it.first)); + item->setText(0, qt_(itt.first)); + item->setData(0, Qt::UserRole, toqstr(itt.first)); item->setText(1, qt_("Typewriter")); item->setData(1, Qt::UserRole, "tt"); - item->setText(2, toqstr(it.second)); - if (auto res = bp_.special_fonts_typewriter_scale.find(it.first); res != bp_.special_fonts_typewriter_scale.end() + item->setText(2, toqstr(itt.second)); + if (auto res = bp_.special_fonts_typewriter_scale.find(itt.first); res != bp_.special_fonts_typewriter_scale.end() && res->second != 100) item->setText(3, toqstr(res->second)); - if (auto res = bp_.special_fonts_typewriter_osf.find(it.first); res != bp_.special_fonts_typewriter_osf.end() + if (auto res = bp_.special_fonts_typewriter_osf.find(itt.first); res != bp_.special_fonts_typewriter_osf.end() && res->second) item->setCheckState(4, Qt::Checked); - if (auto res = bp_.special_fonts_typewriter_opts.find(it.first); res != bp_.special_fonts_typewriter_opts.end() + if (auto res = bp_.special_fonts_typewriter_opts.find(itt.first); res != bp_.special_fonts_typewriter_opts.end() && !res->second.empty()) item->setText(5, toqstr(res->second)); specialScriptFontItems.append(item); -- lyx-cvs mailing list [email protected] https://lists.lyx.org/mailman/listinfo/lyx-cvs