namespace {
-void output_arguments(ostream &, Parser &, bool, bool, string, Context &,
+void output_arguments(ostream &, Parser &, bool, bool, const string &, Context &,
Layout::LaTeXArgMap const &);
}
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;
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 =
/// 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
res = "brs";
else if (preamble.quotesStyle() == "french")
res = "frs";
+ else if (preamble.quotesStyle() == "hungarian")
+ res = "hrd";
else if (preamble.quotesStyle() == "swedish")
res = opening ? "sld" : "srd";
} else if (in == "els") {// `
res = "fld";
else if (preamble.quotesStyle() == "russian")
res = "rld";
+ else if (preamble.quotesStyle() == "hungarian")
+ res = "hrs";
} else if (in == "ald") {// <<
if (preamble.quotesStyle() == "swiss")
res = "crd";
res = "frd";
else if (preamble.quotesStyle() == "russian")
res = "rrd";
+ else if (preamble.quotesStyle() == "hungarian")
+ res = "hls";
} else if (in == "ars") {// >
if (preamble.quotesStyle() == "swiss")
res = "cls";
} else if (in == "gld") {// ,,
if (preamble.quotesStyle() == "polish")
res = "pld";
+ else if (preamble.quotesStyle() == "hungarian")
+ res = "hld";
else if (preamble.quotesStyle() == "russian")
res = "rls";
} else if (in == "gls") {// ,
}
-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
}
-string uncapitalize(string const s)
+string uncapitalize(string const & s)
{
docstring in = from_ascii(s);
char_type t = lowercase(s[0]);
}
-bool isCapitalized(string const s)
+bool isCapitalized(string const & s)
{
docstring in = from_ascii(s);
char_type t = uppercase(s[0]);
/// 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", " ");
void output_ert(ostream & os, string const & s, Context & context)
{
context.check_layout(os);
- for (string::const_iterator it = s.begin(), et = s.end(); it != et; ++it) {
- if (*it == '\\')
+ for (char const c : s) {
+ if (c == '\\')
os << "\n\\backslash\n";
- else if (*it == '\n') {
+ else if (c == '\n') {
context.new_paragraph(os);
context.check_layout(os);
} else
- os << *it;
+ os << c;
}
context.check_end_layout(os);
}
}
-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()) {
}
-void copy_file(FileName const & src, string dstname)
+void copy_file(FileName const & src, string const & dstname)
{
if (!copyFiles())
return;
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;
if (t.cs() == "newpage" ||
(t.cs() == "pagebreak" && !p.hasOpt()) ||
t.cs() == "clearpage" ||
- t.cs() == "cleardoublepage") {
+ t.cs() == "cleardoublepage" ||
+ t.cs() == "nopagebreak") {
context.check_layout(os);
begin_inset(os, "Newpage ");
os << t.cs();