Match header/source function argument naming

This commit is contained in:
Yuriy Skalko 2020-10-31 19:18:51 +02:00
parent 5061db891c
commit d38eddb397
53 changed files with 249 additions and 249 deletions

View File

@ -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<Buffer *>(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);
}
}

View File

@ -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;
}
}

View File

@ -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<pit_type, ParagraphMetrics const *> 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<pit_type, ParagraphMetrics const *> 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;
}

View File

@ -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;
}

View File

@ -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

View File

@ -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.

View File

@ -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_; }

View File

@ -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());
}

View File

@ -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);
}

View File

@ -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());
}

View File

@ -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)
{}

View File

@ -45,11 +45,11 @@ bool Graph::bfs_init(int s, bool clear_visited, queue<int> & Q)
Graph::EdgePath const
Graph::getReachableTo(int target, bool clear_visited)
Graph::getReachableTo(int to, bool clear_visited)
{
EdgePath result;
queue<int> 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<Arrow *>::iterator it = vertices_[current].in_arrows.begin();

View File

@ -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);
/**

View File

@ -832,15 +832,15 @@ TexString getSnippets(std::list<TexString> 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);
}

View File

@ -142,7 +142,7 @@ public:
void getFontEncodings(std::vector<std::string> & encodings,
bool const onlylangs = false) const;
///
void useLayout(docstring const & lyt);
void useLayout(docstring const & layoutname);
///
void useInsetLayout(InsetLayout const & lay);
///

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}

View File

@ -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<int N> void pushTable(LexerKeyword (&table)[N])

View File

@ -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);

View File

@ -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

View File

@ -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);
}

View File

@ -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());
}

View File

@ -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();
///

View File

@ -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);
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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);

View File

@ -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;
///

View File

@ -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;

View File

@ -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();
///

View File

@ -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<string>(igp.lyxscale)));
draftCB->setChecked(params.draft);
clip->setChecked(params.clip);
displayGB->setChecked(params.display);
displayscale->setText(toqstr(convert<string>(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();
}

View File

@ -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();
}

View File

@ -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

View File

@ -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<std::string, std::string>::const_iterator const_iterator;
const_iterator begin() const { return data_.begin(); }

View File

@ -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:

View File

@ -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;
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 = igp.bbox;
clip = igp.clip;
bbox = params.bbox;
clip = params.clip;
rotateAngle = igp.rotateAngle;
rotateOrigin = igp.rotateOrigin;
special = igp.special;
groupId = igp.groupId;
rotateAngle = params.rotateAngle;
rotateOrigin = params.rotateOrigin;
special = params.special;
groupId = params.groupId;
}

View File

@ -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);

View File

@ -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());

View File

@ -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

View File

@ -43,7 +43,7 @@ public:
///
InsetSeparator();
///
explicit InsetSeparator(InsetSeparatorParams const & par);
explicit InsetSeparator(InsetSeparatorParams const & params);
///
static void string2params(std::string const &, InsetSeparatorParams &);
///

View File

@ -99,7 +99,7 @@ public:
///
InsetSpace() : Inset(0) {}
///
explicit InsetSpace(InsetSpaceParams const & par);
explicit InsetSpace(InsetSpaceParams const & params);
///
InsetSpaceParams const & params() const { return params_; }
///

View File

@ -30,21 +30,21 @@ using namespace std;
namespace lyx {
HullType hullType(docstring const & s)
HullType hullType(docstring const & name)
{
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;
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;
}

View File

@ -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; }
///

View File

@ -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"))
{}

View File

@ -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;
///

View File

@ -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<int>(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<int>(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;

View File

@ -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<MathData> const & optionalValues = std::vector<MathData>(),
MathData const & def = MathData(),
MathData const & display = MathData());

View File

@ -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)
{}

View File

@ -63,7 +63,7 @@ MacroData::MacroData(Buffer * buf, InsetMathMacroTemplate const & macro)
}
bool MacroData::expand(vector<MathData> const & args, MathData & to) const
bool MacroData::expand(vector<MathData> const & from, MathData & to) const
{
updateData();
@ -82,9 +82,9 @@ bool MacroData::expand(vector<MathData> const & args, MathData & to) const
//it.cell().erase(it.pos());
//it.cell().insert(it.pos(), it.nextInset()->asInsetMath()
size_t n = static_cast<InsetMathMacroArgument*>(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);
}

View File

@ -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;
}

View File

@ -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,

View File

@ -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);