Remove redundant const & for primitive types

This commit is contained in:
Yuriy Skalko 2020-10-16 10:19:34 +03:00
parent 26f3dfe45d
commit 65c88f0a0a
19 changed files with 26 additions and 28 deletions

View File

@ -3410,7 +3410,7 @@ docstring const & BufferView::inlineCompletion() const
}
size_t const & BufferView::inlineCompletionUniqueChars() const
size_t BufferView::inlineCompletionUniqueChars() const
{
return d->inlineCompletionUniqueChars_;
}

View File

@ -219,7 +219,7 @@ public:
/// return the inline completion postfix.
docstring const & inlineCompletion() const;
/// return the number of unique characters in the inline completion.
size_t const & inlineCompletionUniqueChars() const;
size_t inlineCompletionUniqueChars() const;
/// return the position in the buffer of the inline completion postfix.
DocIterator const & inlineCompletionPos() const;
/// make sure inline completion position is OK

View File

@ -643,7 +643,7 @@ Encodings::fromLyXName(string const & name, bool allowUnsafe) const
Encoding const *
Encodings::fromLaTeXName(string const & n, int const & p, bool allowUnsafe) const
Encodings::fromLaTeXName(string const & n, int p, bool allowUnsafe) const
{
string name = n;
// FIXME: if we have to test for too many of these synonyms,
@ -666,7 +666,7 @@ Encodings::fromLaTeXName(string const & n, int const & p, bool allowUnsafe) cons
Encoding const *
Encodings::fromIconvName(string const & n, int const & p, bool allowUnsafe) const
Encodings::fromIconvName(string const & n, int p, bool allowUnsafe) const
{
EncodingList::const_iterator const end = encodinglist.end();
for (EncodingList::const_iterator it = encodinglist.begin(); it != end; ++it)

View File

@ -255,10 +255,10 @@ public:
fromLyXName(std::string const & name, bool allowUnsafe = false) const;
/// Get encoding from LaTeX name \p name and package \p package
Encoding const * fromLaTeXName(std::string const & name,
int const & package = Encoding::any, bool allowUnsafe = false) const;
int package = Encoding::any, bool allowUnsafe = false) const;
/// Get encoding from iconv name \p name and package \p package
Encoding const * fromIconvName(std::string const & name,
int const & package = Encoding::any, bool allowUnsafe = false) const;
int package = Encoding::any, bool allowUnsafe = false) const;
///
const_iterator begin() const { return encodinglist.begin(); }

View File

@ -228,8 +228,8 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
OutputParams const & runparams,
Font const & base,
Font const & prev,
bool const & non_inherit_inset,
bool const & needs_cprotection) const
bool non_inherit_inset,
bool needs_cprotection) const
{
int count = 0;
@ -522,7 +522,7 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
Font const & base,
Font const & next,
bool & needPar,
bool const & closeLanguage) const
bool closeLanguage) const
{
int count = 0;

View File

@ -76,8 +76,8 @@ public:
OutputParams const & runparams,
Font const & base,
Font const & prev,
bool const & non_inherit_inset = false,
bool const & needs_cprotection = false) const;
bool non_inherit_inset = false,
bool needs_cprotection = false) const;
/** Writes the tail of the LaTeX needed to change to this font.
Returns number of chars written. Base is the font state we want
@ -88,7 +88,7 @@ public:
Font const & base,
Font const & next,
bool & needPar,
bool const & closeLanguage = true) const;
bool closeLanguage = true) const;
/// Build GUI description of font state

View File

@ -292,8 +292,7 @@ string const LaTeXFont::getPackageOptions(bool ot1, bool complete, bool sc, bool
string const LaTeXFont::getLaTeXCode(bool dryrun, bool ot1, bool complete, bool sc,
bool osf, bool nomath, string const & extraopts,
int const & scale)
bool osf, bool nomath, string const & extraopts, int scale)
{
ostringstream os;

View File

@ -90,7 +90,7 @@ public:
std::string const getLaTeXCode(bool dryrun, bool ot1, bool complete,
bool sc, bool osf, bool nomath,
std::string const & extraopts = std::string(),
int const & scale = 100);
int scale = 100);
/// Return the actually used font
docstring const getUsedFont(bool ot1, bool complete, bool nomath, bool osf);
/// Return the actually used package

View File

@ -490,7 +490,7 @@ public:
///
docstring const & htmlstyles() const { return htmlstyles_; }
///
bool const & docbookforceabstract() const { return docbookforceabstract_; }
bool docbookforceabstract() const { return docbookforceabstract_; }
///
std::string const & docbookroot() const { return docbookroot_; }
/// Looks for the layout of "highest level", other than Part (or other

View File

@ -45,7 +45,7 @@ int prompt(docstring const & title, docstring const & question,
* The console output takes care of converting any Qt html to plain text.
*/
void warning(docstring const & title, docstring const & message,
bool const & askshowagain = false);
bool askshowagain = false);
/**
* Display a warning to the user. Title should be a short (general) summary.

View File

@ -89,7 +89,7 @@ void FloatPlacement::useSideways()
}
bool FloatPlacement::possiblePlacement(char const & p) const
bool FloatPlacement::possiblePlacement(char p) const
{
return !spanCB->isVisible() || contains(allowed_placement_, p);
}

View File

@ -65,7 +65,7 @@ private:
///
void initFloatPlacementCO(bool const);
///
bool possiblePlacement(char const & p) const;
bool possiblePlacement(char p) const;
/// one of figure or table?
bool standardfloat_;

View File

@ -150,7 +150,7 @@ int prompt(docstring const & title, docstring const & question,
}
void doWarning(docstring const & title, docstring const & message,
bool const & askshowagain)
bool askshowagain)
{
lyxerr << "Warning: " << toPlainText(title) << '\n'
<< "----------------------------------------\n"
@ -190,7 +190,7 @@ void doWarning(docstring const & title, docstring const & message,
}
void warning(docstring const & title, docstring const & message,
bool const & askshowagain)
bool askshowagain)
{
#ifdef EXPORT_in_THREAD
InGuiThread<void>().call(&doWarning,

View File

@ -198,7 +198,7 @@ string widgetToDoubleStr(QLineEdit const * input)
}
void doubleToWidget(QLineEdit * input, double const & value, char f, int prec)
void doubleToWidget(QLineEdit * input, double value, char f, int prec)
{
QLocale loc;
loc.setNumberOptions(QLocale::OmitGroupSeparator);

View File

@ -61,7 +61,7 @@ double widgetToDouble(QLineEdit const * input);
/// method to get a double value from a localized widget (QLineEdit)
std::string widgetToDoubleStr(QLineEdit const * input);
/// method to set a (localized) double value in a widget (QLineEdit)
void doubleToWidget(QLineEdit * input, double const & value,
void doubleToWidget(QLineEdit * input, double value,
char f = 'g', int prec = 6);
/// method to set a (localized) double value in a widget (QLineEdit)
void doubleToWidget(QLineEdit * input, std::string const & value,

View File

@ -20,7 +20,7 @@ using namespace std;
namespace lyx {
namespace frontend {
namespace Alert {
void warning(docstring const & title, docstring const & message, bool const &)
void warning(docstring const & title, docstring const & message, bool)
{
LYXERR0(title);
LYXERR0(message);

View File

@ -196,7 +196,7 @@ void Parser::deparse()
}
bool Parser::setEncoding(std::string const & e, int const & p)
bool Parser::setEncoding(std::string const & e, int p)
{
// We may (and need to) use unsafe encodings here: Since the text is
// converted to unicode while reading from is_, we never see text in

View File

@ -187,7 +187,7 @@ public:
/// change the encoding of the input stream according to \p encoding
/// (latex name) and package \p package
bool setEncoding(std::string const & encoding, int const & package);
bool setEncoding(std::string const & encoding, int package);
/// change the encoding of the input stream to \p encoding (iconv name)
bool setEncoding(std::string const & encoding);
/// get the current iconv encoding of the input stream

View File

@ -38,8 +38,7 @@ namespace lyx {
namespace frontend {
namespace Alert {
void warning(docstring const & title, docstring const & message,
bool const &)
void warning(docstring const & title, docstring const & message, bool)
{
cerr << to_utf8(title) << "\n" << to_utf8(message) << endl;
}