diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index 6d2af6cd47..15705ce144 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -1045,7 +1045,7 @@ docstring const & BibTeXInfo::getInfo(BibTeXInfoList const & xrefs, } -docstring const BibTeXInfo::getLabel(BibTeXInfoList const xrefs, +docstring const BibTeXInfo::getLabel(BibTeXInfoList const & xrefs, Buffer const & buf, docstring const & format, CiteItem const & ci, bool next, bool second) const { diff --git a/src/BiblioInfo.h b/src/BiblioInfo.h index 5a6f0d5b4e..a08204ed5f 100644 --- a/src/BiblioInfo.h +++ b/src/BiblioInfo.h @@ -78,7 +78,7 @@ public: Buffer const & buf, CiteItem const & ci, docstring const & format = docstring()) const; /// \return formatted BibTeX data for a citation label - docstring const getLabel(BibTeXInfoList const xrefs, + docstring const getLabel(BibTeXInfoList const & xrefs, Buffer const & buf, docstring const & format, CiteItem const & ci, bool next = false, bool second = false) const; /// diff --git a/src/CiteEnginesList.cpp b/src/CiteEnginesList.cpp index 53ec83e64d..7d7ad3f7df 100644 --- a/src/CiteEnginesList.cpp +++ b/src/CiteEnginesList.cpp @@ -110,7 +110,7 @@ bool LyXCiteEngine::isDefaultBiblio(string const & bf) const } -bool LyXCiteEngine::required(const string p) const +bool LyXCiteEngine::required(string const & p) const { return find(package_list_.begin(), package_list_.end(), p) != package_list_.end(); } diff --git a/src/CiteEnginesList.h b/src/CiteEnginesList.h index ad703325c6..6b795b47af 100644 --- a/src/CiteEnginesList.h +++ b/src/CiteEnginesList.h @@ -80,7 +80,7 @@ public: std::vector const & getPackageList() const { return package_list_; } /// - bool required(std::string const p) const; + bool required(std::string const & p) const; private: /// what appears in the ui std::string name_; diff --git a/src/HunspellChecker.cpp b/src/HunspellChecker.cpp index c211b47c85..dcdc1bbbd7 100644 --- a/src/HunspellChecker.cpp +++ b/src/HunspellChecker.cpp @@ -47,7 +47,7 @@ typedef map LangPersonalWordList; typedef vector IgnoreList; -docstring remap_result(docstring const s) +docstring remap_result(docstring const & s) { // substitute RIGHT SINGLE QUOTATION MARK // by APOSTROPHE diff --git a/src/mathed/MathStream.cpp b/src/mathed/MathStream.cpp index f93ff72cf0..7e6ea6bd49 100644 --- a/src/mathed/MathStream.cpp +++ b/src/mathed/MathStream.cpp @@ -269,7 +269,7 @@ WriteStream & operator<<(WriteStream & ws, unsigned int i) ////////////////////////////////////////////////////////////////////// -MathStream::MathStream(odocstream & os, std::string xmlns, bool xmlMode) +MathStream::MathStream(odocstream & os, std::string const & xmlns, bool xmlMode) : os_(os), tab_(0), line_(0), in_text_(false), xmlns_(xmlns), xml_mode_(xmlMode) {} diff --git a/src/mathed/MathStream.h b/src/mathed/MathStream.h index 9344dac497..fb229e66cc 100644 --- a/src/mathed/MathStream.h +++ b/src/mathed/MathStream.h @@ -327,7 +327,7 @@ public: class CTag { public: /// - CTag(char const * const tag, std::string attr = "") + CTag(char const * const tag, std::string const & attr = "") : tag_(tag), attr_(attr) {} /// char const * const tag_; @@ -346,7 +346,7 @@ class MathExportException : public std::exception {}; class MathStream { public: /// Builds a stream proxy for os; the MathML namespace is given by xmlns (supposed to be already defined elsewhere in the document). - explicit MathStream(odocstream & os, std::string xmlns="", bool xmlMode=false); + explicit MathStream(odocstream & os, std::string const & xmlns="", bool xmlMode=false); /// void cr(); /// @@ -370,7 +370,9 @@ public: /// bool xmlMode() const { return xml_mode_; } /// Returns the tag name prefixed by the name space if needed. - std::string namespacedTag(std::string tag) const { return ((xmlns().empty()) ? "" : xmlns() + ":") + tag; } + std::string namespacedTag(std::string const & tag) const { + return (xmlns().empty() ? "" : xmlns() + ":") + tag; + } private: /// void setTextMode(bool t) { in_text_ = t; } diff --git a/src/tex2lyx/Parser.cpp b/src/tex2lyx/Parser.cpp index fa40533363..cc8dd5aa58 100644 --- a/src/tex2lyx/Parser.cpp +++ b/src/tex2lyx/Parser.cpp @@ -453,7 +453,7 @@ bool Parser::good() } -bool Parser::hasOpt(string const l) +bool Parser::hasOpt(string const & l) { // An optional argument can occur in any of the following forms: // - \foo[bar] @@ -577,7 +577,7 @@ string Parser::getFullParentheseArg() } -bool Parser::hasListPreamble(string const itemcmd) +bool Parser::hasListPreamble(string const & itemcmd) { // remember current position unsigned int oldpos = pos_; diff --git a/src/tex2lyx/Parser.h b/src/tex2lyx/Parser.h index d61151388e..e9afbd19d9 100644 --- a/src/tex2lyx/Parser.h +++ b/src/tex2lyx/Parser.h @@ -214,7 +214,7 @@ public: void dump() const; /// Does an optional argument follow after the current token? - bool hasOpt(std::string const l = "["); + bool hasOpt(std::string const & l = "["); /// typedef std::pair Arg; /*! @@ -260,7 +260,7 @@ public: */ std::string getFullParentheseArg(); /// Check if we have a list preamble - bool hasListPreamble(std::string const itemcmd); + bool hasListPreamble(std::string const & itemcmd); /*! * \returns the contents of the environment \p name. * \begin{name} must be parsed already, \end{name} diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index f28df64b9f..cf01fddaa5 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -295,7 +295,7 @@ vector split_options(string const & input) * \p options and return the value. * The found option is also removed from \p options. */ -string process_keyval_opt(vector & options, string name) +string process_keyval_opt(vector & options, string const & name) { for (size_t i = 0; i < options.size(); ++i) { vector option; @@ -469,7 +469,7 @@ void Preamble::add_package(string const & name, vector & options) } } -void Preamble::setTextClass(string const tclass, TeX2LyXDocClass & tc) +void Preamble::setTextClass(string const & tclass, TeX2LyXDocClass & tc) { h_textclass = tclass; tc.setName(h_textclass); diff --git a/src/tex2lyx/Preamble.h b/src/tex2lyx/Preamble.h index 92d3694cd4..5287f53d8a 100644 --- a/src/tex2lyx/Preamble.h +++ b/src/tex2lyx/Preamble.h @@ -96,7 +96,7 @@ public: /// Get author named \p name (must be registered first) Author const & getAuthor(std::string const & name) const; /// Set text class - void setTextClass(std::string const tclass, TeX2LyXDocClass & tc); + void setTextClass(std::string const & tclass, TeX2LyXDocClass & tc); /// Get number of arguments of special table column type \c or -1 /// if no column type \p c exists int getSpecialTableColumnArguments(char c) const; diff --git a/src/tex2lyx/tex2lyx.h b/src/tex2lyx/tex2lyx.h index 883eb75635..2b1eaf9034 100644 --- a/src/tex2lyx/tex2lyx.h +++ b/src/tex2lyx/tex2lyx.h @@ -48,7 +48,7 @@ extern std::string rgbcolor2code(std::string const & name); std::string translate_len(std::string const &); void parse_text(Parser & p, std::ostream & os, unsigned flags, bool outer, - Context & context, std::string const rdelim = std::string()); + Context & context, std::string const & rdelim = std::string()); void check_comment_bib(std::ostream & os, Context & context); void fix_child_filename(std::string & name); @@ -68,7 +68,7 @@ std::string find_file(std::string const & name, std::string const & path, void parse_text_in_inset(Parser & p, std::ostream & os, unsigned flags, bool outer, Context const & context, InsetLayout const * layout = 0, - std::string const rdelim = std::string()); + std::string const & rdelim = std::string()); /// Guess document language from \p p if CJK is used. /// \p lang is used for all non-CJK contents. diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 6744d78157..208e1497c7 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -55,7 +55,7 @@ void output_arguments(ostream &, Parser &, bool, bool, string, Context &, void parse_text_in_inset(Parser & p, ostream & os, unsigned flags, bool outer, Context const & context, InsetLayout const * layout, - string const rdelim) + string const & rdelim) { bool const forcePlainLayout = layout ? layout->forcePlainLayout() : false; @@ -86,7 +86,7 @@ namespace { void parse_text_in_inset(Parser & p, ostream & os, unsigned flags, bool outer, Context const & context, string const & name, - string const rdelim = string()) + string const & rdelim = string()) { InsetLayout const * layout = 0; DocumentClass::InsetLayouts::const_iterator it = @@ -2867,7 +2867,7 @@ void fix_child_filename(string & name) void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, - Context & context, string const rdelim) + Context & context, string const & rdelim) { Layout const * newlayout = 0; InsetLayout const * newinsetlayout = 0; diff --git a/src/xml.h b/src/xml.h index 857867ba90..4fa19aa024 100644 --- a/src/xml.h +++ b/src/xml.h @@ -219,9 +219,9 @@ struct StartTag struct EndTag { /// - explicit EndTag(std::string tag) : tag_(from_ascii(tag)) {} + explicit EndTag(std::string const & tag) : tag_(from_ascii(tag)) {} /// - explicit EndTag(docstring tag) : tag_(tag) {} + explicit EndTag(docstring const & tag) : tag_(tag) {} /// virtual ~EndTag() {} ///