I went through the warnings raised by CXXFLAGS=-Wshadow and fixed most
of them. Most are really straightforward but I'd like to have some
double-checking before I commit.
Also, there are three I didn't dare to touch. (1.) is probably for
JMarc, (2.) and (3.) for Thibaut:
(1.)
Buffer.cpp: In member function 'void
lyx::Buffer::Impl::traverseErrors(std::vector<lyx::TeXErrors::Error>::c
onst_iterator, std::vector<lyx::TeXErrors::Error>::const_iterator,
lyx::ErrorList&) const':
Buffer.cpp:5050:62: warning: declaration of 'lyx::TexRow::TextEntry
end' shadows a parameter [-Wshadow]
5050 | TexRow::TextEntry start = TexRow::text_none,
end = TexRow::text_none;
|
^~~
Buffer.cpp:5047:108: note: shadowed declaration is here
5047 | void
Buffer::Impl::traverseErrors(TeXErrors::Errors::const_iterator err,
TeXErrors::Errors::const_iterator end, ErrorList & errorList) const
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
(2.)
output_docbook.cpp: In lambda function:
output_docbook.cpp:409:22: warning: declaration of
'isLyxCodeSpecialCase' shadows a previous local [-Wshadow]
409 | auto isLyxCodeSpecialCase =
[](InsetList::Element inset) {
| ^~~~~~~~~~~~~~~~~~~~
output_docbook.cpp:393:14: note: shadowed declaration is here
393 | auto isLyxCodeSpecialCase = [](InsetList::Element
inset) {
| ^~~~~~~~~~~~~~~~~~~~
output_docbook.cpp: In lambda function:
output_docbook.cpp:409:67: warning: declaration of
'lyx::InsetList::Element inset' shadows a parameter [-Wshadow]
409 | auto isLyxCodeSpecialCase =
[](InsetList::Element inset) {
|
~~~~~~~~~~~~~~~~~~~^~~~~
output_docbook.cpp:399:56: note: shadowed declaration is here
399 | auto isFlexSpecialCase = [](InsetList::Element inset) {
| ~~~~~~~~~~~~~~~~~~~^~~~~
(3.)
insets/InsetIndex.cpp: In lambda function:
insets/InsetIndex.cpp:1778:81: warning: declaration of 'entry_number'
shadows a previous local [-Wshadow]
1778 | auto writeLinkToEntry = [&xs](const IndexEntry
&entry, unsigned entry_number) {
|
~~~~~~~~~^~~~~~~~~~~~
insets/InsetIndex.cpp:1776:26: note: shadowed declaration is here
1776 | unsigned entry_number = 1;
| ^~~~~~~~~~~~
Thanks,
--
Jürgen
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 1a3fbfef13..325652c600 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -1269,9 +1269,9 @@ string BufferParams::readToken(Lexer & lex, string const & token,
if (token == "\\spellchecker_ignore") {
lex.eatLine();
docstring wl = lex.getDocString();
- docstring language;
- docstring word = split(wl, language, ' ');
- Language const * lang = languages.getLanguage(to_ascii(language));
+ docstring l;
+ docstring word = split(wl, l, ' ');
+ Language const * lang = languages.getLanguage(to_ascii(l));
if (lang)
spellignore().push_back(WordLangTuple(word, lang));
break;
@@ -4116,15 +4116,15 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
} else {
// We might have an additional language that requires inputenc
set<string> encoding_set = features.getEncodingSet(doc_encoding);
- bool inputenc = false;
+ bool use_inputenc = false;
for (auto const & enc : encoding_set) {
if (encodings.fromLaTeXName(enc)
&& encodings.fromLaTeXName(enc)->package() == Encoding::inputenc) {
- inputenc = true;
+ use_inputenc = true;
break;
}
}
- if (inputenc)
+ if (use_inputenc)
// load (lua)inputenc without options
// (the encoding is loaded later)
os << "\\usepackage{" << inputenc_package << "}\n";
diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index 6731a63078..0dda44b131 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -3709,18 +3709,18 @@ void BufferView::buildCaretGeometry(bool complet, Point shift)
// The completion triangle |> (if needed)
if (complet) {
int const m = p.y + dim.height() / 2;
- int const d = dim.height() / 8;
+ int const dd = dim.height() / 8;
// offset for slanted carret
- int const sx = iround((dim.asc - (dim.height() / 2 - d)) * slope);
+ int const sx = iround((dim.asc - (dim.height() / 2 - dd)) * slope);
// starting position x
int const xx = p.x + dir * dim.wid + sx;
cg.shapes.push_back(
- {{xx, m - d},
- {xx + dir * d, m},
- {xx, m + d},
- {xx, m + d - dim.wid},
- {xx + dir * d - dim.wid, m},
- {xx, m - d + dim.wid}}
+ {{xx, m - dd},
+ {xx + dir * dd, m},
+ {xx, m + dd},
+ {xx, m + dd - dim.wid},
+ {xx + dir * dd - dim.wid, m},
+ {xx, m - dd + dim.wid}}
);
}
@@ -3730,11 +3730,11 @@ void BufferView::buildCaretGeometry(bool complet, Point shift)
cg.top = 1000000;
cg.bottom = -1000000;
for (auto const & shape : cg.shapes)
- for (Point const & p : shape) {
- cg.left = min(cg.left, p.x);
- cg.right = max(cg.right, p.x);
- cg.top = min(cg.top, p.y);
- cg.bottom = max(cg.bottom, p.y);
+ for (Point const & pt : shape) {
+ cg.left = min(cg.left, pt.x);
+ cg.right = max(cg.right, pt.x);
+ cg.top = min(cg.top, pt.y);
+ cg.bottom = max(cg.bottom, pt.y);
}
}
@@ -3980,17 +3980,17 @@ void BufferView::draw(frontend::Painter & pain, bool paint_caret)
Cursor cur(d->cursor_);
while (cur.depth() > 1) {
if (cur.inTexted()) {
- TextMetrics const & tm = textMetrics(cur.text());
- if (d->caret_geometry_.left >= tm.origin().x
- && d->caret_geometry_.right <= tm.origin().x + tm.dim().width())
+ TextMetrics const & tms = textMetrics(cur.text());
+ if (d->caret_geometry_.left >= tms.origin().x
+ && d->caret_geometry_.right <= tms.origin().x + tms.dim().width())
break;
}
cur.pop();
}
- TextMetrics const & tm = textMetrics(cur.text());
- if (tm.contains(cur.pit())) {
- ParagraphMetrics const & pm = tm.parMetrics(cur.pit());
- pm.getRow(cur.pos(), cur.boundary()).changed(true);
+ TextMetrics const & tms = textMetrics(cur.text());
+ if (tms.contains(cur.pit())) {
+ ParagraphMetrics const & pms = tms.parMetrics(cur.pit());
+ pms.getRow(cur.pos(), cur.boundary()).changed(true);
}
}
}
diff --git a/src/Format.cpp b/src/Format.cpp
index f851b9a57a..e55242f650 100644
--- a/src/Format.cpp
+++ b/src/Format.cpp
@@ -482,8 +482,8 @@ string Formats::getFormatFromExtension(string const & ext) const
struct ZippedInfo {
bool zipped;
std::time_t timestamp;
- ZippedInfo(bool zipped, std::time_t timestamp)
- : zipped(zipped), timestamp(timestamp) { }
+ ZippedInfo(bool z, std::time_t ts)
+ : zipped(z), timestamp(ts) { }
};
diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index 03359fb31c..7057c560b0 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -362,10 +362,10 @@ int LaTeX::run(TeXErrors & terr)
LYXERR(Debug::OUTFILE, "Running Bibliography Processor.");
message(_("Running Bibliography Processor."));
updateBibtexDependencies(head, bibtex_info);
- int exit_code;
- rerun |= runBibTeX(bibtex_info, runparams, exit_code);
- if (exit_code == Systemcall::KILLED || exit_code == Systemcall::TIMEOUT)
- return exit_code;
+ int ex_code;
+ rerun |= runBibTeX(bibtex_info, runparams, ex_code);
+ if (ex_code == Systemcall::KILLED || ex_code == Systemcall::TIMEOUT)
+ return ex_code;
FileName const blgfile(changeExtension(file.absFileName(), ".blg"));
if (blgfile.exists())
bscanres = scanBlgFile(head, terr);
@@ -394,9 +394,9 @@ int LaTeX::run(TeXErrors & terr)
LYXERR(Debug::DEPEND, "Dep. file has changed or rerun requested");
LYXERR(Debug::OUTFILE, "Run #" << count);
message(runMessage(count));
- int exit_code = startscript();
- if (exit_code == Systemcall::KILLED || exit_code == Systemcall::TIMEOUT)
- return exit_code;
+ int ex_code = startscript();
+ if (ex_code == Systemcall::KILLED || ex_code == Systemcall::TIMEOUT)
+ return ex_code;
scanres = scanLogFile(terr);
// update the depedencies
@@ -423,10 +423,10 @@ int LaTeX::run(TeXErrors & terr)
LYXERR(Debug::OUTFILE, "Re-Running Bibliography Processor.");
message(_("Re-Running Bibliography Processor."));
updateBibtexDependencies(head, bibtex_info);
- int exit_code;
- rerun |= runBibTeX(bibtex_info, runparams, exit_code);
- if (exit_code == Systemcall::KILLED || exit_code == Systemcall::TIMEOUT)
- return exit_code;
+ int ex_code;
+ rerun |= runBibTeX(bibtex_info, runparams, ex_code);
+ if (ex_code == Systemcall::KILLED || ex_code == Systemcall::TIMEOUT)
+ return ex_code;
FileName const blgfile(changeExtension(file.absFileName(), ".blg"));
if (blgfile.exists())
bscanres = scanBlgFile(head, terr);
@@ -781,16 +781,16 @@ void LaTeX::updateBibtexDependencies(DepTable & dep,
it != bibtex_info.end(); ++it) {
for (set<string>::const_iterator it2 = it->databases.begin();
it2 != it->databases.end(); ++it2) {
- FileName const file = findtexfile(*it2, "bib");
- if (!file.empty())
- dep.insert(file, true);
+ FileName const fname = findtexfile(*it2, "bib");
+ if (!fname.empty())
+ dep.insert(fname, true);
}
for (set<string>::const_iterator it2 = it->styles.begin();
it2 != it->styles.end(); ++it2) {
- FileName const file = findtexfile(*it2, "bst");
- if (!file.empty())
- dep.insert(file, true);
+ FileName const fname = findtexfile(*it2, "bst");
+ if (!fname.empty())
+ dep.insert(fname, true);
}
}
diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h
index af0e42b7b3..ca64ef31cb 100644
--- a/src/LaTeXFeatures.h
+++ b/src/LaTeXFeatures.h
@@ -168,7 +168,7 @@ public:
///
std::set<std::string> getEncodingSet(std::string const & doc_encoding) const;
///
- void getFontEncodings(std::vector<std::string> & encodings,
+ void getFontEncodings(std::vector<std::string> & encs,
bool const onlylangs = false) const;
///
void useLayout(docstring const & layoutname);
diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp
index 650cacfbc1..3adc55a119 100644
--- a/src/LyXRC.cpp
+++ b/src/LyXRC.cpp
@@ -2804,12 +2804,12 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
system_lyxrc.viewer_alternatives.find(fmt);
for (; sit != sen; ++sit) {
- string const & cmd = *sit;
+ string const & command = *sit;
if (ignore_system_lyxrc
|| sysfmt == sysend // format not found
- || sysfmt->second.count(cmd) == 0 // this command not found
+ || sysfmt->second.count(command) == 0 // this command not found
)
- os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
+ os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(command) << "\"\n";
}
}
if (tag != RC_LAST)
@@ -2830,12 +2830,12 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
system_lyxrc.editor_alternatives.find(fmt);
for (; sit != sen; ++sit) {
- string const & cmd = *sit;
+ string const & command = *sit;
if (ignore_system_lyxrc
|| sysfmt == sysend // format not found
- || sysfmt->second.count(cmd) == 0 // this command not found
+ || sysfmt->second.count(command) == 0 // this command not found
)
- os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
+ os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(command) << "\"\n";
}
}
if (tag != RC_LAST)
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 7449faad4f..77a52301fd 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1212,7 +1212,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
os << "\\end{" << close_env << "}";
if (close_brace > 0) {
- for (unsigned i = 0; i < close_brace; ++i)
+ for (unsigned j = 0; j < close_brace; ++j)
os << '}';
if (disp_env)
os << safebreakln;
@@ -3462,7 +3462,7 @@ public:
bool has_value;
OptionalFontType(): ft(xml::FT_EMPH), has_value(false) {} // A possible value at random for ft.
- OptionalFontType(xml::FontTypes ft): ft(ft), has_value(true) {}
+ OptionalFontType(xml::FontTypes ftt): ft(ftt), has_value(true) {}
};
OptionalFontType fontShapeToXml(FontShape fs)
diff --git a/src/Text.cpp b/src/Text.cpp
index 9c49b79310..ef4c369c86 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -895,7 +895,7 @@ void Text::insertStringAsLines(Cursor & cur, docstring const & str,
pos_type pos = cur.pos();
// The special chars we handle
- static map<wchar_t, string> specialchars = {
+ static map<wchar_t, string> special_chars = {
{ 0x200c, "ligaturebreak" },
{ 0x200b, "allowbreak" },
{ 0x2026, "ldots" },
@@ -937,9 +937,9 @@ void Text::insertStringAsLines(Cursor & cur, docstring const & str,
++pos;
space_inserted = true;
}
- } else if (specialchars.find(ch) != specialchars.end()
+ } else if (special_chars.find(ch) != special_chars.end()
&& (par.insertInset(pos, new InsetSpecialChar(cur.buffer(), cur.current_font.language(),
- specialchars.find(ch)->second),
+ special_chars.find(ch)->second),
font, bparams.track_changes
? Change(Change::INSERTED)
: Change(Change::UNCHANGED)))) {
@@ -6966,10 +6966,10 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
&& (cur.text()->getTocLevel(cur.pit()) == Layout::NOT_IN_TOC
|| cur.pos() == 0 || cur.pos() == cur.lastpos());
if (cmd.getArg(0) == "contextual") {
- string cmd;
+ string command;
string gui;
- getContextualBreak(paragraphs(), cur.pit(), cmd, gui);
- enable &= !cmd.empty();
+ getContextualBreak(paragraphs(), cur.pit(), command, gui);
+ enable &= !command.empty();
}
break;
diff --git a/src/frontends/qt/FloatPlacement.cpp b/src/frontends/qt/FloatPlacement.cpp
index aa0548170f..4d48a5b6d1 100644
--- a/src/frontends/qt/FloatPlacement.cpp
+++ b/src/frontends/qt/FloatPlacement.cpp
@@ -225,11 +225,11 @@ string const FloatPlacement::getPlacement() const
{
string placement;
- QString const data =
+ QString const idata =
placementCO->itemData(placementCO->currentIndex()).toString();
- if (data == "class")
+ if (idata == "class")
return "class";
- if (data == "document")
+ if (idata == "document")
return "document";
if (heredefinitelyCB->isChecked()) {
diff --git a/src/frontends/qt/GuiCounter.cpp b/src/frontends/qt/GuiCounter.cpp
index 04fab3a664..4ac9b791a1 100644
--- a/src/frontends/qt/GuiCounter.cpp
+++ b/src/frontends/qt/GuiCounter.cpp
@@ -112,10 +112,10 @@ void GuiCounter::paramsToDialog(Inset const * ip)
}
-bool GuiCounter::initialiseParams(std::string const & data)
+bool GuiCounter::initialiseParams(std::string const & cdata)
{
InsetCommandParams params(insetCode());
- if (!InsetCommand::string2params(data, params))
+ if (!InsetCommand::string2params(cdata, params))
return false;
fillCombos();
diff --git a/src/frontends/qt/GuiDelimiter.cpp b/src/frontends/qt/GuiDelimiter.cpp
index 7b361add9a..21e5cf84c7 100644
--- a/src/frontends/qt/GuiDelimiter.cpp
+++ b/src/frontends/qt/GuiDelimiter.cpp
@@ -78,8 +78,8 @@ static docstring fix_name(string const & str, bool big)
}
struct MathSymbol {
- MathSymbol(char_type uc = '?', string const & icon = string())
- : unicode(uc), icon(icon)
+ MathSymbol(char_type uc = '?', string const & icn = string())
+ : unicode(uc), icon(icn)
{}
char_type unicode;
string icon;
diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp
index 71b9f60790..4d228796d7 100644
--- a/src/frontends/qt/GuiDocument.cpp
+++ b/src/frontends/qt/GuiDocument.cpp
@@ -3604,11 +3604,11 @@ void GuiDocument::getTableStyles()
QString fn = QFileInfo(it.next()).fileName();
if (!fn.endsWith(".lyx") || fn.contains("_1x"))
continue;
- QString data = fn.left(fn.lastIndexOf(".lyx"));
- QString guiname = data;
+ QString tsdata = fn.left(fn.lastIndexOf(".lyx"));
+ QString guiname = tsdata;
guiname = toqstr(translateIfPossible(qstring_to_ucs4(guiname.replace('_', ' '))));
- if (textLayoutModule->tableStyleCO->findData(data) == -1)
- textLayoutModule->tableStyleCO->addItem(guiname, data);
+ if (textLayoutModule->tableStyleCO->findData(tsdata) == -1)
+ textLayoutModule->tableStyleCO->addItem(guiname, tsdata);
}
}
}
@@ -4443,13 +4443,13 @@ void GuiDocument::paramsToDialog()
}
map<string, string> const & packages = BufferParams::auto_packages();
- for (map<string, string>::const_iterator it = packages.begin();
- it != packages.end(); ++it) {
- QTableWidgetItem * item = mathsModule->packagesTW->findItems(toqstr(it->first), Qt::MatchExactly)[0];
+ for (map<string, string>::const_iterator itt = packages.begin();
+ itt != packages.end(); ++itt) {
+ QTableWidgetItem * item = mathsModule->packagesTW->findItems(toqstr(itt->first), Qt::MatchExactly)[0];
if (!item)
continue;
int row = mathsModule->packagesTW->row(item);
- switch (bp_.use_package(it->first)) {
+ switch (bp_.use_package(itt->first)) {
case BufferParams::package_off: {
QRadioButton * rb =
(QRadioButton*)mathsModule->packagesTW->cellWidget(row, 3)->layout()->itemAt(0)->widget();
diff --git a/src/frontends/qt/GuiInclude.cpp b/src/frontends/qt/GuiInclude.cpp
index 0f4a5a2bab..7185acde46 100644
--- a/src/frontends/qt/GuiInclude.cpp
+++ b/src/frontends/qt/GuiInclude.cpp
@@ -250,11 +250,11 @@ void GuiInclude::applyView()
// the parameter string should have passed validation
InsetListingsParams par(fromqstr(listingsED->toPlainText()));
string caption = fromqstr(captionLE->text());
- string label = fromqstr(labelLE->text());
+ string lab = fromqstr(labelLE->text());
if (!caption.empty())
par.addParam("caption", "{" + caption + "}");
- if (!label.empty())
- par.addParam("label", "{" + label + "}");
+ if (!lab.empty())
+ par.addParam("label", "{" + lab + "}");
string const listparams = par.params();
params_["lstparams"] = from_utf8(listparams);
} else {
diff --git a/src/frontends/qt/GuiInfo.cpp b/src/frontends/qt/GuiInfo.cpp
index f8a1d6e86e..44f7393378 100644
--- a/src/frontends/qt/GuiInfo.cpp
+++ b/src/frontends/qt/GuiInfo.cpp
@@ -260,11 +260,11 @@ void GuiInfo::paramsToDialog(Inset const * inset)
updateArguments(i);
int argindex = -1;
int customindex = 0;
- for (int i = 0 ; i < infoLW->count() ; ++i) {
- if (infoLW->item(i)->data(Qt::UserRole).toString() == name)
- argindex = i;
- else if (infoLW->item(i)->data(Qt::UserRole).toString() == "custom")
- customindex = i;
+ for (int j = 0 ; j < infoLW->count() ; ++j) {
+ if (infoLW->item(j)->data(Qt::UserRole).toString() == name)
+ argindex = j;
+ else if (infoLW->item(j)->data(Qt::UserRole).toString() == "custom")
+ customindex = j;
}
if (argindex != -1)
infoLW->setCurrentRow(argindex);
diff --git a/src/frontends/qt/GuiLyXFiles.cpp b/src/frontends/qt/GuiLyXFiles.cpp
index a93000c3c6..358e75a003 100644
--- a/src/frontends/qt/GuiLyXFiles.cpp
+++ b/src/frontends/qt/GuiLyXFiles.cpp
@@ -289,8 +289,8 @@ void GuiLyXFiles::on_filesLW_itemClicked(QTreeWidgetItem * item, int)
return;
}
- QString const data = item->data(0, Qt::UserRole).toString();
- if (!data.endsWith(getSuffix())) {
+ QString const idata = item->data(0, Qt::UserRole).toString();
+ if (!idata.endsWith(getSuffix())) {
// not a file (probably a header)
bc().setValid(false);
return;
@@ -299,8 +299,8 @@ void GuiLyXFiles::on_filesLW_itemClicked(QTreeWidgetItem * item, int)
languageCO->clear();
QMap<QString, QString>::const_iterator i =available_languages_.constBegin();
while (i != available_languages_.constEnd()) {
- if (localizations_.contains(data)
- && localizations_.find(data).value().contains(i.key()))
+ if (localizations_.contains(idata)
+ && localizations_.find(idata).value().contains(i.key()))
languageCO->addItem(i.value(), i.key());
++i;
}
@@ -604,9 +604,9 @@ bool GuiLyXFiles::initialiseParams(string const & type)
}
-void GuiLyXFiles::passParams(string const & data)
+void GuiLyXFiles::passParams(string const & params)
{
- initialiseParams(data);
+ initialiseParams(params);
updateContents();
}
diff --git a/src/frontends/qt/GuiSelectionManager.cpp b/src/frontends/qt/GuiSelectionManager.cpp
index 57056925f9..c3522ec039 100644
--- a/src/frontends/qt/GuiSelectionManager.cpp
+++ b/src/frontends/qt/GuiSelectionManager.cpp
@@ -300,8 +300,8 @@ void GuiSelectionManager::addPB_clicked()
// select and show last added item
if (isAdded) {
- QModelIndex idx = selectedModel->index(srows, 0);
- selectedLV->setCurrentIndex(idx);
+ QModelIndex i = selectedModel->index(srows, 0);
+ selectedLV->setCurrentIndex(i);
}
updateHook();
diff --git a/src/frontends/qt/GuiTabularCreate.cpp b/src/frontends/qt/GuiTabularCreate.cpp
index 483d53a1b1..95eb3b8f81 100644
--- a/src/frontends/qt/GuiTabularCreate.cpp
+++ b/src/frontends/qt/GuiTabularCreate.cpp
@@ -57,11 +57,11 @@ void GuiTabularCreate::getFiles()
QString fn = QFileInfo(it.next()).fileName();
if (!fn.endsWith(".lyx") || fn.contains("_1x"))
continue;
- QString data = fn.left(fn.lastIndexOf(".lyx"));
- QString guiname = data;
+ QString tdata = fn.left(fn.lastIndexOf(".lyx"));
+ QString guiname = tdata;
guiname = toqstr(translateIfPossible(qstring_to_ucs4(guiname.replace('_', ' '))));
- if (styleCO->findData(data) == -1)
- styleCO->addItem(guiname, data);
+ if (styleCO->findData(tdata) == -1)
+ styleCO->addItem(guiname, tdata);
}
}
}
diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index 3a42afefea..2e96d24089 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -2582,8 +2582,8 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
break;
}
enable = false;
- for (Buffer * buf : doc_buffer->allRelatives()) {
- GuiWorkArea * wa = workArea(*buf);
+ for (Buffer * bf : doc_buffer->allRelatives()) {
+ GuiWorkArea * wa = workArea(*bf);
if (!wa)
continue;
if (wa->bufferView().getStatus(cmdToPass, flag)) {
diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp
index 8f9c7afbd8..2671b60f07 100644
--- a/src/frontends/qt/GuiWorkArea.cpp
+++ b/src/frontends/qt/GuiWorkArea.cpp
@@ -592,12 +592,12 @@ void GuiWorkArea::Private::drawCaret(QPainter & painter, int horiz_offset,
for (auto const & shape : buffer_view_->caretGeometry().shapes) {
bool first = true;
QPainterPath path;
- for (Point const & p : shape) {
+ for (Point const & pt : shape) {
if (first) {
- path.moveTo(p.x - horiz_offset, p.y - vert_offset);
+ path.moveTo(pt.x - horiz_offset, pt.y - vert_offset);
first = false;
} else
- path.lineTo(p.x - horiz_offset, p.y - vert_offset);
+ path.lineTo(pt.x - horiz_offset, pt.y - vert_offset);
}
painter.fillPath(path, color);
}
diff --git a/src/frontends/qt/TocWidget.cpp b/src/frontends/qt/TocWidget.cpp
index ca9ac3f39c..1db5b35a62 100644
--- a/src/frontends/qt/TocWidget.cpp
+++ b/src/frontends/qt/TocWidget.cpp
@@ -258,11 +258,11 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd,
case LFUN_REFERENCE_TO_PARAGRAPH: {
docstring const type = cmd.argument();
- TocItem const & item =
+ TocItem const & toc_item =
gui_view_.tocModels().currentItem(current_type_, index);
- docstring const id = (item.parIDs().empty())
- ? item.dit().paragraphGotoArgument(true)
- : item.parIDs();
+ docstring const id = (toc_item.parIDs().empty())
+ ? toc_item.dit().paragraphGotoArgument(true)
+ : toc_item.parIDs();
docstring const arg = (type.empty()) ? id : id + " " + type;
dispatch(FuncRequest(cmd, arg));
refocus_wa = true;
diff --git a/src/frontends/qt/Toolbars.cpp b/src/frontends/qt/Toolbars.cpp
index e36ff6d6f5..6573b2207b 100644
--- a/src/frontends/qt/Toolbars.cpp
+++ b/src/frontends/qt/Toolbars.cpp
@@ -44,9 +44,9 @@ ToolbarItem::ToolbarItem(Type t, FuncRequest const & f,
}
-ToolbarItem::ToolbarItem(Type type, string const & name,
- docstring const & label)
- : type(type), func(make_shared<FuncRequest>()), label(label), name(name)
+ToolbarItem::ToolbarItem(Type typ, string const & nam,
+ docstring const & lab)
+ : type(typ), func(make_shared<FuncRequest>()), label(lab), name(nam)
{
}
@@ -174,10 +174,10 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
case TO_DYNAMICMENU: {
if (lex.next(true)) {
- string const name = lex.getString();
+ string const mname = lex.getString();
lex.next(true);
docstring const label = lex.getDocString();
- add(ToolbarItem(ToolbarItem::DYNAMICMENU, name, label));
+ add(ToolbarItem(ToolbarItem::DYNAMICMENU, mname, label));
}
break;
}
diff --git a/src/frontends/qt/Toolbars.h b/src/frontends/qt/Toolbars.h
index e6989b183d..67bd25e97a 100644
--- a/src/frontends/qt/Toolbars.h
+++ b/src/frontends/qt/Toolbars.h
@@ -80,8 +80,8 @@ public:
typedef Items::const_iterator item_iterator;
- explicit ToolbarInfo(std::string const & name = std::string())
- : name(name), allow_auto(false) {}
+ explicit ToolbarInfo(std::string const & name_in = std::string())
+ : name(name_in), allow_auto(false) {}
/// toolbar name
std::string name;
diff --git a/src/graphics/GraphicsLoader.cpp b/src/graphics/GraphicsLoader.cpp
index dc3f7c5e35..614f57f76f 100644
--- a/src/graphics/GraphicsLoader.cpp
+++ b/src/graphics/GraphicsLoader.cpp
@@ -364,9 +364,9 @@ void Loader::setDisplayPixelRatio(double scale)
}
-connection Loader::connect(slot const & slot) const
+connection Loader::connect(slot const & sl) const
{
- return pimpl_->signal_.connect(slot);
+ return pimpl_->signal_.connect(sl);
}
diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp
index 25dcb2fd61..7fa7dfb456 100644
--- a/src/graphics/PreviewLoader.cpp
+++ b/src/graphics/PreviewLoader.cpp
@@ -282,9 +282,9 @@ void PreviewLoader::refreshPreviews()
}
-connection PreviewLoader::connect(slot const & slot) const
+connection PreviewLoader::connect(slot const & sl) const
{
- return pimpl_->imageReady.connect(slot);
+ return pimpl_->imageReady.connect(sl);
}
diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp
index 77206dc44f..32121c435c 100644
--- a/src/insets/InsetInfo.cpp
+++ b/src/insets/InsetInfo.cpp
@@ -350,37 +350,37 @@ vector<pair<string,docstring>> InsetInfoParams::getArguments(Buffer const * buf,
bool InsetInfoParams::validateArgument(Buffer const * buf, docstring const & arg,
bool const usedefaults) const
{
- string type;
- string name = trim(split(to_utf8(arg), type, ' '));
- if (name.empty() && usedefaults)
- name = defaultValueTranslator().find(type);
+ string itype;
+ string iname = trim(split(to_utf8(arg), itype, ' '));
+ if (iname.empty() && usedefaults)
+ iname = defaultValueTranslator().find(itype);
- switch (nameTranslator().find(type)) {
+ switch (nameTranslator().find(itype)) {
case UNKNOWN_INFO:
return false;
case SHORTCUT_INFO:
case SHORTCUTS_INFO:
case MENU_INFO: {
- FuncRequest func = lyxaction.lookupFunc(name);
+ FuncRequest func = lyxaction.lookupFunc(iname);
return func.action() != LFUN_UNKNOWN_ACTION;
}
case L7N_INFO:
- return !name.empty();
+ return !iname.empty();
case ICON_INFO: {
- FuncCode const action = lyxaction.lookupFunc(name).action();
+ FuncCode const action = lyxaction.lookupFunc(iname).action();
if (action == LFUN_UNKNOWN_ACTION) {
string dir = "images";
- return !imageLibFileSearch(dir, name, "svgz,png").empty();
+ return !imageLibFileSearch(dir, iname, "svgz,png").empty();
}
return true;
}
case LYXRC_INFO: {
set<string> rcs = lyxrc.getRCs();
- return rcs.find(name) != rcs.end();
+ return rcs.find(iname) != rcs.end();
}
case PACKAGE_INFO:
@@ -388,54 +388,54 @@ bool InsetInfoParams::validateArgument(Buffer const * buf, docstring const & arg
return true;
case BUFFER_INFO:
- return (name == "name" || name == "name-noext"
- || name == "path" || name == "class");
+ return (iname == "name" || iname == "name-noext"
+ || iname == "path" || iname == "class");
case VCS_INFO:
- if (name == "revision" || name == "revision-abbrev" || name == "tree-revision"
- || name == "author" || name == "date" || name == "time")
+ if (iname == "revision" || iname == "revision-abbrev" || iname == "tree-revision"
+ || iname == "author" || iname == "date" || iname == "time")
return buf->lyxvc().inUse();
return false;
case LYX_INFO:
- return name == "version" || name == "layoutformat";
+ return iname == "version" || iname == "layoutformat";
case FIXDATE_INFO: {
string date;
string piece;
- date = split(name, piece, '@');
+ date = split(iname, piece, '@');
if (!date.empty() && !QDate::fromString(toqstr(date), Qt::ISODate).isValid())
return false;
if (!piece.empty())
- name = piece;
+ iname = piece;
}
// fall through
case DATE_INFO:
case MODDATE_INFO: {
- if (name == "long" || name == "short" || name == "ISO")
+ if (iname == "long" || iname == "short" || iname == "ISO")
return true;
else {
QDate date = QDate::currentDate();
- return !date.toString(toqstr(name)).isEmpty();
+ return !date.toString(toqstr(iname)).isEmpty();
}
}
case FIXTIME_INFO: {
string time;
string piece;
- time = split(name, piece, '@');
+ time = split(iname, piece, '@');
if (!time.empty() && !QTime::fromString(toqstr(time), Qt::ISODate).isValid())
return false;
if (!piece.empty())
- name = piece;
+ iname = piece;
}
// fall through
case TIME_INFO:
case MODTIME_INFO: {
- if (name == "long" || name == "short" || name == "ISO")
+ if (iname == "long" || iname == "short" || iname == "ISO")
return true;
else {
QTime time = QTime::currentTime();
- return !time.toString(toqstr(name)).isEmpty();
+ return !time.toString(toqstr(iname)).isEmpty();
}
}
}
@@ -1040,11 +1040,11 @@ void InsetInfo::build()
// TODO: when away from a release, replace with getTextClassInfo.
// the TextClass can change
LayoutFileList const & list = LayoutFileList::get();
- bool available = false;
+ bool avail = false;
// params_.name is the class name
if (list.haveClass(params_.name))
- available = list[params_.name].isTeXClassAvailable();
- if (available) {
+ avail = list[params_.name].isTeXClassAvailable();
+ if (avail) {
gui = _("yes");
info(from_ascii("yes"), params_.lang);
} else {
@@ -1306,8 +1306,8 @@ std::pair<QDate, std::string> parseDate(Buffer const & buffer, const InsetInfoPa
if (params.type == InsetInfoParams::MODDATE_INFO)
date = QDateTime::fromSecsSinceEpoch(buffer.fileName().lastModified()).date();
else if (params.type == InsetInfoParams::FIXDATE_INFO && !date_specifier.empty()) {
- QDate date = QDate::fromString(toqstr(date_specifier), Qt::ISODate);
- date = (date.isValid()) ? date : QDate::currentDate();
+ QDate trydate = QDate::fromString(toqstr(date_specifier), Qt::ISODate);
+ date = (trydate.isValid()) ? trydate : QDate::currentDate();
} else {
if (params.type != InsetInfoParams::DATE_INFO && params.type != InsetInfoParams::FIXDATE_INFO)
lyxerr << "Unexpected InsetInfoParams::info_type in parseDate: " << params.type;
diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp
index af3e8edc8e..3613d92aea 100644
--- a/src/insets/InsetRef.cpp
+++ b/src/insets/InsetRef.cpp
@@ -564,9 +564,9 @@ void InsetRef::latex(otexstream & os, OutputParams const & rp) const
os << '{' << data << '}';
} else if (nlabels == 1) {
InsetCommandParams p(REF_CODE, cmd);
- bool const use_nolink = hyper_on && getParam("nolink") == "true";
+ bool const nolink = hyper_on && getParam("nolink") == "true";
p["reference"] = getParam("reference");
- os << p.getCommand(rp, use_nolink);
+ os << p.getCommand(rp, nolink);
} else {
bool first = true;
vector<docstring>::const_iterator it = labels.begin();
diff --git a/src/insets/RenderPreview.cpp b/src/insets/RenderPreview.cpp
index 48d471c3c5..dea9aaae09 100644
--- a/src/insets/RenderPreview.cpp
+++ b/src/insets/RenderPreview.cpp
@@ -288,9 +288,9 @@ void RenderMonitoredPreview::draw(PainterInfo & pi, int x, int y, bool const) co
}
-connection RenderMonitoredPreview::connect(slot const & slot)
+connection RenderMonitoredPreview::connect(slot const & sl)
{
- return changed_.connect(slot);
+ return changed_.connect(sl);
}
diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index b4a2f99a9c..ecd66e2ef0 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -3867,38 +3867,38 @@ static void modifyRegexForMatchWord(string &t)
t = "\\b" + s + "\\b";
}
-MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opt)
- : p_buf(&buf), p_first_buf(&buf), opt(opt)
+MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opts)
+ : p_buf(&buf), p_first_buf(&buf), opt(opts)
{
- Buffer & find_buf = *theBufferList().getBuffer(FileName(to_utf8(opt.find_buf_name)), true);
- docstring const & ds = stringifySearchBuffer(find_buf, opt);
+ Buffer & find_buf = *theBufferList().getBuffer(FileName(to_utf8(opts.find_buf_name)), true);
+ docstring const & ds = stringifySearchBuffer(find_buf, opts);
if (ds.empty() ) {
- CreateRegexp(opt, "", "", "");
+ CreateRegexp(opts, "", "", "");
return;
}
use_regexp = ds.find(from_utf8("\\regexp{")) != std::string::npos;
- if (opt.replace_all && previous_single_replace) {
+ if (opts.replace_all && previous_single_replace) {
previous_single_replace = false;
num_replaced = 0;
}
- else if (!opt.replace_all) {
+ else if (!opts.replace_all) {
num_replaced = 0; // count number of replaced strings
previous_single_replace = true;
}
// When using regexp, braces are hacked already by escape_for_regex()
- par_as_string = convertLF2Space(ds, opt.ignoreformat);
+ par_as_string = convertLF2Space(ds, opts.ignoreformat);
size_t lead_size = 0;
// correct the language settings
- par_as_string = correctlanguagesetting(par_as_string, true, !opt.ignoreformat, &buf);
+ par_as_string = correctlanguagesetting(par_as_string, true, !opts.ignoreformat, &buf);
if (par_as_string.empty()) {
- CreateRegexp(opt, "", "", "");
+ CreateRegexp(opts, "", "", "");
return;
}
- opt.matchAtStart = false;
+ opts.matchAtStart = false;
if (!use_regexp) {
- identifyClosing(par_as_string, opt.ignoreformat); // Removes math closings ($, ], ...) at end of string
- if (opt.ignoreformat) {
+ identifyClosing(par_as_string, opts.ignoreformat); // Removes math closings ($, ], ...) at end of string
+ if (opts.ignoreformat) {
lead_size = 0;
}
else {
@@ -3910,20 +3910,20 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opt)
string par_as_regex_string_nolead = string2regex(par_as_string_nolead);
/* Handle whole words too in this case
*/
- if (opt.matchword) {
+ if (opts.matchword) {
par_as_regex_string_nolead = "\\b" + par_as_regex_string_nolead + "\\b";
- opt.matchword = false;
+ opts.matchword = false;
}
string regexp_str = "(" + lead_as_regex_string + ")()" + par_as_regex_string_nolead;
string regexp2_str = "(" + lead_as_regex_string + ")(.*?)" + par_as_regex_string_nolead;
- CreateRegexp(opt, regexp_str, regexp2_str);
+ CreateRegexp(opts, regexp_str, regexp2_str);
use_regexp = true;
LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Setting regexp to : '" << regexp_str << "'");
LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Setting regexp2 to: '" << regexp2_str << "'");
return;
}
- if (!opt.ignoreformat) {
+ if (!opts.ignoreformat) {
lead_size = identifyLeading(par_as_string);
LYXERR(Debug::FINDVERBOSE, "Lead_size: " << lead_size);
lead_as_string = par_as_string.substr(0, lead_size);
@@ -3943,12 +3943,12 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opt)
LYXERR(Debug::FINDVERBOSE, "par_as_string now is '" << par_as_string << "'");
}
// LYXERR(Debug::FINDVERBOSE, "par_as_string before escape_for_regex() is '" << par_as_string << "'");
- par_as_string = escape_for_regex(par_as_string, !opt.ignoreformat);
+ par_as_string = escape_for_regex(par_as_string, !opts.ignoreformat);
// Insert (.*?) before trailing closure of math, macros and environments, so to catch parts of them.
// LYXERR(Debug::FINDVERBOSE, "par_as_string now is '" << par_as_string << "'");
++close_wildcards;
size_t lng = par_as_string.size();
- if (!opt.ignoreformat) {
+ if (!opts.ignoreformat) {
// Remove extra '\}' at end if not part of \{\.\}
while(lng > 2) {
if (par_as_string.substr(lng-2, 2).compare("\\}") == 0) {
@@ -3969,7 +3969,7 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opt)
if ((lng > 0) && (par_as_string[0] == '^')) {
par_as_string = par_as_string.substr(1);
--lng;
- opt.matchAtStart = true;
+ opts.matchAtStart = true;
}
// LYXERR(Debug::FINDVERBOSE, "par_as_string now is '" << par_as_string << "'");
// LYXERR(Debug::FINDVERBOSE, "Open braces: " << open_braces);
@@ -3988,7 +3988,7 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opt)
string dest = "\\" + std::to_string(i+2);
while (regex_replace(par_as_string, par_as_string, orig, dest));
}
- if (opt.matchword) {
+ if (opts.matchword) {
modifyRegexForMatchWord(par_as_string);
// opt.matchword = false;
}
@@ -3997,7 +3997,7 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opt)
}
LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Setting regexp to : '" << regexp_str << "'");
LYXERR(Debug::FINDVERBOSE|Debug::FIND, "Setting regexp2 to: '" << regexp2_str << "'");
- CreateRegexp(opt, regexp_str, regexp2_str, par_as_string);
+ CreateRegexp(opts, regexp_str, regexp2_str, par_as_string);
}
}
diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp
index 75b1c1922f..b753af503a 100644
--- a/src/mathed/InsetMathDecoration.cpp
+++ b/src/mathed/InsetMathDecoration.cpp
@@ -214,8 +214,8 @@ void InsetMathDecoration::infoize(odocstream & os) const
namespace {
struct Attributes {
Attributes() : over(false) {}
- Attributes(bool o, string const & entity)
- : over(o), entity(entity) {}
+ Attributes(bool o, string const & e)
+ : over(o), entity(e) {}
bool over;
string entity;
};
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 5d8e3b4abd..fc16936a76 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -823,7 +823,7 @@ void InsetMathHull::usedMacros(MathData const & md, DocIterator const & pos,
continue;
macros.erase(name);
// Look for macros in the definition of this macro.
- MathData md(pos.buffer());
+ MathData mdd(pos.buffer());
MacroData const * data =
pos.buffer()->getMacro(name, pos, true);
if (data) {
@@ -839,13 +839,13 @@ void InsetMathHull::usedMacros(MathData const & md, DocIterator const & pos,
from_ascii("\r\n"),
from_ascii("\n")),
"\n") + "\n");
- asMathData(data->definition(), md);
+ asMathData(data->definition(), mdd);
}
- usedMacros(md, pos, macros, defs);
+ usedMacros(mdd, pos, macros, defs);
} else if (mt) {
- MathData md(pos.buffer());
- asMathData(mt->definition(), md);
- usedMacros(md, pos, macros, defs);
+ MathData mdd(pos.buffer());
+ asMathData(mt->definition(), mdd);
+ usedMacros(mdd, pos, macros, defs);
} else if (si) {
if (!si->nuc().empty())
usedMacros(si->nuc(), pos, macros, defs);
diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp
index ece9bfd39d..9354ef716e 100644
--- a/src/mathed/InsetMathMacro.cpp
+++ b/src/mathed/InsetMathMacro.cpp
@@ -289,9 +289,9 @@ void InsetMathMacro::Private::updateNestedChildren(InsetMathMacro * owner, Inset
InsetArgumentProxy * ap = dynamic_cast
<InsetArgumentProxy *>(md[j].nucleus());
if (ap) {
- InsetMathMacro::Private * md = ap->owner()->d;
- if (md->macro_)
- md->macro_ = &md->macroBackup_;
+ InsetMathMacro::Private * mdd = ap->owner()->d;
+ if (mdd->macro_)
+ mdd->macro_ = &mdd->macroBackup_;
ap->setOwner(owner);
}
InsetMathNest * imn = md[j].nucleus()->asNestInset();
diff --git a/src/mathed/InsetMathStackrel.cpp b/src/mathed/InsetMathStackrel.cpp
index 238c9faa5d..b6540d1b96 100644
--- a/src/mathed/InsetMathStackrel.cpp
+++ b/src/mathed/InsetMathStackrel.cpp
@@ -39,17 +39,17 @@ Inset * InsetMathStackrel::clone() const
bool InsetMathStackrel::idxUpDown(Cursor & cur, bool up) const
{
- idx_type const npos = 1234; // impossible number
- idx_type target = npos;
+ idx_type const nopos = 1234; // impossible number
+ idx_type target = nopos;
if (up) {
- idx_type const targets[] = { 1, npos, 0 };
+ idx_type const targets[] = { 1, nopos, 0 };
target = targets[cur.idx()];
} else {
- idx_type const targets[] = { 2, 0, npos };
+ idx_type const targets[] = { 2, 0, nopos };
target = targets[cur.idx()];
}
- if (target == npos || target == nargs())
+ if (target == nopos || target == nargs())
return false;
cur.idx() = target;
cur.pos() = cell(target).x2pos(&cur.bv(), cur.x_target());
diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp
index a896f77a00..531138b358 100644
--- a/src/mathed/MathExtern.cpp
+++ b/src/mathed/MathExtern.cpp
@@ -814,17 +814,17 @@ void extractSums(MathData & md)
InsetMathScript const * sub = md[i]->asScriptInset();
if (sub && sub->hasDown()) {
// try to figure out the summation index from the subscript
- MathData const & md = sub->down();
+ MathData const & mdd = sub->down();
MathData::const_iterator xt =
- find_if(md.begin(), md.end(), &testEqualSign);
- if (xt != md.end()) {
+ find_if(mdd.begin(), mdd.end(), &testEqualSign);
+ if (xt != mdd.end()) {
// we found a '=', use everything in front of that as index,
// and everything behind as lower index
- p->cell(1) = MathData(buf, md.begin(), xt);
- p->cell(2) = MathData(buf, xt + 1, md.end());
+ p->cell(1) = MathData(buf, mdd.begin(), xt);
+ p->cell(2) = MathData(buf, xt + 1, mdd.end());
} else {
// use everything as summation index, don't use scripts.
- p->cell(1) = md;
+ p->cell(1) = mdd;
}
}
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 3ab34e3361..a9ee3084ca 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -410,16 +410,16 @@ void makeParagraph(
return lyxCodeSpecialCases.find(inset.inset->lyxCode()) != lyxCodeSpecialCases.end() ||
inset.inset->lyxCode() == BIBITEM_CODE;
};
- if (InsetText * text = inset.inset->asInsetText()) {
- for (auto const & par : text->paragraphs()) {
- size_t nInsets = std::distance(par.insetList().begin(), par.insetList().end());
- auto parSize = (size_t) par.size();
+ if (InsetText * itext = inset.inset->asInsetText()) {
+ for (auto const & p : itext->paragraphs()) {
+ size_t numInsets = std::distance(p.insetList().begin(), p.insetList().end());
+ auto pSize = (size_t) p.size();
- if (nInsets == 1 && par.insetList().begin()->inset->lyxCode() == BIBITEM_CODE)
+ if (numInsets == 1 && p.insetList().begin()->inset->lyxCode() == BIBITEM_CODE)
return true;
- if (nInsets != parSize)
+ if (numInsets != pSize)
return false;
- if (!std::all_of(par.insetList().begin(), par.insetList().end(), isLyxCodeSpecialCase))
+ if (!std::all_of(p.insetList().begin(), p.insetList().end(), isLyxCodeSpecialCase))
return false;
}
return true;
@@ -753,10 +753,10 @@ struct DocBookInfoTag
pit_type bpit;
pit_type epit;
- DocBookInfoTag(const set<pit_type> & shouldBeInInfo, const set<pit_type> & mustBeInInfo,
- const set<pit_type> & abstract, bool abstractLayout, pit_type bpit, pit_type epit) :
- shouldBeInInfo(shouldBeInInfo), mustBeInInfo(mustBeInInfo), abstract(abstract),
- abstractLayout(abstractLayout), bpit(bpit), epit(epit) {}
+ DocBookInfoTag(const set<pit_type> & shdBeInInfo, const set<pit_type> & mstBeInInfo,
+ const set<pit_type> & abs, bool absLayout, pit_type bpit_in, pit_type epit_in) :
+ shouldBeInInfo(shdBeInInfo), mustBeInInfo(mstBeInInfo), abstract(abs),
+ abstractLayout(absLayout), bpit(bpit_in), epit(epit_in) {}
};
diff --git a/src/support/Changer.h b/src/support/Changer.h
index 8cd04894c8..0a5d14b8a3 100644
--- a/src/support/Changer.h
+++ b/src/support/Changer.h
@@ -37,7 +37,7 @@ using Changer = std::unique_ptr<Revertible>;
template<typename X>
class RevertibleRef : public Revertible {
public:
- RevertibleRef(X & ref) : ref(ref), old(ref), enabled(true) {}
+ RevertibleRef(X & rf) : ref(rf), old(rf), enabled(true) {}
//
~RevertibleRef() override { revert(); }
//
diff --git a/src/support/FileMonitor.cpp b/src/support/FileMonitor.cpp
index e692f89cb1..cdaeac0c8b 100644
--- a/src/support/FileMonitor.cpp
+++ b/src/support/FileMonitor.cpp
@@ -179,9 +179,9 @@ void FileMonitor::connectToFileMonitorGuard()
}
-connection FileMonitor::connect(slot const & slot)
+connection FileMonitor::connect(slot const & sl)
{
- return fileChanged_.connect(slot);
+ return fileChanged_.connect(sl);
}
diff --git a/src/support/unicode.cpp b/src/support/unicode.cpp
index 073b7e818d..a9154e0163 100644
--- a/src/support/unicode.cpp
+++ b/src/support/unicode.cpp
@@ -51,7 +51,7 @@ namespace lyx {
struct IconvProcessor::Handler {
// assumes cd is valid
- explicit Handler(iconv_t const cd) : cd(cd) {}
+ explicit Handler(iconv_t const cd_in) : cd(cd_in) {}
~Handler() {
if (iconv_close(cd) == -1)
LYXERR0("Error returned from iconv_close(" << errno << ')');
diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index 3c5d998bd7..e51be6f218 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -3261,10 +3261,10 @@ void Preamble::parse(Parser & p, string const & forceclass,
string const fsize_format = tc.fontsizeformat();
for (auto const & fsize : class_fsizes) {
string latexsize = subst(fsize_format, "$$s", fsize);
- vector<string>::iterator it = find(opts.begin(), opts.end(), latexsize);
- if (it != opts.end()) {
+ vector<string>::iterator itt = find(opts.begin(), opts.end(), latexsize);
+ if (itt != opts.end()) {
h_paperfontsize = fsize;
- opts.erase(it);
+ opts.erase(itt);
break;
}
}
@@ -3327,10 +3327,10 @@ void Preamble::parse(Parser & p, string const & forceclass,
string const psize_format = tc.pagesizeformat();
for (auto const & psize : class_psizes) {
string latexsize = subst(psize_format, "$$s", psize);
- vector<string>::iterator it = find(opts.begin(), opts.end(), latexsize);
- if (it != opts.end()) {
+ vector<string>::iterator itt = find(opts.begin(), opts.end(), latexsize);
+ if (itt != opts.end()) {
h_papersize = psize;
- opts.erase(it);
+ opts.erase(itt);
break;
}
if (psize_format == "$$spaper")
@@ -3338,10 +3338,10 @@ void Preamble::parse(Parser & p, string const & forceclass,
// Also try with the default format since this is understood by
// most classes
latexsize = psize + "paper";
- it = find(opts.begin(), opts.end(), latexsize);
- if (it != opts.end()) {
+ itt = find(opts.begin(), opts.end(), latexsize);
+ if (itt != opts.end()) {
h_papersize = psize;
- opts.erase(it);
+ opts.erase(itt);
break;
}
}
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 15d13b01a4..0724eb7718 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -4736,11 +4736,11 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
if ((where = is_known(t.cs(), known_ref_commands))
&& (t.cs() != "prettyref" || preamble.crossrefPackage() == "prettyref")
&& (p.next_token().asInput() != "*" || is_known(t.cs(), known_starref_commands))) {
- bool starred = false;
+ bool star = false;
bool const caps = contains(t.cs(), 'C');
bool const plural = suffixIs(t.cs(), "refs");
if (p.next_token().asInput() == "*") {
- starred = true;
+ star = true;
p.get_token();
}
string const opt = p.getOpt();
@@ -4766,7 +4766,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
else
os << "caps \"false\"\n";
os << "noprefix \"false\"\n";
- if (starred)
+ if (star)
os << "nolink \"true\"\n";
else
os << "nolink \"false\"\n";
@@ -4792,13 +4792,13 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
if ((where = is_known(t.cs(), known_zref_commands))
&& preamble.crossrefPackage() == "zref") {
- bool starred = false;
+ bool star = false;
bool caps = false;
bool range = false;
bool noname = false;
bool page = false;
if (p.next_token().asInput() == "*") {
- starred = true;
+ star = true;
p.get_token();
}
vector<string> const opts = getVectorFromString(p.getOpt());
@@ -4841,7 +4841,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
else
os << "caps \"false\"\n";
os << "noprefix \"false\"\n";
- if (starred)
+ if (star)
os << "nolink \"true\"\n";
else
os << "nolink \"false\"\n";
@@ -5386,10 +5386,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
begin_inset(os, "Quotes ");
string quotetype = known_coded_quotes[where - known_quotes];
// try to make a smart guess about the side
- Token const prev = p.prev_token();
- bool const opening = (prev.cat() != catSpace && prev.character() != 0
- && prev.character() != '\n' && prev.character() != '~');
- quotetype = guessQuoteStyle(quotetype, opening);
+ Token const prev_tok = p.prev_token();
+ bool const op_quote = (prev_tok.cat() != catSpace && prev_tok.character() != 0
+ && prev_tok.character() != '\n' && prev_tok.character() != '~');
+ quotetype = guessQuoteStyle(quotetype, op_quote);
os << quotetype;
end_inset(os);
// LyX adds {} after the quote, so we have to eat
--
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel