void BufferView::Pimpl::buffer(Buffer * b)
{
lyxerr[Debug::INFO] << "Setting buffer in BufferView ("
- << b << ")" << endl;
+ << b << ')' << endl;
if (buffer_) {
buffer_->delUser(bv_);
bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
{
lyxerr[Debug::ACTION] << "BufferView::Pimpl::Dispatch:"
- << " action[" << ev.action <<"]"
- << " arg[" << ev.argument << "]"
- << " x[" << ev.x << "]"
- << " y[" << ev.y << "]"
- << " button[" << ev.button() << "]"
+ << " action[" << ev.action << ']'
+ << " arg[" << ev.argument << ']'
+ << " x[" << ev.x << ']'
+ << " y[" << ev.y << ']'
+ << " button[" << ev.button() << ']'
<< endl;
// e.g. Qt mouse press when no buffer
+2002-11-27 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * tabular.C (asciiPrintCell): use string(size, char) instead of
+ explicit loop.
+
+ * sgml.C (openTag): fix order of arguments to string constructor
+ (closeTag): ditto
+
+ * lyxfunc.C (dispatch): use boost.format
+
+ * lots of files: change "c" -> 'c'
+
2002-11-25 Dekel Tsur <dekelts@tau.ac.il>
* encoding.C: Patch from Isam Bayazidi: Fix Arabic shaping.
// CRC value.
// The older one is effectively set to 0 upon re-load.
lyxerr << "Write dep: "
- << cit->first << " "
- << cit->second.crc_cur << " "
+ << cit->first << ' '
+ << cit->second.crc_cur << ' '
<< cit->second.mtime_cur << endl;
}
- ofs << cit->first << " "
- << cit->second.crc_cur << " "
+ ofs << cit->first << ' '
+ << cit->second.crc_cur << ' '
<< cit->second.mtime_cur << endl;
}
}
while (ifs >> nome >> di.crc_cur >> di.mtime_cur) {
if (lyxerr.debugging(Debug::DEPEND)) {
lyxerr << "Read dep: "
- << nome << " "
- << di.crc_cur << " "
+ << nome << ' '
+ << di.crc_cur << ' '
<< di.mtime_cur << endl;
}
deplist[nome] = di;
result.push_back(scanAuxFile(file));
for (int i = 1; i < 1000; ++i) {
- string file2 = ChangeExtension(file, "") + "." + tostr(i)
+ string file2 = ChangeExtension(file, "") + '.' + tostr(i)
+ ".aux";
FileInfo fi(file2);
if (!fi.exist())
data = split(data, database, ',');
database = ChangeExtension(database, "bib");
lyxerr[Debug::LATEX] << "Bibtex database: `"
- << database << "'" << endl;
+ << database << '\'' << endl;
aux_info.databases.insert(database);
}
} else if (regex_match(STRCONV(token), sub, reg3)) {
// pass it to the helper
style = ChangeExtension(style, "bst");
lyxerr[Debug::LATEX] << "Bibtex style: `"
- << style << "'" << endl;
+ << style << '\'' << endl;
aux_info.styles.insert(style);
} else if (regex_match(STRCONV(token), sub, reg4)) {
string const file2 = STRCONV(sub.str(1));
<< "We should rerun." << endl;
retval |= RERUN;
}
- } else if (prefixIs(token, "(")) {
+ } else if (token[0] == '(') {
if (contains(token, "Rerun LaTeX") ||
contains(token, "Rerun to get")) {
// Used by natbib
string const name = fl.name();
os << "\\floatstyle{" << style << "}\n"
<< "\\newfloat{" << type << "}{" << placement
- << "}{" << ext << "}";
+ << "}{" << ext << '}';
if (!within.empty())
- os << "[" << within << "]";
- os << "\n"
+ os << '[' << within << ']';
+ os << '\n'
<< "\\floatname{" << type << "}{"
<< name << "}\n";
{
FuncRequest ev = retrieveActionArg(action);
if (!ev.argument.empty())
- ev.argument.insert(0, " ");
+ ev.argument.insert(0, 1, ' ');
info_map::const_iterator const it = lyx_info_map.find(ev.action);
FuncRequest ev = retrieveActionArg(pseudoaction);
string help;
-
+
info_map::const_iterator ici = lyx_info_map.find(ev.action);
if (ici != lyx_info_map.end()) {
if (lyxerr.debugging(Debug::ACTION)) {
else if ((*fit)->name() == "textparagraph")
label = _("Ascii text as paragraphs");
if (!(*fit)->shortcut().empty())
- label += "|" + (*fit)->shortcut();
+ label += '|' + (*fit)->shortcut();
int const action2 = lyxaction.
getPseudoAction(action, (*fit)->name());
tomenu.add(MenuItem(MenuItem::Command, label, action2));
label += limit_string_length(toc_list[i].str);
if (toc_list[i].depth == depth
&& ++shortcut_count <= 9) {
- label += "|" + tostr(shortcut_count);
+ label += '|' + tostr(shortcut_count);
}
tomenu.add(MenuItem(MenuItem::Command, label, action));
}
os.setf(ios::showpoint|ios::fixed);
os.precision(2);
os << cmd << spacing_string[getSpace()]
- << " " << getValue() << " \n";
+ << ' ' << getValue() << " \n";
} else {
os << cmd << spacing_string[getSpace()] << " \n";
}
{
ostringstream ost;
ost << "\\begin{spacing}{"
- << getValue() << "}";
+ << getValue() << '}';
return STRCONV(ost.str());
}
}
string const func = lex.getString();
lyxerr[Debug::PARSER]
<< "Toolbar::read TO_ADD func: `"
- << func << "'" << endl;
+ << func << '\'' << endl;
add(func);
}
break;
ostream & operator<<(ostream & o, Box const & b)
{
- return o << "x1,y1: " << b.x1 << "," << b.y1
- << " x2,y2: " << b.x2 << "," << b.y2
+ return o << "x1,y1: " << b.x1 << ',' << b.y1
+ << " x2,y2: " << b.x2 << ',' << b.y2
<< std::endl;
}
if (token.empty()) continue;
lyxerr[Debug::PARSER] << "Handling token: `"
- << token << "'" << endl;
+ << token << '\'' << endl;
the_end_read =
parseSingleLyXformat2Token(lex, par, first_par,
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 == "~") {
string const s = fmt.str();
#else
string const s = _("Unknown token: ") + token
- + " " + lex.text() + "\n";
+ + ' ' + 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.
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:
// 2) In HOME directory.
string s = AddName(GetEnvPath("HOME"), buf->fileName());
s += ".emergency";
- lyxerr << " " << s << endl;
+ lyxerr << ' ' << s << endl;
if (buf->writeFile(s)) {
buf->markClean();
lyxerr << _(" Save seems successful. Phew.") << endl;
// drive letter on OS/2
s = AddName(MakeAbsPath("/tmp/"), buf->fileName());
s += ".emergency";
- lyxerr << " " << s << endl;
+ lyxerr << ' ' << s << endl;
if (buf->writeFile(s)) {
buf->markClean();
lyxerr << _(" Save seems successful. Phew.") << endl;
case Spacing::Other:
state << _("Other (")
<< text->cursor.par()->params().spacing().getValue()
- << ")";
+ << ')';
break;
case Spacing::Default:
// should never happen, do nothing
string const str = STRCONV(sub.str(2));
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "Chardef: " << n
- << " to [" << str << "]" << endl;
+ << " to [" << str << ']' << endl;
map_[str] = n;
}
}
pair<bool, int> const CharacterSet::encodeString(string const & str) const
{
- lyxerr[Debug::KBMAP] << "Checking if we know [" << str << "]" << endl;
+ lyxerr[Debug::KBMAP] << "Checking if we know [" << str << ']' << endl;
bool ret = false;
int val = 0;
Cdef::const_iterator cit = map_.find(str);
}
lyxerr[Debug::KBMAP] << " "
<< (ret ? "yes we" : "no we don't")
- << " know [" << str << "]" << endl;
+ << " know [" << str << ']' << endl;
return make_pair(ret, val);
}
if (format_name == "dvi" &&
!lyxrc.view_dvi_paper_option.empty()) {
- command += " " + lyxrc.view_dvi_paper_option;
+ command += ' ' + lyxrc.view_dvi_paper_option;
string paper_size = converters.papersize(buffer);
if (paper_size == "letter")
paper_size = "us";
- command += " " + paper_size;
+ command += ' ' + paper_size;
if (buffer->params.orientation
== BufferParams::ORIENTATION_LANDSCAPE)
command += 'r';
}
if (!contains(command, token_from))
- command += " " + token_from;
+ command += ' ' + token_from;
command = subst(command, token_from,
QuoteName(OnlyFilename(filename)));
CounterList::iterator it = counterList.find(ctr);
if (it == counterList.end()) {
lyxerr << "Counter does not exist." << endl;
- return "";
+ return string();
}
if (!first) {
- s << "." << value(ctr);
+ s << '.' << value(ctr);
} else {
if (numbertype == "sectioning" || numbertype == "appendix") {
if (numbertype == "appendix") {
<< endl;
#else
o << _("Debugging `") << errorTags[i].name << "' ("
- << _(errorTags[i].desc) << ")"
+ << _(errorTags[i].desc) << ')'
<< endl;
#endif
}
* Licence details can be found in the file COPYING.
*
* \author Lars Gullik Bjønnes
- * \author John Levon
+ * \author John Levon
*
* Full author contact details are available in file CREDITS
*/
minimize_title = OnlyFilename(cur_title);
if (!buffer()->isClean()) {
maximize_title += _(" (changed)");
- minimize_title += "*";
+ minimize_title += '*';
}
if (buffer()->isReadonly())
maximize_title += _(" (read only)");
// substitute the correct BufferView here
FuncRequest r = req;
r.setView(view().get());
- getLyXFunc().dispatch(r);
+ getLyXFunc().dispatch(r);
}
* Licence details can be found in the file COPYING.
*
* \author unknown
- * \author John Levon
+ * \author John Levon
*
* Full author contact details are available in file CREDITS
*/
/// begin painting
virtual void start() {}
-
+
/// end painting
virtual void end() {}
-
+
/// return the width of the work area in pixels
virtual int paperWidth() const = 0;
/// return the height of the work area in pixels
LColor::color = LColor::foreground,
line_style = line_solid,
line_width = line_thin) = 0;
-
+
/// draw a filled rectangle
virtual Painter & fillRectangle(
int x, int y,
int w, int h,
LColor::color) = 0;
-
+
/// draw a filled (irregular) polygon
virtual Painter & fillPolygon(
int const * xp,
virtual Painter & point(
int x, int y,
LColor::color = LColor::foreground) = 0;
-
+
/// draw a filled rectangle with the shape of a 3D button
virtual Painter & button(int x, int y,
int w, int h);
virtual Painter & image(int x, int y,
int w, int h,
grfx::Image const & image) = 0;
-
+
/// draw a string at position x, y (y is the baseline)
virtual Painter & text(int x, int y,
string const & str, LyXFont const & f) = 0;
protected:
/// check the font, and if set, draw an underline
- void underline(LyXFont const & f,
+ void underline(LyXFont const & f,
int x, int y, int width);
-
+
/// draw a bevelled button border
- Painter & buttonFrame(int x, int y, int w, int h);
+ Painter & buttonFrame(int x, int y, int w, int h);
};
#endif // PAINTER_H
pattern = "*";
// FIXME: a temporary hack until the FileDialog interface is updated
- pattern += "|";
+ pattern += '|';
std::pair<string, string> dir1(N_("Documents|#o#O"),
string(lyxrc.document_path));
#include "ControlMath.h"
#include "ViewBase.h"
-#include "debug.h"
+#include "debug.h"
#include "funcrequest.h"
#include "frontends/LyXView.h"
"lessdot", "lll", "lessgtr", "gtreqless", "gtreqqless", "eqcirc",
"lesseqgtr", "lesseqqgtr", "doteqdot", "circeq", "triangleq", "thicksim",
"risingdotseq", "fallingdotseq", "backsim", "thickapprox", "supseteqq", "Supset",
- "backsimeq", "subseteqq", "Subset","sqsupset", "succcurlyeq", "curlyeqsucc",
+ "backsimeq", "subseteqq", "Subset", "sqsupset", "succcurlyeq", "curlyeqsucc",
"sqsubset", "preccurlyeq", "curlyeqprec", "succsim", "succapprox", "vartriangleright",
"precsim", "precapprox", "vartriangleleft", "trianglerighteq", "Vdash", "shortmid",
"trianglelefteq", "vDash", "Vvdash", "shortparallel", "between", "pitchfork",
char const * latex_ams_nrel[] = {
"nless", "nleq", "nleqslant", "ngeqslant", "ngeqq", "gneq",
- "nleqq", "lneq", "lneqq","gneqq", "gvertneqq", "gnsim",
+ "nleqq", "lneq", "lneqq", "gneqq", "gvertneqq", "gnsim",
"lvertneqq", "lnsim", "lnapprox", "gnapprox", "nsucc", "nsucceq",
"nprec", "npreceq", "precnsim","succnsim", "succnapprox", "ncong",
"precnapprox", "nsim", "nshortmid", "nshortparallel", "nparallel", "nvDash",
- "nmid", "nvdash", "nvDash","nVDash", "ntriangleright", "ntrianglerighteq",
+ "nmid", "nvdash", "nvDash", "nVDash", "ntriangleright", "ntrianglerighteq",
"ntriangleleft", "ntrianglelefteq", "nsubseteq", "nsupseteq", "nsupseteqq", "supsetneq",
"subsetneq", "varsubsetneq", "subsetneqq", "varsupsetneq", "supsetneqq", "varsupsetneqq",
- "varsubsetneqq", "ngtr", "ngeq","", "", ""
+ "varsubsetneqq", "ngtr", "ngeq", "", "", ""
};
int const nr_latex_ams_nrel = sizeof(latex_ams_nrel) / sizeof(char const *);
int const nr_latex_ams_ops = sizeof(latex_ams_ops) / sizeof(char const *);
-
+
string const find_xpm(string const & name)
{
+#warning Use a static table for this (Lgb)
+ // And get O(log n) lookup (Lgb)
+
string xpm_name = subst(name, ' ', '_');
if (xpm_name == "(") xpm_name = "lparen";
else if (xpm_name == ")") xpm_name = "rparen";
else if (xpm_name == "Xi") xpm_name = "xi2";
lyxerr[Debug::GUI] << "Looking for math XPM called \""
- << xpm_name << "\"" << std::endl;
-
+ << xpm_name << '"' << std::endl;
+
return LibFileSearch("images/math/", xpm_name, "xpm");
}
#endif
#include <utility>
-
+
#include "ControlPrefs.h"
#include "ViewBase.h"
extern string system_lyxdir;
extern string user_lyxdir;
-
+
using std::endl;
using std::pair;
-
+
ControlPrefs::ControlPrefs(LyXView & lv, Dialogs & d)
: ControlDialogBI(lv, d)
{}
void ControlPrefs::apply()
{
view().apply();
- lyxrc = rc_;
+ lyxrc = rc_;
}
lv_.dispatch(FuncRequest(LFUN_SAVEPREFERENCES));
}
-
+
string const ControlPrefs::browsebind(string const & file)
{
string dir = AddName(system_lyxdir, "bind");
// FIXME: stupid name
string name = _("System Bind|#S#s");
pair<string,string> dir1(name, dir);
-
+
dir = AddName(user_lyxdir, "bind");
// FIXME: stupid name
name = _("User Bind|#U#u");
pair<string,string> dir2(name, dir);
-
+
return browseFile(&lv_, file, _("Choose bind file"), "*.bind", false, dir1, dir2);
}
// FIXME: stupid name
string name = _("Sys UI|#S#s");
pair<string,string> dir1(name, dir);
-
+
dir = AddName(user_lyxdir, "ui");
// FIXME: stupid name
name = _("User UI|#U#u");
pair<string,string> dir2(name, dir);
-
+
return browseFile(&lv_, file, _("Choose UI file"), "*.ui", false, dir1, dir2);
}
-
+
string const ControlPrefs::browsekbmap(string const & file)
{
string const dir = AddName(system_lyxdir, "kbd");
string const name = _("Key maps|#K#k");
pair<string, string> dir1(name, dir);
-
+
return browseFile(&lv_, file, _("Choose keyboard map"), "*.kmap", false, dir1);
}
-
+
string const ControlPrefs::browsedict(string const & file)
{
return browseFile(&lv_, file, _("Choose personal dictionary"), "*.ispell");
}
-
-
+
+
string const ControlPrefs::browse(string const & file, string const & title)
{
return browseFile(&lv_, file, title, "*", true);
{
// we must be sure to get the new values first
lyxrc = rc_;
-
+
lv_.getDialogs().redrawGUI();
}
-
+
void ControlPrefs::setColor(LColor::color col, string const & hex)
{
- string const s = lcolor.getLyXName(col) + string(" ") + hex;
+ string const s = lcolor.getLyXName(col) + ' ' + hex;
lv_.dispatch(FuncRequest(LFUN_SET_COLOR, s));
}
{
// we must be sure to get the new values first
lyxrc = rc_;
-
+
lv_.dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
}
-
-
+
+
void ControlPrefs::setConverters(Converters const & conv)
-{
+{
converters = conv;
converters.update(formats);
converters.buildGraph();
+ tostr(pp.count_copies)
+ ' ';
}
-
+
if (pp.reverse_order) {
command += lyxrc.print_reverse_flag + ' ';
}
// case 1: print to a file
command += lyxrc.print_to_file
+ QuoteName(MakeAbsPath(pp.file_name, path))
- + ' '
+ + ' '
+ QuoteName(dviname);
res = one.startscript(Systemcall::DontWait, command);
break;
}
- lyxerr[Debug::LATEX] << "ControlPrint::apply(): print command = \"" << command << "\"" << endl;
+ lyxerr[Debug::LATEX] << "ControlPrint::apply(): print command = \""
+ << command << '"' << endl;
if (res != 0) {
Alert::alert(_("Error:"),
_("Unable to print"),
_("Check that your parameters are correct"));
- }
+ }
}
view().apply();
- string const val = tostr(params().first) + " " + tostr(params().second);
+ string const val = tostr(params().first) + ' ' + tostr(params().second);
lyxfunc().dispatch(FuncRequest(LFUN_TABULAR_INSERT, val));
}
// "Surname, F."
// "FirstName Surname"
// "F. Surname"
- string::size_type idx = fname.find(",");
+ string::size_type idx = fname.find(',');
if (idx != string::npos)
return ltrim(fname.substr(0, idx));
- idx = fname.rfind(".");
+ idx = fname.rfind('.');
if (idx != string::npos)
fname = ltrim(fname.substr(idx + 1));
// test if we have a LaTeX Space in front
string data = key;
InfoMap::const_iterator info = map_.find(key);
if (info != map_.end())
- data += " " + info->second;
+ data += ' ' + info->second;
// Attempts to find a match for the current RE
// somewhere in data.
// with a space
if (!dummy.empty()) {
if (!contains(dummy, "="))
- data_ += (' ' + dummy);
+ data_ += ' ' + dummy;
else
data_ += dummy;
}
keyvalue = dummy;
dummy = token(data, ',', Entries++);
while (!contains(dummy, '=') && !dummy.empty()) {
- keyvalue += (',' + dummy);
+ keyvalue += ',' + dummy;
dummy = token(data, ',', Entries++);
}
if (full) {
CiteStyle const * last = citeStylesFull + nCiteStylesFull;
if (std::find(citeStylesFull, last, command) != last)
- cite += "*";
+ cite += '*';
}
if (forceUCase) {
break;
case CITEYEARPAR:
- str = "(" + year + ")";
+ str = '(' + year + ')';
break;
}
switch (styles[i]) {
case CITE:
case CITET:
- str = author + " (" + year + ")";
+ str = author + " (" + year + ')';
break;
case CITEP:
- str = "(" + author + ", " + year + ")";
+ str = '(' + author + ", " + year + ')';
break;
case CITEALT:
- str = author + " " + year ;
+ str = author + ' ' + year ;
break;
case CITEALP:
break;
case CITEYEARPAR:
- str = "(" + year + ")";
+ str = '(' + year + ')';
break;
}
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Michael Koziarski
+ * \author Michael Koziarski
*
* Full author contact details are available in file CREDITS
*/
{
string placement;
if (here_definitely()->get_active()) {
- placement += "H";
+ placement += 'H';
} else {
if (top_of_page()->get_active()) {
- placement += "t";
+ placement += 't';
}
if (bottom_of_page()->get_active()) {
- placement += "b";
+ placement += 'b';
}
if (page_of_floats()->get_active()) {
- placement += "p";
+ placement += 'p';
}
if (here_if_possible()->get_active()) {
- placement += "h";
+ placement += 'h';
}
}
controller().params().placement = placement;
here = true;
}
}
-
+
top_of_page()->set_active(top);
page_of_floats()->set_active(page);
bottom_of_page()->set_active(bottom);
);
}
-void GFloat::disconnect_signals()
+void GFloat::disconnect_signals()
{
conn_top_.disconnect();
conn_bottom_.disconnect();
conn_disable_.disconnect();
}
-void GFloat::update_sensitive()
+void GFloat::update_sensitive()
{
- if (here_definitely()->get_active())
+ if (here_definitely()->get_active())
other_options()->set_sensitive(false);
- else
+ else
other_options()->set_sensitive(true);
}
-Gtk::HBox * GFloat::other_options() const
+Gtk::HBox * GFloat::other_options() const
{
- return getWidget<Gtk::HBox>("r_other_options");
+ return getWidget<Gtk::HBox>("r_other_options");
}
-Gtk::CheckButton * GFloat::page_of_floats() const
+Gtk::CheckButton * GFloat::page_of_floats() const
{
- return getWidget<Gtk::CheckButton>("r_page_of_floats");
+ return getWidget<Gtk::CheckButton>("r_page_of_floats");
}
-Gtk::CheckButton * GFloat::top_of_page() const
+Gtk::CheckButton * GFloat::top_of_page() const
{
- return getWidget<Gtk::CheckButton>("r_top_of_page");
+ return getWidget<Gtk::CheckButton>("r_top_of_page");
}
-Gtk::CheckButton * GFloat::bottom_of_page() const
+Gtk::CheckButton * GFloat::bottom_of_page() const
{
- return getWidget<Gtk::CheckButton>("r_bottom_of_page");
+ return getWidget<Gtk::CheckButton>("r_bottom_of_page");
}
-Gtk::CheckButton * GFloat::here_if_possible() const
+Gtk::CheckButton * GFloat::here_if_possible() const
{
- return getWidget<Gtk::CheckButton>("r_here_if_possible");
+ return getWidget<Gtk::CheckButton>("r_here_if_possible");
}
-Gtk::RadioButton * GFloat::here_definitely() const
+Gtk::RadioButton * GFloat::here_definitely() const
{
- return getWidget<Gtk::RadioButton>("r_here_definitely");
+ return getWidget<Gtk::RadioButton>("r_here_definitely");
}
-Gtk::Button * GFloat::close_btn() const
+Gtk::Button * GFloat::close_btn() const
{
- return getWidget<Gtk::Button>("r_close_btn");
+ return getWidget<Gtk::Button>("r_close_btn");
}
#include "Alert.h"
#include "Alert_pimpl.h"
+#include "BoostFormat.h"
+
+
using std::pair;
using std::make_pair;
void alert_pimpl(string const & s1, string const & s2, string const & s3)
{
QMessageBox::warning(0, "LyX",
- (s1 + "\n" + "\n" + s2 + "\n" + s3).c_str());
+ (s1 + '\n' + '\n' + s2 + '\n' + s3).c_str());
}
bool askQuestion_pimpl(string const & s1, string const & s2, string const & s3)
{
- return !(QMessageBox::information(0, "LyX", (s1 + "\n" + s2 + "\n" + s3).c_str(),
+ return !(QMessageBox::information(0, "LyX", (s1 + '\n' + s2 + '\n' + s3).c_str(),
_("&Yes"), _("&No"), 0, 1));
}
int askConfirmation_pimpl(string const & s1, string const & s2, string const & s3)
{
- return (QMessageBox::information(0, "LyX", (s1 + "\n" + s2 + "\n" + s3).c_str(),
+ return (QMessageBox::information(0, "LyX", (s1 + '\n' + s2 + '\n' + s3).c_str(),
_("&Yes"), _("&No"), _("&Cancel"), 0, 2)) + 1;
}
pair<bool, string> const
askForText_pimpl(string const & msg, string const & dflt)
{
- string title = _("LyX: ");
- title += msg;
-
+#if USE_BOOST_FORMAT
+ boost::format fmt(_("LyX: %1$s"));
+ fmt % msg;
+ string const title = fmt.str();
+#else
+ string const title = _("LyX: ") + msg;
+#endif
QAskForTextDialog d(0, title.c_str(), true);
// less than ideal !
- d.askLA->setText((string("&") + msg).c_str());
+ d.askLA->setText(('&' + msg).c_str());
d.askLE->setText(dflt.c_str());
d.askLE->setFocus();
int ret = d.exec();
+2002-11-27 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * Alert_pimpl.C (askForText_pimpl): use boost.format
+
2002-11-26 John Levon <levon@movementarian.org>
* QMathDialog.C:
* Toolbar_pimpl.h:
* Toolbar_pimpl.C: Qt is the Lord of Suck
-
+
2002-11-25 John Levon <levon@movementarian.org>
* qscreen.C: use LColor::cursor properly
* QPrefs.C:
* ui/QPrefKeyboardModule.ui:
* ui/QPrefUIModule.ui: UI fixes
-
+
2002-11-25 Herbert Voss <Herbert.Voss@alumni.TU-Berlin.DE>
* QVCLog.C (update_contents): fix USE_BOOST_FORMAT
return result;
}
-
+
FileDialog::Result const FileDialog::open(string const & path,
string const & mask,
string const & suggested)
string::size_type pos = label.find(sc[1]);
if (pos == string::npos)
return label;
- label.insert(pos, "&");
+ label.insert(pos, 1, '&');
return label;
}
if (comp.empty()) {
edit_->setText(new_input.c_str());
- // show_info_suffix(("[only completion]"), new_input + " ");
+ // show_info_suffix(("[only completion]"), new_input + ' ');
return;
}
void QCommandBuffer::complete_selected(QString const & str)
{
- edit_->setText(str + " ");
+ edit_->setText(str + ' ');
QWidget const * widget = static_cast<QWidget const *>(sender());
const_cast<QWidget *>(widget)->hide();
}
{
stored_input_ = input;
info_suffix_shown_ = true;
- set_input(input + " " + suffix);
+ set_input(input + ' ' + suffix);
suffix_timer_->start();
}
void QContentPane::keyPressEvent(QKeyEvent * e)
{
lyxerr[Debug::KEY] << "Press key " << e->key()
- << " text \"" << (e->text().isEmpty() ? "none" : e->text().latin1())
- << "\", ascii \"" << e->ascii() << "\"" << endl;
+ << " text \""
+ << (e->text().isEmpty() ?
+ "none" :
+ e->text().latin1())
+ << "\", ascii \"" << e->ascii() << '"' << endl;
QLyXKeySym * sym = new QLyXKeySym();
sym->set(e);
wa_->workAreaKeyPress(LyXKeySymPtr(sym), q_key_state(e->state()));
QRect r(e->rect());
lyxerr[Debug::GUI] << "repainting " << r.x()
- << "," << r.y() << " " << r.width()
- << "," << r.height() << endl;
+ << ',' << r.y() << ' ' << r.width()
+ << ',' << r.height() << endl;
QPainter q(this);
q.drawPixmap(QPoint(r.x(), r.y()),
*pixmap_.get(), r);
leftIP->add(QPixmap(xpm.c_str()), delim[i], delim[i]);
rightIP->add(QPixmap(xpm.c_str()), delim[i], delim[i]);
}
-
+
string empty_xpm(find_xpm("empty"));
-
+
leftIP->add(QPixmap(empty_xpm.c_str()), "empty", "empty");
rightIP->add(QPixmap(empty_xpm.c_str()), "empty", "empty");
connect(leftIP, SIGNAL(button_clicked(string const &)), this, SLOT(ldelim_clicked(string const &)));
void QDelimiterDialog::insertClicked()
{
- form_->insertDelim(fix_name(left_) + " " + fix_name(right_));
+ form_->insertDelim(fix_name(left_) + ' ' + fix_name(right_));
}
string placement;
if (dialog_->heredefinitelyCB->isChecked()) {
- placement += "H";
+ placement += 'H';
} else {
if (dialog_->ignoreCB->isChecked()) {
- placement += "!";
+ placement += '!';
}
if (dialog_->topCB->isChecked()) {
- placement += "t";
+ placement += 't';
}
if (dialog_->bottomCB->isChecked()) {
- placement += "b";
+ placement += 'b';
}
if (dialog_->pageCB->isChecked()) {
- placement += "p";
+ placement += 'p';
}
if (dialog_->herepossiblyCB->isChecked()) {
- placement += "h";
+ placement += 'h';
}
}
params.placement = placement;
find(v.begin(), v.end(), s);
return (cit != v.end()) ? int(cit - v.begin()) : 0;
}
-
+
// returns the number of the unit in the array unit_name,
// which is defined in lengthcommon.C
int getUnitNo(char const * c[], string const & s) {
++i;
return (i < num_units) ? i : 0;
}
-
+
}
dialog_->rtXunit->insertItem((*it).c_str(), -1);
dialog_->rtYunit->insertItem((*it).c_str(), -1);
}
-
+
InsetGraphicsParams & igp = controller().params();
// set the right default unit
//// the output section (width/height)
// set the length combo boxes
// only the width has the possibility for scale%. The original
- // units are defined in lengthcommon.C
+ // units are defined in lengthcommon.C
// 1. the width (a listttype)
dialog_->widthUnit->clear();
dialog_->widthUnit->insertItem(_("Scale%"));
- for (int i = 0; i < num_units; i++)
+ for (int i = 0; i < num_units; i++)
dialog_->widthUnit->insertItem(unit_name_gui[i], -1);
if (!lyx::float_equal(igp.scale, 0.0, 0.05)) {
dialog_->angle->setText(tostr(igp.rotateAngle).c_str());
dialog_->origin->clear();
-
+
using namespace frnt;
vector<RotationOriginPair> origindata = getRotationOriginData();
vector<string> const origin_lang = getFirst(origindata);
for (vector<string>::const_iterator it = origin_lang.begin();
it != origin_lang.end(); ++it)
dialog_->origin->insertItem((*it).c_str(), -1);
-
+
if (!igp.rotateOrigin.empty())
dialog_->origin->setCurrentItem(
::getItemNo(origin_ltx, igp.rotateOrigin));
else
dialog_->origin->setCurrentItem(0);
- //// latex section
+ //// latex section
dialog_->latexoptions->setText(igp.special.c_str());
}
string lbY(dialog_->lbY->text());
string rtX(dialog_->rtX->text());
string rtY(dialog_->rtY->text());
- int bb_sum =
- strToInt(lbX) + strToInt(lbY) +
+ int bb_sum =
+ strToInt(lbX) + strToInt(lbY) +
strToInt(rtX) + strToInt(rtX);
if (bb_sum) {
if (lbX.empty())
bb = lbX + dialog_->lbXunit->currentText().latin1() + ' ';
if (lbY.empty())
bb += "0 ";
- else
+ else
bb += (lbY + dialog_->lbYunit->currentText().latin1() + ' ');
if (rtX.empty())
bb += "0 ";
- else
+ else
bb += (rtX + dialog_->rtXunit->currentText().latin1() + ' ');
if (rtY.empty())
- bb += "0";
- else
+ bb += '0';
+ else
bb += (rtY + dialog_->rtYunit->currentText().latin1());
igp.bb = bb;
}
string value(dialog_->width->text());
if (dialog_->widthUnit->currentItem() > 0) {
// width/height combination
- int const unitNo = getUnitNo(unit_name_gui,
+ int const unitNo = getUnitNo(unit_name_gui,
string(dialog_->widthUnit->currentText()));
igp.width = LyXLength(value + unit_name_ltx[unitNo]);
- igp.scale = 0.0;
+ igp.scale = 0.0;
} else {
// scaling instead of a width
- igp.scale = strToDbl(value);
- igp.width = LyXLength();
+ igp.scale = strToDbl(value);
+ igp.width = LyXLength();
}
value = string(dialog_->height->text());
- int const unitNo = getUnitNo(unit_name_gui,
+ int const unitNo = getUnitNo(unit_name_gui,
string(dialog_->heightUnit->currentText()));
igp.height = LyXLength(value + unit_name_ltx[unitNo]);
// save the latex name for the origin. If it is the default
// then origin_ltx returns ""
- igp.rotateOrigin =
+ igp.rotateOrigin =
QGraphics::origin_ltx[dialog_->origin->currentItem()];
// more latex options
lyxerr[Debug::GRAPHICS] << "setPixmap()" << endl;
// FIXME: it's a fake kind of grayscale !
-
+
switch (params.display) {
case GrayscaleDisplay:
case MonochromeDisplay: {
xformed_pixmap_.convertFromImage(i, QPixmap::Mono);
break;
}
-
+
default:
break;
}
if (width == getWidth() && height == getHeight())
return;
- lyxerr[Debug::GRAPHICS] << "resizing image to " << width << "(" <<
- (double(width)/getWidth()) << ")," << height << "(" <<
- (double(height)/getHeight()) << ")" << endl;
+ lyxerr[Debug::GRAPHICS] << "resizing image to " << width << '('
+ << (double(width)/getWidth()) << "),"
+ << height << '('
+ << (double(height)/getHeight()) << ')' << endl;
QWMatrix m;
m.scale(double(width) / getWidth(), double(height) / getHeight());
xformed_pixmap_ = xformed_pixmap_.xForm(m);
line_style ls,
line_width lw)
{
- //lyxerr << "rectangle " << x<<","<<y << " " <<w<<","<<h<<endl;
+ //lyxerr << "rectangle " << x << ',' << y << ' '
+ // << w << ',' << h << endl;
setPen(col, ls, lw).drawRect(x, y, w, h);
return *this;
}
int w, int h,
LColor::color col)
{
- //lyxerr << "fillRectangle " << x<<","<<y << " " <<w<<","<<h<<endl;
+ //lyxerr << "fillRectangle " << x << ',' << y << ' '
+ // << w << ',' << h << endl;
qp_->fillRect(x, y, w, h, QColor(lcolor.getX11Name(col).c_str()));
return *this;
}
unsigned int w, unsigned int h,
int a1, int a2, LColor::color col)
{
- lyxerr[Debug::GUI] << "arc: " << x<<","<<y
- << " " << w<<","<<h << ", angles "
+ lyxerr[Debug::GUI] << "arc: " << x << ',' << y
+ << ' ' << w << ',' << h << ", angles "
<< a1 << " - " << a2 << endl;
// LyX usings 1/64ths degree, Qt usings 1/16th
setPen(col).drawArc(x, y, w, h, a1 / 4, a2 / 4);
#include "lyxfunc.h"
#include "kbmap.h"
#include "debug.h"
-
+
#include "QtView.h"
#include "QLPopupMenu.h"
#include <boost/scoped_ptr.hpp>
-
+
using std::pair;
using std::make_pair;
-
+
extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
-
+
namespace {
string const getLabel(MenuItem const & mi)
string::size_type pos = label.find(shortcut);
if (pos == string::npos)
return label;
- label.insert(pos, "&");
-
+ label.insert(pos, 1, '&');
+
if (mi.kind() == MenuItem::Command) {
// FIXME: backend should do this
string const accel(toplevel_keymap->findbinding(mi.action()));
-
+
if (!accel.empty()) {
- label += "\t" + accel.substr(1, accel.find(']') - 1);
+ label += '\t' + accel.substr(1, accel.find(']') - 1);
}
-
+
lyxerr[Debug::GUI] << "Label: " << mi.label()
<< " Shortcut: " << mi.shortcut()
<< " Accel: " << accel << endl;
file.close();
- editor += " " + filename;
+ editor += ' ' + filename;
Forkedcall call;
#include "support/lstrings.h"
#include "Lsstream.h"
#include <iomanip>
-
+
#include "ControlPrefs.h"
#include "QPrefsDialog.h"
#include "ui/QPrefAsciiModule.h"
#include <qcheckbox.h>
#include <qlineedit.h>
#include <qspinbox.h>
-#include <qcombobox.h>
+#include <qcombobox.h>
#include <qlistbox.h>
#include <qlabel.h>
#include "qcoloritem.h"
-
+
using std::vector;
using std::ostringstream;
using std::setfill;
using std::setw;
using std::endl;
-
+
typedef Qt2CB<ControlPrefs, Qt2DB<QPrefsDialog> > base_class;
bc().setApply(dialog_->applyPB);
bc().setCancel(dialog_->closePB);
bc().setRestore(dialog_->restorePB);
-
+
QPrefLanguageModule * langmod(dialog_->languageModule);
-
+
langmod->defaultLanguageCO->clear();
// store the lang identifiers for later
vector<frnt::LanguagePair> const langs = frnt::getLanguageData(false);
{
LyXRC & rc(controller().rc());
- // do something ...
+ // do something ...
QPrefLanguageModule * langmod(dialog_->languageModule);
-
+
// FIXME: remove rtl_support bool
rc.rtl_support = langmod->rtlCB->isChecked();
- rc.mark_foreign_language = langmod->markForeignCB->isChecked();
- rc.language_auto_begin = langmod->autoBeginCB->isChecked();
- rc.language_auto_end = langmod->autoEndCB->isChecked();
+ rc.mark_foreign_language = langmod->markForeignCB->isChecked();
+ rc.language_auto_begin = langmod->autoBeginCB->isChecked();
+ rc.language_auto_end = langmod->autoEndCB->isChecked();
rc.language_use_babel = langmod->useBabelCB->isChecked();
rc.language_global_options = langmod->globalCB->isChecked();
rc.language_package = langmod->languagePackageED->text().latin1();
rc.language_command_begin = langmod->startCommandED->text().latin1();
rc.language_command_end = langmod->endCommandED->text().latin1();
- rc.default_language = lang_[langmod->defaultLanguageCO->currentItem()];
+ rc.default_language = lang_[langmod->defaultLanguageCO->currentItem()];
- QPrefUIModule * uimod(dialog_->uiModule);
+ QPrefUIModule * uimod(dialog_->uiModule);
rc.ui_file = uimod->uiFileED->text().latin1();
rc.bind_file = uimod->bindFileED->text().latin1();
- rc.cursor_follows_scrollbar = uimod->cursorFollowsCB->isChecked();
+ rc.cursor_follows_scrollbar = uimod->cursorFollowsCB->isChecked();
rc.wheel_jump = uimod->wheelMouseSB->value();
rc.autosave = uimod->autoSaveSB->value() * 60;
rc.make_backup = uimod->autoSaveCB->isChecked();
rc.num_lastfiles = uimod->lastfilesSB->value();
-
-
+
+
QPrefKeyboardModule * keymod(dialog_->keyboardModule);
- // FIXME: can derive CB from the two EDs
+ // FIXME: can derive CB from the two EDs
rc.use_kbmap = keymod->keymapCB->isChecked();
rc.primary_kbmap = keymod->firstKeymapED->text().latin1();
rc.secondary_kbmap = keymod->secondKeymapED->text().latin1();
-
+
QPrefAsciiModule * ascmod(dialog_->asciiModule);
QPrefLatexModule * latexmod(dialog_->latexModule);
rc.fontenc = latexmod->latexEncodingED->text().latin1();
- rc.chktex_command = latexmod->latexChecktexED->text().latin1();
+ rc.chktex_command = latexmod->latexChecktexED->text().latin1();
rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
rc.view_dvi_paper_option = latexmod->latexDviPaperED->text().latin1();
rc.default_papersize =
QPrefDisplayModule * displaymod(dialog_->displayModule);
rc.preview = displaymod->previewCB->isChecked();
-
+
grfx::DisplayType dtype(grfx::ColorDisplay);
-
+
switch (displaymod->displayGraphicsCO->currentItem()) {
case 3: dtype = grfx::NoDisplay; break;
case 2: dtype = grfx::ColorDisplay; break;
case 0: dtype = grfx::MonochromeDisplay; break;
}
rc.display_graphics = dtype;
-
+
#ifdef WITH_WARNINGS
#warning FIXME!! The graphics cache no longer has a changeDisplay method.
#endif
gc.changeDisplay();
}
#endif
-
+
QPrefPathsModule * pathsmod(dialog_->pathsModule);
-
+
rc.document_path = pathsmod->workingDirED->text().latin1();
rc.template_path = pathsmod->templateDirED->text().latin1();
rc.backupdir_path = pathsmod->backupDirED->text().latin1();
rc.isp_command = "ispell";
else
rc.isp_command = "aspell";
-
+
// FIXME: remove isp_use_alt_lang
rc.isp_alt_lang = spellmod->altLanguageED->text().latin1();
- rc.isp_use_alt_lang = !rc.isp_alt_lang.empty();
- // FIXME: remove isp_use_esc_chars
+ rc.isp_use_alt_lang = !rc.isp_alt_lang.empty();
+ // FIXME: remove isp_use_esc_chars
rc.isp_esc_chars = spellmod->escapeCharactersED->text().latin1();
rc.isp_use_esc_chars = !rc.isp_esc_chars.empty();
- // FIXME: remove isp_use_pers_dict
+ // FIXME: remove isp_use_pers_dict
rc.isp_pers_dict = spellmod->persDictionaryED->text().latin1();
rc.isp_use_pers_dict = !rc.isp_pers_dict.empty();
rc.isp_accept_compound = spellmod->compoundWordCB->isChecked();
QPrefScreenFontsModule * fontmod(dialog_->screenfontsModule);
LyXRC const oldrc(rc);
-
+
rc.roman_font_name = fontmod->screenRomanCO->currentText().latin1();
rc.sans_font_name = fontmod->screenSansCO->currentText().latin1();
rc.typewriter_font_name = fontmod->screenTypewriterCO->currentText().latin1();
|| rc.zoom != oldrc.zoom || rc.dpi != oldrc.dpi) {
controller().updateScreenFonts();
}
-
+
controller().setConverters(converters_);
- controller().setFormats(formats_);
+ controller().setFormats(formats_);
QPrefColorsModule * colmod(dialog_->colorsModule);
-
+
unsigned int i;
for (i = 0; i < colmod->lyxObjectsLB->count(); ++i) {
QColorItem * ci(static_cast<QColorItem*>(ib));
ostringstream ostr;
-
- ostr << "#" << std::setbase(16) << setfill('0')
+
+ ostr << '#' << std::setbase(16) << setfill('0')
<< setw(2) << ci->color().red()
<< setw(2) << ci->color().green()
<< setw(2) << ci->color().blue();
-
+
string newhex(STRCONV(ostr.str()));
LColor::color col(dialog_->colors_[i]);
}
-// FIXME: move to helper_funcs.h
+// FIXME: move to helper_funcs.h
namespace {
-
+
template<class A>
typename std::vector<A>::size_type
findPos(std::vector<A> const & vec, A const & val)
LyXRC const & rc(controller().rc());
QPrefLanguageModule * langmod(dialog_->languageModule);
-
+
// FIXME: remove rtl_support bool
langmod->rtlCB->setChecked(rc.rtl_support);
- langmod->markForeignCB->setChecked(rc.mark_foreign_language);
- langmod->autoBeginCB->setChecked(rc.language_auto_begin);
- langmod->autoEndCB->setChecked(rc.language_auto_end);
+ langmod->markForeignCB->setChecked(rc.mark_foreign_language);
+ langmod->autoBeginCB->setChecked(rc.language_auto_begin);
+ langmod->autoEndCB->setChecked(rc.language_auto_end);
langmod->useBabelCB->setChecked(rc.language_use_babel);
langmod->globalCB->setChecked(rc.language_global_options);
langmod->languagePackageED->setText(rc.language_package.c_str());
int const pos = int(findPos(lang_, rc.default_language));
langmod->defaultLanguageCO->setCurrentItem(pos);
- QPrefUIModule * uimod(dialog_->uiModule);
+ QPrefUIModule * uimod(dialog_->uiModule);
uimod->uiFileED->setText(rc.ui_file.c_str());
uimod->bindFileED->setText(rc.bind_file.c_str());
- uimod->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
+ uimod->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
uimod->wheelMouseSB->setValue(rc.wheel_jump);
// convert to minutes
int mins(rc.autosave / 60);
uimod->autoSaveSB->setValue(mins);
uimod->autoSaveCB->setChecked(rc.make_backup);
uimod->lastfilesSB->setValue(rc.num_lastfiles);
-
-
+
+
QPrefKeyboardModule * keymod(dialog_->keyboardModule);
- // FIXME: can derive CB from the two EDs
+ // FIXME: can derive CB from the two EDs
keymod->keymapCB->setChecked(rc.use_kbmap);
// no idea why we need these. Fscking Qt.
keymod->firstKeymapED->setEnabled(rc.use_kbmap);
keymod->secondKeymapLA->setEnabled(rc.use_kbmap);
keymod->firstKeymapED->setText(rc.primary_kbmap.c_str());
keymod->secondKeymapED->setText(rc.secondary_kbmap.c_str());
-
+
QPrefAsciiModule * ascmod(dialog_->asciiModule);
QPrefLatexModule * latexmod(dialog_->latexModule);
latexmod->latexEncodingED->setText(rc.fontenc.c_str());
- latexmod->latexChecktexED->setText(rc.chktex_command.c_str());
+ latexmod->latexChecktexED->setText(rc.chktex_command.c_str());
latexmod->latexAutoresetCB->setChecked(rc.auto_reset_options);
latexmod->latexDviPaperED->setText(rc.view_dvi_paper_option.c_str());
latexmod->latexPaperSizeCO->setCurrentItem(rc.default_papersize);
QPrefDisplayModule * displaymod(dialog_->displayModule);
displaymod->previewCB->setChecked(rc.preview);
-
+
int item = 2;
-
+
switch (rc.display_graphics) {
case grfx::NoDisplay: item = 3; break;
case grfx::ColorDisplay: item = 2; break;
case grfx::MonochromeDisplay: item = 0; break;
}
displaymod->displayGraphicsCO->setCurrentItem(item);
-
+
QPrefPathsModule * pathsmod(dialog_->pathsModule);
-
+
pathsmod->workingDirED->setText(rc.document_path.c_str());
pathsmod->templateDirED->setText(rc.template_path.c_str());
pathsmod->backupDirED->setText(rc.backupdir_path.c_str());
spellmod->spellCommandCO->setCurrentItem(item);
// FIXME: remove isp_use_alt_lang
spellmod->altLanguageED->setText(rc.isp_alt_lang.c_str());
- // FIXME: remove isp_use_esc_chars
+ // FIXME: remove isp_use_esc_chars
spellmod->escapeCharactersED->setText(rc.isp_esc_chars.c_str());
- // FIXME: remove isp_use_pers_dict
+ // FIXME: remove isp_use_pers_dict
spellmod->persDictionaryED->setText(rc.isp_pers_dict.c_str());
spellmod->compoundWordCB->setChecked(rc.isp_accept_compound);
spellmod->inputEncodingCB->setChecked(rc.isp_use_input_encoding);
QString roman(rc.roman_font_name.c_str());
QString sans(rc.sans_font_name.c_str());
QString typewriter(rc.typewriter_font_name.c_str());
-
+
for (int i = 0; i < fontmod->screenRomanCO->count(); ++i) {
if (fontmod->screenRomanCO->text(i) == roman) {
fontmod->screenRomanCO->setCurrentItem(i);
dialog_->select_roman(roman);
dialog_->select_sans(sans);
dialog_->select_typewriter(typewriter);
-
+
fontmod->screenZoomSB->setValue(rc.zoom);
fontmod->screenDpiSB->setValue(int(rc.dpi));
fontmod->screenTinyED->setText(tostr(rc.font_sizes[LyXFont::SIZE_TINY]).c_str());
formats_ = formats;
dialog_->updateFormats();
-
+
converters_ = converters;
dialog_->updateConverters();
<< ", previous sibling \""
<< (last ? last->text(0).latin1() : "0")
<< "\", parent \""
- << (parent ? parent->text(0).latin1() : "0") << "\""
+ << (parent ? parent->text(0).latin1() : "0") << '"'
<< endl;
item->setText(0,iter->str.c_str());
item->setOpen(iter->depth < depth_);
#include "support/filetools.h"
#include "support/lstrings.h"
-#include "ControlMath.h"
+#include "ControlMath.h"
#include <boost/tuple/tuple.hpp>
FuncRequest f = lyxaction.retrieveActionArg(action);
string fullname;
-
+
if (f.action == LFUN_INSERT_MATH && !f.argument.empty()) {
fullname = find_xpm(f.argument.substr(1));
} else {
if (!f.argument.empty())
xpm_name = subst(name + ' ' + f.argument, ' ','_');
-
+
fullname = LibFileSearch("images", xpm_name, "xpm");
}
if (!fullname.empty()) {
lyxerr[Debug::GUI] << "Full icon name is `"
- << fullname << "'" << endl;
+ << fullname << '\'' << endl;
return QPixmap(fullname.c_str());
}
- lyxerr << "Unable to find icon `" << fullname << "'" << endl;
+ lyxerr << "Unable to find icon `" << fullname << '\'' << endl;
fullname = LibFileSearch("images", "unknown", "xpm");
if (!fullname.empty()) {
lyxerr[Debug::GUI] << "Using default `unknown' icon"
QWidget::resizeEvent(e);
lyxerr[Debug::GUI] << "resize panel to "
- << e->size().width() << "," << e->size().height() << endl;
+ << e->size().width() << ',' << e->size().height() << endl;
int maxcol = e->size().width() / button_size;
++rows;
lyxerr[Debug::GUI] << "Laying out " << buttons_.size() << " widgets in a "
- << cols << "x" << rows << " grid." << endl;
+ << cols << 'x' << rows << " grid." << endl;
setUpdatesEnabled(false);
void QScreen::expose(int x, int y, int w, int h)
{
- lyxerr[Debug::GUI] << "expose " << w << "x" << h
- << "+" << x << "+" << y << endl;
+ lyxerr[Debug::GUI] << "expose " << w << 'x' << h
+ << '+' << x << '+' << y << endl;
owner_.getContent()->update(x, y, w, h);
}
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author John Levon
+ * \author John Levon
*
* Full author contact details are available in file CREDITS
*
int y1, int y2, int yo, int xo,
bool internal)
{
- lyxerr[Debug::GUI] << "screen: drawFromTo " << y1 << "-" << y2 << endl;
+ lyxerr[Debug::GUI] << "screen: drawFromTo " << y1 << '-' << y2 << endl;
int y_text = text->first_y + y1;
+2002-11-27 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * XMiniBuffer.C (peek_event): add l10n on a string missing it.
+
2002-11-26 Angus Leeming <leeming@lyx.org>
* forms_gettext.[Ch] (scex, idex): ditch the #defines and rename the
2002-11-26 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* FileDialog.C (save): actually return the result from
- FileDialog::open
+ FileDialog::open
2002-11-26 Jürgen Spitzmüller <juergen.sp@t-online.de>
lyxerr << _("LyX: Couldn't allocate '") << s
<< _("' for ") << lcolor.getGUIName(c)
<< _(" with (r,g,b)=(")
- << xcol.red << "," << xcol.green << "," << xcol.blue
+ << xcol.red << ',' << xcol.green << ',' << xcol.blue
<< _(").\n")
<< _(" Using closest allocated color with (r,g,b)=(")
- << cmap[closest_pixel].red << ","
- << cmap[closest_pixel].green << ","
+ << cmap[closest_pixel].red << ','
+ << cmap[closest_pixel].green << ','
<< cmap[closest_pixel].blue
<< _(") instead.\nPixel [")
<< closest_pixel << _("] is used.")
return open(path, mask, suggested);
}
-
+
FileDialog::Result const FileDialog::open(string const & path, string const & mask, string const & suggested)
{
string filter = mask;
}
lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", mask \""
- << filter << "\", suggested \"" << suggested << "\"" << endl;
+ << filter << "\", suggested \"" << suggested << '"' << endl;
// no support for asynchronous selection yet
* Licence details can be found in the file COPYING.
*
* \author Asger Alstrup
- * \author John Levon
+ * \author John Levon
*
* Full author contact details are available in file CREDITS
*/
// We have matches. Run them through
for (int i = 0; i < matches; ++i) {
string name(list[i]);
- lyxerr[Debug::FONT] << "match #" << i << " "
+ lyxerr[Debug::FONT] << "match #" << i << ' '
<< name << endl;
sizes[i] = lyx::atoi(token(name, '-', 7));
strings[i] = name;
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Angus Leeming
+ * \author Angus Leeming
* \author John Levon
* \author Herbert Voss
* \author Rob Lahaye
string const bibtotoc = addtotoc ? "bibtotoc" : "";
if (addtotoc && !bibstyle.empty()) {
// Both bibtotoc and style.
- controller().params().setOptions(bibtotoc + "," + bibstyle);
+ controller().params().setOptions(bibtotoc + ',' + bibstyle);
} else {
// At least one of addtotoc and bibstyle is empty. No harm to output both!
* Licence details can be found in the file COPYING.
*
* \author Edwin Leuven
- * \author Angus Leeming
+ * \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
// create a string of entries " entry1 | entry2 | entry3 | entry4 "
// with which to initialise the xforms choice object.
- string choice = " " + getStringFromVector(getFirst(family), " | ") +" ";
+ string choice = ' ' + getStringFromVector(getFirst(family), " | ") + ' ';
fl_addto_choice(dialog_->choice_family, choice.c_str());
- choice = " " + getStringFromVector(getFirst(series), " | ") + " ";
+ choice = ' ' + getStringFromVector(getFirst(series), " | ") + ' ';
fl_addto_choice(dialog_->choice_series, choice.c_str());
- choice = " " + getStringFromVector(getFirst(shape), " | ") + " ";
+ choice = ' ' + getStringFromVector(getFirst(shape), " | ") + ' ';
fl_addto_choice(dialog_->choice_shape, choice.c_str());
- choice = " " + getStringFromVector(getFirst(size), " | ") + " ";
+ choice = ' ' + getStringFromVector(getFirst(size), " | ") + ' ';
fl_addto_choice(dialog_->choice_size, choice.c_str());
- choice = " " + getStringFromVector(getFirst(bar), " | ") + " ";
+ choice = ' ' + getStringFromVector(getFirst(bar), " | ") + ' ';
fl_addto_choice(dialog_->choice_bar, choice.c_str());
- choice = " " + getStringFromVector(getFirst(color), " | ") + " ";
+ choice = ' ' + getStringFromVector(getFirst(color), " | ") + ' ';
fl_addto_choice(dialog_->choice_color, choice.c_str());
// xforms appears to need this to prevent a crash...
*
* \author Asger Alstrup
* \author John Levon
- * \author Angus Leeming
+ * \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
dialog_.reset(build_external(this));
string const choice =
- " " + getStringFromVector(controller().getTemplates(), " | ") + " ";
+ ' ' + getStringFromVector(controller().getTemplates(), " | ") + ' ';
fl_addto_choice(dialog_->choice_template, choice.c_str());
fl_set_input_return (dialog_->input_filename, FL_RETURN_CHANGED);
HERE_DEFINITELY,
ALTERNATIVES
};
-
+
} // namespace anon
case ALTERNATIVES:
if (fl_get_button(dialog_->check_force)) {
// Ignore internal LaTeX rules
- placement += "!";
+ placement += '!';
}
if (fl_get_button(dialog_->check_top)) {
// Top of page
- placement += "t";
+ placement += 't';
}
if (fl_get_button(dialog_->check_bottom)) {
// Bottom of page
- placement += "b";
+ placement += 'b';
}
if (fl_get_button(dialog_->check_page)) {
// Page of floats
- placement += "p";
+ placement += 'p';
}
// ignore if wide is selected
if (!wide && fl_get_button(dialog_->check_here)) {
// Here, if possible
- placement += "h";
+ placement += 'h';
}
if (placement == "!") {
// ignore placement if only force is selected.
bb = getLengthFromWidgets(bbox_->input_bb_x0,
bbox_->choice_bb_units);
- bb += " ";
+ bb += ' ';
if (getString(bbox_->input_bb_y0).empty())
- bb += "0";
+ bb += '0';
else
bb += getLengthFromWidgets(bbox_->input_bb_y0,
bbox_->choice_bb_units);
- bb += " " + x1_str + " ";
+ bb += ' ' + x1_str + ' ';
if (getString(bbox_->input_bb_y1).empty())
- bb += "0";
+ bb += '0';
else
bb += getLengthFromWidgets(bbox_->input_bb_y1,
bbox_->choice_bb_units);
}
-#if 0
+#if 0
void FormPreferences::ok()
{
FormBaseDeprecated::ok();
-// FIXME !!
+// FIXME !!
if (colors_.modifiedXformsPrefs) {
string const filename =
AddName(user_lyxdir, "preferences.xform");
lv_.dispatch(FuncRequest(LFUN_SAVEPREFERENCES));
}
-#endif
+#endif
// machines.
lyxerr << "apply in form !" << endl;
-
+
LyXRC & rc(controller().rc());
-
+
colors_.apply();
formats_.apply(); // Must be before converters_.apply()
converters_.apply();
lyx::Assert(ob);
bool valid = true;
-
+
// whatever checks you need to ensure the user hasn't entered
// some totally ridiculous value somewhere. Change activate to suit.
// comments before each test describe what is _valid_
if (!dialog_.get()) return;
LyXRC const & rc(controller().rc());
-
+
// read lyxrc entries
colors_.update();
formats_.update(); // Must be before converters_.update()
{
ostringstream ostr;
- ostr << "#" << std::setbase(16) << setfill('0')
+ ostr << '#' << std::setbase(16) << setfill('0')
<< setw(2) << col.r
<< setw(2) << col.g
<< setw(2) << col.b;
if (!choice.empty())
choice += " | ";
else
- choice += " ";
+ choice += ' ';
choice += cit->prettyname();
}
- choice += " ";
+ choice += ' ';
fl_clear_choice(dialog_->choice_from);
fl_addto_choice(dialog_->choice_from, choice.c_str());
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Angus Leeming
+ * \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
// create a string of entries " entry1 | entry2 | entry3 "
// with which to initialise the xforms choice object.
string const choice =
- " " + getStringFromVector(buffers, " | ") + " ";
+ ' ' + getStringFromVector(buffers, " | ") + ' ';
fl_clear_choice(dialog_->choice_document);
fl_addto_choice(dialog_->choice_document, choice.c_str());
fl_select_browser_line(browser, i+1);
}
}
-
+
} // namespace anon
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Angus Leeming
+ * \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
dialog_.reset(build_toc(this));
vector<string> types = controller().getTypes();
-
-
+
+
string const choice =
- " " + getStringFromVector(controller().getTypes(), " | ") + " ";
+ ' ' + getStringFromVector(controller().getTypes(), " | ") + ' ';
fl_addto_choice(dialog_->choice_toc_type, choice.c_str());
// Manage the cancel/close button
continue;
}
string const label = i->label();
- string const shortcut = "#" + i->shortcut();
+ string const shortcut = '#' + i->shortcut();
int const width = string_width(label);
obj = fl_add_button(FL_MENU_BUTTON,
air + moffset, yloc,
}
lyxerr[Debug::GUI] << "max_width=" << max_width
<< ", widest_label=`" << widest_label
- << "'" << endl;
+ << '\'' << endl;
// Compute where to put separators
vector<string> extra_labels(menu.size());
<< "\", binding \"" << accel
<< "\", shortcut \"" << shortcut
<< "\" (added to menu"
- << curmenuid << ")" << endl;
+ << curmenuid << ')' << endl;
break;
}
// If we already have an icon, release it.
// But we don't copy the icon from ti
kill_icon();
-
+
action = ti.action;
return *this;
if (!p->icon)
continue;
-
+
FuncStatus const status = owner_->getLyXFunc().getStatus(p->action);
if (status.onoff(true)) {
// I'd like to use a different color
{
string xpm_name;
FuncRequest ev = lyxaction.retrieveActionArg(action);
-
+
string const name = lyxaction.getActionName(ev.action);
if (!ev.argument.empty())
xpm_name = subst(name + ' ' + ev.argument, ' ','_');
string arg = ev.argument.substr(1);
fullname = LibFileSearch("images/math/", arg, "xpm");
}
-
+
if (!fullname.empty()) {
lyxerr[Debug::GUI] << "Full icon name is `"
- << fullname << "'" << endl;
+ << fullname << '\'' << endl;
fl_set_pixmapbutton_file(obj, fullname.c_str());
return;
}
- lyxerr << "Unable to find icon `" << xpm_name << "'" << endl;
+ lyxerr << "Unable to find icon `" << xpm_name << '\'' << endl;
fullname = LibFileSearch("images", "unknown", "xpm");
if (!fullname.empty()) {
lyxerr[Debug::GUI] << "Using default `unknown' icon"
toolbarItem item;
item.action = action;
-
+
switch (action) {
case ToolbarDefaults::SEPARATOR:
xpos += sepspace;
*/
break;
}
-
+
toollist_.push_back(item);
}
if (comp.empty()) {
set_input(new_input);
- show_info(("[only completion]"), new_input + " ");
+ show_info(_("[only completion]"), new_input + ' ');
break;
}
stored_input_ = input;
info_shown_ = true;
if (append)
- set_input(input + " " + info);
+ set_input(input + ' ' + info);
else
set_input(info);
info_timer_->start();
if (!str.empty()) {
// add a space so the user can type
// an argument immediately
- set_input(str + " ");
+ set_input(str + ' ');
}
}
if (lyxerr.debugging(Debug::WORKAREA)) {
lyxerr << "(Re)creating pixmap ("
- << width << 'x' << height << ")" << endl;
+ << width << 'x' << height << ')' << endl;
}
if (workareapixmap) {
string const stm = (tmp ? tmp : "");
string const stm2 = (tmp2 ? tmp2 : "");
- lyxerr[Debug::KEY] << "XWorkArea: Key is `" << stm << "' ["
- << key << "]" << endl;
- lyxerr[Debug::KEY] << "XWorkArea: Keysym is `" << stm2 << "' ["
- << keysym << "]" << endl;
+ lyxerr[Debug::KEY] << "XWorkArea: Key is `" << stm
+ << "' [" << key << ']' << endl;
+ lyxerr[Debug::KEY] << "XWorkArea: Keysym is `" << stm2
+ << "' [" << keysym << ']' << endl;
}
#if FL_VERSION < 1 && (FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5))
if (ypos == -1)
ypos = (HeightOfScreen(s) - height) / 2;
- lyxerr[Debug::GUI] << "Creating view: " << width << "x" << height
- << "+" << xpos << "+" << ypos << endl;
+ lyxerr[Debug::GUI] << "Creating view: " << width << 'x' << height
+ << '+' << xpos << '+' << ypos << endl;
XFormsView view(width, height);
view.show(xpos, ypos, "LyX");
if (XLookupColor(display, cmap, name.c_str(), &xcol, &ccol) == 0) {
lyxerr << "X can't find color \""
<< lcolor.getLyXName(col)
- << "\"" << endl;
+ << '"' << endl;
return string();
}
<< "### file " << filename << "\n\n"
<< "### This file is written by LyX, if you want to make your own\n"
<< "### modifications you should do them from inside LyX and save\n"
- << "\n";
+ << '\n';
for (int i = 0; i < xformCount; ++i) {
string const tag = xformTags[i].tag;
fl_getmcolor(colorID, &color.r, &color.g, &color.b);
- os << tag << " "
- << color.r << " " << color.g << " " << color.b << "\n";
+ os << tag << ' '
+ << color.r << ' ' << color.g << ' ' << color.b << '\n';
}
return true;
void XScreen::expose(int x, int y, int w, int h)
{
- lyxerr[Debug::GUI] << "expose " << w << "x" << h
- << "+" << x << "+" << y << endl;
+ lyxerr[Debug::GUI] << "expose " << w << 'x' << h
+ << '+' << x << '+' << y << endl;
XCopyArea(fl_get_display(),
owner_.getPixmap(),
owner_.getWin(),
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Baruch Even
- * \author Herbert Voss
- * \author Angus Leeming
+ * \author Baruch Even
+ * \author Herbert Voss
+ * \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
void CacheItem::Impl::imageConverted(bool success)
{
string const text = success ? "succeeded" : "failed";
- lyxerr[Debug::GRAPHICS] << "Image conversion " << text << "." << endl;
+ lyxerr[Debug::GRAPHICS] << "Image conversion " << text << '.' << endl;
file_to_load_ = converter_.get() ?
converter_->convertedFile() : string();
void CacheItem::Impl::imageLoaded(bool success)
{
string const text = success ? "succeeded" : "failed";
- lyxerr[Debug::GRAPHICS] << "Image loading " << text << "." << endl;
+ lyxerr[Debug::GRAPHICS] << "Image loading " << text << '.' << endl;
// Clean up after loading.
if (zipped_)
// We create a dummy command for ease of understanding of the
// list of forked processes.
// Note that 'sh ' is absolutely essential, or execvp will fail.
- script_command_ = "sh " + script_file_ + " " +
- OnlyFilename(from_file) + " " + to_format;
+ script_command_ = "sh " + script_file_ + ' ' +
+ OnlyFilename(from_file) + ' ' + to_format;
}
// All is ready to go
valid_process_ = true;
lyxerr[Debug::GRAPHICS]
<< "Error reading XPM file '"
- << XpmGetErrorString(success) << "'"
+ << XpmGetErrorString(success) << '\''
<< std::endl;
} else {
image_.reset(*xpm_image);
if (status != XpmSuccess) {
lyxerr << "Error creating pixmap from xpm_image '"
- << XpmGetErrorString(status) << "'"
+ << XpmGetErrorString(status) << '\''
<< std::endl;
pixmap_status_ = PIXMAP_FAILED;
return false;
int const gray = int((0.32 * r) + (0.5 * g) + (0.18 * b));
ostringstream gray_stream;
- gray_stream << "#" << std::setbase(16) << std::setfill('0')
+ gray_stream << '#' << std::setbase(16) << std::setfill('0')
<< std::setw(2) << gray
<< std::setw(2) << gray
<< std::setw(2) << gray;
int const mono = (gray < 128) ? 0 : 255;
ostringstream mono_stream;
- mono_stream << "#" << std::setbase(16) << std::setfill('0')
+ mono_stream << '#' << std::setbase(16) << std::setfill('0')
<< std::setw(2) << mono
<< std::setw(2) << mono
<< std::setw(2) << mono;
StrPair const operator()(string const & snippet)
{
ostringstream os;
- os << base_ << counter_++ << "." << to_format_;
+ os << base_ << counter_++ << '.' << to_format_;
string const file = STRCONV(os.str());
return make_pair(snippet, file);
// The conversion command.
ostringstream cs;
- cs << pconverter_->command << " " << latexfile << " "
- << int(font_scaling_factor_) << " " << pconverter_->to;
+ cs << pconverter_->command << ' ' << latexfile << ' '
+ << int(font_scaling_factor_) << ' ' << pconverter_->to;
string const command = "sh " + LibScriptSearch(STRCONV(cs.str()));
os << "\\AtBeginDocument{\\AtBeginDvi{%\n"
<< "\\special{!userdict begin/bop-hook{//bop-hook exec\n"
- << "<" << fg << bg << ">{255 div}forall setrgbcolor\n"
+ << '<' << fg << bg << ">{255 div}forall setrgbcolor\n"
<< "clippath fill setrgbcolor}bind def end}}}\n";
}
string const InsetBibKey::getScreenLabel(Buffer const *) const
{
- return getContents() + " [" + getBibLabel() + "]";
+ return getContents() + " [" + getBibLabel() + ']';
}
string contents(getContents());
if (!contains(contents, db)) {
if (!contents.empty())
- contents += ",";
+ contents += ',';
setContents(contents + db);
return true;
}
string const label = frm.str();
#else
// Generate the label
- string const label = _(fl) + " " + num + ":";
+ string const label = _(fl) + ' ' + num + ':';
#endif
Painter & pain = bv->painter();
int const w = font_metrics::width(label, f);
// puctuation mark separating citation entries.
char const * const sep = ";";
- string const op_str(string(1, ' ') + string(1, op));
- string const cp_str(string(1, cp) + string(1, ' '));
- string const sep_str(string(sep) + " ");
+ string const op_str(' ' + string(1, op));
+ string const cp_str(string(1, cp) + ' ');
+ string const sep_str(string(sep) + ' ');
string label;
vector<string> keys = getVectorFromString(keyList);
if (contains(keys, ",")) {
// Final comma allows while loop to cover all keys
- keys = ltrim(split(keys, label, ',')) + ",";
+ keys = ltrim(split(keys, label, ',')) + ',';
while (contains(keys, ",")) {
string key;
keys = ltrim(split(keys, key, ','));
if (!after.empty())
label += ", " + after;
- return "[" + label + "]";
+ return '[' + label + ']';
}
} // anon namespace
string const before = string();
string const after = getOptions();
if (!before.empty() && buffer->params.use_natbib)
- os << "[" << before << "][" << after << "]";
+ os << '[' << before << "][" << after << ']';
else if (!after.empty())
- os << "[" << after << "]";
+ os << '[' << after << ']';
#else
// and the cleaned up equvalent, should it just be changed? (Lgb)
string const after = getOptions();
if (!after.empty())
- os << "[" << after << "]";
+ os << '[' << after << ']';
#endif
string::const_iterator it = getContents().begin();
string::const_iterator end = getContents().end();
content += *it;
}
- os << "{" << content << "}";
+ os << '{' << content << '}';
return 0;
}
string const InsetCommandParams::getCommand() const
{
string s;
- if (!getCmdName().empty()) s += "\\"+getCmdName();
- if (!getOptions().empty()) s += "["+getOptions()+']';
- s += "{"+getContents()+'}';
+ if (!getCmdName().empty()) s += '\\' + getCmdName();
+ if (!getOptions().empty()) s += '[' + getOptions() + ']';
+ s += '{' + getContents() + '}';
return s;
}
}
// Parse string format...
- string::size_type const pos1 = format.find(",");
+ string::size_type const pos1 = format.find(',');
params_.templ = ExternalTemplateManager::get().getTemplateByName(format.substr(0, pos1));
string::size_type const pos2 = format.find("\",\"", pos1);
params_.filename = format.substr(pos1 + 2, pos2 - (pos1 + 2));
params_.parameters = format.substr(pos2 + 3, format.length() - (pos2 + 4));
lyxerr[Debug::INFO] << "InsetExternal::Read: " << params_.templ.lyxName
- << " " << params_.filename
- << " " << params_.parameters << endl;
+ << ' ' << params_.filename
+ << ' ' << params_.parameters << endl;
}
Systemcall one;
if (lyxerr.debugging()) {
lyxerr << "Executing '" << s << "' in '"
- << buffer->filePath() << "'" << endl;
+ << buffer->filePath() << '\'' << endl;
}
one.startscript(Systemcall::Wait, s);
}
if (!floatPlacement_.empty()
&& floatPlacement_ != def_placement) {
placement = floatPlacement_;
- } else if (floatPlacement_.empty()
+ } else if (floatPlacement_.empty()
&& !buf_placement.empty()
&& buf_placement != def_placement) {
placement = buf_placement;
// The \n is used to force \begin{<floatname>} to appear in a new line.
// The % is needed to prevent two consecutive \n chars in the case
// when the current output line is empty.
- os << "%\n\\begin{" << tmptype << "}";
+ os << "%\n\\begin{" << tmptype << '}';
// We only output placement if different from the def_placement.
if (!placement.empty()) {
- os << "[" << placement << "]";
+ os << '[' << placement << ']';
}
- os << "\n";
+ os << '\n';
int const i = inset.latex(buf, os, fragile, fp);
int InsetFloat::docbook(Buffer const * buf, ostream & os, bool mixcont) const
{
- os << "<" << floatType_ << ">";
+ os << '<' << floatType_ << '>';
int const i = inset.docbook(buf, os, mixcont);
- os << "</" << floatType_ << ">";
+ os << "</" << floatType_ << '>';
return i;
}
lab += floatname(floatType_, bp);
if (wide_)
- lab += "*";
+ lab += '*';
setLabel(lab);
}
// Find a caption layout in one of the (child inset's) pars
for (; pit != end; ++pit) {
Paragraph * tmp = *pit;
-
+
if (tmp->layout()->name() == caplayout) {
string const str =
tostr(toclist[type()].size() + 1)
bb.erase();
for (int i = 0; i < 4; ++i) {
if (i != 0)
- bb += " ";
+ bb += ' ';
lex.next();
bb += lex.getString();
}
unsigned int const bb_orig_xl = strToInt(token(tmp, ' ', 0));
unsigned int const bb_orig_yb = strToInt(token(tmp, ' ', 1));
- // new pars.bb values must be >= zero
+ // new pars.bb values must be >= zero
if (pars.bb.xl > bb_orig_xl)
pars.bb.xl -= bb_orig_xl;
else
pars.bb.xl = 0;
-
+
if (pars.bb.xr > bb_orig_xl)
pars.bb.xr -= bb_orig_xl;
else
pars.bb.xr = 0;
-
+
if (pars.bb.yb > bb_orig_yb)
pars.bb.yb -= bb_orig_yb;
else
pars.bb.yb = 0;
-
+
if (pars.bb.yt > bb_orig_yb)
pars.bb.yt -= bb_orig_yb;
else
pars.bb.yt = 0;
}
}
-
+
if (display == grfx::DefaultDisplay) {
pars.display = lyxrc.display_graphics;
} else {
pars.display = display;
}
-
+
// Override the above if we're not using a gui
if (!lyxrc.use_gui) {
pars.display = grfx::NoDisplay;
int InsetLabel::ascii(Buffer const *, ostream & os, int) const
{
- os << "<" << getContents() << ">";
+ os << '<' << getContents() << '>';
return 0;
}
break;
}
//ic = (modtype == DOT_LESS_J ? 'j' : 'i');
- lyxerr[Debug::KEY] << "Contents: [" << contents << "]"
+ lyxerr[Debug::KEY] << "Contents: [" << contents << ']'
<< ", ic: " << ic
<< ", top: " << plusasc
<< ", bot: " << plusdesc
if (contents[++i] != '}' && contents[++i]) return;
// fine, the char is properly decoded now (hopefully)
- lyxerr[Debug::KEY] << "Contents: [" << contents << "]"
+ lyxerr[Debug::KEY] << "Contents: [" << contents << ']'
<< ", ic: " << ic
<< ", top: " << plusasc
<< ", bot: " << plusdesc
void InsetMinipage::write(Buffer const * buf, ostream & os) const
{
- os << getInsetName() << "\n"
- << "position " << pos_ << "\n"
- << "inner_position " << inner_pos_ << "\n"
+ os << getInsetName() << '\n'
+ << "position " << pos_ << '\n'
+ << "inner_position " << inner_pos_ << '\n'
<< "height \"" << height_.asString() << "\"\n"
<< "width \"" << width_.asString() << "\"\n";
InsetCollapsable::write(buf, os);
string s_pos;
switch (pos_) {
case top:
- s_pos += "t";
+ s_pos += 't';
break;
case center:
- s_pos += "c";
+ s_pos += 'c';
break;
case bottom:
- s_pos += "b";
+ s_pos += 'b';
break;
}
os << "\\begin{minipage}[" << s_pos << "]{"
// in french, spaces are added inside double quotes
if (times_ == DoubleQ && prefixIs(loclang->code(), "fr")) {
if (side_ == LeftQ)
- disp += " ";
+ disp += ' ';
else
- disp = " " + disp;
+ disp = ' ' + disp;
}
return disp;
int InsetQuotes::ascii(Buffer const *, ostream & os, int) const
{
- os << "\"";
+ os << '"';
return 0;
}
int InsetQuotes::linuxdoc(Buffer const *, ostream & os) const
{
- os << "\"";
+ os << '"';
return 0;
}
int InsetRef::ascii(Buffer const *, ostream & os, int) const
{
- os << "[" << getContents() << "]";
+ os << '[' << getContents() << ']';
return 0;
}
case HYPHENATION:
{
font.setColor(LColor::special);
- pain.text(int(x), baseline, "-", font);
+ pain.text(int(x), baseline, '-', font);
x += width(bv, font);
break;
}
case LIGATURE_BREAK:
{
font.setColor(LColor::special);
- pain.text(int(x), baseline, "|", font);
+ pain.text(int(x), baseline, '|', font);
x += width(bv, font);
break;
}
case END_OF_SENTENCE:
{
font.setColor(LColor::special);
- pain.text(int(x), baseline, ".", font);
+ pain.text(int(x), baseline, '.', font);
x += width(bv, font);
break;
}
os << "\\lyxarrow{}";
break;
case PROTECTED_SEPARATOR:
- os << (free_space ? " " : "~");
+ os << (free_space ? ' ' : '~');
break;
}
return 0;
case LIGATURE_BREAK:
break;
case END_OF_SENTENCE:
- os << ".";
+ os << '.';
break;
case LDOTS:
os << "...";
os << "->";
break;
case PROTECTED_SEPARATOR:
- os << " ";
+ os << ' ';
break;
}
return 0;
case LIGATURE_BREAK:
break;
case END_OF_SENTENCE:
- os << ".";
+ os << '.';
break;
case LDOTS:
os << "...";
case LIGATURE_BREAK:
break;
case END_OF_SENTENCE:
- os << ".";
+ os << '.';
break;
case LDOTS:
os << "...";
desc_on = (style->labeltype == LABEL_MANUAL);
- environment_inner[depth] = desc_on?"varlistentry":"listitem";
+ environment_inner[depth] = desc_on ? "varlistentry" : "listitem";
lines += sgml::openTag(os, depth + 1 + command_depth, mixcont, environment_inner[depth]);
- item_name = desc_on?"term":"para";
+ item_name = desc_on ? "term" : "para";
lines += sgml::openTag(os, depth + 1 + command_depth, mixcont, item_name);
break;
temp = _("HtmlUrl: ");
string url;
-
+
if (!getOptions().empty())
url += getOptions();
else
int InsetUrl::ascii(Buffer const *, ostream & os, int) const
{
if (getOptions().empty())
- os << "[" << getContents() << "]";
+ os << '[' << getContents() << ']';
else
- os << "[" << getContents() << "||" << getOptions() << "]";
+ os << '[' << getContents() << "||" << getOptions() << ']';
return 0;
}
int InsetUrl::linuxdoc(Buffer const *, ostream & os) const
{
- os << "<" << getCmdName()
+ os << '<' << getCmdName()
<< " url=\"" << getContents() << "\""
<< " name=\"" << getOptions() << "\">";
int InsetWrap::latex(Buffer const * buf,
ostream & os, bool fragile, bool fp) const
{
- os << "\\begin{floating" << Type_ << "}";
+ os << "\\begin{floating" << Type_ << '}';
if (!Placement_.empty()) {
- os << "[" << Placement_ << "]";
+ os << '[' << Placement_ << ']';
}
- os << "{" << width_.asLatexString() << "}%\n";
+ os << '{' << width_.asLatexString() << "}%\n";
int const i = inset.latex(buf, os, fragile, fp);
int InsetWrap::docbook(Buffer const * buf, ostream & os, bool mixcont) const
{
- os << "<" << Type_ << ">";
+ os << '<' << Type_ << '>';
int const i = inset.docbook(buf, os, mixcont);
- os << "</" << Type_ << ">";
+ os << "</" << Type_ << '>';
return i;
}
case FLOAT_CODE:
case FOOT_CODE:
case MARGIN_CODE:
- return false;
+ return false;
default:
return InsetCollapsable::insetAllowed(code);
}
}
+
int InsetWrap::getMaxWidth(BufferView * bv, UpdatableInset const * inset)
const
{
return -1;
}
if (!width_.zero()) {
- int ww1 = latexTextWidth(bv);
- int ww2 = InsetCollapsable::getMaxWidth(bv, inset);
+ int const ww1 = latexTextWidth(bv);
+ int const ww2 = InsetCollapsable::getMaxWidth(bv, inset);
if (ww2 > 0 && ww2 < ww1) {
return ww2;
}
#include <fcntl.h>
#include <cstdio>
-// FIXME: do we need any of this horrible gook ?
+// FIXME: do we need any of this horrible gook ?
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <ctime>
int * in, int * out)
: params(p), lang(l), pipein(in), pipeout(out) {}
///
- virtual ForkedProcess * clone() const {
+ virtual ForkedProcess * clone() const {
return new LaunchIspell(*this);
}
///
int LaunchIspell::generateChild()
-{
+{
isp_pid = fork();
if (isp_pid != 0) {
string("-w").copy(tmp, 2); tmp[2] = '\0';
argv[argc++] = tmp;
// Put the escape chars in ""s
- string tms = "\"" + lyxrc.isp_esc_chars + "\"";
+ string tms = '"' + lyxrc.isp_esc_chars + '"';
tmp = new char[tms.length() + 1];
tms.copy(tmp, tms.length()); tmp[tms.length()] = '\0';
argv[argc++] = tmp;
// Actually I used it to tell if it's truly Ispell or if it's
// aspell -- (kevinatk@home.com)
// But no code actually used the results for anything useful
- // so I removed it again. Perhaps we can remove this code too.
+ // so I removed it again. Perhaps we can remove this code too.
// - jbl
char buf[2048];
fd_set infds;
// FIXME Please rewrite to use string.
Result res;
-
+
::fputs(word.word().c_str(), out);
::fputc('\n', out);
if (lyxerr.debugging(Debug::KBMAP)) {
lyxerr << "BIND: Sequence `"
<< seq << "' Action `"
- << action << "'" << endl;
+ << action << '\'' << endl;
}
kb_sequence k(0, 0);
key_modifier::state mask(cit->mod.second);
key_modifier::state check =
static_cast<key_modifier::state>(mod & ~mask);
-
+
if (*(cit->code) == *key && cit->mod.first == check) {
// match found
if (cit->table.get()) {
res += cit->table->findbinding(act,
prefix
+ printKey((*cit))
- + " ");
+ + ' ');
} else if (cit->action == act) {
- res += "[";
+ res += '[';
res += prefix + printKey((*cit));
res += "] ";
}
// create autosave filename
string fname = bv->buffer()->filePath();
- fname += "#";
+ fname += '#';
fname += OnlyFilename(bv->buffer()->fileName());
- fname += "#";
+ fname += '#';
AutoSaveBuffer autosave(*bv, fname);
autosave.start();
if (layout->latexname() == "theorem")
text = "thm"; // Create a correct prefix for prettyref
- text += ":";
+ text += ':';
if (layout->latextype == LATEX_PARAGRAPH ||
lyxrc.label_init_length < 0)
text.erase();
// Execute batch commands if available
if (!batch_command.empty()) {
lyxerr[Debug::INIT] << "About to handle -x '"
- << batch_command << "'" << endl;
+ << batch_command << '\'' << endl;
Buffer * last_loaded = 0;
exit(1);
}
- batch = "buffer-import " + type + " " + file;
+ batch = "buffer-import " + type + ' ' + file;
return 2;
}
"\\newcommand{\\mathcircumflex}[0]{\\mbox{\\^{}}}\n";
string const tabularnewline_def =
- "%% Because html converters don't know tabularnewline\n"
- "\\providecommand{\\tabularnewline}{\\\\}\n";
+ "%% Because html converters don't know tabularnewline\n"
+ "\\providecommand{\\tabularnewline}{\\\\}\n";
class Paragraph;
class Row;
-/**
+/**
* The cursor class describes the position of a cursor within a document.
* Several cursors exist within LyX; for example, when locking an inset,
* the position of the cursor in the containing inset is stored.
* blah blah blah blah blah blah
*
* When we move onto row 3, we would like to be vertically aligned
- * with where we were in row 1, despite the fact that row 2 is
+ * with where we were in row 1, despite the fact that row 2 is
* shorter than x()
*/
int x_fix() const;
bool boundary_;
/// the pixel x position
int x_;
- /// the stored next-row x position
+ /// the stored next-row x position
int ix_;
/// the cached x position
int x_fix_;
int iy_;
/// the containing row
Row * row_;
- /// the containing row for the next line
+ /// the containing row for the next line
Row * irow_;
};
}
if (language() != base.language() && language() != next.language()) {
- os << "}";
+ os << '}';
++count;
}
cancel_meta_seq.reset();
int action = cancel_meta_seq.addkey(keysym, state);
- lyxerr[Debug::KEY] << "action first set to [" << action << "]" << endl;
+ lyxerr[Debug::KEY] << "action first set to [" << action << ']' << endl;
// When not cancel or meta-fake, do the normal lookup.
// Note how the meta_fake Mod1 bit is OR-ed in and reset afterwards.
// remove Caps Lock and Mod2 as a modifiers
action = keyseq.addkey(keysym, (state | meta_fake_bit));
lyxerr[Debug::KEY] << "action now set to ["
- << action << "]" << endl;
+ << action << ']' << endl;
}
// Dont remove this unless you know what you are doing.
if (lyxerr.debugging(Debug::KEY)) {
lyxerr << "Key [action="
<< action << "]["
- << keyseq.print() << "]"
+ << keyseq.print() << ']'
<< endl;
}
lyxerr[Debug::KEY] << "Removing modifiers...\n"
<< "Action now set to ["
- << action << "]" << endl;
+ << action << ']' << endl;
if (action == LFUN_UNKNOWN_ACTION) {
owner->message(_("Unknown function."));
int const action = lyxaction.LookupFunc(s);
if (action == LFUN_UNKNOWN_ACTION) {
+#if USE_BOOST_FORMAT
+boost::format fmt(_("Unknown function (%1$s)"));
+fmt % s;
+owner->message(fmt.str());
+#else
string const msg = string(_("Unknown function ("))
- + s + ")";
+ + s + ')';
owner->message(msg);
+#endif
return;
}
void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
{
lyxerr[Debug::ACTION] << "LyXFunc::dispatch: action[" << ev.action
- <<"] arg[" << ev.argument << "]" << endl;
+ <<"] arg[" << ev.argument << ']' << endl;
// we have not done anything wrong yet.
errorstat = false;
Paragraph * par = owner->buffer()->getParFromID(id);
if (par == 0) {
lyxerr[Debug::INFO] << "No matching paragraph found! ["
- << id << "]" << endl;
+ << id << ']' << endl;
break;
} else {
lyxerr[Debug::INFO] << "Paragraph " << par->id()
string dispatch_msg = msg;
if (!dispatch_msg.empty())
- dispatch_msg += " ";
+ dispatch_msg += ' ';
string comname = lyxaction.getActionName(ev.action);
if (pseudoaction == LFUN_UNKNOWN_ACTION) {
pseudoaction = ev.action;
} else {
- comname += " " + ev.argument;
+ comname += ' ' + ev.argument;
argsadded = true;
}
}
if (!shortcuts.empty()) {
comname += ": " + shortcuts;
} else if (!argsadded && !ev.argument.empty()) {
- comname += " " + ev.argument;
+ comname += ' ' + ev.argument;
}
if (!comname.empty()) {
comname = rtrim(comname);
- dispatch_msg += "(" + comname + ')';
+ dispatch_msg += '(' + comname + ')';
}
lyxerr[Debug::ACTION] << "verbose dispatch msg " << dispatch_msg << endl;
string const extension = "*." + formats.extension(format)
+ "| " + formats.prettyName(format)
- + " (*." + formats.extension(format) + ")";
+ + " (*." + formats.extension(format) + ')';
FileDialog::Result result = fileDlg.open(initpath,
extension);
if (minus_.zero()) {
if (len_.unit() != plus_.unit())
buffer << unit_name[len_.unit()];
- buffer << "+" << plus_.value();
+ buffer << '+' << plus_.value();
buffer << unit_name[plus_.unit()];
return STRCONV(buffer.str());
}
if (plus_.zero()) {
if (len_.unit() != minus_.unit())
buffer << unit_name[len_.unit()];
- buffer << "-" << minus_.value();
+ buffer << '-' << minus_.value();
buffer << unit_name[minus_.unit()];
return STRCONV(buffer.str());
}
// this is so rare a case, why bother minimising units ?
buffer << unit_name[len_.unit()];
- buffer << "+" << plus_.value() << unit_name[plus_.unit()];
- buffer << "-" << minus_.value() << unit_name[minus_.unit()];
+ buffer << '+' << plus_.value() << unit_name[plus_.unit()];
+ buffer << '-' << minus_.value() << unit_name[minus_.unit()];
return STRCONV(buffer.str());
}
{ "alignpossible", LT_ALIGNPOSSIBLE },
{ "bottomsep", LT_BOTTOMSEP },
{ "copystyle", LT_COPYSTYLE },
- { "dependson", LT_DEPENDSON },
+ { "dependson", LT_DEPENDSON },
{ "end", LT_END },
{ "endlabelstring", LT_ENDLABELSTRING },
{ "endlabeltype", LT_ENDLABELTYPE },
if (obsoleted_by().empty())
obsoleted_by_ = style;
} else {
- lyxerr << "Cannot replace with unknown style `" << style << "'" << endl;
+ lyxerr << "Cannot replace with unknown style `" << style << '\'' << endl;
//lexrc.printError("Cannot replace with"
// " unknown style "
}
break;
- case LT_DEPENDSON:
+ case LT_DEPENDSON:
if (lexrc.next()) {
depends_on_ = lexrc.getString();
}
break;
case LT_OPTARGS:
- if (lexrc.next()) {
+ if (lexrc.next()) {
optionalargs = lexrc.getInteger();
}
- break;
+ break;
case LT_NEED_PROTECT:
needprotect = lexrc.next() && lexrc.getInteger();
ostringstream buffer;
switch (unit_) {
case PTW:
- buffer << abs(static_cast<int>(val_/100)) << "."
+ buffer << abs(static_cast<int>(val_/100)) << '.'
<< abs(static_cast<int>(val_)%100) << "\\textwidth";
break;
case PCW:
- buffer << abs(static_cast<int>(val_/100)) << "."
+ buffer << abs(static_cast<int>(val_/100)) << '.'
<< abs(static_cast<int>(val_)%100) << "\\columnwidth";
break;
case PPW:
- buffer << abs(static_cast<int>(val_/100)) << "."
+ buffer << abs(static_cast<int>(val_/100)) << '.'
<< abs(static_cast<int>(val_)%100) << "\\paperwidth";
break;
case PLW:
- buffer << abs(static_cast<int>(val_/100)) << "."
+ buffer << abs(static_cast<int>(val_/100)) << '.'
<< abs(static_cast<int>(val_)%100) << "\\linewidth";
break;
case PPH:
- buffer << abs(static_cast<int>(val_/100)) << "."
+ buffer << abs(static_cast<int>(val_/100)) << '.'
<< abs(static_cast<int>(val_)%100) << "\\paperheight";
break;
case PTH:
- buffer << abs(static_cast<int>(val_/100)) << "."
+ buffer << abs(static_cast<int>(val_/100)) << '.'
<< abs(static_cast<int>(val_)%100) << "\\textheight";
break;
default:
#if 1
is.getline(buff, sizeof(buff));
lyxerr[Debug::LYXLEX] << "Comment read: `" << c
- << buff << "'" << endl;
+ << buff << '\'' << endl;
#else
// unfortunately ignore is buggy (Lgb)
is.ignore(100, '\n');
#if 1
is.getline(buff, sizeof(buff));
lyxerr[Debug::LYXLEX] << "Comment read: `" << c
- << buff << "'" << endl;
+ << buff << '\'' << endl;
#else
// but ignore is also still buggy (Lgb)
// This is fast (Lgb)
is.get(cc);
c = cc;
//lyxerr[Debug::LYXLEX] << "LyXLex::EatLine read char: `"
- // << c << "'" << endl;
+ // << c << '\'' << endl;
if (c != '\r')
buff[i++] = c;
}
os << "# Set to false to inhibit automatic replacement of\n"
<< "# the current selection.\n"
<< "\\auto_region_delete " << tostr(auto_region_delete)
- << "\n";
+ << '\n';
}
case RC_AUTORESET_OPTIONS:
if (auto_reset_options != system_lyxrc.auto_reset_options) {
os << "# Set to false to inhibit automatic reset of\n"
<< "# the class options to defaults on class change.\n"
<< "\\auto_reset_options " << tostr(auto_reset_options)
- << "\n";
+ << '\n';
}
case RC_AUTOSAVE:
if (autosave != system_lyxrc.autosave) {
os << "# The time interval between auto-saves in seconds.\n"
- << "\\autosave " << autosave << "\n";
+ << "\\autosave " << autosave << '\n';
}
case RC_DISPLAY_GRAPHICS:
if (display_graphics != system_lyxrc.display_graphics) {
os << "# Display graphics within LyX\n"
<< "# monochrome|grayscale|color|none\n"
<< "\\display_graphics " << grfx::displayTranslator.find(display_graphics)
- << "\n";
+ << '\n';
}
case RC_VIEWDVI_PAPEROPTION:
}
case RC_KBMAP:
if (use_kbmap != system_lyxrc.use_kbmap) {
- os << "\\kbmap " << tostr(use_kbmap) << "\n";
+ os << "\\kbmap " << tostr(use_kbmap) << '\n';
}
case RC_KBMAP_PRIMARY:
if (primary_kbmap != system_lyxrc.primary_kbmap) {
case RC_LABEL_INIT_LENGTH:
if (label_init_length != system_lyxrc.label_init_length) {
os << "\\label_init_length " << label_init_length
- << "\n";
+ << '\n';
}
case RC_SHOW_BANNER:
if (show_banner != system_lyxrc.show_banner) {
- os << "\\show_banner " << tostr(show_banner) << "\n";
+ os << "\\show_banner " << tostr(show_banner) << '\n';
}
case RC_PREVIEW:
if (preview != system_lyxrc.preview) {
- os << "\\preview " << tostr(preview) << "\n";
+ os << "\\preview " << tostr(preview) << '\n';
}
case RC_PREVIEW_HASHED_LABELS:
if (preview_hashed_labels !=
system_lyxrc.preview_hashed_labels) {
os << "\\preview_hashed_labels "
- << tostr(preview_hashed_labels) << "\n";
+ << tostr(preview_hashed_labels) << '\n';
}
case RC_PREVIEW_SCALE_FACTOR:
if (preview_scale_factor != system_lyxrc.preview_scale_factor) {
os << "\\preview_scale_factor "
- << preview_scale_factor << "\n";
+ << preview_scale_factor << '\n';
}
os << "\n#\n"
}
case RC_SCREEN_DPI:
if (dpi != system_lyxrc.dpi) {
- os << "\\screen_dpi " << dpi << "\n";
+ os << "\\screen_dpi " << dpi << '\n';
}
case RC_SCREEN_ZOOM:
if (zoom != system_lyxrc.zoom) {
- os << "\\screen_zoom " << zoom << "\n";
+ os << "\\screen_zoom " << zoom << '\n';
}
case RC_WHEEL_JUMP:
if (wheel_jump != system_lyxrc.wheel_jump) {
- os << "\\wheel_jump " << wheel_jump << "\n";
+ os << "\\wheel_jump " << wheel_jump << '\n';
}
case RC_CURSOR_FOLLOWS_SCROLLBAR:
if (cursor_follows_scrollbar
!= system_lyxrc.cursor_follows_scrollbar) {
os << "\\cursor_follows_scrollbar "
- << tostr(cursor_follows_scrollbar) << "\n";
+ << tostr(cursor_follows_scrollbar) << '\n';
}
case RC_DIALOGS_ICONIFY_WITH_MAIN:
if (dialogs_iconify_with_main
!= system_lyxrc.dialogs_iconify_with_main) {
os << "\\dialogs_iconify_with_main "
- << tostr(dialogs_iconify_with_main) << "\n";
+ << tostr(dialogs_iconify_with_main) << '\n';
}
case RC_SCREEN_FONT_ROMAN:
if (roman_font_name != system_lyxrc.roman_font_name) {
if (use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
os << "\\screen_font_scalable "
<< tostr(use_scalable_fonts)
- << "\n";
+ << '\n';
}
case RC_SCREEN_FONT_ENCODING:
if (font_norm != system_lyxrc.font_norm) {
os.setf(ios::fixed);
os.precision(2);
os << "\\screen_font_sizes"
- << " " << font_sizes[LyXFont::SIZE_TINY]
- << " " << font_sizes[LyXFont::SIZE_SCRIPT]
- << " " << font_sizes[LyXFont::SIZE_FOOTNOTE]
- << " " << font_sizes[LyXFont::SIZE_SMALL]
- << " " << font_sizes[LyXFont::SIZE_NORMAL]
- << " " << font_sizes[LyXFont::SIZE_LARGE]
- << " " << font_sizes[LyXFont::SIZE_LARGER]
- << " " << font_sizes[LyXFont::SIZE_LARGEST]
- << " " << font_sizes[LyXFont::SIZE_HUGE]
- << " " << font_sizes[LyXFont::SIZE_HUGER]
- << "\n";
+ << ' ' << font_sizes[LyXFont::SIZE_TINY]
+ << ' ' << font_sizes[LyXFont::SIZE_SCRIPT]
+ << ' ' << font_sizes[LyXFont::SIZE_FOOTNOTE]
+ << ' ' << font_sizes[LyXFont::SIZE_SMALL]
+ << ' ' << font_sizes[LyXFont::SIZE_NORMAL]
+ << ' ' << font_sizes[LyXFont::SIZE_LARGE]
+ << ' ' << font_sizes[LyXFont::SIZE_LARGER]
+ << ' ' << font_sizes[LyXFont::SIZE_LARGEST]
+ << ' ' << font_sizes[LyXFont::SIZE_HUGE]
+ << ' ' << font_sizes[LyXFont::SIZE_HUGER]
+ << '\n';
}
os << "\n#\n"
if (print_adapt_output != system_lyxrc.print_adapt_output) {
os << "\\print_adapt_output "
<< tostr(print_adapt_output)
- << "\n";
+ << '\n';
}
case RC_PRINT_COMMAND:
if (print_command != system_lyxrc.print_command) {
}
case RC_NUMLASTFILES:
if (num_lastfiles != system_lyxrc.num_lastfiles) {
- os << "\\num_lastfiles " << num_lastfiles << "\n";
+ os << "\\num_lastfiles " << num_lastfiles << '\n';
}
case RC_CHECKLASTFILES:
if (check_lastfiles != system_lyxrc.check_lastfiles) {
os << "\\check_lastfiles " << tostr(check_lastfiles)
- << "\n";
+ << '\n';
}
case RC_TEMPLATEPATH:
if (template_path != system_lyxrc.template_path) {
}
case RC_USETEMPDIR:
if (use_tempdir != system_lyxrc.use_tempdir) {
- os << "\\use_tempdir " << tostr(use_tempdir) << "\n";
+ os << "\\use_tempdir " << tostr(use_tempdir) << '\n';
}
case RC_ASCII_LINELEN:
if (ascii_linelen != system_lyxrc.ascii_linelen) {
- os << "\\ascii_linelen " << ascii_linelen << "\n";
+ os << "\\ascii_linelen " << ascii_linelen << '\n';
}
case RC_MAKE_BACKUP:
if (make_backup != system_lyxrc.make_backup) {
- os << "\\make_backup " << tostr(make_backup) << "\n";
+ os << "\\make_backup " << tostr(make_backup) << '\n';
}
case RC_BACKUPDIR_PATH:
if (backupdir_path != system_lyxrc.backupdir_path) {
#ifdef USE_PSPELL
case RC_USE_PSPELL:
if (use_pspell != system_lyxrc.use_pspell) {
- os << "\\use_pspell " << tostr(use_pspell) << "\n";
+ os << "\\use_pspell " << tostr(use_pspell) << '\n';
}
#endif
case RC_SPELL_COMMAND:
case RC_ACCEPT_COMPOUND:
if (isp_accept_compound != system_lyxrc.isp_accept_compound) {
os << "\\accept_compound " << tostr(isp_accept_compound)
- << "\n";
+ << '\n';
}
case RC_USE_ALT_LANG:
if (isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
os << "\\use_alt_language " << tostr(isp_use_alt_lang)
- << "\n";
+ << '\n';
}
case RC_ALT_LANG:
if (isp_alt_lang != system_lyxrc.isp_alt_lang) {
case RC_USE_ESC_CHARS:
if (isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
os << "\\use_escape_chars " << tostr(isp_use_esc_chars)
- << "\n";
+ << '\n';
}
case RC_ESC_CHARS:
if (isp_esc_chars != system_lyxrc.isp_esc_chars) {
if (isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
os << "\\use_personal_dictionary "
<< tostr(isp_use_pers_dict)
- << "\n";
+ << '\n';
}
case RC_PERS_DICT:
if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
!= system_lyxrc.isp_use_input_encoding) {
os << "\\use_input_encoding "
<< tostr(isp_use_input_encoding)
- << "\n";
+ << '\n';
}
os << "\n#\n"
case RC_RTL_SUPPORT:
if (rtl_support != system_lyxrc.rtl_support) {
- os << "\\rtl " << tostr(rtl_support) << "\n";
+ os << "\\rtl " << tostr(rtl_support) << '\n';
}
case RC_LANGUAGE_PACKAGE:
if (language_package != system_lyxrc.language_package) {
case RC_LANGUAGE_AUTO_BEGIN:
if (language_auto_begin != system_lyxrc.language_auto_begin) {
os << "\\language_auto_begin "
- << tostr(language_auto_begin) << "\n";
+ << tostr(language_auto_begin) << '\n';
}
case RC_LANGUAGE_AUTO_END:
if (language_auto_end != system_lyxrc.language_auto_end) {
os << "\\language_auto_end "
- << tostr(language_auto_end) << "\n";
+ << tostr(language_auto_end) << '\n';
}
case RC_MARK_FOREIGN_LANGUAGE:
if (mark_foreign_language
!= system_lyxrc.mark_foreign_language) {
os << "\\mark_foreign_language " <<
- tostr(mark_foreign_language) << "\n";
+ tostr(mark_foreign_language) << '\n';
}
os << "\n#\n"
case RC_OVERRIDE_X_DEADKEYS:
if (override_x_deadkeys != system_lyxrc.override_x_deadkeys) {
os << "\\override_x_deadkeys "
- << tostr(override_x_deadkeys) << "\n";
+ << tostr(override_x_deadkeys) << '\n';
}
case RC_AUTO_NUMBER:
if (auto_number != system_lyxrc.auto_number) {
- os << "\\auto_number " << tostr(auto_number) << "\n";
+ os << "\\auto_number " << tostr(auto_number) << '\n';
}
case RC_DEFAULT_LANGUAGE:
if (default_language != system_lyxrc.default_language) {
- os << "\\default_language " << default_language << "\n";
+ os << "\\default_language " << default_language << '\n';
}
os << "\n#\n"
if (!write) {
lyx_gui::remove_read_callback(fd);
}
-
+
#ifdef __EMX__
APIRET rc;
int errnum;
read_buffer_.erase();
}
- // reset connection
+ // reset connection
closeConnection();
openConnection();
break;
} else {
// errno == EAGAIN
- // Nothing new has arrived, so now's the time
+ // Nothing new has arrived, so now's the time
// to tell the outside world if there's anything
// in the read buffer.
break;
if (compare(p, "LYXSRV:", 7) == 0) {
server_only = true;
} else if (0 != compare(p, "LYXCMD:", 7)) {
- lyxerr << "LyXServer: Unknown request \"" << p << "\"" << endl;
+ lyxerr << "LyXServer: Unknown request \""
+ << p << '"' << endl;
return;
}
p += 7;
}
} else {
lyxerr <<"LyXServer: Undefined server command "
- << cmd << "." << endl;
+ << cmd << '.' << endl;
}
return;
}
buf = "ERROR:";
else
buf = "INFO:";
- buf += client + ":" + cmd + ":" + rval + "\n";
+ buf += client + ':' + cmd + ':' + rval + '\n';
serv->pipes.send(buf);
// !!! we don't do any error checking -
lay.reslabelfont.realize(defaultfont());
return false; // no errors
}
- lyxerr << "Error parsing style `" << lay.name() << "'" << endl;
+ lyxerr << "Error parsing style `" << lay.name() << '\'' << endl;
return true;
}
string const style = subst(lexrc.getString(),
'_', ' ');
if (!delete_layout(style))
- lyxerr << "Cannot delete style `" << style << "'" << endl;
+ lyxerr << "Cannot delete style `"
+ << style << '\'' << endl;
// lexrc.printError("Cannot delete style"
// " `$$Token'");
}
{
switch (p) {
case LyXTextClass::OneSide:
- os << "1";
+ os << '1';
break;
case LyXTextClass::TwoSides:
- os << "2";
+ os << '2';
break;
}
return os;
LyXLex lex(0, 0);
string real_file = LibFileSearch("", "textclass.lst");
lyxerr[Debug::TCLASS] << "Reading textclasses from `"
- << real_file << "'" << endl;
+ << real_file << '\'' << endl;
if (real_file.empty()) {
lyxerr << "LyXTextClassList::Read: unable to find "
+2002-11-27 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * math_inferinset.C: remove unused "using std::max"
+
2002-11-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
* formulamacro.C (prefix): use boost::format
void CommandInset::write(WriteStream & os) const
{
- os << "\\" << name_.c_str();
+ os << '\\' << name_.c_str();
if (cell(1).size())
- os << "[" << cell(1) << "]";
- os << "{" << cell(0) << "}";
+ os << '[' << cell(1) << ']';
+ os << '{' << cell(0) << '}';
}
void InsetFormula::write(Buffer const *, ostream & os) const
{
WriteStream wi(os, false, false);
- os << par_->fileInsetLabel() << " ";
+ os << par_->fileInsetLabel() << ' ';
par_->write(wi);
}
x = mathcursor->targetX();
x -= xo_;
y -= yo_;
- //lyxerr << "getCursorPos: " << x << " " << y << "\n";
+ //lyxerr << "getCursorPos: " << x << ' ' << y << endl;
}
void InsetFormulaBase::toggleInsetCursor(BufferView * bv)
{
if (!mathcursor) {
- lyxerr << "toggleInsetCursor impossible\n";
+ lyxerr << "toggleInsetCursor impossible" << endl;
return;
}
- //lyxerr << "toggleInsetCursor: " << isCursorVisible() << "\n";
+ //lyxerr << "toggleInsetCursor: " << isCursorVisible() << endl;
if (isCursorVisible())
hideInsetCursor(bv);
else
void InsetFormulaBase::showInsetCursor(BufferView * bv, bool)
{
if (!mathcursor) {
- lyxerr << "showInsetCursor impossible\n";
+ lyxerr << "showInsetCursor impossible" << endl;
return;
}
if (isCursorVisible())
math_font_max_dim(font_, asc, des);
bv->showLockedInsetCursor(x, y - yo_, asc, des);
setCursorVisible(true);
- //lyxerr << "showInsetCursor: " << x << " " << y << "\n";
+ //lyxerr << "showInsetCursor: " << x << ' ' << y << endl;
}
return;
bv->hideLockedInsetCursor();
setCursorVisible(false);
- //lyxerr << "hideInsetCursor: \n";
+ //lyxerr << "hideInsetCursor: " << endl;
}
math_font_max_dim(font_, asc, des);
getCursorPos(bv, x, y);
//y += yo_;
- //lyxerr << "fitInsetCursor: x: " << x << " y: " << y << " yo: " << yo_ << "\n";
+ //lyxerr << "fitInsetCursor: x: " << x << " y: " << y << " yo: " << yo_ << endl;
bv->fitLockedInsetCursor(x, y, asc, des);
}
hideInsetCursor(bv);
showInsetCursor(bv);
bv->updateInset(this, false);
- //lyxerr << "lfunMouseRelease: buttons: " << cmd.button() << "\n";
+ //lyxerr << "lfunMouseRelease: buttons: " << cmd.button() << endl;
if (cmd.button() == mouse_button::button3) {
// try to dispatch to enclosed insets first
Inset::RESULT InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
{
BufferView * bv = cmd.view();
- //lyxerr << "lfunMousePress: buttons: " << cmd.button() << "\n";
+ //lyxerr << "lfunMousePress: buttons: " << cmd.button() << endl;
if (!mathcursor || mathcursor->formula() != this) {
- lyxerr << "re-create cursor\n";
+ lyxerr << "re-create cursor" << endl;
releaseMathCursor(bv);
mathcursor = new MathCursor(this, cmd.x == 0);
metrics(bv);
// << " arg: '" << cmd.argument
// << " x: '" << cmd.x
// << " y: '" << cmd.y
- // << "' button: " << cmd.button() << "\n";
+ // << "' button: " << cmd.button() << endl;
switch (cmd.action) {
case LFUN_MOUSE_PRESS:
void MathAMSArrayInset::write(WriteStream & os) const
{
- os << "\\begin{" << name_ << "}";
+ os << "\\begin{" << name_ << '}';
MathGridInset::write(os);
- os << "\\end{" << name_ << "}";
+ os << "\\end{" << name_ << '}';
}
void MathAMSArrayInset::normalize(NormalStream & os) const
{
- os << "[" << name_ << " ";
+ os << '[' << name_ << ' ';
MathGridInset::normalize(os);
- os << "]";
+ os << ']';
}
-
{
if (os.fragile())
os << "\\protect";
- os << "\\begin{" << name_ << "}";
+ os << "\\begin{" << name_ << '}';
if (v_align_ == 't' || v_align_ == 'b')
os << '[' << char(v_align_) << ']';
if (os.fragile())
os << "\\protect";
- os << "\\end{" << name_ << "}";
+ os << "\\end{" << name_ << '}';
// adding a \n here is bad if the array is the last item
// in an \eqnarray...
}
void MathArrayInset::normalize(NormalStream & os) const
{
- os << "[" << name_ << " ";
+ os << '[' << name_ << ' ';
MathGridInset::normalize(os);
- os << "]";
+ os << ']';
}
{
os << "array(";
MathGridInset::maplize(os);
- os << ")";
+ os << ')';
}
void Correction::write(ostream & os) const
{
os << "from: '" << from1_ << "' and '" << from2_
- << "' to '" << to_ << "'" << endl;
+ << "' to '" << to_ << '\'' << endl;
}
bool Correction::correct(MathAtom & at, char c) const
{
//lyxerr[Debug::MATHED]
- // << "trying to correct ar: " << at << " from: '" << from1_ << "'" << endl;
+ // << "trying to correct ar: " << at << " from: '" << from1_ << '\'' << endl;
if (from2_ != c)
return false;
if (!at->match(from1_))
return false;
lyxerr[Debug::MATHED]
<< "match found! subst in " << at
- << " from: '" << from1_ << "' to '" << to_ << "'" << endl;
+ << " from: '" << from1_ << "' to '" << to_ << '\'' << endl;
at = to_;
return true;
}
ifstream is(file.c_str());
while (getline(is, line)) {
if (line.size() == 0 || line[0] == '#') {
- //lyxerr[Debug::MATHED] << "ignoring line '" << line << "'" << endl;
+ //lyxerr[Debug::MATHED] << "ignoring line '" << line << '\'' << endl;
continue;
}
istringstream il(STRCONV(line));
- //lyxerr[Debug::MATHED] << "line '" << line << "'" << endl;
+ //lyxerr[Debug::MATHED] << "line '" << line << '\'' << endl;
Correction corr;
if (corr.read(il)) {
- //lyxerr[Debug::MATHED] << "parsed: '" << corr << "'" << endl;
+ //lyxerr[Debug::MATHED] << "parsed: '" << corr << '\'' << endl;
theCorrections.insert(corr);
}
}
void MathBigInset::normalize(NormalStream & os) const
{
- os << "[" << name_ << ' ' << delim_ << ']';
+ os << '[' << name_ << ' ' << delim_ << ']';
}
void MathBoxInset::write(WriteStream & os) const
{
- os << "\\" << name_ << "{" << cell(0) << "}";
+ os << '\\' << name_ << '{' << cell(0) << '}';
}
{
os << "[cases ";
MathGridInset::normalize(os);
- os << "]";
+ os << ']';
}
{
os << "cases(";
MathGridInset::maplize(os);
- os << ")";
+ os << ')';
}
void MathCharInset::normalize(NormalStream & os) const
{
- os << "[char " << char_ << " " << "mathalpha" << "]";
+ os << "[char " << char_ << ' ' << "mathalpha]";
}
#if FILEDEBUG
void MathCursor::dump(char const * what) const
{
- lyxerr << "MC: " << what << "\n";
- lyxerr << " Cursor: " << depth() << "\n";
+ lyxerr << "MC: " << what << endl;
+ lyxerr << " Cursor: " << depth() << endl;
for (unsigned i = 0; i < depth(); ++i)
- lyxerr << " i: " << i << " " << Cursor_[i] << "\n";
- lyxerr << " Anchor: " << Anchor_.size() << "\n";
+ lyxerr << " i: " << i << ' ' << Cursor_[i] << endl;
+ lyxerr << " Anchor: " << Anchor_.size() << endl;
for (unsigned i = 0; i < Anchor_.size(); ++i)
- lyxerr << " i: " << i << " " << Anchor_[i] << "\n";
- lyxerr << " sel: " << selection_ << "\n";
+ lyxerr << " i: " << i << ' ' << Anchor_[i] << endl;
+ lyxerr << " sel: " << selection_ << endl;
}
#else
void MathCursor::dump(char const *) const {}
{
if (idx() >= par()->nargs()) {
lyxerr << "this should not really happen - 1: "
- << idx() << " " << par()->nargs() << " in: " << par() << "\n";
+ << idx() << ' ' << par()->nargs()
+ << " in: " << par() << endl;
dump("error 2");
}
idx() = min(idx(), par()->nargs() - 1);
if (pos() > size()) {
lyxerr << "this should not really happen - 2: "
- << pos() << " " << size() << " in idx: " << idx()
- << " in atom: '";
+ << pos() << ' ' << size() << " in idx: " << idx()
+ << " in atom: '";
WriteStream wi(lyxerr, false, true);
par()->write(wi);
- lyxerr << "\n";
+ lyxerr << endl;
dump("error 4");
}
pos() = min(pos(), size());
data += "\\\\";
for (col_type col = c1; col <= c2; ++col) {
if (col > c1)
- data += "&";
+ data += '&';
data += asString(i1.par_->cell(i1.par_->index(row, col)));
}
}
{
NormalStream ns(lyxerr);
for (const_iterator it = begin(); it != end(); ++it)
- ns << "<" << *it << ">";
+ ns << '<' << *it << '>';
}
{
//if (drawn_ && x == xo_ && y == yo_)
// return;
- //lyxerr << "x: " << x << " y: " << y << " " << pain.workAreaHeight() << endl;
+ //lyxerr << "x: " << x << " y: " << y << ' ' << pain.workAreaHeight() << endl;
xo_ = x;
yo_ = y;
drawn_ = true;
return name;
if (name == "|")
return name;
- return "\\" + name + " ";
+ return '\\' + name + ' ';
}
}
{
if (isAbs()) {
if (cell(0).size() == 1 && cell(0).front()->asMatrixInset())
- os << "linalg[det](" << cell(0) << ")";
+ os << "linalg[det](" << cell(0) << ')';
else
- os << "abs(" << cell(0) << ")";
+ os << "abs(" << cell(0) << ')';
}
else
os << left_ << cell(0) << right_;
{
if (isAbs()) {
if (cell(0).size() == 1 && cell(0).front()->asMatrixInset())
- os << "determinant(" << cell(0) << ")";
+ os << "determinant(" << cell(0) << ')';
else
- os << "abs(" << cell(0) << ")";
+ os << "abs(" << cell(0) << ')';
}
else
os << left_ << cell(0) << right_;
void MathDelimInset::octavize(OctaveStream & os) const
{
if (isAbs())
- os << "det(" << cell(0) << ")";
+ os << "det(" << cell(0) << ')';
else
os << left_ << cell(0) << right_;
}
void MathEnvInset::normalize(NormalStream & os) const
{
- os << "[env " << name_ << " " << cell(0) << ']';
+ os << "[env " << name_ << ' ' << cell(0) << ']';
}
// Probably missing an operator such as * p
//
lyxerr << "checking expr: '" << expr << "'\n";
- string out = captureOutput("mint -i 1 -S -s -q -q", expr + ";");
+ string out = captureOutput("mint -i 1 -S -s -q -q", expr + ';');
if (out.empty())
break; // expression syntax is ok
istringstream is(out.c_str());
pos -= 15; // skip the "on line ..." part
if (expr[pos] == '*' || (pos > 0 && expr[pos - 1] == '*'))
break; // two '*' in a row are definitely bad
- expr.insert(pos, "*");
+ expr.insert(pos, 1, '*');
}
string full = "latex(" + extra + '(' + expr + "));";
pos -= 4; // skip the ">>> " part
if (expr[pos] == '*')
break; // two '*' in a row are definitely bad
- expr.insert(pos, "*");
+ expr.insert(pos, 1, '*');
}
if (out.size() < 6)
// create normalized expression
ostringstream os;
NormalStream ns(os);
- os << "[" << extra << ' ';
+ os << '[' << extra << ' ';
ns << ar;
- os << "]";
+ os << ']';
string data = STRCONV(os.str());
// search external script
string file = LibFileSearch("mathed", "extern_" + lang);
if (file.empty()) {
- lyxerr << "converter to '" << lang << "' not found\n";
+ lyxerr << "converter to '" << lang << "' not found" << endl;
return MathArray();
}
// special case of pre-defined macros
if (line.size() > 8 && line.substr(0, 5) == "\\def\\") {
- //lyxerr << "defining: '" << line << "'" << endl;
+ //lyxerr << "defining: '" << line << '\'' << endl;
istringstream is(STRCONV(line));
MathMacroTable::create(MathAtom(new MathMacroTemplate(is)));
continue;
else
is >> tmp.extra;
if (!is) {
- lyxerr[Debug::MATHED] << "skipping line '" << line << "'" << endl;
+ lyxerr[Debug::MATHED] << "skipping line '" << line << '\'' << endl;
lyxerr[Debug::MATHED]
<< tmp.name << ' ' << tmp.inset << ' ' << tmp.extra << endl;
continue;
<< " inset: " << tmp.inset
<< " draw: " << int(tmp.draw.empty() ? 0 : tmp.draw[0])
<< " extra: " << tmp.extra
- << "'" << endl;
+ << '\'' << endl;
}
string tmp = "cmm";
string tmp2 = "cmsy";
MathAtom createMathInset(string const & s)
{
lyxerr[Debug::MATHED] << "creating inset with name: '"
- << s << "'" << endl;;
+ << s << '\'' << endl;;
latexkeys const * l = in_word_set(s);
if (l) {
string const & inset = l->inset;
lyxerr[Debug::MATHED] << " found inset: '" <<
- inset << "'" << endl;
+ inset << '\'' << endl;
if (inset == "ref")
return MathAtom(new RefInset(l->name));
if (inset == "underset")
if (MathMacroTable::has(s))
return MathAtom(new MathMacro(s));
- //lyxerr[Debug::MATHED] << "creating inset 2 with name: '" << s << "'" << endl;
+ //lyxerr[Debug::MATHED] << "creating inset 2 with name: '" << s << '\'' << endl;
return MathAtom(new MathUnknownInset(s));
}
void MathFontOldInset::normalize(NormalStream & os) const
{
- os << "[font " << key_->name << " " << cell(0) << "]";
+ os << "[font " << key_->name << ' ' << cell(0) << ']';
}
for (int i = 0; i < n; ++i)
res += "\\hline";
if (n)
- res += " ";
+ res += ' ';
return res;
}
for (string::const_iterator it = hh.begin(); it != hh.end(); ++it)
if (*it == 'c' || *it == 'l' || *it == 'r')
++col;
- // let's have at least one column, even if we did not recognize its
+ // let's have at least one column, even if we did not recognize its
// alignment
if (col == 0)
col = 1;
string eol;
if (!rowinfo_[row].crskip_.zero())
- eol += "[" + rowinfo_[row].crskip_.asLatexString() + "]";
+ eol += '[' + rowinfo_[row].crskip_.asLatexString() + ']';
// make sure an upcoming '[' does not break anything
if (row + 1 < nrows()) {
if (idx > 0)
--idx;
pos = cell(idx).size();
-
+
//mathcursor->normalize();
//updateLocal(bv, true);
return DISPATCHED_POP;
copyCol(col(idx));
else if (cmd.argument == "swap-column")
swapCol(col(idx));
- else
+ else
return UNDISPATCHED;
return DISPATCHED_POP;
return DISPATCHED_POP;
}
- default:
+ default:
return MathNestInset::dispatch(cmd, idx, pos);
}
return UNDISPATCHED;
os << "\\begin{" << type_ << star(n) << "}\n";
else if (type_ == "alignat" || type_ == "xalignat")
- os << "\\begin{" << type_ << star(n) << "}"
- << "{" << static_cast<unsigned int>((ncols() + 1)/2) << "}\n";
+ os << "\\begin{" << type_ << star(n) << '}'
+ << '{' << static_cast<unsigned int>((ncols() + 1)/2) << "}\n";
else if (type_ == "xxalignat")
- os << "\\begin{" << type_ << "}"
- << "{" << static_cast<unsigned int>((ncols() + 1)/2) << "}\n";
+ os << "\\begin{" << type_ << '}'
+ << '{' << static_cast<unsigned int>((ncols() + 1)/2) << "}\n";
else if (type_ == "multline" || type_ == "gather")
os << "\\begin{" << type_ << "}\n";
else
- os << "\\begin{unknown" << star(n) << "}";
+ os << "\\begin{unknown" << star(n) << '}';
}
os << "\\end{" << type_ << "}\n";
else
- os << "\\end{unknown" << star(n) << "}";
+ os << "\\end{unknown" << star(n) << '}';
}
return string();
if (label_[row].empty())
return string("(#)");
- return "(" + label_[row] + ")";
+ return '(' + label_[row] + ')';
}
string res;
if (numberedType()) {
if (!label_[row].empty() && !nonum_[row])
- res += "\\label{" + label_[row] + "}";
+ res += "\\label{" + label_[row] + '}';
if (nonum_[row])
res += "\\nonumber ";
}
void MathHullInset::normalize(NormalStream & os) const
{
- os << "[formula " << type_ << " ";
+ os << "[formula " << type_ << ' ';
MathGridInset::normalize(os);
os << "] ";
}
#include "textpainter.h"
-using std::max;
-
-
MathInferInset::MathInferInset()
: MathGridInset(1, 1)
{}
{
os << "\\infer";
if (opt_.size())
- os << "[" << opt_ << "]";
+ os << '[' << opt_ << ']';
MathGridInset::write(os);
}
-
-
void MathKernInset::write(WriteStream & os) const
{
- os << "\\kern" << wid_.asLatexString() << " ";
+ os << "\\kern" << wid_.asLatexString() << ' ';
}
void MathKernInset::normalize(NormalStream & os) const
{
- os << "[kern " << wid_.asLatexString() << "]";
+ os << "[kern " << wid_.asLatexString() << ']';
}
void MathNumberInset::normalize(NormalStream & os) const
{
- os << "[number " << str_ << "]";
+ os << "[number " << str_ << ']';
}
ostream & operator<<(ostream & os, Token const & t)
{
if (t.cs().size())
- os << "\\" << t.cs();
+ os << '\\' << t.cs();
else
- os << "[" << t.character() << "," << t.cat() << "]";
+ os << '[' << t.character() << ',' << t.cat() << ']';
return os;
}
-
#ifdef __GNUG__
-#pragma implementation
+#pragma implementation
#endif
#include "config.h"
std::ostream & operator<<(std::ostream & os, MathCursorPos const & p)
{
- os << "(par: " << p.par_ << " idx: " << p.idx_ << " pos: " << p.pos_ << ")";
+ os << "(par: " << p.par_ << " idx: " << p.idx_ << " pos: " << p.pos_ << ')';
return os;
}
void MathRootInset::maplize(MapleStream & os) const
{
- os << "(" << cell(1) << ")^(1/(" << cell(0) <<"))";
+ os << '(' << cell(1) << ")^(1/(" << cell(0) <<"))";
}
void MathRootInset::octavize(OctaveStream & os) const
{
- os << "root(" << cell(1) << ',' << cell(0) <<')';
+ os << "root(" << cell(1) << ',' << cell(0) << ')';
}
return false;
// otherwise go to last base position
idx = 2;
- pos = cell(2).size();
+ pos = cell(2).size();
}
else if (idx == 0) {
if (!up)
return false;
idx = 2;
- pos = cell(2).size();
+ pos = cell(2).size();
}
-
+
else {
// in nucleus
// don't go up/down unless in last position
if (pos != cell(2).size())
- return false;
+ return false;
// don't go up/down if there is no cell.
if (!has(up))
return false;
bool u = hasUp() && up().size();
if (nuc().size()) {
- if (d)
+ if (d)
os << "Subscript[" << nuc();
else
os << nuc();
}
if (u)
- os << "^(" << up() << ")";
+ os << "^(" << up() << ')';
if (nuc().size())
if (d)
- os << "," << down() << "]";
+ os << ',' << down() << ']';
}
void MathSizeInset::normalize(NormalStream & os) const
{
- os << "[" << key_->name << ' ' << cell(0) << ']';
+ os << '[' << key_->name << ' ' << cell(0) << ']';
}
{
if (ws.fragile())
ws << "\\protect";
- ws << "\\begin{" << name_ << "}";
+ ws << "\\begin{" << name_ << '}';
MathGridInset::write(ws);
if (ws.fragile())
ws << "\\protect";
void MathStringInset::normalize(NormalStream & os) const
{
- os << "[string " << str_ << ' ' << "mathalpha" << "]";
+ os << "[string " << str_ << ' ' << "mathalpha" << ']';
}
{
os << "[substack ";
MathGridInset::normalize(os);
- os << "]";
+ os << ']';
}
{
os << "substack(";
MathGridInset::maplize(os);
- os << ")";
+ os << ')';
}
-
#ifdef __GNUG__
-#pragma implementation
+#pragma implementation
#endif
#include <config.h>
for (int j = 0; j < n; ++j) {
double xx = d[i++];
double yy = d[i++];
-// lyxerr << " " << xx << " " << yy << " ";
+// lyxerr << ' ' << xx << ' ' << yy << ' ';
if (code == 4)
sqmt.transform(xx, yy);
else
mt.transform(xx, yy);
xp[j] = int(x + xx + 0.5);
yp[j] = int(y + yy + 0.5);
- // lyxerr << "P[" << j " " << xx << " " << yy << " " << x << " " << y << "]";
+ // lyxerr << "P[" << j ' ' << xx << ' ' << yy << ' ' << x << ' ' << y << ']';
}
pi.pain.lines(xp, yp, n, LColor::math);
}
LyXFont::FONT_FAMILY const inh_family = LyXFont::INHERIT_FAMILY;
LyXFont::FONT_SERIES const inh_series = LyXFont::INHERIT_SERIES;
-LyXFont::FONT_SHAPE const inh_shape = LyXFont::INHERIT_SHAPE;
+LyXFont::FONT_SHAPE const inh_shape = LyXFont::INHERIT_SHAPE;
// mathnormal should be the first, otherwise the fallback further down
fontinfo * lookupFont(string const & name)
{
- //lyxerr << "searching font '" << name << "'\n";
+ //lyxerr << "searching font '" << name << "'\n";
int const n = sizeof(fontinfos) / sizeof(fontinfo);
for (int i = 0; i < n; ++i)
if (fontinfos[i].cmd_ == name) {
- //lyxerr << "found '" << i << "'\n";
+ //lyxerr << "found '" << i << "'\n";
return fontinfos + i;
}
return 0;
-
#ifdef __GNUG__
-#pragma implementation
+#pragma implementation
#endif
#include <config.h>
void MathSymbolInset::normalize(NormalStream & os) const
{
- os << "[symbol " << name() << "]";
+ os << "[symbol " << name() << ']';
}
MathArray const & MathXYArrowInset::targetCell() const
{
-#if 0
+#if 0
MathXYMatrixInset const * p = targetMatrix();
int x = 0;
int y = 0;
{
os << "\\ar";
if (cell(0).size())
- os << "[" << cell(0) << "]";
+ os << '[' << cell(0) << ']';
if (cell(1).size())
- os << (up_ ? "^" : "_") << "{" << cell(1) << "}";
+ os << (up_ ? '^' : '_') << '{' << cell(1) << '}';
os << " ";
}
{
os << "[xyarrow ";
MathNestInset::normalize(os);
- os << "]";
+ os << ']';
}
{
os << "[xymatrix ";
MathGridInset::normalize(os);
- os << "]";
+ os << ']';
}
{
os << "xymatrix(";
MathGridInset::maplize(os);
- os << ")";
+ os << ')';
}
return DISPATCHED;
}
break;
- case LFUN_MOUSE_PRESS:
+ case LFUN_MOUSE_PRESS:
case LFUN_MOUSE_MOTION:
// eat other mouse commands
return DISPATCHED;
int RefInset::ascii(std::ostream & os, int) const
{
- os << "[" << asString(cell(0)) << "]";
+ os << '[' << asString(cell(0)) << ']';
return 0;
}
-
#ifdef __GNUG__
-#pragma implementation
+#pragma implementation
#endif
#include "textpainter.h"
void TextPainter::draw(int x, int y, char const * str)
{
- //cerr << "drawing string '" << str << "' at " << x << "," << y << "\n";
+ //cerr << "drawing string '" << str << "' at " << x << ',' << y << endl;
for (int i = 0; *str && x + i < xmax_; ++i, ++str)
at(x + i, y) = *str;
//show();
void TextPainter::draw(int x, int y, char c)
{
- //cerr << "drawing char '" << c << "' at " << x << "," << y << "\n";
+ //cerr << "drawing char '" << c << "' at " << x << ',' << y << endl;
at(x, y) = c;
//show();
}
os << '\n';
for (int j = 0; j <= ymax_; ++j) {
for (int i = 0; i < offset; ++i)
- os << ' ';
+ os << ' ';
for (int i = 0; i < xmax_; ++i)
os << at(i, j);
os << '\n';
}
// First write the layout
- os << "\n\\layout " << layout()->name() << "\n";
+ os << "\n\\layout " << layout()->name() << '\n';
// Maybe some vertical spaces.
if (params().spaceTop().kind() != VSpace::NONE)
os << "\\added_space_top "
- << params().spaceTop().asLyXCommand() << " ";
+ << params().spaceTop().asLyXCommand() << ' ';
if (params().spaceBottom().kind() != VSpace::NONE)
os << "\\added_space_bottom "
- << params().spaceBottom().asLyXCommand() << " ";
+ << params().spaceBottom().asLyXCommand() << ' ';
// Maybe the paragraph has special spacing
params().spacing().writeFile(os, true);
// Do we have a manual left indent?
if (!params().leftIndent().zero())
- os << "\\leftindent " << params().leftIndent().asString() << " ";
+ os << "\\leftindent " << params().leftIndent().asString()
+ << ' ';
// Alignment?
if (params().align() != LYX_ALIGN_LAYOUT) {
case LYX_ALIGN_CENTER: h = 3; break;
default: h = 0; break;
}
- os << "\\align " << string_align[h] << " ";
+ os << "\\align " << string_align[h] << ' ';
}
// bibitem ale970302
int column = 0;
for (pos_type i = 0; i < size(); ++i) {
if (!i) {
- os << "\n";
+ os << '\n';
column = 0;
}
os << ".\n";
column = 0;
} else
- os << ".";
+ os << '.';
break;
default:
if ((column > 70 && c == ' ')
|| column > 79) {
- os << "\n";
+ os << '\n';
column = 0;
}
// this check is to amend a bug. LyX sometimes
if (!params().spacing().isDefault()
&& (!previous() || !previous()->hasSameLayout(this))) {
- os << params().spacing().writeEnvirBegin() << "\n";
+ os << params().spacing().writeEnvirBegin() << '\n';
texrow.newline();
}
language->encoding() != previous_language->encoding()) {
os << "\\inputencoding{"
<< language->encoding()->LatexName()
- << "}" << endl;
+ << "}\n";
texrow.newline();
}
if (style->resfont.size() != font.size() && next_ && !is_command) {
if (!need_par)
- os << "{";
+ os << '{';
os << "\\" << font.latexSize() << " \\par}";
} else if (need_par) {
os << "\\par}";
} else if (is_command)
- os << "}";
+ os << '}';
switch (style->latextype) {
case LATEX_ITEM_ENVIRONMENT:
if (!params().spacing().isDefault()
&& (!next_ || !next_->hasSameLayout(this))) {
- os << params().spacing().writeEnvirEnd() << "\n";
+ os << params().spacing().writeEnvirEnd() << '\n';
texrow.newline();
}
}
running_font = basefont;
if (font.family() ==
LyXFont::TYPEWRITER_FAMILY) {
- os << "~";
+ os << '~';
}
if (moving_arg)
os << "\\protect ";
style.free_spacing);
if (close)
- os << "}";
+ os << '}';
if (tmp) {
for (int j = 0; j < tmp; ++j) {
{
if (!latexname.empty() && latexname != "!-- --") {
if (!mixcont)
- os << string(" ", depth);
- os << "<" << latexname << ">";
+ os << string(depth, ' ');
+ os << '<' << latexname << '>';
}
if (!mixcont)
{
if (!latexname.empty() && latexname != "!-- --") {
if (!mixcont)
- os << endl << string(" ", depth);
- os << "</" << latexname << ">";
+ os << endl << string(depth, ' ');
+ os << "</" << latexname << '>';
}
if (!mixcont)
string const QuoteName(string const & name)
{
return (os::shell() == os::UNIX) ?
- "\'" + name + "\'":
- "\"" + name + "\"";
+ '\'' + name + '\'':
+ '"' + name + '"';
}
// This is a non-error checking C/system implementation
string extension(ext);
if (!extension.empty() && extension[0] != '.')
- extension.insert(0, ".");
+ extension.insert(0, 1, '.');
vector<string> dirlist;
DIR * dirp = ::opendir(dir.c_str());
if (!dirp) {
*/
/* A C++ implementaion will look like this:
string extension(ext);
- if (extension[0] != '.') extension.insert(0, ".");
+ if (extension[0] != '.') extension.insert(0, 1, '.');
vector<string> dirlist;
directory_iterator dit("dir");
while (dit != directory_iterator()) {
{
lyxerr[Debug::FILES]
<< "CreateTmpDir: tempdir=`" << tempdir << "'\n"
- << "CreateTmpDir: mask=`" << mask << "'" << endl;
+ << "CreateTmpDir: mask=`" << mask << '\'' << endl;
string const tmpfl(lyx::tempName(tempdir, mask));
// lyx::tempName actually creates a file to make sure that it
return STRCONV(ofs.str());
}
}
- lyxerr << "LyX was not able to read file '" << fname << "'" << endl;
+ lyxerr << "LyX was not able to read file '" << fname << '\'' << endl;
return string();
}
string ext;
// Make sure the extension starts with a dot
if (!extension.empty() && extension[0] != '.')
- ext= "." + extension;
+ ext= '.' + extension;
else
ext = extension;
cmd_ret const c = RunCommand(kpsecmd);
- lyxerr[Debug::LATEX] << "kpse status = " << c.first << "\n"
+ lyxerr[Debug::LATEX] << "kpse status = " << c.first << '\n'
<< "kpse result = `" << rtrim(c.second, "\n")
- << "'" << endl;
+ << '\'' << endl;
if (c.first != -1)
return os::internal_path(rtrim(c.second, "\n\r"));
else
// Wait for child process to finish.
-int ForkedProcess::runBlocking()
+int ForkedProcess::runBlocking()
{
retval_ = 0;
pid_ = generateChild();
void ForkedProcess::kill(int tol)
{
- lyxerr << "ForkedProcess::kill(" << tol << ")" << std::endl;
+ lyxerr << "ForkedProcess::kill(" << tol << ')' << endl;
if (pid() == 0) {
lyxerr << "Can't kill non-existent process!" << endl;
return;
lyxerr[Debug::LATEX]
<< "<Win32 path correction> ["
<< p << "]->>["
- << dos_path << "]" << endl;
+ << dos_path << ']' << endl;
return dos_path;
}
lyxerr[Debug::DEPEND]
<< "<Win32 path correction> ["
<< p << "]->>["
- << posix_path << "]" << endl;
+ << posix_path << ']' << endl;
return posix_path;
}
Init(buf->params, rows_arg, columns_arg);
l_getline(is, line);
if (!prefixIs(line, "<Features ")) {
- lyxerr << "Wrong tabular format (expected <Feture ...> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected <Feture ...> got"
+ << line << ')' << endl;
return;
}
getTokenValue(line, "islongtable", is_long_tabular);
for (int i = 0; i < rows_; ++i) {
l_getline(is, line);
if (!prefixIs(line, "<Row ")) {
- lyxerr << "Wrong tabular format (expected <Row ...> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected <Row ...> got"
+ << line << ')' << endl;
return;
}
getTokenValue(line, "topline", row_info[i].top_line);
for (int j = 0; j < columns_; ++j) {
l_getline(is,line);
if (!prefixIs(line,"<Column")) {
- lyxerr << "Wrong tabular format (expected <Column ...> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected <Column ...> got"
+ << line << ')' << endl;
return;
}
if (!i) {
}
l_getline(is, line);
if (!prefixIs(line, "<Cell")) {
- lyxerr << "Wrong tabular format (expected <Cell ...> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected <Cell ...> got"
+ << line << ')' << endl;
return;
}
getTokenValue(line, "multicolumn", cell_info[i][j].multicolumn);
l_getline(is, line);
}
if (line != "</Cell>") {
- lyxerr << "Wrong tabular format (expected </Cell> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected </Cell> got"
+ << line << ')' << endl;
return;
}
l_getline(is, line);
if (line != "</Column>") {
- lyxerr << "Wrong tabular format (expected </Column> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected </Column> got"
+ << line << ')' << endl;
return;
}
}
l_getline(is, line);
if (line != "</Row>") {
- lyxerr << "Wrong tabular format (expected </Row> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected </Row> got"
+ << line << ')' << endl;
return;
}
}
Init(buf->params, rows_arg, columns_arg);
l_getline(is, line);
if (!prefixIs(line, "<features")) {
- lyxerr << "Wrong tabular format (expected <features ...> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected <features ...> got"
+ << line << ')' << endl;
return;
}
getTokenValue(line, "rotate", rotate);
for (int j = 0; j < columns_; ++j) {
l_getline(is,line);
if (!prefixIs(line,"<column")) {
- lyxerr << "Wrong tabular format (expected <column ...> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected <column ...> got"
+ << line << ')' << endl;
return;
}
getTokenValue(line, "alignment", column_info[j].alignment);
for (int i = 0; i < rows_; ++i) {
l_getline(is, line);
if (!prefixIs(line, "<row")) {
- lyxerr << "Wrong tabular format (expected <row ...> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected <row ...> got"
+ << line << ')' << endl;
return;
}
getTokenValue(line, "topline", row_info[i].top_line);
for (int j = 0; j < columns_; ++j) {
l_getline(is, line);
if (!prefixIs(line, "<cell")) {
- lyxerr << "Wrong tabular format (expected <cell ...> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected <cell ...> got"
+ << line << ')' << endl;
return;
}
getTokenValue(line, "multicolumn", cell_info[i][j].multicolumn);
l_getline(is, line);
}
if (!prefixIs(line, "</cell>")) {
- lyxerr << "Wrong tabular format (expected </cell> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected </cell> got"
+ << line << ')' << endl;
return;
}
}
l_getline(is, line);
if (!prefixIs(line, "</row>")) {
- lyxerr << "Wrong tabular format (expected </row> got" <<
- line << ")" << endl;
+ lyxerr << "Wrong tabular format (expected </row> got"
+ << line << ')' << endl;
return;
}
}
if (!GetPWidth(cell).zero()) {
switch (GetVAlignment(cell)) {
case LYX_VALIGN_TOP:
- os << "p";
+ os << 'p';
break;
case LYX_VALIGN_CENTER:
- os << "m";
+ os << 'm';
break;
case LYX_VALIGN_BOTTOM:
- os << "b";
+ os << 'b';
break;
}
- os << "{" << GetPWidth(cell).asLatexString() << '}';
+ os << '{'
+ << GetPWidth(cell).asLatexString()
+ << '}';
} else {
switch (GetAlignment(cell)) {
case LYX_ALIGN_LEFT:
os << "\\parbox[";
switch (GetVAlignment(cell)) {
case LYX_VALIGN_TOP:
- os << "t";
+ os << 't';
break;
case LYX_VALIGN_CENTER:
- os << "c";
+ os << 'c';
break;
case LYX_VALIGN_BOTTOM:
- os << "b";
+ os << 'b';
break;
}
os << "]{" << GetPWidth(cell).asLatexString() << "}{";
os << "\\begin{minipage}[";
switch (GetVAlignment(cell)) {
case LYX_VALIGN_TOP:
- os << "t";
+ os << 't';
break;
case LYX_VALIGN_CENTER:
- os << "m";
+ os << 'm';
break;
case LYX_VALIGN_BOTTOM:
- os << "b";
+ os << 'b';
break;
}
os << "]{" << GetPWidth(cell).asLatexString() << "}\n";
// usual cells
if (GetUsebox(cell) == BOX_PARBOX)
- os << "}";
+ os << '}';
else if (GetUsebox(cell) == BOX_MINIPAGE) {
os << "%\n\\end{minipage}";
ret += 2;
os << "\\R{";
ret += inset->latex(buf, os, fragile, fp);
if (rtl)
- os << "}";
+ os << '}';
ret += TeXCellPostamble(os, cell);
if (!IsLastCellInRow(cell)) { // not last cell in row
os << ">{\\centering}";
break;
}
-
+
switch (column_info[i].valignment) {
case LYX_VALIGN_TOP:
- os << "p";
+ os << 'p';
break;
case LYX_VALIGN_CENTER:
- os << "m";
+ os << 'm';
break;
case LYX_VALIGN_BOTTOM:
- os << "b";
+ os << 'b';
break;
}
- os << "{"
+ os << '{'
<< column_info[i].p_width.asLatexString()
<< '}';
} else {
os << 'l';
break;
case LYX_ALIGN_RIGHT:
- os << 'r';
- break;
+ os << 'r';
+ break;
default:
os << 'c';
break;
case LYX_VALIGN_CENTER:
os << "middle";
}
- os << "\"";
+ os << '"';
if (IsMultiColumn(cell)) {
os << " namest=\"col" << j << "\" ";
- os << "nameend=\"col" << j + cells_in_multicolumn(cell) - 1<< "\"";
+ os << "nameend=\"col" << j + cells_in_multicolumn(cell) - 1<< '"';
}
- os << ">";
+ os << '>';
ret += GetCellInset(cell)->docbook(buf, os, true);
os << "</entry>\n";
++cell;
break;
}
- for (unsigned int i = 0; i < len1; ++i)
- os << " ";
- os << sstr.str();
- for (unsigned int i = 0; i < len2; ++i)
- os << " ";
+ os << string(len1, ' ')
+ << sstr.str()
+ << string(len2, ' ');
if (RightLine(cell))
os << " |";
else
void LyXTabular::Validate(LaTeXFeatures & features) const
{
- features.require("NeedTabularnewline");
+ features.require("NeedTabularnewline");
if (IsLongTabular())
features.require("longtable");
if (NeedRotating())
// we would not get a rebreak!
row->fill(fill(bview, row, workWidth(bview)));
}
-
+
if (c == Paragraph::META_INSET || row->fill() < 0) {
refresh_y = y;
refresh_row = row;
WordLangTuple word = the_locking_inset->selectNextWordToSpellcheck(bview, value);
if (!word.word().empty()) {
value += float(cursor.y());
- value /= float(height);
+ value /= float(height);
return word;
}
// we have to go on checking so move cursor to the next char
switch (vsp.kind()) {
case VSpace::LENGTH:
{
- str = prefix + " (" + vsp.asLyXCommand() + ")";
+ str = prefix + " (" + vsp.asLyXCommand() + ')';
// adding or removing space
bool const added = !(vsp.length().len().value() < 0.0);
ty1 = added ? (start + arrow_size) : start;
// Doesn't work... yet.
ostringstream o;
- //o << fl.name() << " " << buf->counters().value(fl.name()) << ":";
+ //o << fl.name() << ' ' << buf->counters().value(fl.name()) << ":";
o << fl.name() << " #:";
s = STRCONV(o.str());
} else {
extern int bibitemMaxWidth(BufferView *, LyXFont const &);
// the selection possible is needed, that only motion events are
-// used, where the bottom press event was on the drawing area too
+// used, where the bottom press event was on the drawing area too
bool selection_possible = false;
Inset /*const*/ * inset = par.getInset(pos);
- if (!isEditableInset(inset))
+ if (!isEditableInset(inset))
return 0;
// get inset dimensions
);
if (!b.contained(x, y)) {
- lyxerr[Debug::GUI] << "Missed inset at x,y " << x << "," << y
- << " box " << b << endl;
+ lyxerr[Debug::GUI] << "Missed inset at x,y "
+ << x << ',' << y
+ << " box " << b << endl;
return 0;
}
Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
{
lyxerr[Debug::ACTION] << "LyXFunc::dispatch: action[" << cmd.action
- <<"] arg[" << cmd.argument << "]" << endl;
+ <<"] arg[" << cmd.argument << ']' << endl;
BufferView * bv = cmd.view();
case LFUN_WORDSEL: {
update(bv, false);
- LyXCursor cur1;
- LyXCursor cur2;
+ LyXCursor cur1;
+ LyXCursor cur2;
getWord(cur1, cur2, WHOLE_WORD);
setCursor(bv, cur1.par(), cur1.pos());
bv->beforeChange(this);
if (!is)
lyxerr << "SETXY: Could not parse coordinates in '"
<< cmd.argument << std::endl;
- else
+ else
setCursorFromCoordinates(bv, x, y);
break;
}
// in some other local environment, but I would like to leave this here
// for the moment until I can remove this (Jug 20020418)
if (y_before < bv->text->cursor.y())
- lyxerr << y_before << ":" << bv->text->cursor.y() << endl;
+ lyxerr << y_before << ':'
+ << bv->text->cursor.y() << endl;
#endif
// This is to allow jumping over large insets
if (cursorrow == bv->text->cursor.row()) {
// do nothing if we used the mouse wheel
if (!bv->buffer())
break;
-
+
if (cmd.button() == mouse_button::button4
|| cmd.button() == mouse_button::button5)
break;
case LFUN_INSET_WRAP:
case LFUN_TABULAR_INSERT:
case LFUN_INDEX_INSERT:
- case LFUN_INDEX_PRINT:
+ case LFUN_INDEX_PRINT:
case LFUN_PARENTINSERT:
case LFUN_TOC_INSERT:
{
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "key\t`" << lex.text()
- << "'" << endl;
+ << '\'' << endl;
} else
return -1;
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "accent\t`" << lex.text()
- << "'" << endl;
+ << '\'' << endl;
} else
return -1;
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "allowed\t`" << lex.text()
- << "'" << endl;
+ << '\'' << endl;
} else
return -1;
if (lex.next(true)) {
key_from = lex.text()[0];
if (lyxerr.debugging(Debug::KBMAP))
- lyxerr << "\t`" << lex.text() << "'"
+ lyxerr << "\t`" << lex.text() << '\''
<< endl;
} else
return -1;
string string_to = lex.text();
keymap_[key_from] = string_to;
if (lyxerr.debugging(Debug::KBMAP))
- lyxerr << "\t`" << string_to << "'"
+ lyxerr << "\t`" << string_to << '\''
<< endl;
} else
return -1;
lyxerr << "KXMOD:\t" << lex.text() << endl;
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
- lyxerr << "\t`" << lex.text() << "'"
+ lyxerr << "\t`" << lex.text() << '\''
<< endl;
accent = getkeymod(lex.getString());
} else
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
- lyxerr << "\t`" << lex.text() << "'"
+ lyxerr << "\t`" << lex.text() << '\''
<< endl;
key = lex.text()[0];
} else
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
- lyxerr << "\t`" << lex.text() << "'"
+ lyxerr << "\t`" << lex.text() << '\''
<< endl;
str = lex.text();
} else
lyxerr << "p = " << p
<< ", lyx_accent_table[" << i
<< "].name = `" << lyx_accent_table[i].name
- << "'" << endl;
+ << '\'' << endl;
if (lyx_accent_table[i].name
&& contains(p, lyx_accent_table[i].name)) {
{
lyxerr[Debug::LYXVC] << "LyXVC::RCS: retrieve.\n\t" << file << endl;
VCS::doVCCommand("co -q -r \""
- + file + "\"",
+ + file + '"',
string());
}
while (!read_enough && ifs >> token) {
lyxerr[Debug::LYXVC]
<< "LyXVC::scanMaster: current lex text: `"
- << token << "'" << endl;
+ << token << '\'' << endl;
if (token.empty())
continue;
cmd += msg;
cmd += "\" \"";
cmd += OnlyFilename(owner_->fileName());
- cmd += "\"";
+ cmd += '"';
doVCCommand(cmd, owner_->filePath());
owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
}
void RCS::checkIn(string const & msg)
{
doVCCommand("ci -q -u -m\"" + msg + "\" \""
- + OnlyFilename(owner_->fileName()) + "\"", owner_->filePath());
+ + OnlyFilename(owner_->fileName()) + '"',
+ owner_->filePath());
owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
}
{
owner_->markClean();
doVCCommand("co -q -l \""
- + OnlyFilename(owner_->fileName()) + "\"", owner_->filePath());
+ + OnlyFilename(owner_->fileName()) + '"',
+ owner_->filePath());
owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
}
void RCS::revert()
{
doVCCommand("co -f -u" + version() + " \""
- + OnlyFilename(owner_->fileName()) + "\"", owner_->filePath());
+ + OnlyFilename(owner_->fileName()) + '"',
+ owner_->filePath());
// We ignore changes and just reload!
owner_->markClean();
owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
{
lyxerr[Debug::LYXVC] << "LyXVC: undoLast" << endl;
doVCCommand("rcs -o" + version() + " \""
- + OnlyFilename(owner_->fileName()) + "\"",
+ + OnlyFilename(owner_->fileName()) + '"',
owner_->filePath());
}
void RCS::getLog(string const & tmpf)
{
doVCCommand("rlog \""
- + OnlyFilename(owner_->fileName()) + "\" > " + tmpf, owner_->filePath());
+ + OnlyFilename(owner_->fileName()) + "\" > "
+ + tmpf, owner_->filePath());
}
string const dir = OnlyPath(file) + "/CVS/Entries";
string const tmpf = "/" + OnlyFilename(file) + "/";
lyxerr[Debug::LYXVC] << "LyXVC: checking in `" << dir
- << "' for `" << tmpf << "'" << endl;
+ << "' for `" << tmpf << '\'' << endl;
FileInfo const f(dir);
if (f.readable()) {
// Ok we are at least in a CVS dir. Parse the CVS/Entries
// Ok now we do the real scan...
ifstream ifs(master_.c_str());
string tmpf = "/" + OnlyFilename(file_) + "/";
- lyxerr[Debug::LYXVC] << "\tlooking for `" << tmpf << "'" << endl;
+ lyxerr[Debug::LYXVC] << "\tlooking for `" << tmpf << '\'' << endl;
string line;
regex reg("/(.*)/(.*)/(.*)/(.*)/(.*)");
while (getline(ifs, line)) {
lyxerr[Debug::LYXVC]
<< "Date in Entries: `" << file_date
<< "'\nModification date of file: `"
- << mod_date << "'" << endl;
+ << mod_date << '\'' << endl;
if (file_date == mod_date) {
locker_ = "Unlocked";
vcstatus = UNLOCKED;
void CVS::registrer(string const & msg)
{
doVCCommand("cvs -q add -m \"" + msg + "\" \""
- + OnlyFilename(owner_->fileName()) + "\"", owner_->filePath());
+ + OnlyFilename(owner_->fileName()) + '"',
+ owner_->filePath());
owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
}
void CVS::checkIn(string const & msg)
{
doVCCommand("cvs -q commit -m \"" + msg + "\" \""
- + OnlyFilename(owner_->fileName()) + "\"",
+ + OnlyFilename(owner_->fileName()) + '"',
owner_->filePath());
owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
}
// gets the updated version from the repository.
string const fil = OnlyFilename(owner_->fileName());
- doVCCommand("rm -f \"" + fil + "\"; cvs update \"" + fil + "\"",
+ doVCCommand("rm -f \"" + fil + "\"; cvs update \"" + fil + '"',
owner_->filePath());
owner_->markClean();
owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));