From d38eddb397de982a379d8c0644c6ca2190c67fe9 Mon Sep 17 00:00:00 2001 From: Yuriy Skalko Date: Sat, 31 Oct 2020 19:18:51 +0200 Subject: [PATCH] Match header/source function argument naming --- src/Buffer.cpp | 10 ++--- src/BufferList.cpp | 8 ++-- src/BufferView.cpp | 48 ++++++++++----------- src/Cursor.cpp | 26 ++++++------ src/Cursor.h | 2 +- src/CutAndPaste.h | 4 +- src/Floating.h | 4 +- src/Font.cpp | 8 ++-- src/FontInfo.cpp | 4 +- src/Format.cpp | 4 +- src/FuncRequest.cpp | 4 +- src/Graph.cpp | 6 +-- src/KeySequence.h | 4 +- src/LaTeXFeatures.cpp | 8 ++-- src/LaTeXFeatures.h | 2 +- src/Language.cpp | 14 +++---- src/LayoutFile.h | 2 +- src/Lexer.cpp | 4 +- src/Lexer.h | 4 +- src/LyXAction.cpp | 4 +- src/MetricsInfo.h | 2 +- src/Paragraph.cpp | 24 +++++------ src/ParagraphParameters.cpp | 12 +++--- src/Server.h | 2 +- src/Session.cpp | 4 +- src/Text.h | 2 +- src/Text3.cpp | 28 ++++++------- src/TextMetrics.h | 4 +- src/frontends/qt/FloatPlacement.h | 2 +- src/frontends/qt/GuiClipboard.h | 2 +- src/frontends/qt/GuiCounter.h | 2 +- src/frontends/qt/GuiGraphics.cpp | 60 +++++++++++++-------------- src/frontends/qt/qt_helpers.cpp | 14 +++---- src/frontends/qt/qt_helpers.h | 4 +- src/insets/ExternalTransforms.h | 2 +- src/insets/Inset.cpp | 12 +++--- src/insets/InsetGraphicsParams.cpp | 36 ++++++++-------- src/insets/InsetInfo.cpp | 10 ++--- src/insets/InsetLabel.cpp | 14 +++---- src/insets/InsetListingsParams.cpp | 4 +- src/insets/InsetSeparator.h | 2 +- src/insets/InsetSpace.h | 2 +- src/mathed/InsetMath.cpp | 30 +++++++------- src/mathed/InsetMathAMSArray.h | 2 +- src/mathed/InsetMathCases.cpp | 4 +- src/mathed/InsetMathDots.h | 2 +- src/mathed/InsetMathMacroTemplate.cpp | 22 +++++----- src/mathed/InsetMathMacroTemplate.h | 4 +- src/mathed/InsetMathUnknown.cpp | 4 +- src/mathed/MacroTable.cpp | 10 ++--- src/mathed/TextPainter.cpp | 8 ++-- src/output_plaintext.h | 2 +- src/tex2lyx/tex2lyx.h | 2 +- 53 files changed, 252 insertions(+), 252 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 64a3daa4aa..d1831d49aa 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -3525,19 +3525,19 @@ bool Buffer::hasChildren() const } -void Buffer::collectChildren(ListOfBuffers & clist, bool grand_children) const +void Buffer::collectChildren(ListOfBuffers & children, bool grand_children) const { // loop over children for (auto const & p : d->children_positions) { Buffer * child = const_cast(p.first); // No duplicates - ListOfBuffers::const_iterator bit = find(clist.begin(), clist.end(), child); - if (bit != clist.end()) + ListOfBuffers::const_iterator bit = find(children.begin(), children.end(), child); + if (bit != children.end()) continue; - clist.push_back(child); + children.push_back(child); if (grand_children) // there might be grandchildren - child->collectChildren(clist, true); + child->collectChildren(children, true); } } diff --git a/src/BufferList.cpp b/src/BufferList.cpp index 0cfbec135d..198e0bfad0 100644 --- a/src/BufferList.cpp +++ b/src/BufferList.cpp @@ -312,21 +312,21 @@ Buffer * BufferList::getBuffer(support::FileName const & fname, bool internal) c } -Buffer * BufferList::getBufferFromTmp(string const & s, bool realpath) +Buffer * BufferList::getBufferFromTmp(string const & path, bool realpath) { for (Buffer * buf : bstore) { string const temppath = realpath ? FileName(buf->temppath()).realPath() : buf->temppath(); - if (prefixIs(s, temppath)) { + if (prefixIs(path, temppath)) { // check whether the filename matches the master string const master_name = buf->latexName(); - if (suffixIs(s, master_name)) + if (suffixIs(path, master_name)) return buf; // if not, try with the children for (Buffer * child : buf->getDescendants()) { string const mangled_child_name = DocFileName( changeExtension(child->absFileName(), ".tex")).mangledFileName(); - if (suffixIs(s, mangled_child_name)) + if (suffixIs(path, mangled_child_name)) return child; } } diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 05630cba0b..4e704e3249 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -654,24 +654,24 @@ string BufferView::contextMenu(int x, int y) const -void BufferView::scrollDocView(int const value, bool update) +void BufferView::scrollDocView(int const pixels, bool update) { // The scrollbar values are relative to the top of the screen, therefore the // offset is equal to the target value. // No scrolling at all? No need to redraw anything - if (value == 0) + if (pixels == 0) return; // If the offset is less than 2 screen height, prefer to scroll instead. - if (abs(value) <= 2 * height_) { - d->anchor_ypos_ -= value; + if (abs(pixels) <= 2 * height_) { + d->anchor_ypos_ -= pixels; processUpdateFlags(Update::Force); return; } // cut off at the top - if (value <= d->scrollbarParameters_.min) { + if (pixels <= d->scrollbarParameters_.min) { DocIterator dit = doc_iterator_begin(&buffer_); showCursor(dit, false, update); LYXERR(Debug::SCROLLING, "scroll to top"); @@ -679,7 +679,7 @@ void BufferView::scrollDocView(int const value, bool update) } // cut off at the bottom - if (value >= d->scrollbarParameters_.max) { + if (pixels >= d->scrollbarParameters_.max) { DocIterator dit = doc_iterator_end(&buffer_); dit.backwardPos(); showCursor(dit, false, update); @@ -692,11 +692,11 @@ void BufferView::scrollDocView(int const value, bool update) pit_type i = 0; for (; i != int(d->par_height_.size()); ++i) { par_pos += d->par_height_[i]; - if (par_pos >= value) + if (par_pos >= pixels) break; } - if (par_pos < value) { + if (par_pos < pixels) { // It seems we didn't find the correct pit so stay on the safe side and // scroll to bottom. LYXERR0("scrolling position not found!"); @@ -706,7 +706,7 @@ void BufferView::scrollDocView(int const value, bool update) DocIterator dit = doc_iterator_begin(&buffer_); dit.pit() = i; - LYXERR(Debug::SCROLLING, "value = " << value << " -> scroll to pit " << i); + LYXERR(Debug::SCROLLING, "pixels = " << pixels << " -> scroll to pit " << i); showCursor(dit, false, update); } @@ -2425,21 +2425,21 @@ int BufferView::minVisiblePart() } -int BufferView::scroll(int y) +int BufferView::scroll(int pixels) { - if (y > 0) - return scrollDown(y); - if (y < 0) - return scrollUp(-y); + if (pixels > 0) + return scrollDown(pixels); + if (pixels < 0) + return scrollUp(-pixels); return 0; } -int BufferView::scrollDown(int offset) +int BufferView::scrollDown(int pixels) { Text * text = &buffer_.text(); TextMetrics & tm = d->text_metrics_[text]; - int const ymax = height_ + offset; + int const ymax = height_ + pixels; while (true) { pair last = tm.last(); int bottom_pos = last.second->position() + last.second->descent(); @@ -2448,38 +2448,38 @@ int BufferView::scrollDown(int offset) if (last.first + 1 == int(text->paragraphs().size())) { if (bottom_pos <= height_) return 0; - offset = min(offset, bottom_pos - height_); + pixels = min(pixels, bottom_pos - height_); break; } if (bottom_pos > ymax) break; tm.newParMetricsDown(); } - d->anchor_ypos_ -= offset; - return -offset; + d->anchor_ypos_ -= pixels; + return -pixels; } -int BufferView::scrollUp(int offset) +int BufferView::scrollUp(int pixels) { Text * text = &buffer_.text(); TextMetrics & tm = d->text_metrics_[text]; - int ymin = - offset; + int ymin = - pixels; while (true) { pair first = tm.first(); int top_pos = first.second->position() - first.second->ascent(); if (first.first == 0) { if (top_pos >= 0) return 0; - offset = min(offset, - top_pos); + pixels = min(pixels, - top_pos); break; } if (top_pos < ymin) break; tm.newParMetricsUp(); } - d->anchor_ypos_ += offset; - return offset; + d->anchor_ypos_ += pixels; + return pixels; } diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 9e7867c8d3..97fbeb6a88 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -637,9 +637,9 @@ void CursorData::recordUndo(UndoKind kind) const } -void CursorData::recordUndoInset(Inset const * in) const +void CursorData::recordUndoInset(Inset const * inset) const { - buffer()->undo().recordUndoInset(*this, in); + buffer()->undo().recordUndoInset(*this, inset); } @@ -897,19 +897,19 @@ void Cursor::pop() } -void Cursor::push(Inset & p) +void Cursor::push(Inset & inset) { - push_back(CursorSlice(p)); - p.setBuffer(*buffer()); + push_back(CursorSlice(inset)); + inset.setBuffer(*buffer()); } -void Cursor::pushBackward(Inset & p) +void Cursor::pushBackward(Inset & inset) { LASSERT(!empty(), return); //lyxerr << "Entering inset " << t << " front" << endl; - push(p); - p.idxFirst(*this); + push(inset); + inset.idxFirst(*this); } @@ -1379,19 +1379,19 @@ void Cursor::updateTextTargetOffset() } -bool Cursor::selHandle(bool sel) +bool Cursor::selHandle(bool selecting) { //lyxerr << "Cursor::selHandle" << endl; if (mark()) - sel = true; - if (sel == selection()) + selecting = true; + if (selecting == selection()) return false; - if (!sel) + if (!selecting) cap::saveSelection(*this); resetAnchor(); - selection(sel); + selection(selecting); return true; } diff --git a/src/Cursor.h b/src/Cursor.h index 951a0cc4db..6f4ac227f9 100644 --- a/src/Cursor.h +++ b/src/Cursor.h @@ -270,7 +270,7 @@ public: void setCursorData(CursorData const & data); /// returns true if we made a decision - bool getStatus(FuncRequest const & cmd, FuncStatus & flag) const; + bool getStatus(FuncRequest const & cmd, FuncStatus & status) const; /// dispatch from innermost inset upwards void dispatch(FuncRequest const & cmd); /// display a message diff --git a/src/CutAndPaste.h b/src/CutAndPaste.h index fcbac19a89..09fe05215a 100644 --- a/src/CutAndPaste.h +++ b/src/CutAndPaste.h @@ -127,8 +127,8 @@ void pasteParagraphList(Cursor & cur, ParagraphList const & parlist, * for a list of paragraphs beginning with the specified par. * It changes layouts and character styles. */ -void switchBetweenClasses(DocumentClassConstPtr c1, - DocumentClassConstPtr c2, InsetText & in, ErrorList &); +void switchBetweenClasses(DocumentClassConstPtr oldone, + DocumentClassConstPtr newone, InsetText & in, ErrorList &); /// Get the current selection as a string. Does not change the selection. /// Does only work if the whole selection is in mathed. diff --git a/src/Floating.h b/src/Floating.h index a6f2ec3431..4672d9ac75 100644 --- a/src/Floating.h +++ b/src/Floating.h @@ -36,10 +36,10 @@ public: std::string const & style, std::string const & name, std::string const & listName, std::string const & listCmd, std::string const & refPrefix, std::string const & allowedplacement, - std::string const & htmlType, std::string const & htmlClass, + std::string const & htmlTag, std::string const & htmlAttrib, docstring const & htmlStyle, std::string const & docbookAttr, std::string const & docbookTagType, - std::string const & required, bool usesfloat, bool isprefined, + std::string const & required, bool usesfloat, bool ispredefined, bool allowswide, bool allowssideways); /// std::string const & floattype() const { return floattype_; } diff --git a/src/Font.cpp b/src/Font.cpp index aed80592a5..b70c237db4 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -114,18 +114,18 @@ void Font::setLanguage(Language const * l) /// Updates font settings according to request void Font::update(Font const & newfont, - Language const * document_language, + Language const * default_lang, bool toggleall) { bits_.update(newfont.fontInfo(), toggleall); if (newfont.language() == language() && toggleall) - if (language() == document_language) + if (language() == default_lang) setLanguage(default_language); else - setLanguage(document_language); + setLanguage(default_lang); else if (newfont.language() == reset_language) - setLanguage(document_language); + setLanguage(default_lang); else if (newfont.language() != ignore_language) setLanguage(newfont.language()); } diff --git a/src/FontInfo.cpp b/src/FontInfo.cpp index 02a9e70e1e..967771373a 100644 --- a/src/FontInfo.cpp +++ b/src/FontInfo.cpp @@ -343,9 +343,9 @@ Changer FontInfo::changeStyle(MathStyle const new_style) } -Changer FontInfo::change(FontInfo font, bool realiz) +Changer FontInfo::change(FontInfo font, bool realize) { - if (realiz) + if (realize) font.realize(*this); return make_change(*this, font); } diff --git a/src/Format.cpp b/src/Format.cpp index d639dbfd9f..6a3d49ca53 100644 --- a/src/Format.cpp +++ b/src/Format.cpp @@ -94,9 +94,9 @@ string const Format::extensions() const } -bool Format::hasExtension(string const & e) const +bool Format::hasExtension(string const & ext) const { - return (find(extension_list_.begin(), extension_list_.end(), e) + return (find(extension_list_.begin(), extension_list_.end(), ext) != extension_list_.end()); } diff --git a/src/FuncRequest.cpp b/src/FuncRequest.cpp index 2049210529..0d6a487b8a 100644 --- a/src/FuncRequest.cpp +++ b/src/FuncRequest.cpp @@ -55,9 +55,9 @@ FuncRequest::FuncRequest(FuncCode act, string const & arg, Origin o) FuncRequest::FuncRequest(FuncCode act, int ax, int ay, - mouse_button::state but, KeyModifier modifier, Origin o) + mouse_button::state button, KeyModifier modifier, Origin o) : action_(act), origin_(o), view_origin_(nullptr), x_(ax), y_(ay), - button_(but), modifier_(modifier), allow_async_(true) + button_(button), modifier_(modifier), allow_async_(true) {} diff --git a/src/Graph.cpp b/src/Graph.cpp index f78be287b2..86694eea58 100644 --- a/src/Graph.cpp +++ b/src/Graph.cpp @@ -45,11 +45,11 @@ bool Graph::bfs_init(int s, bool clear_visited, queue & Q) Graph::EdgePath const - Graph::getReachableTo(int target, bool clear_visited) + Graph::getReachableTo(int to, bool clear_visited) { EdgePath result; queue Q; - if (!bfs_init(target, clear_visited, Q)) + if (!bfs_init(to, clear_visited, Q)) return result; // Here's the logic, which is shared by the other routines. @@ -61,7 +61,7 @@ Graph::EdgePath const while (!Q.empty()) { int const current = Q.front(); Q.pop(); - if (current != target || theFormats().get(target).name() != "lyx") + if (current != to || theFormats().get(to).name() != "lyx") result.push_back(current); vector::iterator it = vertices_[current].in_arrows.begin(); diff --git a/src/KeySequence.h b/src/KeySequence.h index 444fb08719..6e46abac2c 100644 --- a/src/KeySequence.h +++ b/src/KeySequence.h @@ -40,12 +40,12 @@ public: /** * Add a key to the key sequence and look it up in the curmap * if the latter is defined. - * @param keysym the key to add + * @param key the key to add * @param mod modifier mask * @param nmod which modifiers to mask out for equality test * @return the action matching this key sequence or LFUN_UNKNOWN_ACTION */ - FuncRequest const & addkey(KeySymbol const & keysym, KeyModifier mod, + FuncRequest const & addkey(KeySymbol const & key, KeyModifier mod, KeyModifier nmod = NoModifier); /** diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 347a3e0450..59769a02f5 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -832,15 +832,15 @@ TexString getSnippets(std::list const & list) } // namespace -void LaTeXFeatures::addPreambleSnippet(TexString ts, bool allow_dupes) +void LaTeXFeatures::addPreambleSnippet(TexString snippet, bool allow_dupes) { - addSnippet(preamble_snippets_, move(ts), allow_dupes); + addSnippet(preamble_snippets_, move(snippet), allow_dupes); } -void LaTeXFeatures::addPreambleSnippet(docstring const & str, bool allow_dupes) +void LaTeXFeatures::addPreambleSnippet(docstring const & snippet, bool allow_dupes) { - addSnippet(preamble_snippets_, TexString(str), allow_dupes); + addSnippet(preamble_snippets_, TexString(snippet), allow_dupes); } diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h index 27edb1f6a8..2cc90cdbac 100644 --- a/src/LaTeXFeatures.h +++ b/src/LaTeXFeatures.h @@ -142,7 +142,7 @@ public: void getFontEncodings(std::vector & encodings, bool const onlylangs = false) const; /// - void useLayout(docstring const & lyt); + void useLayout(docstring const & layoutname); /// void useInsetLayout(InsetLayout const & lay); /// diff --git a/src/Language.cpp b/src/Language.cpp index dad933f0c6..884d1a039b 100644 --- a/src/Language.cpp +++ b/src/Language.cpp @@ -57,22 +57,22 @@ bool Language::isBabelExclusive() const } -docstring const Language::translateLayout(string const & m) const +docstring const Language::translateLayout(string const & msg) const { - if (m.empty()) + if (msg.empty()) return docstring(); - if (!isAscii(m)) { - lyxerr << "Warning: not translating `" << m + if (!isAscii(msg)) { + lyxerr << "Warning: not translating `" << msg << "' because it is not pure ASCII.\n"; - return from_utf8(m); + return from_utf8(msg); } - TranslationMap::const_iterator it = layoutTranslations_.find(m); + TranslationMap::const_iterator it = layoutTranslations_.find(msg); if (it != layoutTranslations_.end()) return it->second; - docstring t = from_ascii(m); + docstring t = from_ascii(msg); cleanTranslation(t); return t; } diff --git a/src/LayoutFile.h b/src/LayoutFile.h index 81dff9de78..f2b27a118d 100644 --- a/src/LayoutFile.h +++ b/src/LayoutFile.h @@ -107,7 +107,7 @@ public: /// Read textclass list. Returns false if this fails. bool read(); /// Clears the textclass so as to force it to be reloaded - void reset(LayoutFileIndex const & tc); + void reset(LayoutFileIndex const & classname); /// Add a default textclass with all standard layouts. /// Note that this will over-write any information we may have diff --git a/src/Lexer.cpp b/src/Lexer.cpp index b11bf4743a..08fb469ce3 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -944,9 +944,9 @@ bool Lexer::checkFor(char const * required) } -void Lexer::setContext(std::string const & str) +void Lexer::setContext(std::string const & functionName) { - pimpl_->context = str; + pimpl_->context = functionName; } diff --git a/src/Lexer.h b/src/Lexer.h index 9568b6e19d..6ecdd90989 100644 --- a/src/Lexer.h +++ b/src/Lexer.h @@ -138,14 +138,14 @@ public: std::string const getString(bool trim = false) const; /// docstring const getDocString(bool trim = false) const; - /** Get a long string, ended by the tag `endtag'. + /** Get a long string, ended by the tag `endtoken'. This string can span several lines. The first line serves as a template for how many spaces the lines are indented. This much white space is skipped from each following line. This mechanism does not work perfectly if you use tabs. */ - docstring getLongString(docstring const & endtag); + docstring getLongString(docstring const & endtoken); /// Pushes a token list on a stack and replaces it with a new one. template void pushTable(LexerKeyword (&table)[N]) diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 23cc74504b..8b13630d86 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -4490,9 +4490,9 @@ LyXAction::LyXAction() } -FuncRequest LyXAction::lookupFunc(string const & func) const +FuncRequest LyXAction::lookupFunc(string const & func_name) const { - string const func2 = trim(func); + string const func2 = trim(func_name); if (func2.empty()) return FuncRequest(LFUN_NOACTION); diff --git a/src/MetricsInfo.h b/src/MetricsInfo.h index 1508eb345f..14fd02642a 100644 --- a/src/MetricsInfo.h +++ b/src/MetricsInfo.h @@ -55,7 +55,7 @@ public: int macro_nesting; /// Temporarily change a full font. - Changer changeFontSet(std::string const & font); + Changer changeFontSet(std::string const & name); /// Temporarily change the font to math if needed. Changer changeEnsureMath(Inset::mode_type mode = Inset::MATH_MODE); // Temporarily change to the style suitable for use in fractions diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 4ade252e72..c668f3b686 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -1560,19 +1560,19 @@ void flushString(ostream & os, docstring & s) void Paragraph::write(ostream & os, BufferParams const & bparams, - depth_type & dth) const + depth_type & depth) const { // The beginning or end of a deeper (i.e. nested) area? - if (dth != d->params_.depth()) { - if (d->params_.depth() > dth) { - while (d->params_.depth() > dth) { + if (depth != d->params_.depth()) { + if (d->params_.depth() > depth) { + while (d->params_.depth() > depth) { os << "\n\\begin_deeper"; - ++dth; + ++depth; } } else { - while (d->params_.depth() < dth) { + while (d->params_.depth() < depth) { os << "\n\\end_deeper"; - --dth; + --depth; } } } @@ -1685,11 +1685,11 @@ void Paragraph::validate(LaTeXFeatures & features) const } -void Paragraph::insert(pos_type start, docstring const & str, +void Paragraph::insert(pos_type pos, docstring const & str, Font const & font, Change const & change) { for (size_t i = 0, n = str.size(); i != n ; ++i) - insertChar(start + i, str[i], font, change); + insertChar(pos + i, str[i], font, change); } @@ -4129,12 +4129,12 @@ void Paragraph::setPlainLayout(DocumentClass const & tc) } -void Paragraph::setPlainOrDefaultLayout(DocumentClass const & tclass) +void Paragraph::setPlainOrDefaultLayout(DocumentClass const & tc) { if (usePlainLayout()) - setPlainLayout(tclass); + setPlainLayout(tc); else - setDefaultLayout(tclass); + setDefaultLayout(tc); } diff --git a/src/ParagraphParameters.cpp b/src/ParagraphParameters.cpp index e6348797dd..72b2286b12 100644 --- a/src/ParagraphParameters.cpp +++ b/src/ParagraphParameters.cpp @@ -244,14 +244,14 @@ void ParagraphParameters::read(Lexer & lex, bool merge) void ParagraphParameters::apply( - ParagraphParameters const & p, Layout const & layout) + ParagraphParameters const & params, Layout const & layout) { - spacing(p.spacing()); + spacing(params.spacing()); // does the layout allow the new alignment? - if (p.align() & layout.alignpossible) - align(p.align()); - labelWidthString(p.labelWidthString()); - noindent(p.noindent()); + if (params.align() & layout.alignpossible) + align(params.align()); + labelWidthString(params.labelWidthString()); + noindent(params.noindent()); } diff --git a/src/Server.h b/src/Server.h index e20406a6d4..9257704b43 100644 --- a/src/Server.h +++ b/src/Server.h @@ -206,7 +206,7 @@ public: // lyxserver is using a buffer that is being edited with a bufferview. // With a common buffer list this is not a problem, maybe. (Alejandro) /// - Server(std::string const & pip); + Server(std::string const & pipes); /// ~Server(); /// diff --git a/src/Session.cpp b/src/Session.cpp index 43c1b9b93e..c80bca5222 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -383,9 +383,9 @@ void LastCommandsSection::setNumberOfLastCommands(unsigned int no) } -void LastCommandsSection::add(std::string const & string) +void LastCommandsSection::add(std::string const & command) { - lastcommands.push_back(string); + lastcommands.push_back(command); } diff --git a/src/Text.h b/src/Text.h index 1c5d4397f4..4defd94fa6 100644 --- a/src/Text.h +++ b/src/Text.h @@ -258,7 +258,7 @@ public: settings are given to the new one. This function will handle a multi-paragraph selection. */ - void setParagraphs(Cursor const & cur, docstring const & arg, bool modify = false); + void setParagraphs(Cursor const & cur, docstring const & arg, bool merge = false); /// Sets parameters for current or selected paragraphs void setParagraphs(Cursor const & cur, ParagraphParameters const & p); diff --git a/src/Text3.cpp b/src/Text3.cpp index 74f86b26f3..1927a2536a 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -2890,7 +2890,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, - FuncStatus & flag) const + FuncStatus & status) const { LBUFERR(this == cur.text()); @@ -2913,7 +2913,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, // FIXME We really should not allow this to be put, e.g., // in a footnote, or in ERT. But it would make sense in a // branch, so I'm not sure what to do. - flag.setOnOff(cur.paragraph().params().startOfAppendix()); + status.setOnOff(cur.paragraph().params().startOfAppendix()); break; case LFUN_DIALOG_SHOW_NEW_INSET: @@ -3043,7 +3043,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, if (cit == floats.end() || // and that we know how to generate a list of them (!cit->second.usesFloatPkg() && cit->second.listCommand().empty())) { - flag.setUnknown(true); + status.setUnknown(true); // probably not necessary, but... enable = false; } @@ -3227,38 +3227,38 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, break; case LFUN_FONT_EMPH: - flag.setOnOff(fontinfo.emph() == FONT_ON); + status.setOnOff(fontinfo.emph() == FONT_ON); enable = !cur.paragraph().isPassThru(); break; case LFUN_FONT_ITAL: - flag.setOnOff(fontinfo.shape() == ITALIC_SHAPE); + status.setOnOff(fontinfo.shape() == ITALIC_SHAPE); enable = !cur.paragraph().isPassThru(); break; case LFUN_FONT_NOUN: - flag.setOnOff(fontinfo.noun() == FONT_ON); + status.setOnOff(fontinfo.noun() == FONT_ON); enable = !cur.paragraph().isPassThru(); break; case LFUN_FONT_BOLD: case LFUN_FONT_BOLDSYMBOL: - flag.setOnOff(fontinfo.series() == BOLD_SERIES); + status.setOnOff(fontinfo.series() == BOLD_SERIES); enable = !cur.paragraph().isPassThru(); break; case LFUN_FONT_SANS: - flag.setOnOff(fontinfo.family() == SANS_FAMILY); + status.setOnOff(fontinfo.family() == SANS_FAMILY); enable = !cur.paragraph().isPassThru(); break; case LFUN_FONT_ROMAN: - flag.setOnOff(fontinfo.family() == ROMAN_FAMILY); + status.setOnOff(fontinfo.family() == ROMAN_FAMILY); enable = !cur.paragraph().isPassThru(); break; case LFUN_FONT_TYPEWRITER: - flag.setOnOff(fontinfo.family() == TYPEWRITER_FAMILY); + status.setOnOff(fontinfo.family() == TYPEWRITER_FAMILY); enable = !cur.paragraph().isPassThru(); break; @@ -3414,7 +3414,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, if (!ins) enable = false; else - flag.setOnOff(to_utf8(cmd.argument()) == ins->getParams().groupId); + status.setOnOff(to_utf8(cmd.argument()) == ins->getParams().groupId); break; } @@ -3426,7 +3426,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_LANGUAGE: enable = !cur.paragraph().isPassThru(); - flag.setOnOff(cmd.getArg(0) == cur.real_current_font.language()->lang()); + status.setOnOff(cmd.getArg(0) == cur.real_current_font.language()->lang()); break; case LFUN_PARAGRAPH_BREAK: @@ -3451,7 +3451,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, docstring const layout = resolveLayout(req_layout, cur); enable = !owner_->forcePlainLayout() && !layout.empty(); - flag.setOnOff(isAlreadyLayout(layout, cur)); + status.setOnOff(isAlreadyLayout(layout, cur)); break; } @@ -3660,7 +3660,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, || (cur.paragraph().layout().pass_thru && !allow_in_passthru))) enable = false; - flag.setEnabled(enable); + status.setEnabled(enable); return true; } diff --git a/src/TextMetrics.h b/src/TextMetrics.h index f7f30fa08e..096f92a7eb 100644 --- a/src/TextMetrics.h +++ b/src/TextMetrics.h @@ -221,9 +221,9 @@ public: void setCursorFromCoordinates(Cursor & cur, int x, int y); /// - int cursorX(CursorSlice const & cursor, bool boundary) const; + int cursorX(CursorSlice const & sl, bool boundary) const; /// - int cursorY(CursorSlice const & cursor, bool boundary) const; + int cursorY(CursorSlice const & sl, bool boundary) const; /// bool cursorHome(Cursor & cur); diff --git a/src/frontends/qt/FloatPlacement.h b/src/frontends/qt/FloatPlacement.h index 96d45dfc45..fcdafc3400 100644 --- a/src/frontends/qt/FloatPlacement.h +++ b/src/frontends/qt/FloatPlacement.h @@ -47,7 +47,7 @@ public: /// void setPlacement(std::string const & placement); /// - void setAlignment(std::string const & placement); + void setAlignment(std::string const & alignment); /// std::string const getPlacement() const; /// diff --git a/src/frontends/qt/GuiClipboard.h b/src/frontends/qt/GuiClipboard.h index 9e48b4ee07..278adb8425 100644 --- a/src/frontends/qt/GuiClipboard.h +++ b/src/frontends/qt/GuiClipboard.h @@ -73,7 +73,7 @@ public: void put(std::string const & text) const override; void put(std::string const & lyx, docstring const & html, docstring const & text) override; bool hasGraphicsContents(GraphicsType type = AnyGraphicsType) const override; - bool hasTextContents(TextType typetype = AnyTextType) const override; + bool hasTextContents(TextType type = AnyTextType) const override; bool isInternal() const override; bool hasInternal() const override; bool empty() const override; diff --git a/src/frontends/qt/GuiCounter.h b/src/frontends/qt/GuiCounter.h index fb589d6c7d..d512a8b06e 100644 --- a/src/frontends/qt/GuiCounter.h +++ b/src/frontends/qt/GuiCounter.h @@ -40,7 +40,7 @@ private: bool checkWidgets(bool readonly) const override; bool initialiseParams(std::string const & data) override; //@} - void processParams(InsetCommandParams const & icp); + void processParams(InsetCommandParams const & params); /// void fillCombos(); /// diff --git a/src/frontends/qt/GuiGraphics.cpp b/src/frontends/qt/GuiGraphics.cpp index 142f433759..10764c19ca 100644 --- a/src/frontends/qt/GuiGraphics.cpp +++ b/src/frontends/qt/GuiGraphics.cpp @@ -492,7 +492,7 @@ void GuiGraphics::on_angle_textChanged(const QString & file_name) } -void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp) +void GuiGraphics::paramsToDialog(InsetGraphicsParams const & params) { static char const * const bb_units[] = { "bp", "cm", "mm", "in" }; static char const * const bb_units_gui[] = { N_("bp"), N_("cm"), N_("mm"), N_("in[[unit of measure]]") }; @@ -519,12 +519,12 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp) //lyxerr << bufferFilePath(); string const name = - igp.filename.outputFileName(fromqstr(bufferFilePath())); + params.filename.outputFileName(fromqstr(bufferFilePath())); filename->setText(toqstr(name)); // set the bounding box values - if (igp.bbox.empty()) { - string const bb = readBoundingBox(igp.filename.absFileName()); + if (params.bbox.empty()) { + string const bb = readBoundingBox(params.filename.absFileName()); // the values from the file always have the bigpoint-unit bp doubleToWidget(lbX, token(bb, ' ', 0)); doubleToWidget(lbY, token(bb, ' ', 1)); @@ -537,32 +537,32 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp) bbChanged = false; } else { // get the values from the inset - doubleToWidget(lbX, igp.bbox.xl.value()); - string unit = unit_name[igp.bbox.xl.unit()]; + doubleToWidget(lbX, params.bbox.xl.value()); + string unit = unit_name[params.bbox.xl.unit()]; lbXunit->setCurrentIndex(lbXunit->findData(toqstr(unit))); - doubleToWidget(lbY, igp.bbox.yb.value()); - unit = unit_name[igp.bbox.yb.unit()]; + doubleToWidget(lbY, params.bbox.yb.value()); + unit = unit_name[params.bbox.yb.unit()]; lbYunit->setCurrentIndex(lbYunit->findData(toqstr(unit))); - doubleToWidget(rtX, igp.bbox.xr.value()); - unit = unit_name[igp.bbox.xr.unit()]; + doubleToWidget(rtX, params.bbox.xr.value()); + unit = unit_name[params.bbox.xr.unit()]; rtXunit->setCurrentIndex(rtXunit->findData(toqstr(unit))); - doubleToWidget(rtY, igp.bbox.yt.value()); - unit = unit_name[igp.bbox.yt.unit()]; + doubleToWidget(rtY, params.bbox.yt.value()); + unit = unit_name[params.bbox.yt.unit()]; rtYunit->setCurrentIndex(rtYunit->findData(toqstr(unit))); bbChanged = true; } // Update the draft and clip mode - draftCB->setChecked(igp.draft); - clip->setChecked(igp.clip); - displayGB->setChecked(igp.display); - displayscale->setText(toqstr(convert(igp.lyxscale))); + draftCB->setChecked(params.draft); + clip->setChecked(params.clip); + displayGB->setChecked(params.display); + displayscale->setText(toqstr(convert(params.lyxscale))); // the output section (width/height) - doubleToWidget(Scale, igp.scale); + doubleToWidget(Scale, params.scale); //igp.scale defaults to 100, so we treat it as empty - bool const scaleChecked = !igp.scale.empty() && igp.scale != "100"; + bool const scaleChecked = !params.scale.empty() && params.scale != "100"; scaleCB->blockSignals(true); scaleCB->setChecked(scaleChecked); scaleCB->blockSignals(false); @@ -578,17 +578,17 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp) for (; it != end; ++it) groupCO->addItem(toqstr(*it), toqstr(*it)); groupCO->insertItem(0, qt_("None"), QString()); - if (igp.groupId.empty()) + if (params.groupId.empty()) groupCO->setCurrentIndex(0); else groupCO->setCurrentIndex( - groupCO->findData(toqstr(igp.groupId), Qt::MatchExactly)); + groupCO->findData(toqstr(params.groupId), Qt::MatchExactly)); groupCO->blockSignals(false); - if (igp.width.value() == 0) + if (params.width.value() == 0) lengthToWidgets(Width, widthUnit, _(autostr), defaultUnit); else - lengthToWidgets(Width, widthUnit, igp.width, defaultUnit); + lengthToWidgets(Width, widthUnit, params.width, defaultUnit); bool const widthChecked = !Width->text().isEmpty() && Width->text() != qt_(autostr); @@ -598,10 +598,10 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp) Width->setEnabled(widthChecked); widthUnit->setEnabled(widthChecked); - if (igp.height.value() == 0) + if (params.height.value() == 0) lengthToWidgets(Height, heightUnit, _(autostr), defaultUnit); else - lengthToWidgets(Height, heightUnit, igp.height, defaultUnit); + lengthToWidgets(Height, heightUnit, params.height, defaultUnit); bool const heightChecked = !Height->text().isEmpty() && Height->text() != qt_(autostr); @@ -618,11 +618,11 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp) setAutoText(); updateAspectRatioStatus(); - doubleToWidget(angle, igp.rotateAngle); - rotateOrderCB->setChecked(igp.scaleBeforeRotation); + doubleToWidget(angle, params.rotateAngle); + rotateOrderCB->setChecked(params.scaleBeforeRotation); rotateOrderCB->setEnabled( (widthChecked || heightChecked || scaleChecked) - && igp.rotateAngle != "0"); + && params.rotateAngle != "0"); origin->clear(); @@ -631,13 +631,13 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp) toqstr(rorigin_lyx_strs[i])); } - if (!igp.rotateOrigin.empty()) - origin->setCurrentIndex(origin->findData(toqstr(igp.rotateOrigin))); + if (!params.rotateOrigin.empty()) + origin->setCurrentIndex(origin->findData(toqstr(params.rotateOrigin))); else origin->setCurrentIndex(0); // latex section - latexoptions->setText(toqstr(igp.special)); + latexoptions->setText(toqstr(params.special)); // cf bug #3852 filename->setFocus(); } diff --git a/src/frontends/qt/qt_helpers.cpp b/src/frontends/qt/qt_helpers.cpp index d9cc3644e1..dcac28f734 100644 --- a/src/frontends/qt/qt_helpers.cpp +++ b/src/frontends/qt/qt_helpers.cpp @@ -686,7 +686,7 @@ QStringList fileFilters(QString const & desc) } -QString formatToolTip(QString text, int em) +QString formatToolTip(QString text, int width) { // 1. QTooltip activates word wrapping only if mightBeRichText() // is true. So we convert the text to rich text. @@ -704,9 +704,9 @@ QString formatToolTip(QString text, int em) // Compute desired width in pixels QFont const font = QToolTip::font(); #if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) - int const px_width = em * QFontMetrics(font).horizontalAdvance("M"); + int const px_width = width * QFontMetrics(font).horizontalAdvance("M"); #else - int const px_width = em * QFontMetrics(font).width("M"); + int const px_width = width * QFontMetrics(font).width("M"); #endif // Determine the ideal width of the tooltip QTextDocument td(""); @@ -723,12 +723,12 @@ QString formatToolTip(QString text, int em) } -QString qtHtmlToPlainText(QString const & html) +QString qtHtmlToPlainText(QString const & text) { - if (!Qt::mightBeRichText(html)) - return html; + if (!Qt::mightBeRichText(text)) + return text; QTextDocument td; - td.setHtml(html); + td.setHtml(text); return td.toPlainText(); } diff --git a/src/frontends/qt/qt_helpers.h b/src/frontends/qt/qt_helpers.h index 92c72f3b26..102c0137de 100644 --- a/src/frontends/qt/qt_helpers.h +++ b/src/frontends/qt/qt_helpers.h @@ -244,9 +244,9 @@ private: #endif -// Check if qstr is understood as rich text (Qt HTML) and if so, produce a +// Check if text is understood as rich text (Qt HTML) and if so, produce a // rendering in plain text. -QString qtHtmlToPlainText(QString const & qstr); +QString qtHtmlToPlainText(QString const & text); } // namespace lyx diff --git a/src/insets/ExternalTransforms.h b/src/insets/ExternalTransforms.h index 10c3dccd12..8b22f622c8 100644 --- a/src/insets/ExternalTransforms.h +++ b/src/insets/ExternalTransforms.h @@ -46,7 +46,7 @@ public: class ExtraData { public: std::string const get(std::string const & id) const; - void set(std::string const & id, std::string const & contents); + void set(std::string const & id, std::string const & data); typedef std::map::const_iterator const_iterator; const_iterator begin() const { return data_.begin(); } diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp index b561533998..14f9f7f19b 100644 --- a/src/insets/Inset.cpp +++ b/src/insets/Inset.cpp @@ -381,7 +381,7 @@ void Inset::doDispatch(Cursor & cur, FuncRequest &cmd) bool Inset::getStatus(Cursor &, FuncRequest const & cmd, - FuncStatus & flag) const + FuncStatus & status) const { // LFUN_INSET_APPLY is sent from the dialogs when the data should // be applied. This is either changed to LFUN_INSET_MODIFY (if the @@ -396,20 +396,20 @@ bool Inset::getStatus(Cursor &, FuncRequest const & cmd, // Allow modification of our data. // This needs to be handled in the doDispatch method of our // instantiatable children. - flag.setEnabled(true); + status.setEnabled(true); return true; case LFUN_INSET_INSERT: // Don't allow insertion of new insets. // Every inset that wants to allow new insets from open // dialogs needs to override this. - flag.setEnabled(false); + status.setEnabled(false); return true; case LFUN_INSET_SETTINGS: if (cmd.argument().empty() || cmd.getArg(0) == insetName(lyxCode())) { bool const enable = hasSettings(); - flag.setEnabled(enable); + status.setEnabled(enable); return true; } else { return false; @@ -417,12 +417,12 @@ bool Inset::getStatus(Cursor &, FuncRequest const & cmd, case LFUN_IN_MATHMACROTEMPLATE: // By default we're not in a InsetMathMacroTemplate inset - flag.setEnabled(false); + status.setEnabled(false); return true; case LFUN_IN_IPA: // By default we're not in an IPA inset - flag.setEnabled(false); + status.setEnabled(false); return true; default: diff --git a/src/insets/InsetGraphicsParams.cpp b/src/insets/InsetGraphicsParams.cpp index 9f55246098..a8c2a26239 100644 --- a/src/insets/InsetGraphicsParams.cpp +++ b/src/insets/InsetGraphicsParams.cpp @@ -82,25 +82,25 @@ void InsetGraphicsParams::init() } -void InsetGraphicsParams::copy(InsetGraphicsParams const & igp) +void InsetGraphicsParams::copy(InsetGraphicsParams const & params) { - filename = igp.filename; - lyxscale = igp.lyxscale; - display = igp.display; - scale = igp.scale; - width = igp.width; - height = igp.height; - keepAspectRatio = igp.keepAspectRatio; - draft = igp.draft; - scaleBeforeRotation = igp.scaleBeforeRotation; - - bbox = igp.bbox; - clip = igp.clip; - - rotateAngle = igp.rotateAngle; - rotateOrigin = igp.rotateOrigin; - special = igp.special; - groupId = igp.groupId; + filename = params.filename; + lyxscale = params.lyxscale; + display = params.display; + scale = params.scale; + width = params.width; + height = params.height; + keepAspectRatio = params.keepAspectRatio; + draft = params.draft; + scaleBeforeRotation = params.scaleBeforeRotation; + + bbox = params.bbox; + clip = params.clip; + + rotateAngle = params.rotateAngle; + rotateOrigin = params.rotateOrigin; + special = params.special; + groupId = params.groupId; } diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp index 3a61dfdccd..981fa536be 100644 --- a/src/insets/InsetInfo.cpp +++ b/src/insets/InsetInfo.cpp @@ -456,12 +456,12 @@ string InsetInfoParams::infoType() const -InsetInfo::InsetInfo(Buffer * buf, string const & name) +InsetInfo::InsetInfo(Buffer * buf, string const & info) : InsetCollapsible(buf), initialized_(false) { params_.type = InsetInfoParams::UNKNOWN_INFO; params_.force_ltr = false; - setInfo(name); + setInfo(info); status_ = Collapsed; } @@ -682,9 +682,9 @@ void InsetInfo::doDispatch(Cursor & cur, FuncRequest & cmd) } -void InsetInfo::setInfo(string const & name) +void InsetInfo::setInfo(string const & info) { - if (name.empty()) + if (info.empty()) return; string saved_date_specifier; @@ -693,7 +693,7 @@ void InsetInfo::setInfo(string const & name) saved_date_specifier = split(params_.name, '@'); // info_type name string type; - params_.name = trim(split(name, type, ' ')); + params_.name = trim(split(info, type, ' ')); params_.type = nameTranslator().find(type); if (params_.name.empty()) params_.name = defaultValueTranslator().find(params_.type); diff --git a/src/insets/InsetLabel.cpp b/src/insets/InsetLabel.cpp index eeced08451..b624cce119 100644 --- a/src/insets/InsetLabel.cpp +++ b/src/insets/InsetLabel.cpp @@ -161,19 +161,19 @@ docstring InsetLabel::screenLabel() const } -void InsetLabel::updateBuffer(ParIterator const & par, UpdateType utype, bool const /*deleted*/) +void InsetLabel::updateBuffer(ParIterator const & it, UpdateType utype, bool const /*deleted*/) { docstring const & label = getParam("name"); // Check if this one is active (i.e., neither deleted with change-tracking // nor in an inset that does not produce output, such as notes or inactive branches) - Paragraph const & para = par.paragraph(); - bool active = !para.isDeleted(par.pos()) && para.inInset().producesOutput(); + Paragraph const & para = it.paragraph(); + bool active = !para.isDeleted(it.pos()) && para.inInset().producesOutput(); // If not, check whether we are in a deleted/non-outputting inset if (active) { - for (size_type sl = 0 ; sl < par.depth() ; ++sl) { - Paragraph const & outer_par = par[sl].paragraph(); - if (outer_par.isDeleted(par[sl].pos()) + for (size_type sl = 0 ; sl < it.depth() ; ++sl) { + Paragraph const & outer_par = it[sl].paragraph(); + if (outer_par.isDeleted(it[sl].pos()) || !outer_par.inInset().producesOutput()) { active = false; break; @@ -194,7 +194,7 @@ void InsetLabel::updateBuffer(ParIterator const & par, UpdateType utype, bool co Counters const & cnts = buffer().masterBuffer()->params().documentClass().counters(); active_counter_ = cnts.currentCounter(); - Language const * lang = par->getParLanguage(buffer().params()); + Language const * lang = it->getParLanguage(buffer().params()); if (lang && !active_counter_.empty()) { counter_value_ = cnts.theCounter(active_counter_, lang->code()); pretty_counter_ = cnts.prettyCounter(active_counter_, lang->code()); diff --git a/src/insets/InsetListingsParams.cpp b/src/insets/InsetListingsParams.cpp index 54707418df..9390d6bbe4 100644 --- a/src/insets/InsetListingsParams.cpp +++ b/src/insets/InsetListingsParams.cpp @@ -948,12 +948,12 @@ docstring ParValidator::validate(string const & name, } -bool ParValidator::onoff(string const & name) const +bool ParValidator::onoff(string const & key) const { int p = InsetListingsParams::package(); // locate name in parameter table - ListingsParams::const_iterator it = all_params_[p].find(name); + ListingsParams::const_iterator it = all_params_[p].find(key); if (it != all_params_[p].end()) return it->second.onoff_; else diff --git a/src/insets/InsetSeparator.h b/src/insets/InsetSeparator.h index 3f8a84cb07..f7e0ab9059 100644 --- a/src/insets/InsetSeparator.h +++ b/src/insets/InsetSeparator.h @@ -43,7 +43,7 @@ public: /// InsetSeparator(); /// - explicit InsetSeparator(InsetSeparatorParams const & par); + explicit InsetSeparator(InsetSeparatorParams const & params); /// static void string2params(std::string const &, InsetSeparatorParams &); /// diff --git a/src/insets/InsetSpace.h b/src/insets/InsetSpace.h index 1d200764a4..5cf7aa7303 100644 --- a/src/insets/InsetSpace.h +++ b/src/insets/InsetSpace.h @@ -99,7 +99,7 @@ public: /// InsetSpace() : Inset(0) {} /// - explicit InsetSpace(InsetSpaceParams const & par); + explicit InsetSpace(InsetSpaceParams const & params); /// InsetSpaceParams const & params() const { return params_; } /// diff --git a/src/mathed/InsetMath.cpp b/src/mathed/InsetMath.cpp index 33a9a4e6b4..40cb906606 100644 --- a/src/mathed/InsetMath.cpp +++ b/src/mathed/InsetMath.cpp @@ -30,21 +30,21 @@ using namespace std; namespace lyx { -HullType hullType(docstring const & s) -{ - if (s == "none") return hullNone; - if (s == "simple") return hullSimple; - if (s == "equation") return hullEquation; - if (s == "eqnarray") return hullEqnArray; - if (s == "align") return hullAlign; - if (s == "alignat") return hullAlignAt; - if (s == "xalignat") return hullXAlignAt; - if (s == "xxalignat") return hullXXAlignAt; - if (s == "multline") return hullMultline; - if (s == "gather") return hullGather; - if (s == "flalign") return hullFlAlign; - if (s == "regexp") return hullRegexp; - lyxerr << "unknown hull type '" << to_utf8(s) << "'" << endl; +HullType hullType(docstring const & name) +{ + if (name == "none") return hullNone; + if (name == "simple") return hullSimple; + if (name == "equation") return hullEquation; + if (name == "eqnarray") return hullEqnArray; + if (name == "align") return hullAlign; + if (name == "alignat") return hullAlignAt; + if (name == "xalignat") return hullXAlignAt; + if (name == "xxalignat") return hullXXAlignAt; + if (name == "multline") return hullMultline; + if (name == "gather") return hullGather; + if (name == "flalign") return hullFlAlign; + if (name == "regexp") return hullRegexp; + lyxerr << "unknown hull type '" << to_utf8(name) << "'" << endl; return hullUnknown; } diff --git a/src/mathed/InsetMathAMSArray.h b/src/mathed/InsetMathAMSArray.h index 5186f5504e..ab9ead0bd0 100644 --- a/src/mathed/InsetMathAMSArray.h +++ b/src/mathed/InsetMathAMSArray.h @@ -34,7 +34,7 @@ public: /// void metrics(MetricsInfo & mi, Dimension & dim) const override; /// - void draw(PainterInfo & pain, int x, int y) const override; + void draw(PainterInfo & pi, int x, int y) const override; /// InsetMathAMSArray * asAMSArrayInset() override { return this; } /// diff --git a/src/mathed/InsetMathCases.cpp b/src/mathed/InsetMathCases.cpp index 5ddb9d015e..09ad0f8fa8 100644 --- a/src/mathed/InsetMathCases.cpp +++ b/src/mathed/InsetMathCases.cpp @@ -32,8 +32,8 @@ using namespace lyx::support; namespace lyx { -InsetMathCases::InsetMathCases(Buffer * buf, row_type n) - : InsetMathGrid(buf, 2, n, 'c', from_ascii("ll")) +InsetMathCases::InsetMathCases(Buffer * buf, row_type rows) + : InsetMathGrid(buf, 2, rows, 'c', from_ascii("ll")) {} diff --git a/src/mathed/InsetMathDots.h b/src/mathed/InsetMathDots.h index d2026de204..2650de0044 100644 --- a/src/mathed/InsetMathDots.h +++ b/src/mathed/InsetMathDots.h @@ -23,7 +23,7 @@ class latexkeys; class InsetMathDots : public InsetMath { public: /// - explicit InsetMathDots(latexkeys const * l); + explicit InsetMathDots(latexkeys const * key); /// void metrics(MetricsInfo & mi, Dimension & dim) const override; /// diff --git a/src/mathed/InsetMathMacroTemplate.cpp b/src/mathed/InsetMathMacroTemplate.cpp index 294e24b073..1152936ee2 100644 --- a/src/mathed/InsetMathMacroTemplate.cpp +++ b/src/mathed/InsetMathMacroTemplate.cpp @@ -1087,7 +1087,7 @@ void InsetMathMacroTemplate::doDispatch(Cursor & cur, FuncRequest & cmd) bool InsetMathMacroTemplate::getStatus(Cursor & cur, FuncRequest const & cmd, - FuncStatus & flag) const + FuncStatus & status) const { bool ret = true; string const arg = to_utf8(cmd.argument()); @@ -1098,12 +1098,12 @@ bool InsetMathMacroTemplate::getStatus(Cursor & cur, FuncRequest const & cmd, num = convert(arg); bool on = (num >= optionals_ && numargs_ < 9 && num <= numargs_ + 1); - flag.setEnabled(on); + status.setEnabled(on); break; } case LFUN_MATH_MACRO_APPEND_GREEDY_PARAM: - flag.setEnabled(numargs_ < 9); + status.setEnabled(numargs_ < 9); break; case LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM: @@ -1111,40 +1111,40 @@ bool InsetMathMacroTemplate::getStatus(Cursor & cur, FuncRequest const & cmd, int num = numargs_; if (!arg.empty()) num = convert(arg); - flag.setEnabled(num >= 1 && num <= numargs_); + status.setEnabled(num >= 1 && num <= numargs_); break; } case LFUN_MATH_MACRO_MAKE_OPTIONAL: - flag.setEnabled(numargs_ > 0 + status.setEnabled(numargs_ > 0 && optionals_ < numargs_ && type_ != MacroTypeDef); break; case LFUN_MATH_MACRO_MAKE_NONOPTIONAL: - flag.setEnabled(optionals_ > 0 + status.setEnabled(optionals_ > 0 && type_ != MacroTypeDef); break; case LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM: - flag.setEnabled(numargs_ < 9); + status.setEnabled(numargs_ < 9); break; case LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM: - flag.setEnabled(optionals_ > 0); + status.setEnabled(optionals_ > 0); break; case LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM: - flag.setEnabled(numargs_ == 0 + status.setEnabled(numargs_ == 0 && type_ != MacroTypeDef); break; case LFUN_IN_MATHMACROTEMPLATE: - flag.setEnabled(true); + status.setEnabled(true); break; default: - ret = InsetMathNest::getStatus(cur, cmd, flag); + ret = InsetMathNest::getStatus(cur, cmd, status); break; } return ret; diff --git a/src/mathed/InsetMathMacroTemplate.h b/src/mathed/InsetMathMacroTemplate.h index 24a0b14875..09408968d6 100644 --- a/src/mathed/InsetMathMacroTemplate.h +++ b/src/mathed/InsetMathMacroTemplate.h @@ -29,8 +29,8 @@ public: /// explicit InsetMathMacroTemplate(Buffer * buf); /// - InsetMathMacroTemplate(Buffer * buf, docstring const & name, int nargs, - int optional, MacroType type, + InsetMathMacroTemplate(Buffer * buf, docstring const & name, int numargs, + int optionals, MacroType type, std::vector const & optionalValues = std::vector(), MathData const & def = MathData(), MathData const & display = MathData()); diff --git a/src/mathed/InsetMathUnknown.cpp b/src/mathed/InsetMathUnknown.cpp index 926e7dd5d5..e79a17c015 100644 --- a/src/mathed/InsetMathUnknown.cpp +++ b/src/mathed/InsetMathUnknown.cpp @@ -23,9 +23,9 @@ namespace lyx { -InsetMathUnknown::InsetMathUnknown(docstring const & nm, +InsetMathUnknown::InsetMathUnknown(docstring const & name, docstring const & selection, bool final, bool black) - : name_(nm), final_(final), black_(black), kerning_(0), + : name_(name), final_(final), black_(black), kerning_(0), selection_(selection) {} diff --git a/src/mathed/MacroTable.cpp b/src/mathed/MacroTable.cpp index c1a4c49312..fb2a9e08a4 100644 --- a/src/mathed/MacroTable.cpp +++ b/src/mathed/MacroTable.cpp @@ -63,7 +63,7 @@ MacroData::MacroData(Buffer * buf, InsetMathMacroTemplate const & macro) } -bool MacroData::expand(vector const & args, MathData & to) const +bool MacroData::expand(vector const & from, MathData & to) const { updateData(); @@ -82,9 +82,9 @@ bool MacroData::expand(vector const & args, MathData & to) const //it.cell().erase(it.pos()); //it.cell().insert(it.pos(), it.nextInset()->asInsetMath() size_t n = static_cast(it.nextInset())->number(); - if (n <= args.size()) { + if (n <= from.size()) { it.cell().erase(it.pos()); - it.cell().insert(it.pos(), args[n - 1]); + it.cell().insert(it.pos(), from[n - 1]); } } //LYXERR0("MathData::expand: res: " << inset.cell(0)); @@ -249,11 +249,11 @@ MacroTable::insert(docstring const & name, MacroData const & data) MacroTable::iterator -MacroTable::insert(Buffer * buf, docstring const & def) +MacroTable::insert(Buffer * buf, docstring const & definition) { //lyxerr << "MacroTable::insert, def: " << to_utf8(def) << endl; InsetMathMacroTemplate mac(buf); - mac.fromString(def); + mac.fromString(definition); MacroData data(buf, mac); return insert(mac.name(), data); } diff --git a/src/mathed/TextPainter.cpp b/src/mathed/TextPainter.cpp index 7ff8368d6b..fb7e7ff3a5 100644 --- a/src/mathed/TextPainter.cpp +++ b/src/mathed/TextPainter.cpp @@ -42,16 +42,16 @@ void TextPainter::draw(int x, int y, char_type const * str) } -void TextPainter::horizontalLine(int x, int y, int n, char_type c) +void TextPainter::horizontalLine(int x, int y, int len, char_type c) { - for (int i = 0; i < n && i + x < xmax_; ++i) + for (int i = 0; i < len && i + x < xmax_; ++i) at(x + i, y) = c; } -void TextPainter::verticalLine(int x, int y, int n, char_type c) +void TextPainter::verticalLine(int x, int y, int len, char_type c) { - for (int i = 0; i < n && i + y < ymax_; ++i) + for (int i = 0; i < len && i + y < ymax_; ++i) at(x, y + i) = c; } diff --git a/src/output_plaintext.h b/src/output_plaintext.h index ebecc5ceba..8b2e4f9d1c 100644 --- a/src/output_plaintext.h +++ b/src/output_plaintext.h @@ -36,7 +36,7 @@ void writePlaintextFile(Buffer const & buf, odocstream &, OutputParams const &); /// void writePlaintextParagraph(Buffer const & buf, - Paragraph const & paragraphs, + Paragraph const & par, odocstream & ofs, OutputParams const &, bool & ref_printed, diff --git a/src/tex2lyx/tex2lyx.h b/src/tex2lyx/tex2lyx.h index c73785ee88..cd7323ba0d 100644 --- a/src/tex2lyx/tex2lyx.h +++ b/src/tex2lyx/tex2lyx.h @@ -81,7 +81,7 @@ void parse_math(Parser & p, std::ostream & os, unsigned flags, mode_type mode); /// in table.cpp void handle_tabular(Parser & p, std::ostream & os, std::string const & name, - std::string const & width, std::string const & halign, + std::string const & tabularwidth, std::string const & halign, Context const & context); -- 2.39.5