Fix #10869 compiler warnings.

This commit is contained in:
Richard Heck 2017-12-16 09:55:25 -05:00
parent fb93733fee
commit e869ec4bc9

View File

@ -494,7 +494,7 @@ void PreambleModule::update(BufferParams const & params, BufferId id)
preamble_coords_[current_id_] = make_pair(0, 0); preamble_coords_[current_id_] = make_pair(0, 0);
else { else {
// Restore saved coords. // Restore saved coords.
QTextCursor cur = preambleTE->textCursor(); cur = preambleTE->textCursor();
cur.setPosition(it->second.first); cur.setPosition(it->second.first);
preambleTE->setTextCursor(cur); preambleTE->setTextCursor(cur);
preambleTE->verticalScrollBar()->setValue(it->second.second); preambleTE->verticalScrollBar()->setValue(it->second.second);
@ -1078,9 +1078,10 @@ GuiDocument::GuiDocument(GuiView & lv)
QStringList encodinglist; QStringList encodinglist;
Encodings::const_iterator it = encodings.begin(); Encodings::const_iterator it = encodings.begin();
Encodings::const_iterator const end = encodings.end(); Encodings::const_iterator const end = encodings.end();
for (; it != end; ++it) for (auto const & encvar : encodings) {
if (!it->unsafe()) if (!encvar.unsafe())
encodinglist.append(qt_(it->guiName())); encodinglist.append(qt_(encvar.guiName()));
}
encodinglist.sort(); encodinglist.sort();
langModule->encodingCO->addItems(encodinglist); langModule->encodingCO->addItems(encodinglist);
@ -1191,9 +1192,8 @@ GuiDocument::GuiDocument(GuiView & lv)
// NOTE: we do not provide "custom" here for security reasons! // NOTE: we do not provide "custom" here for security reasons!
biblioModule->bibtexCO->clear(); biblioModule->bibtexCO->clear();
biblioModule->bibtexCO->addItem(qt_("Default"), QString("default")); biblioModule->bibtexCO->addItem(qt_("Default"), QString("default"));
for (set<string>::const_iterator it = lyxrc.bibtex_alternatives.begin(); for (auto const & alts : lyxrc.bibtex_alternatives) {
it != lyxrc.bibtex_alternatives.end(); ++it) { QString const command = toqstr(alts).left(toqstr(alts).indexOf(" "));
QString const command = toqstr(*it).left(toqstr(*it).indexOf(" "));
biblioModule->bibtexCO->addItem(command, command); biblioModule->bibtexCO->addItem(command, command);
} }
@ -1213,11 +1213,10 @@ GuiDocument::GuiDocument(GuiView & lv)
setSectionResizeMode(mathsModule->packagesTW->horizontalHeader(), QHeaderView::ResizeToContents); setSectionResizeMode(mathsModule->packagesTW->horizontalHeader(), QHeaderView::ResizeToContents);
map<string, string> const & packages = BufferParams::auto_packages(); map<string, string> const & packages = BufferParams::auto_packages();
mathsModule->packagesTW->setRowCount(packages.size()); mathsModule->packagesTW->setRowCount(packages.size());
int i = 0; int packnum = 0;
for (map<string, string>::const_iterator it = packages.begin(); for (auto const & pkgvar : packages) {
it != packages.end(); ++it) { docstring const package = from_ascii(pkgvar.first);
docstring const package = from_ascii(it->first); QString autoTooltip = qt_(pkgvar.second);
QString autoTooltip = qt_(it->second);
QString alwaysTooltip; QString alwaysTooltip;
if (package == "amsmath") if (package == "amsmath")
alwaysTooltip = alwaysTooltip =
@ -1245,10 +1244,10 @@ GuiDocument::GuiDocument(GuiView & lv)
alwaysRB->setToolTip(alwaysTooltip); alwaysRB->setToolTip(alwaysTooltip);
neverRB->setToolTip(neverTooltip); neverRB->setToolTip(neverTooltip);
QTableWidgetItem * pack = new QTableWidgetItem(toqstr(package)); QTableWidgetItem * pack = new QTableWidgetItem(toqstr(package));
mathsModule->packagesTW->setItem(i, 0, pack); mathsModule->packagesTW->setItem(packnum, 0, pack);
mathsModule->packagesTW->setCellWidget(i, 1, autoRB); mathsModule->packagesTW->setCellWidget(packnum, 1, autoRB);
mathsModule->packagesTW->setCellWidget(i, 2, alwaysRB); mathsModule->packagesTW->setCellWidget(packnum, 2, alwaysRB);
mathsModule->packagesTW->setCellWidget(i, 3, neverRB); mathsModule->packagesTW->setCellWidget(packnum, 3, neverRB);
//center the radio buttons //center the radio buttons
autoRB->setStyleSheet("margin-left:50%; margin-right:50%;"); autoRB->setStyleSheet("margin-left:50%; margin-right:50%;");
alwaysRB->setStyleSheet("margin-left:50%; margin-right:50%;"); alwaysRB->setStyleSheet("margin-left:50%; margin-right:50%;");
@ -1260,7 +1259,7 @@ GuiDocument::GuiDocument(GuiView & lv)
this, SLOT(change_adaptor())); this, SLOT(change_adaptor()));
connect(neverRB, SIGNAL(clicked()), connect(neverRB, SIGNAL(clicked()),
this, SLOT(change_adaptor())); this, SLOT(change_adaptor()));
++i; ++packnum;
} }
connect(mathsModule->allPackagesAutoPB, SIGNAL(clicked()), connect(mathsModule->allPackagesAutoPB, SIGNAL(clicked()),
this, SLOT(allPackagesAuto())); this, SLOT(allPackagesAuto()));
@ -1345,10 +1344,8 @@ GuiDocument::GuiDocument(GuiView & lv)
vector<LayoutFileIndex> classList = bcl.classList(); vector<LayoutFileIndex> classList = bcl.classList();
sort(classList.begin(), classList.end(), less_textclass_avail_desc()); sort(classList.begin(), classList.end(), less_textclass_avail_desc());
vector<LayoutFileIndex>::const_iterator cit = classList.begin(); for (auto const & cvar : classList) {
vector<LayoutFileIndex>::const_iterator cen = classList.end(); LayoutFile const & tc = bcl[cvar];
for (int i = 0; cit != cen; ++cit, ++i) {
LayoutFile const & tc = bcl[*cit];
bool const available = tc.isTeXClassAvailable(); bool const available = tc.isTeXClassAvailable();
docstring const guiname = translateIfPossible(from_utf8(tc.description())); docstring const guiname = translateIfPossible(from_utf8(tc.description()));
// tooltip sensu "KOMA-Script Article [Class 'scrartcl']" // tooltip sensu "KOMA-Script Article [Class 'scrartcl']"