if (token.empty()) continue;
lyxerr[Debug::PARSER] << "Handling token: `"
- << token << "'" << endl;
+ << token << '\'' << endl;
the_end_read =
parseSingleLyXformat2Token(lex, par, first_par,
s += tostr(unknown_layouts);
s += _(" paragraphs");
}
+#if USE_BOOST_FORMAT
Alert::alert(_("Textclass Loading Error!"), s,
boost::io::str(boost::format(_("When reading %1$s")) % fileName()));
+#else
+ Alert::alert(_("Textclass Loading Error!"), s,
+ _("When reading ") + fileName());
+#endif
}
if (unknown_tokens > 0) {
s += tostr(unknown_tokens);
s += _(" unknown tokens");
}
+#if USE_BOOST_FORMAT
Alert::alert(_("Textclass Loading Error!"), s,
boost::io::str(boost::format(_("When reading %1$s")) % fileName()));
+#else
+ Alert::alert(_("Textclass Loading Error!"), s,
+ _("When reading ") + fileName());
+#endif
}
return the_end_read;
if (layout->free_spacing || par->isFreeSpacing()) {
if (lex.isOK()) {
lex.next();
- string next_token = lex.getString();
+ string const next_token = lex.getString();
if (next_token == "\\-") {
par->insertChar(pos, '-', font);
} else if (next_token == "~") {
if (pp.first) {
params.textclass = pp.second;
} else {
+#if USE_BOOST_FORMAT
Alert::alert(_("Textclass error"),
boost::io::str(boost::format(_("The document uses an unknown textclass \"%1$s\".")) % lex.getString()),
_("LyX will not be able to produce output correctly."));
+#else
+ Alert::alert(
+ _("Textclass error"),
+ _("The document uses an unknown textclass ")
+ + lex.getString(),
+ _("LyX will not be able to produce output correctly."));
+#endif
params.textclass = 0;
}
if (!params.getLyXTextClass().load()) {
// or stop loading the file.
// I can substitute but I don't see how I can
// stop loading... ideas?? ARRae980418
+#if USE_BOOST_FORMAT
Alert::alert(_("Textclass Loading Error!"),
boost::io::str(boost::format(_("Can't load textclass %1$s")) %
params.getLyXTextClass().name()),
_("-- substituting default"));
+#else
+ Alert::alert(_("Textclass Loading Error!"),
+ _("Can't load textclass ")
+ + params.getLyXTextClass().name(),
+ _("-- substituting default"));
+#endif
params.textclass = 0;
}
} else if (token == "\\options") {
// This should be insurance for the future: (Asger)
++unknown_tokens;
lex.eatLine();
- string const s = boost::io::str(boost::format(_("Unknown token: %1$s %2$s\n")) % token
- % lex.text());
+#if USE_BOOST_FORMAT
+ boost::format fmt(_("Unknown token: %1$s %2$s\n"));
+ fmt % token % lex.text();
+ string const s = fmt.str();
+#else
+ string const s = _("Unknown token: ") + token
+ + ' ' + lex.text() + '\n';
+#endif
// we can do this here this way because we're actually reading
// the buffer and don't care about LyXText right now.
InsetError * new_inset = new InsetError(s);
return the_end_read;
}
+
// needed to insert the selection
void Buffer::insertStringAsLines(Paragraph *& par, pos_type & pos,
LyXFont const & fn,string const & str) const
if (token == "\\lyxformat") { // the first token _must_ be...
lex.eatLine();
string tmp_format = lex.getString();
- //lyxerr << "LyX Format: `" << tmp_format << "'" << endl;
+ //lyxerr << "LyX Format: `" << tmp_format << '\'' << endl;
// if present remove ".," from string.
string::size_type dot = tmp_format.find_first_of(".,");
//lyxerr << " dot found at " << dot << endl;
return false;
}
command += " -t"
- +tostr(LYX_FORMAT)+" "
+ +tostr(LYX_FORMAT) + ' '
+ QuoteName(filename);
lyxerr[Debug::INFO] << "Running '"
- << command << "'" << endl;
+ << command << '\''
+ << endl;
cmd_ret const ret = RunCommand(command);
if (ret.first) {
Alert::alert(_("ERROR!"),
default:
{
string const parlab = par.params().labelString();
- buffer << parlab << " ";
+ buffer << parlab << ' ';
currlinelen += parlab.length() + 1;
}
break;
texrow.newline();
lyxerr[Debug::INFO] << "Finished making latex file." << endl;
- lyxerr[Debug::INFO] << "Row count was " << texrow.rows()-1 << "." << endl;
+ lyxerr[Debug::INFO] << "Row count was " << texrow.rows() - 1
+ << '.' << endl;
// we want this to be true outside previews (for insetexternal)
niceFile = true;
sgml::openTag(ofs, 0, false, top_element);
else {
string top = top_element;
- top += " ";
+ top += ' ';
top += params.options;
sgml::openTag(ofs, 0, false, top);
}
while (!tag_state.empty() && tag_close) {
PAR_TAG k = tag_state.top();
tag_state.pop();
- os << "</" << tag_name(k) << ">";
+ os << "</" << tag_name(k) << '>';
if (tag_close & k)
reset(tag_close,k);
else
for(list< PAR_TAG >::const_iterator j = temp.begin();
j != temp.end(); ++j) {
tag_state.push(*j);
- os << "<" << tag_name(*j) << ">";
+ os << '<' << tag_name(*j) << '>';
}
for(list< PAR_TAG >::const_iterator j = tag_open.begin();
j != tag_open.end(); ++j) {
tag_state.push(*j);
- os << "<" << tag_name(*j) << ">";
+ os << '<' << tag_name(*j) << '>';
}
char c = par->getChar(i);
}
while (!tag_state.empty()) {
- os << "</" << tag_name(tag_state.top()) << ">";
+ os << "</" << tag_name(tag_state.top()) << '>';
tag_state.pop();
}
string top = top_element;
top += " lang=\"";
top += params.language->code();
- top += "\"";
+ top += '"';
if (!params.options.empty()) {
- top += " ";
+ top += ' ';
top += params.options;
}
sgml::openTag(ofs, 0, false, top);
if (lyx_code == Inset::LABEL_CODE) {
command_name += " id=\"";
command_name += (static_cast<InsetCommand *>(inset))->getContents();
- command_name += "\"";
+ command_name += '"';
desc_on = 3;
}
}
sgml::openTag(ofs, depth + command_depth, false, command_name);
- item_name = c_params.empty()?"title":c_params;
+ item_name = c_params.empty() ? "title" : c_params;
sgml::openTag(ofs, depth + 1 + command_depth, false, item_name);
break;
break;
case LATEX_ITEM_ENVIRONMENT:
if (desc_on == 1) break;
- end_tag= "para";
+ end_tag = "para";
sgml::closeTag(ofs, depth + 1 + command_depth, false, end_tag);
break;
case LATEX_PARAGRAPH: