Most of that is changing string to string const &.
}
-docstring constructName(docstring const & name, string const scheme)
+docstring constructName(docstring const & name, string const & scheme)
{
// re-constructs a name from name parts according
// to a given scheme
}
-bool multipleAuthors(docstring const author)
+bool multipleAuthors(docstring const & author)
{
return getAuthors(author).size() > 1;
}
if (it == m.begin())
return m.end();
- it--;
+ --it;
return it;
}
}
-string BufferParams::paperSizeName(PapersizePurpose purpose, string const psize) const
+string BufferParams::paperSizeName(PapersizePurpose purpose, string const & psize) const
{
PAPER_SIZE ppsize = psize.empty() ? papersize : papersizetranslator().find(psize);
switch (ppsize) {
};
///
std::string paperSizeName(PapersizePurpose purpose,
- std::string const psize = std::string()) const;
+ std::string const & psize = std::string()) const;
/// set up if and how babel is called
std::string babelCall(std::string const & lang_opts, bool const langoptions) const;
/// return supported drivers for specific packages
/// set savenote environment (footnote package)
std::string saveNoteEnv() const { return savenote_env_; }
/// return savenote environment
- void saveNoteEnv(std::string const s) { savenote_env_ = s; }
+ void saveNoteEnv(std::string const & s) { savenote_env_ = s; }
/// Runparams that will be used for exporting this file.
OutputParams const & runparams() const { return runparams_; }
/// Resolve alternatives like "esint|amsmath|wasysym"
string const LaTeXFont::getPackageOptions(bool ot1, bool complete, bool sc, bool osf,
- int scale, string const extraopts, bool nomath)
+ int scale, string const & extraopts, bool nomath)
{
ostringstream os;
bool const needosfopt = (osf != osfdefault_);
string const LaTeXFont::getLaTeXCode(bool dryrun, bool ot1, bool complete, bool sc,
- bool osf, bool nomath, string const extraopts,
+ bool osf, bool nomath, string const & extraopts,
int const & scale)
{
ostringstream os;
/// Return the LaTeX Code
std::string const getLaTeXCode(bool dryrun, bool ot1, bool complete,
bool sc, bool osf, bool nomath,
- std::string const extraopts = std::string(),
+ std::string const & extraopts = std::string(),
int const & scale = 100);
/// Return the actually used font
docstring const getUsedFont(bool ot1, bool complete, bool nomath);
bool sc,
bool osf,
int scale,
- std::string const extraopts,
+ std::string const & extraopts,
bool nomath);
/// Return an alternative font
LaTeXFont altFont(docstring const & name);
class PersonalWordList {
public:
/// the word list has an associated language
- PersonalWordList(std::string lang) : lang_(lang), dirty_(false) {}
+ PersonalWordList(std::string & lang) : lang_(lang), dirty_(false) {}
/// the location of the file to hold to word list
lyx::support::FileName dictfile() const;
/// (re)load the word list from file
settings are given to the new one.
This function will handle a multi-paragraph selection.
*/
- void setParagraphs(Cursor & cur, docstring arg, bool modify = false);
+ void setParagraphs(Cursor & cur, docstring const & arg, bool modify = false);
/// Sets parameters for current or selected paragraphs
void setParagraphs(Cursor & cur, ParagraphParameters const & p);
}
-void Text::setParagraphs(Cursor & cur, docstring arg, bool merge)
+void Text::setParagraphs(Cursor & cur, docstring const & arg, bool merge)
{
LBUFERR(cur.text());
///////////////////////////////////////////////////////////////////////////
TocItem::TocItem(DocIterator const & dit, int d, docstring const & s,
- bool output_active, FuncRequest action)
+ bool output_active, FuncRequest const & action)
: dit_(dit), depth_(d), str_(s), output_(output_active),
action_(action)
{
int depth,
docstring const & s,
bool output_active,
- FuncRequest action = FuncRequest(LFUN_UNKNOWN_ACTION)
+ FuncRequest const & action = FuncRequest(LFUN_UNKNOWN_ACTION)
);
///
DocIterator const & dit() const { return dit_; }
///
bool isOutput() const { return output_; }
///
- void setAction(FuncRequest a) { action_ = a; }
+ void setAction(FuncRequest const & a) { action_ = a; }
/// custom action, or the default one (paragraph-goto) if not customised
FuncRequest action() const;
{
}
///
- UndoElement(UndoElement const & ue) : time(current_time())
- {
- kind = ue.kind;
- cur_before = ue.cur_before;
- cur_after = ue.cur_after;
- cell = ue.cell;
- from = ue.from;
- end = ue.end;
- pars = ue.pars;
- array = ue.array;
- bparams = ue.bparams
- ? new BufferParams(*ue.bparams) : 0;
- lyx_clean = ue.lyx_clean;
- group_id = ue.group_id;
- }
+ UndoElement(UndoElement const & ue) :
+ kind(ue.kind),
+ cur_before(ue.cur_before), cur_after(ue.cur_after),
+ cell(ue.cell), from(ue.from), end(ue.end),
+ pars(ue.pars), array(ue.array),
+ bparams(ue.bparams ? new BufferParams(*ue.bparams) : 0),
+ lyx_clean(ue.lyx_clean), group_id(ue.group_id),
+ time(current_time())
+ {}
///
~UndoElement()
{
}
-void InsetBibtex::editDatabases(docstring const db) const
+void InsetBibtex::editDatabases(docstring const & db) const
{
vector<docstring> bibfilelist = getVectorFromString(getParam("bibfiles"));
private:
///
- void editDatabases(docstring const db = docstring()) const;
+ void editDatabases(docstring const & db = docstring()) const;
///
void parseBibTeXFiles(support::FileNameList &) const;
///
} // anonymous namespace
-vector<pair<docstring, docstring>> InsetCitation::getQualifiedLists(docstring const p) const
+vector<pair<docstring, docstring>> InsetCitation::getQualifiedLists(docstring const & p) const
{
vector<docstring> ps =
getVectorFromString(p, from_ascii("\t"));
CitationStyle getCitationStyle(BufferParams const & bp, std::string const & input,
std::vector<CitationStyle> const & valid_styles) const;
///
- QualifiedList getQualifiedLists(docstring const p) const;
+ QualifiedList getQualifiedLists(docstring const & p) const;
///
static bool last_literal;
}
-docstring const InsetQuotesParams::getShortGuiLabel(docstring const string)
+docstring const InsetQuotesParams::getShortGuiLabel(docstring const & str)
{
- std::string const s = to_ascii(string);
+ string const s = to_ascii(str);
QuoteStyle const style = getQuoteStyle(s);
QuoteSide const side = getQuoteSide(s);
QuoteLevel const level = getQuoteLevel(s);
docstring const getGuiLabel(QuoteStyle const & qs,
bool langdef = false);
/// Returns a descriptive label of a given char
- docstring const getShortGuiLabel(docstring const string);
+ docstring const getShortGuiLabel(docstring const & str);
///
int stylescount() const;
/// Returns the matching style shortcut char
///
bool getLanguage() { return ignoreLanguage_; };
///
- void setIgnoreFormat(string type, bool value);
+ void setIgnoreFormat(string const & type, bool value);
private:
///
};
-void IgnoreFormats::setIgnoreFormat(string type, bool value)
+void IgnoreFormats::setIgnoreFormat(string const & type, bool value)
{
if (type == "color") {
ignoreColor_ = value;
IgnoreFormats ignoreFormats;
-void setIgnoreFormat(string type, bool value)
+void setIgnoreFormat(string const & type, bool value)
{
ignoreFormats.setIgnoreFormat(type, value);
}
void removeHead(KeyInfo&, int count=0);
public:
- LatexInfo(string par, bool isPatternString) : entidx_(-1), interval_(isPatternString, par)
+ LatexInfo(string const & par, bool isPatternString)
+ : entidx_(-1), interval_(isPatternString, par)
{
buildKeys(isPatternString);
entries_ = vector<KeyInfo>();
MathInfo() {
actualIdx_ = 0;
}
- void insert(string wait, size_t start, size_t end) {
+ void insert(string const & wait, size_t start, size_t end) {
MathEntry m = MathEntry();
m.wait = wait;
m.mathStart = start;
};
/// Set the formats that should be ignored
-void setIgnoreFormat(std::string type, bool value);
+void setIgnoreFormat(std::string const & type, bool value);
/// Write a FindAdvOptions instance to a stringstream
std::ostringstream & operator<<(std::ostringstream & os, lyx::FindAndReplaceOptions const & opt);
DocIterator const & cur,
int len = -1);
-/** Set format type to be ignore by search
- **/
-void setIgnoreFormat(std::string type, bool value);
} // namespace lyx
class MTag {
public:
///
- MTag(char const * const tag, std::string attr = "")
+ MTag(char const * const tag, std::string const & attr = std::string())
: tag_(tag), attr_(attr) {}
///
char const * const tag_;
struct EndTag
{
///
- explicit EndTag(std::string tag) : tag_(tag) {}
+ explicit EndTag(std::string const & tag) : tag_(tag) {}
///
virtual ~EndTag() {}
/// </tag_>
typedef typename container_type::const_iterator const_iterator;
/// limit is the maximum size of the stack
- limited_stack(size_type limit = 100) {
- limit_ = limit;
- }
+ limited_stack(size_type limit = 100) : limit_(limit) {}
/// Return the top element.
value_type & top() {