if (f.underbar() == FONT_ON) {
os << "\\uline{";
count += 10;
- runparams.inulemcmd = true;
+ ++runparams.inulemcmd;
}
if (f.strikeout() == FONT_ON) {
os << "\\sout{";
count += 9;
- runparams.inulemcmd = true;
+ ++runparams.inulemcmd;
}
if (f.uuline() == FONT_ON) {
os << "\\uuline{";
count += 11;
- runparams.inulemcmd = true;
+ ++runparams.inulemcmd;
}
if (f.uwave() == FONT_ON) {
os << "\\uwave{";
count += 10;
- runparams.inulemcmd = true;
+ ++runparams.inulemcmd;
}
return count;
}
if (f.underbar() == FONT_ON) {
os << '}';
++count;
- runparams.inulemcmd = false;
+ --runparams.inulemcmd;
}
if (f.strikeout() == FONT_ON) {
os << '}';
++count;
- runparams.inulemcmd = false;
+ --runparams.inulemcmd;
}
if (f.uuline() == FONT_ON) {
os << '}';
++count;
- runparams.inulemcmd = false;
+ --runparams.inulemcmd;
}
if (f.uwave() == FONT_ON) {
os << '}';
++count;
- runparams.inulemcmd = false;
+ --runparams.inulemcmd;
}
// If the current language is Hebrew, Arabic, or Farsi
OutputParams::OutputParams(Encoding const * enc)
: flavor(LATEX), math_flavor(NotApplicable), nice(false), is_child(false),
- moving_arg(false), inulemcmd(false), local_font(0), master_language(0),
+ moving_arg(false), inulemcmd(0), local_font(0), master_language(0),
encoding(enc), free_spacing(false), use_babel(false), use_polyglossia(false),
use_indices(false), use_japanese(false), linelen(0), depth(0),
exportdata(new ExportData),
*/
bool intitle;
- /** inulemcmd == true means that the environment in which the
+ /** inulemcmd > 0 means that the environment in which the
inset is typeset is part of a ulem command (\uline, \uuline,
\uwave, or \sout). Insets that output latex commands relying
on local assignments (such as \cite) should enclose such
commands in \mbox{} in order to avoid breakage.
*/
- mutable bool inulemcmd;
+ mutable int inulemcmd;
/** the font at the point where the inset is
*/
// FIXME UNICODE
docstring const cite_str = from_utf8(citationStyleToString(cs));
- if (runparams.inulemcmd)
+ if (runparams.inulemcmd > 0)
os << "\\mbox{";
os << "\\" << cite_str;
string const cmd = getCmdName();
docstring const data = getEscapedLabel(rp);
- if (rp.inulemcmd)
+ if (rp.inulemcmd > 0)
os << "\\mbox{";
if (cmd == "eqref" && buffer().params().use_refstyle) {
os << p.getCommand(rp);
}
- if (rp.inulemcmd)
+ if (rp.inulemcmd > 0)
os << "}";
}