Use const references

This commit is contained in:
Yuriy Skalko 2020-10-31 15:09:46 +02:00
parent 6e65967e15
commit 5061db891c
50 changed files with 79 additions and 79 deletions

View File

@ -1183,9 +1183,8 @@ bool Buffer::readString(string const & s)
Buffer::ReadStatus Buffer::readFile(FileName const & fn)
{
FileName fname(fn);
Lexer lex;
if (!lex.setFile(fname)) {
if (!lex.setFile(fn)) {
Alert::error(_("File Not Found"),
bformat(_("Unable to open file `%1$s'."),
from_utf8(fn.absFileName())));
@ -2702,7 +2701,7 @@ bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag)
break;
case LFUN_BUFFER_EXPORT: {
docstring const arg = cmd.argument();
docstring const & arg = cmd.argument();
if (arg == "custom") {
enable = true;
break;
@ -2731,7 +2730,7 @@ bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag)
|| cmd.action() == LFUN_BRANCH_MASTER_DEACTIVATE);
BranchList const & branchList = master ? masterBuffer()->params().branchlist()
: params().branchlist();
docstring const branchName = cmd.argument();
docstring const & branchName = cmd.argument();
flag.setEnabled(!branchName.empty() && branchList.find(branchName));
break;
}
@ -2893,7 +2892,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
Buffer * buf = master ? const_cast<Buffer *>(masterBuffer())
: this;
docstring const branch_name = func.argument();
docstring const & branch_name = func.argument();
// the case without a branch name is handled elsewhere
if (branch_name.empty()) {
dispatched = false;
@ -2921,7 +2920,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
}
case LFUN_BRANCH_ADD: {
docstring branchnames = func.argument();
docstring const & branchnames = func.argument();
if (branchnames.empty()) {
dispatched = false;
break;

View File

@ -1122,7 +1122,7 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
break;
case LFUN_FILE_INSERT_PLAINTEXT_PARA:
case LFUN_FILE_INSERT_PLAINTEXT: {
docstring const fname = cmd.argument();
docstring const & fname = cmd.argument();
if (!FileName::isAbsolute(to_utf8(fname))) {
flag.message(_("Absolute filename expected."));
return false;

View File

@ -103,7 +103,7 @@ public:
DocPair()
{}
DocPair(DocIterator o_, DocIterator n_)
DocPair(DocIterator const & o_, DocIterator const & n_)
: o(o_), n(n_)
{}

View File

@ -1627,10 +1627,9 @@ int LaTeX::scanBlgFile(DepTable & dep, TeXErrors & terr)
} else if (regex_match(token, sub, biberError)) {
retval |= BIBTEX_ERROR;
string errstr = N_("Biber error: ") + sub.str(2);
string msg = token;
terr.insertError(0,
from_local8bit(errstr),
from_local8bit(msg));
from_local8bit(token));
}
prevtoken = token;
}
@ -1664,10 +1663,9 @@ int LaTeX::scanIlgFile(TeXErrors & terr)
} else if (prefixIs(token, "ERROR: ")) {
retval |= BIBTEX_ERROR;
string errstr = N_("Xindy error: ") + token.substr(6);
string msg = token;
terr.insertError(0,
from_local8bit(errstr),
from_local8bit(msg));
from_local8bit(token));
}
}
return retval;

View File

@ -89,7 +89,7 @@ string Language::fontenc(BufferParams const & params) const
// We check whether the used rm font supports an encoding our language supports
LaTeXFont const & lf =
theLaTeXFonts().getLaTeXFont(from_ascii(params.fontsRoman()));
vector<string> const lfe = lf.fontencs();
vector<string> const & lfe = lf.fontencs();
for (auto & fe : fontenc_) {
// ASCII means: support all T* encodings plus OT1
if (fe == "ASCII") {

View File

@ -1885,7 +1885,7 @@ string const & Layout::docbookattr() const
}
bool isValidTagType(std::string type)
bool isValidTagType(std::string const & type)
{
return !(type.empty() || (type != "block" && type != "paragraph" && type != "inline"));
}

View File

@ -168,7 +168,7 @@ void ParagraphParameters::leftIndent(Length const & li)
}
void ParagraphParameters::read(string str, bool merge)
void ParagraphParameters::read(string const & str, bool merge)
{
istringstream is(str);
Lexer lex;

View File

@ -76,7 +76,7 @@ public:
void leftIndent(Length const &);
/// read the parameters from a string
void read (std::string str, bool merge = true);
void read (std::string const & str, bool merge = true);
/// read the parameters from a lex
void read(Lexer & lex, bool merge = true);

View File

@ -1108,7 +1108,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_NEWLINE_INSERT: {
InsetNewlineParams inp;
docstring arg = cmd.argument();
docstring const & arg = cmd.argument();
if (arg == "linebreak")
inp.kind = InsetNewlineParams::LINEBREAK;
else

View File

@ -2045,6 +2045,7 @@ vector<string> const DocumentClass::citeCommands(
{
vector<CitationStyle> const styles = citeStyles(type);
vector<string> cmds;
cmds.reserve(styles.size());
for (auto const & cs : styles)
cmds.push_back(cs.name);

View File

@ -217,7 +217,7 @@ Thesaurus::Meanings Thesaurus::lookup(WordLangTuple const & wl)
MyThes * mythes = nullptr;
docstring const lang_code = from_ascii(wl.lang()->code());
docstring const t = wl.word();
docstring const & t = wl.word();
if (!d->addThesaurus(lang_code))
return meanings;
@ -266,6 +266,7 @@ Thesaurus::Meanings Thesaurus::lookup(WordLangTuple const & wl)
// remove silly item
if (support::prefixIs(meaning, '-'))
meaning = support::ltrim(meaning, "- ");
ret.reserve(pm->count);
for (int j = 0; j < pm->count; j++) {
ret.push_back(from_iconv_encoding(string(pm->psyns[j]), encoding));
}

View File

@ -215,7 +215,7 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
}
case LFUN_INDEX_INSERT: {
docstring arg = cmd.argument();
docstring const & arg = cmd.argument();
return new InsetIndex(buf, InsetIndexParams(arg));
}
@ -341,7 +341,7 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
}
case INDEX_CODE: {
docstring arg = cmd.argument();
docstring const & arg = cmd.argument();
return new InsetIndex(buf, InsetIndexParams(arg));
}

View File

@ -3002,7 +3002,7 @@ static QStringList uifiles;
static QStringList toolbar_uifiles;
GuiApplication::ReturnValues GuiApplication::readUIFile(FileName ui_path)
GuiApplication::ReturnValues GuiApplication::readUIFile(FileName const & ui_path)
{
enum {
ui_menuset = 1,

View File

@ -242,7 +242,7 @@ private:
FormatMismatch
};
///
ReturnValues readUIFile(support::FileName);
ReturnValues readUIFile(support::FileName const & ui_path);
///
void setGuiLanguage();
///

View File

@ -957,7 +957,7 @@ void GuiCitation::clearParams()
void GuiCitation::filterByEntryType(BiblioInfo const & bi,
vector<docstring> & keyVector, docstring entry_type)
vector<docstring> & keyVector, docstring const & entry_type)
{
if (entry_type.empty())
return;
@ -1009,7 +1009,7 @@ static docstring escape_special_chars(docstring const & expr)
vector<docstring> GuiCitation::searchKeys(BiblioInfo const & bi,
vector<docstring> const & keys_to_search, bool only_keys,
docstring const & search_expression, docstring field,
docstring const & search_expression, docstring const & field,
bool case_sensitive, bool regex)
{
vector<docstring> foundKeys;

View File

@ -150,7 +150,7 @@ private:
///
void filterByEntryType(BiblioInfo const & bi,
std::vector<docstring> & keyVector, docstring entryType);
std::vector<docstring> & keyVector, docstring const & entryType);
/// Search a given string within the passed keys.
/// \return the vector of matched keys.
@ -159,7 +159,7 @@ private:
std::vector<docstring> const & keys_to_search, //< Keys to search.
bool only_keys, //< whether to search only the keys
docstring const & search_expression, //< Search expression (regex possible)
docstring field, //< field to search, empty for all fields
docstring const & field, //< field to search, empty for all fields
bool case_sensitive = false, //< set to true is the search should be case sensitive
bool regex = false //< \set to true if \c search_expression is a regex
); //

View File

@ -345,7 +345,7 @@ namespace {
* Since we are going to write a HTML file for external converters we need
* to ensure that it is a well formed HTML file, including all the mentioned tags.
*/
QString tidyHtml(QString input)
QString tidyHtml(QString const & input)
{
// Misuse QTextDocument to cleanup the HTML.
// As a side effect, all visual markup like <tt> is converted to CSS,

View File

@ -244,7 +244,7 @@ void GuiCompare::progressMax(int max) const
}
void GuiCompare::setStatusMessage(QString msg)
void GuiCompare::setStatusMessage(QString const & msg)
{
statusBar->showMessage(msg);
}

View File

@ -57,7 +57,7 @@ private Q_SLOTS:
///
void progressMax(int) const;
///
void setStatusMessage(QString);
void setStatusMessage(QString const &);
private:
///

View File

@ -139,7 +139,7 @@ void initMathSymbols()
}
/// \return the math unicode symbol associated to a TeX name.
MathSymbol const & mathSymbol(string tex_name)
MathSymbol const & mathSymbol(string const & tex_name)
{
map<string, MathSymbol>::const_iterator it =
math_symbols_.find(tex_name);
@ -216,7 +216,7 @@ GuiDelimiter::GuiDelimiter(GuiView & lv)
QChar(ms.fontcode) : toqstr(docstring(1, ms.unicode)));
QListWidgetItem * lwi = new QListWidgetItem(symbol);
lyxfont.setFamily(ms.fontfamily);
QFont font = frontend::getFont(lyxfont);
QFont const & font = frontend::getFont(lyxfont);
lwi->setFont(font);
setDelimiterName(lwi, delim);
lwi->setToolTip(toqstr(delim));

View File

@ -3309,7 +3309,7 @@ void GuiDocument::getTableStyles()
<< toqstr(system);
for (int i = 0; i < dirs.size(); ++i) {
QString const dir = dirs.at(i);
QString const & dir = dirs.at(i);
QDirIterator it(dir, QDir::Files, QDirIterator::Subdirectories);
while (it.hasNext()) {
QString fn = QFileInfo(it.next()).fileName();

View File

@ -37,7 +37,7 @@ namespace frontend {
namespace {
QString const guiString(QString in)
QString const guiString(QString const & in)
{
// recode specially encoded chars in file names (URL encoding and underbar)
return QString::fromUtf8(QByteArray::fromPercentEncoding(in.toUtf8())).replace('_', ' ');
@ -76,7 +76,7 @@ QMap<QString, QString> GuiLyXFiles::getFiles()
<< toqstr(system);
for (int i = 0; i < dirs.size(); ++i) {
QString const dir = dirs.at(i);
QString const & dir = dirs.at(i);
QDirIterator it(dir, QDir::Files, QDirIterator::Subdirectories);
while (it.hasNext()) {
QString fn(QFile(it.next()).fileName());

View File

@ -240,7 +240,7 @@ void GuiPainter::image(int x, int y, int w, int h, graphics::Image const & i)
fillRectangle(x, y, w, h, Color_graphicsbg);
QImage const image = qlimage.image();
QImage const & image = qlimage.image();
QRectF const drect = QRectF(x, y, w, h);
QRectF const srect = QRectF(0, 0, image.width(), image.height());
// Bilinear filtering is needed on a rare occasion for instant previews when

View File

@ -1206,8 +1206,8 @@ void PrefColors::resetAllColor()
}
bool PrefColors::setColor(int const row, QColor const new_color,
QString const old_color)
bool PrefColors::setColor(int const row, QColor const & new_color,
QString const & old_color)
{
if (new_color.isValid() && new_color.name() != old_color) {
newcolors_[size_t(row)] = new_color.name();
@ -1244,7 +1244,7 @@ void PrefColors::setDisabledResets()
}
bool PrefColors::isDefaultColor(int const row, QString const color)
bool PrefColors::isDefaultColor(int const row, QString const & color)
{
return color == getDefaultColorByRow(row).name();
}

View File

@ -255,9 +255,9 @@ private Q_SLOTS:
void resetAllColor();
void changeSysColor();
void changeLyxObjectsSelection();
bool setColor(int const row, QColor const new_color,
QString const old_color);
bool isDefaultColor(int const row, QString const color);
bool setColor(int const row, QColor const & new_color,
QString const & old_color);
bool isDefaultColor(int const row, QString const & color);
void setDisabledResets();
private:

View File

@ -483,11 +483,11 @@ void GuiRef::redoRefs()
if (groupCB->isChecked()) {
QList<QTreeWidgetItem *> refsCats;
for (int i = 0; i < refsCategories.size(); ++i) {
QString const cat = refsCategories.at(i);
QString const & cat = refsCategories.at(i);
QTreeWidgetItem * item = new QTreeWidgetItem(refsTW);
item->setText(0, cat);
for (int j = 0; j < refsStrings.size(); ++j) {
QString const ref = refsStrings.at(j);
QString const & ref = refsStrings.at(j);
if ((ref.startsWith(cat + QString(":")))
|| (cat == qt_("<No prefix>")
&& (!ref.mid(1).contains(":") || ref.left(1).contains(":")))) {

View File

@ -54,7 +54,7 @@ void GuiTabularCreate::getFiles()
<< toqstr(system);
for (int i = 0; i < dirs.size(); ++i) {
QString const dir = dirs.at(i);
QString const & dir = dirs.at(i);
QDirIterator it(dir, QDir::Files, QDirIterator::Subdirectories);
while (it.hasNext()) {
QString fn = QFileInfo(it.next()).fileName();

View File

@ -2193,7 +2193,7 @@ void GuiWorkAreaContainer::updateDisplay()
}
void GuiWorkAreaContainer::dispatch(FuncRequest f) const
void GuiWorkAreaContainer::dispatch(FuncRequest const & f) const
{
lyx::dispatch(FuncRequest(LFUN_BUFFER_SWITCH,
wa_->bufferView().buffer().absFileName()));

View File

@ -280,7 +280,7 @@ class GuiWorkAreaContainer : public QWidget, public Ui::WorkAreaUi
Q_OBJECT
// non-null
GuiWorkArea * const wa_;
void dispatch(FuncRequest f) const;
void dispatch(FuncRequest const & f) const;
private Q_SLOTS:
void updateDisplay();

View File

@ -358,7 +358,7 @@ public:
void expandFloatInsert(Buffer const * buf);
void expandFlexInsert(Buffer const * buf, InsetLayout::InsetLyXType type);
void expandTocSubmenu(std::string const & type, Toc const & toc_list);
void expandToc2(Toc const & toc_list, size_t from, size_t to, int depth, string toc_type);
void expandToc2(Toc const & toc_list, size_t from, size_t to, int depth, const string &toc_type);
void expandToc(Buffer const * buf);
void expandPasteRecent(Buffer const * buf);
void expandToolbars();
@ -1258,7 +1258,7 @@ size_t const menu_size_limit = 80;
void MenuDefinition::expandToc2(Toc const & toc_list,
size_t from, size_t to, int depth,
string toc_type)
string const & toc_type)
{
int shortcut_count = 0;

View File

@ -365,7 +365,7 @@ void TocWidget::sendDispatch(FuncRequest fr)
{
fr.setViewOrigin(&gui_view_);
DispatchResult dr=dispatch(fr);
DispatchResult const & dr = dispatch(fr);
if (dr.error())
gui_view_.message(dr.message());
}

View File

@ -310,7 +310,8 @@ void InsetBibtex::latex(otexstream & os, OutputParams const & runparams) const
vector<pair<docstring, string>> const dbs =
buffer().prepareBibFilePaths(runparams, getBibFiles(), false);
vector<docstring> db_out;
for (pair<docstring, string> const & db : dbs)
db_out.reserve(dbs.size());
for (pair<docstring, string> const & db : dbs)
db_out.push_back(db.first);
// Style options
if (style == "default")

View File

@ -190,7 +190,7 @@ void InsetCommand::validate(LaTeXFeatures & features) const
void InsetCommand::changeCmdName(string const & new_name)
{
string const old_name = getCmdName();
string const & old_name = getCmdName();
if (old_name == new_name)
return;

View File

@ -536,7 +536,7 @@ void InsetRef::addToToc(DocIterator const & cpit, bool output_active,
void InsetRef::validate(LaTeXFeatures & features) const
{
string const cmd = getCmdName();
string const & cmd = getCmdName();
if (cmd == "vref" || cmd == "vpageref")
features.require("varioref");
else if (cmd == "formatted") {

View File

@ -7331,7 +7331,7 @@ ParagraphList InsetTabular::asParList(idx_type stidx, idx_type enidx)
row_type const row2 = tabular.cellRow(enidx);
for (col_type col = col1; col <= col2; col++)
for (row_type row = row1; row <= row2; row++)
for (auto par : tabular.cellInset(row, col)->paragraphs())
for (auto const & par : tabular.cellInset(row, col)->paragraphs())
retval.push_back(par);
return retval;
}

View File

@ -1011,7 +1011,7 @@ pit_type InsetText::openAddToTocForParagraph(pit_type pit,
{
Paragraph const & par = paragraphs()[pit];
TocBuilder & b = backend.builder(par.layout().tocType());
docstring const label = par.labelString();
docstring const & label = par.labelString();
b.pushItem(dit, label + (label.empty() ? "" : " "), output_active);
return text().lastInSequence(pit);
}
@ -1130,7 +1130,7 @@ string InsetText::contextMenuName() const
}
docstring InsetText::toolTipText(docstring prefix, size_t const len) const
docstring InsetText::toolTipText(docstring const & prefix, size_t const len) const
{
OutputParams rp(&buffer().params().encoding());
rp.for_tooltip = true;

View File

@ -215,7 +215,7 @@ public:
/// of that sort. (Note: unnecessary internal copies have been removed
/// since the previous note. The efficiency would have to be assessed
/// again by profiling.)
docstring toolTipText(docstring prefix = empty_docstring(),
docstring toolTipText(docstring const & prefix = empty_docstring(),
size_t len = 400) const;
///

View File

@ -1215,7 +1215,7 @@ void InsetMathGrid::mathmlize(MathStream & ms) const
// FIXME XHTML
// We need to do something about alignment here.
void InsetMathGrid::htmlize(HtmlStream & os, string attrib) const
void InsetMathGrid::htmlize(HtmlStream & os, string const & attrib) const
{
bool const havetable = nrows() > 1 || ncols() > 1;
if (!havetable) {

View File

@ -231,7 +231,7 @@ public:
///
void htmlize(HtmlStream &) const override;
///
void htmlize(HtmlStream &, std::string attrib) const;
void htmlize(HtmlStream &, std::string const & attrib) const;
///
void validate(LaTeXFeatures & features) const override;
///

View File

@ -100,13 +100,13 @@ void mathed_draw_root(PainterInfo & pi, int x, int y, MathData const & nucleus,
int const a = dim.ascent();
int const d = dim.descent();
int const t = pi.base.solidLineThickness();
Dimension const dimn = nucleus.dimension(*pi.base.bv);
Dimension const & dimn = nucleus.dimension(*pi.base.bv);
// the width of the left part of the root
int const wl = dim.width() - dimn.width();
// the "exponent"
if (root) {
Changer script = pi.base.font.changeStyle(SCRIPTSCRIPT_STYLE);
Dimension const dimr = root->dimension(*pi.base.bv);
Dimension const & dimr = root->dimension(*pi.base.bv);
int const root_offset = wl - 3 * w / 8 - dimr.width();
root->draw(pi, x + root_offset, y + (d - a)/2);
}

View File

@ -1881,7 +1881,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
bool const prot = nextToken().character() == '*';
if (prot)
getToken();
docstring const name = t.cs();
docstring const & name = t.cs();
docstring const arg = parse_verbatim_item();
Length length;
if (prot && arg == "\\fill")

View File

@ -168,7 +168,7 @@ public:
void setSecondStream(std::ostream * os)
{ second_enabled_ = (second_stream_ = os); }
/// Is the second stream is enabled?
bool secondEnabled() { return second_enabled_; }
bool secondEnabled() const { return second_enabled_; }
/// Sets the debug level
void setLevel(Debug::Type t) { dt_ = t; }

View File

@ -383,7 +383,7 @@ SetEnc setEncoding(string const & encoding)
}
odocstream & operator<<(odocstream & os, SetEnc e)
odocstream & operator<<(odocstream & os, SetEnc const & e)
{
if (has_facet<iconv_codecvt_facet>(os.rdbuf()->getloc())) {
// This stream must be a file stream, since we never imbue
@ -413,7 +413,7 @@ odocstream & operator<<(odocstream & os, SetEnc e)
}
idocstream & operator<<(idocstream & is, SetEnc e)
idocstream & operator<<(idocstream & is, SetEnc const & e)
{
if (has_facet<iconv_codecvt_facet>(is.rdbuf()->getloc())) {
// This stream must be a file stream, since we never imbue

View File

@ -111,8 +111,8 @@ SetEnc setEncoding(std::string const & encoding);
os << setEncoding("ISO-8859-1");
\endcode
*/
odocstream & operator<<(odocstream & os, SetEnc e);
idocstream & operator<<(idocstream & os, SetEnc e);
odocstream & operator<<(odocstream & os, SetEnc const & e);
idocstream & operator<<(idocstream & os, SetEnc const & e);
} // namespace lyx

View File

@ -442,7 +442,7 @@ string const commandPrep(string const & command_in)
}
FileName const tempFileName(FileName tempdir, string const & mask, bool const dir)
FileName const tempFileName(FileName const & tempdir, string const & mask, bool const dir)
{
return tempFileName(TempFile(tempdir, mask).name(), dir);
}

View File

@ -42,7 +42,7 @@ static std::set<std::string> tmp_names_;
*/
FileName const tempFileName(FileName, bool const dir = false);
/// Get temporary file name with custom path
FileName const tempFileName(FileName, std::string const &, bool const dir = false);
FileName const tempFileName(FileName const &, std::string const &, bool const dir = false);
/// Get temporary file name with default path
FileName const tempFileName(std::string const &, bool const dir = false);

View File

@ -129,7 +129,7 @@ void iparserdocstream::putback(char_type c)
}
void iparserdocstream::putback(docstring s)
void iparserdocstream::putback(docstring const & s)
{
s_ = s + s_;
}

View File

@ -139,7 +139,7 @@ public:
// add to the list of characters to read before actually reading
// the stream
void putback(docstring s);
void putback(const docstring &s);
/// Like std::istream::get()
iparserdocstream & get(char_type &c);

View File

@ -371,7 +371,7 @@ bool checkModule(string const & name, bool command)
if (layout) {
found_style = true;
dpre = layout->preamble();
std::set<std::string> lreqs = layout->required();
std::set<std::string> const & lreqs = layout->required();
if (!lreqs.empty())
cmd_reqs.insert(lreqs.begin(), lreqs.end());
} else if (insetlayout) {

View File

@ -47,7 +47,7 @@ namespace lyx {
namespace {
void output_arguments(ostream &, Parser &, bool, bool, string, Context &,
void output_arguments(ostream &, Parser &, bool, bool, const string &, Context &,
Layout::LaTeXArgMap const &);
}
@ -459,7 +459,7 @@ bool translate_len(string const & length, string & valstring, string & unit)
/// If we have ambiguous quotation marks, make a smart guess
/// based on main quote style
string guessQuoteStyle(string in, bool const opening)
string guessQuoteStyle(string const & in, bool const opening)
{
string res = in;
if (prefixIs(in, "qr")) {// straight quote
@ -528,7 +528,7 @@ string guessQuoteStyle(string in, bool const opening)
}
string const fromPolyglossiaEnvironment(string const s)
string const fromPolyglossiaEnvironment(string const & s)
{
// Since \arabic is taken by the LaTeX kernel,
// the Arabic polyglossia environment is upcased
@ -539,7 +539,7 @@ string const fromPolyglossiaEnvironment(string const s)
}
string uncapitalize(string const s)
string uncapitalize(string const & s)
{
docstring in = from_ascii(s);
char_type t = lowercase(s[0]);
@ -548,7 +548,7 @@ string uncapitalize(string const s)
}
bool isCapitalized(string const s)
bool isCapitalized(string const & s)
{
docstring in = from_ascii(s);
char_type t = uppercase(s[0]);
@ -686,7 +686,7 @@ pair<bool, string> convert_latexed_command_inset_arg(string s)
/// try to convert \p s to a valid InsetCommand argument
/// without trying to recode macros.
string convert_literate_command_inset_arg(string s)
string convert_literate_command_inset_arg(string const & s)
{
// LyX cannot handle newlines in a latex command
return subst(s, "\n", " ");
@ -789,7 +789,7 @@ void skip_spaces_braces(Parser & p, bool keepws = false)
}
void output_arguments(ostream & os, Parser & p, bool outer, bool need_layout, string const prefix,
void output_arguments(ostream & os, Parser & p, bool outer, bool need_layout, string const & prefix,
Context & context, Layout::LaTeXArgMap const & latexargs)
{
if (context.layout->latextype != LATEX_ITEM_ENVIRONMENT || !prefix.empty()) {
@ -2536,7 +2536,7 @@ void get_cite_arguments(Parser & p, bool natbibOrder,
}
void copy_file(FileName const & src, string dstname)
void copy_file(FileName const & src, string const & dstname)
{
if (!copyFiles())
return;