]> git.lyx.org Git - features.git/commitdiff
the string -> char patch
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 27 Nov 2002 10:30:28 +0000 (10:30 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 27 Nov 2002 10:30:28 +0000 (10:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5725 a592a061-630c-0410-9148-cb99ea01b6c8

150 files changed:
src/BufferView_pimpl.C
src/ChangeLog
src/DepTable.C
src/LaTeX.C
src/LaTeXFeatures.C
src/LyXAction.C
src/MenuBackend.C
src/Spacing.C
src/ToolbarDefaults.C
src/box.C
src/buffer.C
src/bufferlist.C
src/bufferview_funcs.C
src/chset.C
src/converter.C
src/counters.C
src/debug.C
src/frontends/LyXView.C
src/frontends/Painter.h
src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlMath.C
src/frontends/controllers/ControlPrefs.C
src/frontends/controllers/ControlPrint.C
src/frontends/controllers/ControlTabularCreate.C
src/frontends/controllers/biblio.C
src/frontends/gnome/GFloat.C
src/frontends/qt2/Alert_pimpl.C
src/frontends/qt2/ChangeLog
src/frontends/qt2/FileDialog.C
src/frontends/qt2/FileDialog_private.C
src/frontends/qt2/QCommandBuffer.C
src/frontends/qt2/QContentPane.C
src/frontends/qt2/QDelimiterDialog.C
src/frontends/qt2/QFloat.C
src/frontends/qt2/QGraphics.C
src/frontends/qt2/QLImage.C
src/frontends/qt2/QLPainter.C
src/frontends/qt2/QLPopupMenu.C
src/frontends/qt2/QPreambleDialog.C
src/frontends/qt2/QPrefs.C
src/frontends/qt2/QToc.C
src/frontends/qt2/Toolbar_pimpl.C
src/frontends/qt2/iconpalette.C
src/frontends/qt2/qscreen.C
src/frontends/screen.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/ColorHandler.C
src/frontends/xforms/FileDialog.C
src/frontends/xforms/FontInfo.C
src/frontends/xforms/FormBibtex.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/FormExternal.C
src/frontends/xforms/FormFloat.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormRef.C
src/frontends/xforms/FormToc.C
src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/Toolbar_pimpl.C
src/frontends/xforms/XMiniBuffer.C
src/frontends/xforms/XWorkArea.C
src/frontends/xforms/lyx_gui.C
src/frontends/xforms/xforms_helpers.C
src/frontends/xforms/xscreen.C
src/graphics/GraphicsCacheItem.C
src/graphics/GraphicsConverter.C
src/graphics/GraphicsImageXPM.C
src/graphics/PreviewLoader.C
src/insets/insetbib.C
src/insets/insetcaption.C
src/insets/insetcite.C
src/insets/insetcommandparams.C
src/insets/insetexternal.C
src/insets/insetfloat.C
src/insets/insetgraphicsParams.C
src/insets/insetlabel.C
src/insets/insetlatexaccent.C
src/insets/insetminipage.C
src/insets/insetquotes.C
src/insets/insetref.C
src/insets/insetspecialchar.C
src/insets/insettext.C
src/insets/inseturl.C
src/insets/insetwrap.C
src/ispell.C
src/kbmap.C
src/lyx_cb.C
src/lyx_main.C
src/lyx_sty.C
src/lyxcursor.h
src/lyxfont.C
src/lyxfunc.C
src/lyxgluelength.C
src/lyxlayout.C
src/lyxlength.C
src/lyxlex_pimpl.C
src/lyxrc.C
src/lyxserver.C
src/lyxtextclass.C
src/lyxtextclasslist.C
src/mathed/ChangeLog
src/mathed/command_inset.C
src/mathed/formula.C
src/mathed/formulabase.C
src/mathed/math_amsarrayinset.C
src/mathed/math_arrayinset.C
src/mathed/math_autocorrect.C
src/mathed/math_biginset.C
src/mathed/math_boxinset.C
src/mathed/math_casesinset.C
src/mathed/math_charinset.C
src/mathed/math_cursor.C
src/mathed/math_data.C
src/mathed/math_deliminset.C
src/mathed/math_envinset.C
src/mathed/math_extern.C
src/mathed/math_factory.C
src/mathed/math_fontoldinset.C
src/mathed/math_gridinset.C
src/mathed/math_hullinset.C
src/mathed/math_inferinset.C
src/mathed/math_kerninset.C
src/mathed/math_numberinset.C
src/mathed/math_parser.C
src/mathed/math_pos.C
src/mathed/math_rootinset.C
src/mathed/math_scriptinset.C
src/mathed/math_sizeinset.C
src/mathed/math_splitinset.C
src/mathed/math_stringinset.C
src/mathed/math_substackinset.C
src/mathed/math_support.C
src/mathed/math_symbolinset.C
src/mathed/math_xyarrowinset.C
src/mathed/math_xymatrixinset.C
src/mathed/ref_inset.C
src/mathed/textpainter.C
src/paragraph.C
src/paragraph_pimpl.C
src/sgml.C
src/support/filetools.C
src/support/forkedcall.C
src/support/os_win32.C
src/tabular-old.C
src/tabular.C
src/text.C
src/text2.C
src/text3.C
src/trans.C
src/vc-backend.C

index d9b6cbba8bedad090f4c2869fc91943c07a3345f..6ffe90292132a884f270c4a358b4d381cb1ba8e3 100644 (file)
@@ -154,7 +154,7 @@ Painter & BufferView::Pimpl::painter() const
 void BufferView::Pimpl::buffer(Buffer * b)
 {
        lyxerr[Debug::INFO] << "Setting buffer in BufferView ("
-                           << b << ")" << endl;
+                           << b << ')' << endl;
        if (buffer_) {
                buffer_->delUser(bv_);
 
@@ -918,11 +918,11 @@ void BufferView::Pimpl::MenuInsertLyXFile(string const & filen)
 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
index d3cb7ce95b4f101489238fc6d5f4941f960976e6..7a4fba5b248aabff7e272b3e1693b819b7267ef3 100644 (file)
@@ -1,3 +1,15 @@
+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.
index dd487fcd39a1ec27702d19a6b9c6e63411a4d030..6ee37d40935ea5c2202471c70078dc2df8481840 100644 (file)
@@ -225,12 +225,12 @@ void DepTable::write(string const & f) const
                        // 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;
        }
 }
@@ -247,8 +247,8 @@ void DepTable::read(string const & f)
        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;
index c1740e1b5f507c81348b60c8ab9dcfc6e5e23f79..45355f8fdb6fd224d539aff55918cfe6233e5dc1 100644 (file)
@@ -417,7 +417,7 @@ LaTeX::scanAuxFiles(string const & file)
        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())
@@ -473,7 +473,7 @@ void LaTeX::scanAuxFile(string const & file, Aux_Info & aux_info)
                                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)) {
@@ -482,7 +482,7 @@ void LaTeX::scanAuxFile(string const & file, Aux_Info & aux_info)
                        // 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));
@@ -589,7 +589,7 @@ int LaTeX::scanLogFile(TeXErrors & terr)
                                        << "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
index c6e65beb99fa6434055c5752ebb3c4aad0858a7f..b91ee8cbdb662ee0ed7821fa3f44faae6ed4a680 100644 (file)
@@ -473,10 +473,10 @@ void LaTeXFeatures::getFloatDefinitions(ostream & os) const
                        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";
 
index a7a5e794d589a9604496b2de45e1e4e86a0bf872..96fe77c7f2e497f941e827b6cfbe6b4171c59f93 100644 (file)
@@ -534,7 +534,7 @@ string const LyXAction::getActionName(int action) const
 {
        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);
 
@@ -549,7 +549,7 @@ string const LyXAction::helpText(int pseudoaction) const
        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)) {
index 4e0f7d4ebd440d6e6f064721459844d0321bb0b2..7d118317f8f591a39a080a23a85ae36c73a4f1bc 100644 (file)
@@ -379,7 +379,7 @@ void expandFormats(MenuItem::Kind kind, Menu & tomenu, Buffer const * buf)
                        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));
@@ -443,7 +443,7 @@ void expandToc2(Menu & tomenu, toc::Toc const & toc_list,
                        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));
                }
index 26ef6edf13d7e17ef48bdf4276a4823adeb9305f..8bc5080f597a8c5f0583bb666b1cd76a33ec85fb 100644 (file)
@@ -70,7 +70,7 @@ void Spacing::writeFile(ostream & os, bool para) const
                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";
        }
@@ -91,7 +91,7 @@ string const Spacing::writeEnvirBegin() const
        {
                ostringstream ost;
                ost << "\\begin{spacing}{"
-                   << getValue() << "}";
+                   << getValue() << '}';
                return STRCONV(ost.str());
        }
        }
index af42a4051ae0e3325ee89fdea5577d43cd0d0816..21c6cf9c94760df4ad7876bffc8568d2ce3162e1 100644 (file)
@@ -118,7 +118,7 @@ void ToolbarDefaults::read(LyXLex & lex)
                                string const func = lex.getString();
                                lyxerr[Debug::PARSER]
                                        << "Toolbar::read TO_ADD func: `"
-                                       << func << "'" << endl;
+                                       << func << '\'' << endl;
                                add(func);
                        }
                        break;
index 3a3dc9f2ea18dbac9a5f97886cfd918b9e46f177..5da0e3f902e745fea647f440ab9fe4ab8ba14c0e 100644 (file)
--- a/src/box.C
+++ b/src/box.C
@@ -31,7 +31,7 @@ bool Box::contained(int x, int y)
 
 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;
 }
index 0f54556775ad49fa5db09f580648947a027a261e..31dd511ea82498cc36963b029ee4c02b06d29b8a 100644 (file)
@@ -339,7 +339,7 @@ bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par)
                if (token.empty()) continue;
 
                lyxerr[Debug::PARSER] << "Handling token: `"
-                                     << token << "'" << endl;
+                                     << token << '\'' << endl;
 
                the_end_read =
                        parseSingleLyXformat2Token(lex, par, first_par,
@@ -574,7 +574,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& 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 == "~") {
@@ -957,7 +957,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
                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.
@@ -1169,7 +1169,7 @@ bool Buffer::readFile(LyXLex & lex, string const & filename, Paragraph * par)
                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;
@@ -1201,10 +1201,11 @@ bool Buffer::readFile(LyXLex & lex, string const & filename, Paragraph * par)
                                                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!"),
@@ -1525,7 +1526,7 @@ string const Buffer::asciiParagraph(Paragraph const & par,
                default:
                {
                        string const parlab = par.params().labelString();
-                       buffer << parlab << " ";
+                       buffer << parlab << ' ';
                        currlinelen += parlab.length() + 1;
                }
                break;
@@ -2140,7 +2141,8 @@ void Buffer::makeLaTeXFile(ostream & os,
        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;
@@ -2272,7 +2274,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
                        sgml::openTag(ofs, 0, false, top_element);
                else {
                        string top = top_element;
-                       top += " ";
+                       top += ' ';
                        top += params.options;
                        sgml::openTag(ofs, 0, false, top);
                }
@@ -2597,7 +2599,7 @@ void Buffer::simpleLinuxDocOnePar(ostream & os,
                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
@@ -2607,13 +2609,13 @@ void Buffer::simpleLinuxDocOnePar(ostream & os,
                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);
@@ -2656,7 +2658,7 @@ void Buffer::simpleLinuxDocOnePar(ostream & os,
        }
 
        while (!tag_state.empty()) {
-               os << "</" << tag_name(tag_state.top()) << ">";
+               os << "</" << tag_name(tag_state.top()) << '>';
                tag_state.pop();
        }
 
@@ -2729,10 +2731,10 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
        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);
@@ -2845,14 +2847,14 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                                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;
 
@@ -2928,7 +2930,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                        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:
index 8140a881503f93c9b55b35a365ba6d5126483e05..10564433367c7c8424de8ab0143dc61ffca6240d 100644 (file)
@@ -336,7 +336,7 @@ void BufferList::emergencyWrite(Buffer * buf)
        // 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;
@@ -350,7 +350,7 @@ void BufferList::emergencyWrite(Buffer * buf)
        // 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;
index 258613a1fe52c638ff444300bbf91b6fca1b88d4..bb7678b51847eb2a11091c9368e92bf78ba6cac1 100644 (file)
@@ -196,7 +196,7 @@ string const currentState(BufferView * bv)
                case Spacing::Other:
                        state << _("Other (")
                              << text->cursor.par()->params().spacing().getValue()
-                             << ")";
+                             << ')';
                        break;
                case Spacing::Default:
                        // should never happen, do nothing
index 20e28319c5bb4b3b01cbb0ff5178bfb123de6015..0c9ccd97d8d810aa09fc324dcf6d468774f0ba2e 100644 (file)
@@ -66,7 +66,7 @@ bool CharacterSet::loadFile(string const & fname)
                        string const str = STRCONV(sub.str(2));
                        if (lyxerr.debugging(Debug::KBMAP))
                                lyxerr << "Chardef: " << n
-                                      << " to [" << str << "]" << endl;
+                                      << " to [" << str << ']' << endl;
                        map_[str] = n;
                }
        }
@@ -77,7 +77,7 @@ bool CharacterSet::loadFile(string const & fname)
 
 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);
@@ -87,7 +87,7 @@ pair<bool, int> const CharacterSet::encodeString(string const & str) const
        }
        lyxerr[Debug::KBMAP] << "   "
                             << (ret ? "yes we" : "no we don't")
-                            <<  " know [" << str << "]" << endl;
+                            <<  " know [" << str << ']' << endl;
        return make_pair(ret, val);
 }
 
index 7b37f0a68d7450f1e85384c6f492ae156f31d7cd..17e07d7d8a59c7a227ea0b02a0ac52e2ac1e4c54 100644 (file)
@@ -193,18 +193,18 @@ bool Formats::view(Buffer const * buffer, string const & filename,
 
        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)));
index cc5d3328ee46609ca81cc402ebdc53b0efb3cfe9..9bad96c367247afe51b5c79015635f739c1ce86d 100644 (file)
@@ -261,11 +261,11 @@ string Counters::labelItem(string const & ctr,
        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") {
index cd9e4656497a210b24b8007751e40d2566c38e17..389efd5a85d83608b55b1caa387c268b361bb3c1 100644 (file)
@@ -117,7 +117,7 @@ void Debug::showLevel(ostream & o, Debug::type level)
                          << endl;
 #else
                        o << _("Debugging `") << errorTags[i].name << "' ("
-                         << _(errorTags[i].desc) << ")"
+                         << _(errorTags[i].desc) << ')'
                          << endl;
 #endif
                }
index cc95fc7cf335b774766ab8d9f7ba7f8694df0556..d805fee37175cec6c713a1110dd7bc6ae9d9a885 100644 (file)
@@ -4,7 +4,7 @@
  * 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
  */
@@ -162,7 +162,7 @@ void LyXView::updateWindowTitle()
                        minimize_title = OnlyFilename(cur_title);
                        if (!buffer()->isClean()) {
                                maximize_title += _(" (changed)");
-                               minimize_title += "*";
+                               minimize_title += '*';
                        }
                        if (buffer()->isReadonly())
                                maximize_title += _(" (read only)");
@@ -181,5 +181,5 @@ void LyXView::dispatch(FuncRequest const & req)
        // substitute the correct BufferView here
        FuncRequest r = req;
        r.setView(view().get());
-       getLyXFunc().dispatch(r); 
+       getLyXFunc().dispatch(r);
 }
index 4d287f3b489f22e597889f12b8f48bc948177dca..eb00a3e195c4ad6bf615a20476797d59e5ddb77b 100644 (file)
@@ -5,7 +5,7 @@
  * 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
  */
@@ -64,10 +64,10 @@ public:
 
        /// 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
@@ -102,13 +102,13 @@ public:
                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,
@@ -127,7 +127,7 @@ public:
        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);
@@ -136,7 +136,7 @@ public:
        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;
@@ -172,11 +172,11 @@ public:
 
 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
index e66829189fedf27f4e30ca06ad9ddf4cb841a85f..de11b7d535c7e3e0397510e843389da149b82285 100644 (file)
@@ -149,7 +149,7 @@ string const ControlExternal::Browse(string const & input) const
                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));
index 6004d5e1be0f2208b086af49fa592a87a970c51e..9a806dfadd309f696d5203d7f9034934f3b17ce3 100644 (file)
@@ -14,7 +14,7 @@
 #include "ControlMath.h"
 #include "ViewBase.h"
 
-#include "debug.h" 
+#include "debug.h"
 #include "funcrequest.h"
 
 #include "frontends/LyXView.h"
@@ -259,7 +259,7 @@ char const * latex_ams_rel[] = {
        "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",
@@ -271,15 +271,15 @@ int const nr_latex_ams_rel = sizeof(latex_ams_rel) / sizeof(char const *);
 
 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 *);
@@ -298,9 +298,12 @@ char const * latex_ams_ops[] = {
 
 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";
@@ -346,7 +349,7 @@ string const find_xpm(string const & name)
        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");
 }
index 00ea4f672e1972e62d766c404dbd385f60f0c439..499968c3295f6ca8b910f4872dd56e0aa97ed009 100644 (file)
@@ -15,7 +15,7 @@
 #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)
 {}
@@ -47,7 +47,7 @@ void ControlPrefs::setParams()
 void ControlPrefs::apply()
 {
        view().apply();
-       lyxrc = rc_; 
+       lyxrc = rc_;
 }
 
 
@@ -57,19 +57,19 @@ void ControlPrefs::OKButton()
        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);
 }
 
@@ -80,32 +80,32 @@ string const ControlPrefs::browseUI(string const & file)
        // 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);
@@ -116,14 +116,14 @@ void ControlPrefs::redrawGUI()
 {
        // 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));
 }
 
@@ -132,13 +132,13 @@ void ControlPrefs::updateScreenFonts()
 {
        // 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();
index 2b151bc4f3305b59f3d5d4075fa1abcdf4831dae..a329ff71dbe888e74a3ec323e1275280ef3d7e4b 100644 (file)
@@ -133,7 +133,7 @@ void ControlPrint::apply()
                        + tostr(pp.count_copies)
                        + ' ';
        }
-       
+
        if (pp.reverse_order) {
                command += lyxrc.print_reverse_flag + ' ';
        }
@@ -199,17 +199,18 @@ void ControlPrint::apply()
                // 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"));
-       }               
+       }
 }
index 3c6ed9add5cde119345889d197f8a3d7ed984800..3b353508082afb7624db9046f48438fa1cbff264 100644 (file)
@@ -48,6 +48,6 @@ void ControlTabularCreate::apply()
 
        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));
 }
index d5ebf67a969ffde49fca44c3a729096d4571125e..822c9263802f9cc6cbaa1a037ca6e3daa72aedeb 100644 (file)
@@ -41,10 +41,10 @@ string const familyName(string const & name)
        // "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
@@ -291,7 +291,7 @@ struct RegexMatch
                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.
@@ -376,7 +376,7 @@ string const parseBibTeX(string data, string const & findkey)
                // with a space
                if (!dummy.empty()) {
                        if (!contains(dummy, "="))
-                               data_ += (' ' + dummy);
+                               data_ += ' ' + dummy;
                        else
                                data_ += dummy;
                }
@@ -418,7 +418,7 @@ string const parseBibTeX(string data, string const & findkey)
        keyvalue = dummy;
        dummy = token(data, ',', Entries++);
        while (!contains(dummy, '=') && !dummy.empty()) {
-               keyvalue += (',' + dummy);
+               keyvalue += ',' + dummy;
                dummy = token(data, ',', Entries++);
        }
 
@@ -551,7 +551,7 @@ string const getCiteCommand(CiteStyle command, bool full, bool forceUCase)
        if (full) {
                CiteStyle const * last = citeStylesFull + nCiteStylesFull;
                if (std::find(citeStylesFull, last, command) != last)
-                       cite += "*";
+                       cite += '*';
        }
 
        if (forceUCase) {
@@ -629,7 +629,7 @@ getNumericalStrings(string const & key,
                        break;
 
                case CITEYEARPAR:
-                       str = "(" + year + ")";
+                       str = '(' + year + ')';
                        break;
                }
 
@@ -660,15 +660,15 @@ getAuthorYearStrings(string const & key,
                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:
@@ -684,7 +684,7 @@ getAuthorYearStrings(string const & key,
                        break;
 
                case CITEYEARPAR:
-                       str = "(" + year + ")";
+                       str = '(' + year + ')';
                        break;
                }
 
index f89a50f8b502414332de1b6bbb869d34fbda7c9c..7186cdfed9851d22bfedcbcc1b6f5195b32f9702 100644 (file)
@@ -3,7 +3,7 @@
  * 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
  */
@@ -46,19 +46,19 @@ void GFloat::apply()
 {
        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;
@@ -92,7 +92,7 @@ void GFloat::update()
                        here = true;
                }
        }
-       
+
        top_of_page()->set_active(top);
        page_of_floats()->set_active(page);
        bottom_of_page()->set_active(bottom);
@@ -123,7 +123,7 @@ void GFloat::connect_signals()
                );
 }
 
-void GFloat::disconnect_signals() 
+void GFloat::disconnect_signals()
 {
        conn_top_.disconnect();
        conn_bottom_.disconnect();
@@ -133,41 +133,41 @@ void GFloat::disconnect_signals()
        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");
 }
index ea523bfda886341fc29e45f176e4bb8c4f7f22d5..553bc0b0c50c859e5a9c4fb0b1ca9881cdc1426a 100644 (file)
@@ -26,6 +26,9 @@
 #include "Alert.h"
 #include "Alert_pimpl.h"
 
+#include "BoostFormat.h"
+
+
 using std::pair;
 using std::make_pair;
 
@@ -33,20 +36,20 @@ 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;
 }
 
@@ -54,12 +57,16 @@ int askConfirmation_pimpl(string const & s1, string const & s2, string const & s
 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();
index 074c35e4c8d69c675222cc80e73cb56454f9a67f..2222bdee6a2a1db040eb20fd6f1b6c2e20541f28 100644 (file)
@@ -1,9 +1,13 @@
+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
@@ -11,7 +15,7 @@
        * 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
index 840d79bcd87fd5acd8f8bffa9c35de4b8349bef4..040039d8ff85f2b60e44ac9be55c054312f8fa93 100644 (file)
@@ -80,7 +80,7 @@ FileDialog::Result const FileDialog::save(string const & path,
        return result;
 }
 
+
 FileDialog::Result const FileDialog::open(string const & path,
                                            string const & mask,
                                            string const & suggested)
index f8e915f3d8001d3d482924b3e62ca1ed0d7cbf67..598b8f430c382dc465b7b84a7faa9215c144465b 100644 (file)
@@ -38,7 +38,7 @@ string const getLabel(string const & str) {
        string::size_type pos = label.find(sc[1]);
        if (pos == string::npos)
                return label;
-       label.insert(pos, "&");
+       label.insert(pos, 1, '&');
        return label;
 }
 
index e0b02d4b944aeae889f57e3e756c49a7c9c00e65..9d04a931e29a663792c972f8deb3289770df6a02 100644 (file)
@@ -123,7 +123,7 @@ void QCommandBuffer::complete()
 
        if (comp.empty()) {
                edit_->setText(new_input.c_str());
-       //      show_info_suffix(("[only completion]"), new_input + " ");
+       //      show_info_suffix(("[only completion]"), new_input + ' ');
                return;
        }
 
@@ -159,7 +159,7 @@ void QCommandBuffer::complete()
 
 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();
 }
@@ -196,7 +196,7 @@ void XMiniBuffer::show_info_suffix(string const & suffix, string const & input)
 {
        stored_input_ = input;
        info_suffix_shown_ = true;
-       set_input(input + " " + suffix);
+       set_input(input + ' ' + suffix);
        suffix_timer_->start();
 }
 
index e5201be8364eb1a8068b637e55daad70b3f4f423..c7d42a2e21a48066b756294161066afdd246db45 100644 (file)
@@ -142,8 +142,11 @@ void QContentPane::wheelEvent(QWheelEvent * e)
 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()));
@@ -196,8 +199,8 @@ void QContentPane::paintEvent(QPaintEvent * e)
        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);
index 18a0dc656f0711405c89bce85cb6efcf68b7f37c..8de79d376dddf08b7a49a9c3c764b947dd3818fd 100644 (file)
@@ -85,9 +85,9 @@ QDelimiterDialog::QDelimiterDialog(QMath * form)
                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 &)));
@@ -99,7 +99,7 @@ QDelimiterDialog::QDelimiterDialog(QMath * form)
 
 void QDelimiterDialog::insertClicked()
 {
-       form_->insertDelim(fix_name(left_) + " " + fix_name(right_));
+       form_->insertDelim(fix_name(left_) + ' ' + fix_name(right_));
 }
 
 
index fe947a2506a2f2690fcd7f620deb4656e75c167d..5b760ced4e9d1ae30f6c2c27af68e147f1a52bb9 100644 (file)
@@ -122,22 +122,22 @@ void QFloat::apply()
        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;
index bdc1810a1af437f84f82577b23f022c741f38283..401d2daf25b244bc6c4ae436f9679c13634443a9 100644 (file)
@@ -109,7 +109,7 @@ int getItemNo(vector<string> v, string const & s) {
                    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) {
@@ -118,7 +118,7 @@ int getUnitNo(char const * c[], string const & s) {
                ++i;
        return (i < num_units) ? i : 0;
 }
+
 }
 
 
@@ -137,7 +137,7 @@ void QGraphics::update_contents()
                dialog_->rtXunit->insertItem((*it).c_str(), -1);
                dialog_->rtYunit->insertItem((*it).c_str(), -1);
        }
-       
+
        InsetGraphicsParams & igp = controller().params();
 
        // set the right default unit
@@ -238,11 +238,11 @@ void QGraphics::update_contents()
        //// 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)) {
@@ -274,7 +274,7 @@ void QGraphics::update_contents()
        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);
@@ -283,14 +283,14 @@ void QGraphics::update_contents()
        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());
 }
 
@@ -309,8 +309,8 @@ void QGraphics::apply()
                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())
@@ -319,15 +319,15 @@ void QGraphics::apply()
                                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;
                }
@@ -352,17 +352,17 @@ void QGraphics::apply()
        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]);
 
@@ -380,7 +380,7 @@ void QGraphics::apply()
 
        // 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
index d7e1382d554c7f9adf4917ba2e8e7b5dc9330198..1d70b20ea67066e1351284be0366cc0192f46892 100644 (file)
@@ -161,7 +161,7 @@ bool QLImage::setPixmap(Params const & params)
        lyxerr[Debug::GRAPHICS] << "setPixmap()" << endl;
 
        // FIXME: it's a fake kind of grayscale !
+
        switch (params.display) {
                case GrayscaleDisplay:
                case MonochromeDisplay: {
@@ -169,7 +169,7 @@ bool QLImage::setPixmap(Params const & params)
                        xformed_pixmap_.convertFromImage(i, QPixmap::Mono);
                        break;
                }
+
                default:
                        break;
        }
@@ -254,9 +254,10 @@ void QLImage::scale(Params const & params)
        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);
index 4f63c944c8cd497fba3fe1fb1fb349a3cfe73ad4..aff7c6af40cd2c070c60cdc19cd5274a57a97ea7 100644 (file)
@@ -142,7 +142,8 @@ Painter & QLPainter::rectangle(int x, int y,
        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;
 }
@@ -152,7 +153,8 @@ Painter & QLPainter::fillRectangle(int x, int y,
        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;
 }
@@ -184,8 +186,8 @@ Painter & QLPainter::arc(int x, int y,
        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);
index 5c130876c4a934bf2e04665f9d5ee113008f8eed..863243d42cf992fd5fdd46fa19f06149973f7383 100644 (file)
 #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)
@@ -44,16 +44,16 @@ 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;
index 35311067e4303f16319f93dd6edf3b490d5ca833..44ffb0519c6b44f9fc60612a3247a79d55ff5d1b 100644 (file)
@@ -85,7 +85,7 @@ void QPreambleDialog::editClicked()
 
        file.close();
 
-       editor += " " + filename;
+       editor += ' ' + filename;
 
        Forkedcall call;
 
index be7e7282a5f66e8a2d05de5f540cd6035f192d84..647024c0aac5b73d4f98082fdc4ad690ffb3af90 100644 (file)
@@ -17,7 +17,7 @@
 #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;
 
 
@@ -73,9 +73,9 @@ void QPrefs::build_dialog()
        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);
@@ -93,40 +93,40 @@ void QPrefs::apply()
 {
        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);
 
@@ -142,7 +142,7 @@ void QPrefs::apply()
        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 =
@@ -152,9 +152,9 @@ void QPrefs::apply()
        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;
@@ -162,7 +162,7 @@ void QPrefs::apply()
                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
@@ -172,9 +172,9 @@ void QPrefs::apply()
                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();
@@ -190,14 +190,14 @@ void QPrefs::apply()
                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();
@@ -230,7 +230,7 @@ void QPrefs::apply()
        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();
@@ -254,12 +254,12 @@ void QPrefs::apply()
                || 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) {
@@ -267,12 +267,12 @@ void QPrefs::apply()
                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]);
@@ -285,9 +285,9 @@ void QPrefs::apply()
 }
 
 
-// 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)
@@ -306,12 +306,12 @@ void QPrefs::update_contents()
        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());
@@ -321,11 +321,11 @@ void QPrefs::update_contents()
        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);
@@ -334,11 +334,11 @@ void QPrefs::update_contents()
        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);
@@ -349,7 +349,7 @@ void QPrefs::update_contents()
        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);
 
@@ -365,7 +365,7 @@ void QPrefs::update_contents()
        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);
@@ -374,9 +374,9 @@ void QPrefs::update_contents()
        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;
@@ -384,10 +384,10 @@ void QPrefs::update_contents()
                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());
@@ -403,9 +403,9 @@ void QPrefs::update_contents()
        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);
@@ -439,7 +439,7 @@ void QPrefs::update_contents()
        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);
@@ -465,7 +465,7 @@ void QPrefs::update_contents()
        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());
@@ -482,7 +482,7 @@ void QPrefs::update_contents()
        formats_ = formats;
 
        dialog_->updateFormats();
+
        converters_ = converters;
 
        dialog_->updateConverters();
index 174db3adf87c9d8340ab3acdb9a1905da5defdc9..c25e578af679da8e47040f338148c436d81f0de7 100644 (file)
@@ -149,7 +149,7 @@ void QToc::updateToc(int newdepth)
                        << ", 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_);
index 2e125bffc7ba6943b99dd487293dcf9d6cc87b81..330b49cbf3d944416f77852331197b54def55bba 100644 (file)
@@ -28,7 +28,7 @@
 #include "support/filetools.h"
 #include "support/lstrings.h"
 
-#include "ControlMath.h" 
+#include "ControlMath.h"
 
 #include <boost/tuple/tuple.hpp>
 
@@ -49,7 +49,7 @@ QPixmap getIconPixmap(int action)
        FuncRequest f = lyxaction.retrieveActionArg(action);
 
        string fullname;
+
        if (f.action == LFUN_INSERT_MATH && !f.argument.empty()) {
                fullname = find_xpm(f.argument.substr(1));
        } else {
@@ -58,18 +58,18 @@ QPixmap getIconPixmap(int action)
 
                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"
index 8f09504414eca60732800bafa4de4d01325117c1..0d75810cb40b13a55d074781b1b870857144ca08 100644 (file)
@@ -71,7 +71,7 @@ void IconPalette::resizeEvent(QResizeEvent * e)
        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;
 
@@ -84,7 +84,7 @@ void IconPalette::resizeEvent(QResizeEvent * e)
                ++rows;
 
        lyxerr[Debug::GUI] << "Laying out " << buttons_.size() << " widgets in a "
-               << cols << "x" << rows << " grid." << endl;
+               << cols << 'x' << rows << " grid." << endl;
 
        setUpdatesEnabled(false);
 
index 8aae6ae4a18daa0cec9e2bac083abdd1f849d4a7..ab6fb8c24bbff3d7bcfffb8b125096c31afec8cf 100644 (file)
@@ -148,8 +148,8 @@ void QScreen::repaint()
 
 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);
 }
index c3c3affcc33f5764fa17156c7b563e68052e5130..74fa21184b591e47430dd3ed14eee7c75b99ec4d 100644 (file)
@@ -3,7 +3,7 @@
  * 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
  *
@@ -406,7 +406,7 @@ void LyXScreen::drawFromTo(LyXText * text, BufferView * bv,
        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;
 
index 57e9d8cab68217e7aeb50044657963b9e8585376..3e558ee08b2eb46e043249031dadb712b3c84bf1 100644 (file)
@@ -1,3 +1,7 @@
+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
@@ -22,7 +26,7 @@
 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>
 
index 7b51fcbb1e8424adcfec89ba02875be9b2c69816..1fd18241d2cb6abce6df0b3c7a4c05a133fcf979 100644 (file)
@@ -188,11 +188,11 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
                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.")
index 7427dd0620f32e1a82246adbdb47382010a25f3d..e629237bf3af7ce5ea26d8a4a2735a700a70b1a6 100644 (file)
@@ -53,7 +53,7 @@ FileDialog::Result const FileDialog::save(string const & path, string const & ma
        return open(path, mask, suggested);
 }
 
+
 FileDialog::Result const FileDialog::open(string const & path, string const & mask, string const & suggested)
 {
        string filter = mask;
@@ -67,7 +67,7 @@ FileDialog::Result const FileDialog::open(string const & path, string const & ma
        }
 
        lyxerr[Debug::GUI] << "filedialog open  with path \"" << path << "\", mask \""
-               << filter << "\", suggested \"" << suggested << "\"" << endl;
+               << filter << "\", suggested \"" << suggested << '"' << endl;
 
        // no support for asynchronous selection yet
 
index 350116735e1327a3ce14670cb39e1c1643955e93..9b3244e023ffa6aa758d64276019ae40168829bf 100644 (file)
@@ -4,7 +4,7 @@
  * 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
  */
@@ -133,7 +133,7 @@ void FontInfo::query()
                // 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;
index cbe76f66c3fa29ba9e3324c7cd9bea36f680a2df..a8f11b22b5a96f5e9f9e6ab14521df95fada1460 100644 (file)
@@ -3,7 +3,7 @@
  * 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
@@ -211,7 +211,7 @@ void FormBibtex::apply()
        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!
index 4e5ae3a9d39066ee05eee511e77935b0582897e5..2dc76414de05cbd6e8bda2f9bb4e14124d7ae2f3 100644 (file)
@@ -4,7 +4,7 @@
  * 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
  */
@@ -74,22 +74,22 @@ void FormCharacter::build()
 
        // 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...
index aee507a291200abe0f8fa5fc0dc0b2e8c1c8a430..2ad4110baf05e313b5be608ba4b9362b044a14a7 100644 (file)
@@ -5,7 +5,7 @@
  *
  * \author Asger Alstrup
  * \author John Levon
- * \author Angus Leeming 
+ * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
  */
@@ -51,7 +51,7 @@ void FormExternal::build()
        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);
index 4a86e9c64705037ae4c2f00fa8cbc25bac5077e9..f62673db497134e3eff022f241e36e6e9c55a511 100644 (file)
@@ -32,7 +32,7 @@ enum {
        HERE_DEFINITELY,
        ALTERNATIVES
 };
+
 } // namespace anon
 
 
@@ -99,24 +99,24 @@ void FormFloat::apply()
        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.
index e30b3c3a170fc5b02ca9d1b809d2e04d064fa283..60021430a4eac87526a910b19cba50815fc52212 100644 (file)
@@ -367,18 +367,18 @@ void FormGraphics::apply()
                        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);
index 302712e24073f08da4df2149c0d23f842f8b9d8c..af881c7581ad2e3b0c5c97a480443fa0d70bbc0d 100644 (file)
@@ -117,12 +117,12 @@ void FormPreferences::redraw()
 }
 
 
-#if 0 
+#if 0
 void FormPreferences::ok()
 {
        FormBaseDeprecated::ok();
 
-// FIXME !! 
+// FIXME !!
        if (colors_.modifiedXformsPrefs) {
                string const filename =
                        AddName(user_lyxdir, "preferences.xform");
@@ -131,7 +131,7 @@ void FormPreferences::ok()
 
        lv_.dispatch(FuncRequest(LFUN_SAVEPREFERENCES));
 }
-#endif 
+#endif
 
 
 
@@ -269,9 +269,9 @@ void FormPreferences::apply()
        // machines.
 
        lyxerr << "apply in form !" << endl;
+
        LyXRC & rc(controller().rc());
+
        colors_.apply();
        formats_.apply();    // Must be before converters_.apply()
        converters_.apply();
@@ -325,7 +325,7 @@ ButtonPolicy::SMInput FormPreferences::input(FL_OBJECT * ob, long)
        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_
@@ -357,7 +357,7 @@ void FormPreferences::update()
        if (!dialog_.get()) return;
 
        LyXRC const & rc(controller().rc());
+
        // read lyxrc entries
        colors_.update();
        formats_.update();   // Must be before converters_.update()
@@ -907,7 +907,7 @@ string const FormPreferences::Colors::X11hexname(RGBColor const & col) const
 {
        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;
@@ -1166,10 +1166,10 @@ void FormPreferences::Converters::UpdateChoices() const
                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());
index 672c24cfa1970cdb756ecad851db56f3826d9539..28860401628243bced1f4ceea5188e577f1a26f1 100644 (file)
@@ -3,7 +3,7 @@
  * 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
  */
@@ -119,7 +119,7 @@ void FormRef::update()
                // 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());
@@ -154,7 +154,7 @@ void updateHighlight(FL_OBJECT * browser,
                fl_select_browser_line(browser, i+1);
        }
 }
+
 } // namespace anon
 
 
index 37d0704d368c56a639ec711ed9a18fea26dd2a56..58533cd87da7db7a7722328b4f429bff7a59e30d 100644 (file)
@@ -3,7 +3,7 @@
  * 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
  */
@@ -42,10 +42,10 @@ void FormToc::build()
        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
index 042ba49280c332033240ca881afe274ea9b772a6..996558f41c1e407bfbe978e36580df5097ef8fd7 100644 (file)
@@ -119,7 +119,7 @@ void Menubar::Pimpl::makeMenubar(Menu const & menu)
                        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,
@@ -228,7 +228,7 @@ int Menubar::Pimpl::create_submenu(Window win, XFormsView * view,
        }
        lyxerr[Debug::GUI] << "max_width=" << max_width
                           << ", widest_label=`" << widest_label
-                          << "'" << endl;
+                          << '\'' << endl;
 
        // Compute where to put separators
        vector<string> extra_labels(menu.size());
@@ -322,7 +322,7 @@ int Menubar::Pimpl::create_submenu(Window win, XFormsView * view,
                                           << "\", binding \"" << accel
                                           << "\", shortcut \"" << shortcut
                                           << "\" (added to menu"
-                                          << curmenuid << ")" << endl;
+                                          << curmenuid << ')' << endl;
                        break;
                }
 
index a0cce76e104f2bbafac61ba48163d6e3a91bb789..bbe3fe40ac76b109b402b54de57ba3768d8e9aca 100644 (file)
@@ -78,7 +78,7 @@ Toolbar::Pimpl::toolbarItem::operator=(toolbarItem const & ti)
        // If we already have an icon, release it.
        // But we don't copy the icon from ti
        kill_icon();
+
        action = ti.action;
 
        return *this;
@@ -124,7 +124,7 @@ void Toolbar::Pimpl::update()
 
                if (!p->icon)
                        continue;
+
                FuncStatus const status = owner_->getLyXFunc().getStatus(p->action);
                if (status.onoff(true)) {
                        // I'd like to use a different color
@@ -250,7 +250,7 @@ void setPixmap(FL_OBJECT * obj, int action)
 {
        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, ' ','_');
@@ -263,15 +263,15 @@ void setPixmap(FL_OBJECT * obj, int action)
                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"
@@ -289,7 +289,7 @@ void Toolbar::Pimpl::add(int action)
 
        toolbarItem item;
        item.action = action;
+
        switch (action) {
        case ToolbarDefaults::SEPARATOR:
                xpos += sepspace;
@@ -340,6 +340,6 @@ void Toolbar::Pimpl::add(int action)
                 */
                break;
        }
+
        toollist_.push_back(item);
 }
index 71c4380eb35d4c785c4d6b79ea4113d40dc3a9a9..815d13c0678ca743736b62ee5d65b91c21fa06eb 100644 (file)
@@ -130,7 +130,7 @@ int XMiniBuffer::peek_event(FL_OBJECT * ob, int event,
 
                        if (comp.empty()) {
                                set_input(new_input);
-                               show_info(("[only completion]"), new_input + " ");
+                               show_info(_("[only completion]"), new_input + ' ');
                                break;
                        }
 
@@ -223,7 +223,7 @@ void XMiniBuffer::show_info(string const & info, string const & input, bool appe
        stored_input_ = input;
        info_shown_ = true;
        if (append)
-               set_input(input + " " + info);
+               set_input(input + ' ' + info);
        else
                set_input(info);
        info_timer_->start();
@@ -293,7 +293,7 @@ void XMiniBuffer::set_complete_input(string const & str)
        if (!str.empty()) {
                // add a space so the user can type
                // an argument immediately
-               set_input(str + " ");
+               set_input(str + ' ');
        }
 }
 
index b616c6aa7d627cdcdecbf1ea655a93973a8ddfee..fcbcb8448842cdaa30b8385a2c5d0b3aca884236 100644 (file)
@@ -244,7 +244,7 @@ void XWorkArea::redraw(int width, int height)
 
        if (lyxerr.debugging(Debug::WORKAREA)) {
                lyxerr << "(Re)creating pixmap ("
-                      << width << 'x' << height << ")" << endl;
+                      << width << 'x' << height << ')' << endl;
        }
 
        if (workareapixmap) {
@@ -417,10 +417,10 @@ int XWorkArea::work_area_handler(FL_OBJECT * ob, int event,
                        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))
index 7713c528225e2613f92bb6836ebecece61a31729..944e78dba38519f7106ddc35435812598edcbfc5 100644 (file)
@@ -275,8 +275,8 @@ void lyx_gui::start(string const & batch, vector<string> const & files)
        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");
@@ -340,7 +340,7 @@ string const lyx_gui::hexname(LColor::color col)
        if (XLookupColor(display, cmap, name.c_str(), &xcol, &ccol) == 0) {
                        lyxerr << "X can't find color \""
                               << lcolor.getLyXName(col)
-                              << "\"" << endl;
+                              << '"' << endl;
                        return string();
        }
 
index fab98d9d8d704ed4687613ab726da3918fc93d3f..66e227fd44e2d545cc0059fe65f7ecb80369cae6 100644 (file)
@@ -329,7 +329,7 @@ bool XformsColor::write(string const & filename)
           << "### 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;
@@ -338,8 +338,8 @@ bool XformsColor::write(string const & filename)
 
                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;
index 40d72f39532751f7dc8a3b798e52bd916a117cf4..1e7957e4cbb871a83dc533c89070641776a2bcf9 100644 (file)
@@ -191,8 +191,8 @@ void XScreen::hideCursor()
 
 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(),
index c84ad76d39d77d3eb3a1bf3a7459e41f4c8051a1..04646d3837ec7f0d4e748fc0174b7f6dee1cd8e2 100644 (file)
@@ -3,9 +3,9 @@
  * 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
  */
@@ -248,7 +248,7 @@ void CacheItem::Impl::setStatus(ImageStatus new_status)
 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();
@@ -290,7 +290,7 @@ void CacheItem::Impl::loadImage()
 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_)
index d03270b7d2a1fbd6757c6884683ae1c0ea684ca0..90235b4334c3a9dc1b00b71341aab48d7e60997c 100644 (file)
@@ -180,8 +180,8 @@ Converter::Impl::Impl(string const & from_file,   string const & to_file_base,
                // 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;
index 274803ea496f96d6a6f152217ff6ce638c9e319c..5f9595e7ccd917d303936a1ec5d8f8fec9ee679e 100644 (file)
@@ -157,7 +157,7 @@ void ImageXPM::load(string const & filename)
 
                lyxerr[Debug::GRAPHICS]
                        << "Error reading XPM file '"
-                       << XpmGetErrorString(success) << "'"
+                       << XpmGetErrorString(success) << '\''
                        << std::endl;
        } else {
                image_.reset(*xpm_image);
@@ -235,7 +235,7 @@ bool ImageXPM::setPixmap(Params const & params)
 
        if (status != XpmSuccess) {
                lyxerr << "Error creating pixmap from xpm_image '"
-                      << XpmGetErrorString(status) << "'"
+                      << XpmGetErrorString(status) << '\''
                       << std::endl;
                pixmap_status_ = PIXMAP_FAILED;
                return false;
@@ -644,14 +644,14 @@ void mapcolor(char const * c_color, char ** g_color_ptr, char ** m_color_ptr)
        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;
index 20f57bf2999acca08fe32e9183d3cbbf732f1b8c..3568c32bbc5535c9460f3b016b5dd4c579430974 100644 (file)
@@ -257,7 +257,7 @@ struct IncrementedFileName {
        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);
@@ -475,8 +475,8 @@ void PreviewLoader::Impl::startLoading()
 
        // 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()));
 
@@ -591,7 +591,7 @@ void PreviewLoader::Impl::dumpPreamble(ostream & os) const
 
        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";
 }
 
index 427d37fc5508cd66154a59aa892b8006d83d22fd..d6e2eb114b57a61bdeee84826cf5422231143562 100644 (file)
@@ -115,7 +115,7 @@ string const InsetBibKey::getBibLabel() const
 
 string const InsetBibKey::getScreenLabel(Buffer const *) const
 {
-       return getContents() + " [" + getBibLabel() + "]";
+       return getContents() + " [" + getBibLabel() + ']';
 }
 
 
@@ -303,7 +303,7 @@ bool InsetBibtex::addDatabase(string const & db)
        string contents(getContents());
        if (!contains(contents, db)) {
                if (!contents.empty())
-                       contents += ",";
+                       contents += ',';
                setContents(contents + db);
                return true;
        }
index 2b478145d05635d4904ad6527d15bf47ed0007b6..fc48276338bc1d1eb49909fa42d8457d395e4fb2 100644 (file)
@@ -97,7 +97,7 @@ void InsetCaption::draw(BufferView * bv, LyXFont const & f,
        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);
index 1be81b58d24850d173602d5823fb9d7de621212d..24f2b12325c7c4d2895b04ca4d32d7ead95bdb8a 100644 (file)
@@ -130,9 +130,9 @@ string const getNatbibLabel(Buffer const * buffer,
        // 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);
@@ -214,7 +214,7 @@ string const getBasicLabel(string const & keyList, string const & after)
 
        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, ','));
@@ -226,7 +226,7 @@ string const getBasicLabel(string const & keyList, string const & after)
        if (!after.empty())
                label += ", " + after;
 
-       return "[" + label + "]";
+       return '[' + label + ']';
 }
 
 } // anon namespace
@@ -375,14 +375,14 @@ int InsetCitation::latex(Buffer const * buffer, ostream & os,
        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();
@@ -396,7 +396,7 @@ int InsetCitation::latex(Buffer const * buffer, ostream & os,
                        content += *it;
        }
 
-       os << "{" << content << "}";
+       os << '{' << content << '}';
 
        return 0;
 }
index cbbca4463b2a565b2c10e5462610543e486da353..b6a4c015c304eccb1385c5a11618dcb6d9d934e2 100644 (file)
@@ -164,9 +164,9 @@ void InsetCommandParams::write(ostream & os) const
 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;
 }
 
index ed22c53cdff5a5b10c2cea610b1ad35c4114ce7e..bd4ce0116b469a0252e304e8135a5902329946ff 100644 (file)
@@ -122,15 +122,15 @@ void InsetExternal::read(Buffer const *, LyXLex & lex)
        }
 
        // 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;
 }
 
 
@@ -224,7 +224,7 @@ void InsetExternal::executeCommand(string const & s,
        Systemcall one;
        if (lyxerr.debugging()) {
                lyxerr << "Executing '" << s << "' in '"
-                      << buffer->filePath() << "'" << endl;
+                      << buffer->filePath() << '\'' << endl;
        }
        one.startscript(Systemcall::Wait, s);
 }
index 75a6746df9a33bd9a80e8be472d59b0e669e8044..3c9c62784b492e17348a6bf4938068e5e3ee6672 100644 (file)
@@ -241,7 +241,7 @@ int InsetFloat::latex(Buffer const * buf,
        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;
@@ -250,12 +250,12 @@ int InsetFloat::latex(Buffer const * buf,
        // 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);
 
@@ -269,9 +269,9 @@ int InsetFloat::latex(Buffer const * buf,
 
 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;
 }
@@ -326,7 +326,7 @@ void InsetFloat::wide(bool w, BufferParams const & bp)
        lab += floatname(floatType_, bp);
 
        if (wide_)
-               lab += "*";
+               lab += '*';
 
        setLabel(lab);
 }
@@ -346,7 +346,7 @@ void InsetFloat::addToToc(toc::TocList & toclist, Buffer const * buf) const
        // 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)
index ad012fd9fe73d4fe8442592b7aa47ca3fb2cb4a8..0a8af2c574809bb3941f2e685f0b03537bf6c1c8 100644 (file)
@@ -210,7 +210,7 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
                bb.erase();
                for (int i = 0; i < 4; ++i) {
                        if (i != 0)
-                               bb += " ";
+                               bb += ' ';
                        lex.next();
                        bb += lex.getString();
                }
@@ -266,22 +266,22 @@ grfx::Params InsetGraphicsParams::as_grfxParams(string const & filepath) const
                        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
@@ -299,13 +299,13 @@ grfx::Params InsetGraphicsParams::as_grfxParams(string const & filepath) const
                        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;
index bfc43de3a1109f58c1a6e7e1ea7dbdf10503d730..d83a9263366e4221cfa9482c0378f5a865ef24b0 100644 (file)
@@ -83,7 +83,7 @@ int InsetLabel::latex(Buffer const *, ostream & os,
 
 int InsetLabel::ascii(Buffer const *, ostream & os, int) const
 {
-       os << "<" << getContents()  << ">";
+       os << '<' << getContents()  << '>';
        return 0;
 }
 
index ea827026969356ae55b8f967f7acf8a57021892f..708685b571a2ebbb62ad9c4d20fcc12e63f3a561 100644 (file)
@@ -211,7 +211,7 @@ void InsetLatexAccent::checkContents()
                        break;
                }
                //ic = (modtype == DOT_LESS_J ? 'j' : 'i');
-               lyxerr[Debug::KEY] << "Contents: [" << contents << "]"
+               lyxerr[Debug::KEY] << "Contents: [" << contents << ']'
                                   << ", ic: " << ic
                                   << ", top: " << plusasc
                                   << ", bot: " << plusdesc
@@ -251,7 +251,7 @@ void InsetLatexAccent::checkContents()
                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
index a4057dbfbd6a3a4bc23d3a3bab38e370fd31d25e..1a748d80849b725ecde898d2d43299a21fdc7414 100644 (file)
@@ -109,9 +109,9 @@ InsetMinipage::~InsetMinipage()
 
 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);
@@ -236,13 +236,13 @@ int InsetMinipage::latex(Buffer const * buf,
        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 << "]{"
index 1403f21a6471c08babceaab64ee77f670990d0e3..3fb7beda0c6e1849d63c1c5eedb09c219363d8c1 100644 (file)
@@ -176,9 +176,9 @@ string const InsetQuotes::dispString(Language const * loclang) const
        // 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;
@@ -314,14 +314,14 @@ int InsetQuotes::latex(Buffer const * buf, ostream & os,
 
 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;
 }
 
index e8e401473f747e3a7e349d3a22d1205c8d05ccbe..c899d8de94b574b07a99c6cc52571ff6f01e0c81 100644 (file)
@@ -79,7 +79,7 @@ int InsetRef::latex(Buffer const *, ostream & os,
 
 int InsetRef::ascii(Buffer const *, ostream & os, int) const
 {
-       os << "[" << getContents() << "]";
+       os << '[' << getContents() << ']';
        return 0;
 }
 
index ce473a29f2a4d72a1a5ccf9323e8c16ca44eddfb..79956b56d3ced97934b051246716719fa5621dae 100644 (file)
@@ -96,21 +96,21 @@ void InsetSpecialChar::draw(BufferView * bv, LyXFont const & f,
        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;
        }
@@ -235,7 +235,7 @@ int InsetSpecialChar::latex(Buffer const *, ostream & os, bool /*fragile*/,
                os << "\\lyxarrow{}";
                break;
        case PROTECTED_SEPARATOR:
-               os << (free_space ? " " : "~");
+               os << (free_space ? ' ' : '~');
                break;
        }
        return 0;
@@ -249,7 +249,7 @@ int InsetSpecialChar::ascii(Buffer const *, ostream & os, int) const
        case LIGATURE_BREAK:
                break;
        case END_OF_SENTENCE:
-               os << ".";
+               os << '.';
                break;
        case LDOTS:
                os << "...";
@@ -258,7 +258,7 @@ int InsetSpecialChar::ascii(Buffer const *, ostream & os, int) const
                os << "->";
                break;
        case PROTECTED_SEPARATOR:
-               os << " ";
+               os << ' ';
                break;
        }
        return 0;
@@ -272,7 +272,7 @@ int InsetSpecialChar::linuxdoc(Buffer const *, ostream & os) const
        case LIGATURE_BREAK:
                break;
        case END_OF_SENTENCE:
-               os << ".";
+               os << '.';
                break;
        case LDOTS:
                os << "...";
@@ -295,7 +295,7 @@ int InsetSpecialChar::docbook(Buffer const *, ostream & os, bool) const
        case LIGATURE_BREAK:
                break;
        case END_OF_SENTENCE:
-               os << ".";
+               os << '.';
                break;
        case LDOTS:
                os << "...";
index 8b335ffc37d4f1062d90098965af195a65cd1cb6..f5ab4e26c476beacf16103f863b249258e0536d2 100644 (file)
@@ -1704,10 +1704,10 @@ int InsetText::docbook(Buffer const * buf, ostream & os, bool mixcont) const
 
                        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;
index 46678467dba6602376521dcffe0a0c411a6c6a96..37c8c41b51db889bc42fe2822f12329909861001 100644 (file)
@@ -51,7 +51,7 @@ string const InsetUrl::getScreenLabel(Buffer const *) const
                temp = _("HtmlUrl: ");
 
        string url;
+
        if (!getOptions().empty())
                url += getOptions();
        else
@@ -81,16 +81,16 @@ int InsetUrl::latex(Buffer const *, ostream & os,
 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() << "\">";
 
index 47c2f17255599544e9ba67bb7b8f841c6536e34f..43dc8afd500f2690e8d950ff12c5a08d82d12a94 100644 (file)
@@ -148,11 +148,11 @@ string const InsetWrap::editMessage() const
 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);
 
@@ -163,9 +163,9 @@ int InsetWrap::latex(Buffer const * buf,
 
 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;
 }
@@ -177,12 +177,13 @@ bool InsetWrap::insetAllowed(Inset::Code code) const
        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
 {
@@ -191,8 +192,8 @@ int InsetWrap::getMaxWidth(BufferView * bv, UpdatableInset const * inset)
                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;
                }
index 4159334427f30458c786275783c93fce72f56045..9ac2625b503967d702dbc6c2c73f9a1018ee8cbc 100644 (file)
@@ -19,7 +19,7 @@
 #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>
@@ -74,7 +74,7 @@ public:
                     int * in, int * out)
                : params(p), lang(l), pipein(in), pipeout(out) {}
        ///
-       virtual ForkedProcess * clone() const { 
+       virtual ForkedProcess * clone() const {
                return new LaunchIspell(*this);
        }
        ///
@@ -99,7 +99,7 @@ int LaunchIspell::start()
 
 
 int LaunchIspell::generateChild()
-{      
+{
        isp_pid = fork();
 
        if (isp_pid != 0) {
@@ -154,7 +154,7 @@ int LaunchIspell::generateChild()
                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;
@@ -251,7 +251,7 @@ ISpell::ISpell(BufferParams const & params, string const & lang)
        // 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;
@@ -348,7 +348,7 @@ enum ISpell::Result ISpell::check(WordLangTuple const & word)
        // FIXME Please rewrite to use string.
 
        Result res;
+
        ::fputs(word.word().c_str(), out);
        ::fputc('\n', out);
 
index 3d86b2c74c857dc81bbea5a47023f1d66f8f0b2a..64b3ed9913e50707aaeea9c96ca1415c0853e6e9 100644 (file)
@@ -45,7 +45,7 @@ string::size_type kb_keymap::bind(string const & seq, int action)
        if (lyxerr.debugging(Debug::KBMAP)) {
                lyxerr << "BIND: Sequence `"
                       << seq << "' Action `"
-                      << action << "'" << endl;
+                      << action << '\'' << endl;
        }
 
        kb_sequence k(0, 0);
@@ -77,7 +77,7 @@ int kb_keymap::lookup(LyXKeySymPtr key,
                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()) {
@@ -177,9 +177,9 @@ string const kb_keymap::findbinding(int act, string const & prefix) const
                        res += cit->table->findbinding(act,
                                                       prefix
                                                       + printKey((*cit))
-                                                      + " ");
+                                                      + ' ');
                } else if (cit->action == act) {
-                       res += "[";
+                       res += '[';
                        res += prefix + printKey((*cit));
                        res += "] ";
                }
index 354f54ca31dcf322068004096d1cc88d2621438e..757487b531d9ce26a0715cdb6bfab8b71eda3565 100644 (file)
@@ -342,9 +342,9 @@ void AutoSave(BufferView * bv)
 
        // create autosave filename
        string fname = bv->buffer()->filePath();
-       fname += "#";
+       fname += '#';
        fname += OnlyFilename(bv->buffer()->fileName());
-       fname += "#";
+       fname += '#';
 
        AutoSaveBuffer autosave(*bv, fname);
        autosave.start();
@@ -491,7 +491,7 @@ void MenuInsertLabel(BufferView * bv, string const & arg)
                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();
index 64ca76e3c965e090b2051ddb84bb21c6a5e5eac3..b20b2aee64ed81370cb84eec46ded5d46ed57611 100644 (file)
@@ -136,7 +136,7 @@ LyX::LyX(int & argc, char * argv[])
        // 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;
 
@@ -886,7 +886,7 @@ int parse_import(string const & type, string const & file)
                exit(1);
        }
 
-       batch = "buffer-import " + type + " " + file;
+       batch = "buffer-import " + type + ' ' + file;
        return 2;
 }
 
index 94078b90ff4710f89d27894ff1804058b99c5b53..9319529246f7d81ece810c7c964ec74bad5ffaea 100644 (file)
@@ -120,5 +120,5 @@ string const mathcircumflex_def =
        "\\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";
index 8c78d9f5d463e1be81a3994486ed913cf13c08bd..1d75d1e32ad3c17afc25346ba4a630bbd13e71c7 100644 (file)
@@ -19,7 +19,7 @@
 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.
@@ -66,7 +66,7 @@ public:
         * 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;
@@ -121,7 +121,7 @@ private:
        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_;
@@ -131,7 +131,7 @@ private:
        int iy_;
        /// the containing row
        Row * row_;
-       /// the containing row for the next line 
+       /// the containing row for the next line
        Row * irow_;
 };
 
index 5c3da3a316eb48e4f8f8fed08ecf4eee7b1d0162..401b148accdb2df60d57e50a10c107baa8cccae9 100644 (file)
@@ -947,7 +947,7 @@ int LyXFont::latexWriteEndChanges(ostream & os, LyXFont const & base,
        }
 
        if (language() != base.language() && language() != next.language()) {
-               os << "}";
+               os << '}';
                ++count;
        }
 
index 319f418e4a9209c63230ce1e84ad720e513978e2..179156e15761c28ba5735176425277b9ef40f521 100644 (file)
@@ -179,7 +179,7 @@ void LyXFunc::processKeySym(LyXKeySymPtr keysym,
        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.
@@ -188,7 +188,7 @@ void LyXFunc::processKeySym(LyXKeySymPtr keysym,
                // 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.
@@ -202,7 +202,7 @@ void LyXFunc::processKeySym(LyXKeySymPtr keysym,
        if (lyxerr.debugging(Debug::KEY)) {
                lyxerr << "Key [action="
                       << action << "]["
-                      << keyseq.print() << "]"
+                      << keyseq.print() << ']'
                       << endl;
        }
 
@@ -221,7 +221,7 @@ void LyXFunc::processKeySym(LyXKeySymPtr keysym,
 
                lyxerr[Debug::KEY] << "Removing modifiers...\n"
                        << "Action now set to ["
-                       << action << "]" << endl;
+                       << action << ']' << endl;
 
                if (action == LFUN_UNKNOWN_ACTION) {
                        owner->message(_("Unknown function."));
@@ -674,9 +674,15 @@ void LyXFunc::dispatch(string const & s, bool verbose)
        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;
        }
 
@@ -694,7 +700,7 @@ void LyXFunc::dispatch(int ac, bool verbose)
 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;
@@ -1283,7 +1289,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                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()
@@ -1533,7 +1539,7 @@ void LyXFunc::sendDispatchMessage(string const & msg, FuncRequest const & ev, bo
 
        string dispatch_msg = msg;
        if (!dispatch_msg.empty())
-               dispatch_msg += " ";
+               dispatch_msg += ' ';
 
        string comname = lyxaction.getActionName(ev.action);
 
@@ -1547,7 +1553,7 @@ void LyXFunc::sendDispatchMessage(string const & msg, FuncRequest const & ev, bo
                if (pseudoaction == LFUN_UNKNOWN_ACTION) {
                        pseudoaction = ev.action;
                } else {
-                       comname += " " + ev.argument;
+                       comname += ' ' + ev.argument;
                        argsadded = true;
                }
        }
@@ -1557,12 +1563,12 @@ void LyXFunc::sendDispatchMessage(string const & msg, FuncRequest const & ev, bo
        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;
@@ -1761,7 +1767,7 @@ void LyXFunc::doImport(string const & argument)
 
                string const extension = "*." + formats.extension(format)
                        + "| " + formats.prettyName(format)
-                       + " (*." + formats.extension(format) + ")";
+                       + " (*." + formats.extension(format) + ')';
 
                FileDialog::Result result = fileDlg.open(initpath,
                                                           extension);
index ae56a832689dc1a2902fd1f503d45d6615fe9e1b..d153dc3dcd9b720f8776fa45e0be9a8a4f12da4f 100644 (file)
@@ -52,7 +52,7 @@ string const LyXGlueLength::asString() const
        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());
        }
@@ -61,7 +61,7 @@ string const LyXGlueLength::asString() const
        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());
        }
@@ -80,8 +80,8 @@ string const LyXGlueLength::asString() const
        // 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());
 }
index 0848e20bd6dd98f79f0075e63e521de23f78ae73..0a95c43811397b8ab0be3de73fefdd4746959213 100644 (file)
@@ -121,7 +121,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                { "alignpossible",      LT_ALIGNPOSSIBLE },
                { "bottomsep",          LT_BOTTOMSEP },
                { "copystyle",          LT_COPYSTYLE },
-               { "dependson",          LT_DEPENDSON },
+               { "dependson",          LT_DEPENDSON },
                { "end",                LT_END },
                { "endlabelstring",     LT_ENDLABELSTRING },
                { "endlabeltype",       LT_ENDLABELTYPE },
@@ -221,7 +221,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                                        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 "
@@ -230,7 +230,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                        }
                        break;
 
-               case LT_DEPENDSON: 
+               case LT_DEPENDSON:
                        if (lexrc.next()) {
                                depends_on_ = lexrc.getString();
                        }
@@ -249,10 +249,10 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                        break;
 
                case LT_OPTARGS:
-                       if (lexrc.next()) { 
+                       if (lexrc.next()) {
                                optionalargs = lexrc.getInteger();
                        }
-                       break;
+                       break;
 
                case LT_NEED_PROTECT:
                        needprotect = lexrc.next() && lexrc.getInteger();
index 2e16c84ed3ea28f122cd381397dfbcd31f59d159..ff1b580c094784b0fa70dbfc2899f6bbf9f9a0c2 100644 (file)
@@ -62,27 +62,27 @@ string const LyXLength::asLatexString() const
        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:
index a4e71bee93cbf3269a91fa88e63409b45f47ad4b..4bca54ed3101a1d0960b63a6eefd03576333f7f8 100644 (file)
@@ -172,7 +172,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
 #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');
@@ -288,7 +288,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
 #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)
@@ -408,7 +408,7 @@ bool LyXLex::Pimpl::eatLine()
                is.get(cc);
                c = cc;
                //lyxerr[Debug::LYXLEX] << "LyXLex::EatLine read char: `"
-               //                    << c << "'" << endl;
+               //                    << c << '\'' << endl;
                if (c != '\r')
                        buff[i++] = c;
        }
index cc25842280416196170d3cfaeed86cf45b2a1514..81b5ab85472e3f404bc704df4823ca1a0a610dd3 100644 (file)
@@ -1138,26 +1138,26 @@ void LyXRC::output(ostream & os) const
                        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:
@@ -1202,7 +1202,7 @@ void LyXRC::output(ostream & os) const
                }
        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) {
@@ -1225,30 +1225,30 @@ void LyXRC::output(ostream & os) const
        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"
@@ -1272,27 +1272,27 @@ void LyXRC::output(ostream & os) const
                }
        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) {
@@ -1313,7 +1313,7 @@ void LyXRC::output(ostream & os) const
                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) {
@@ -1344,17 +1344,17 @@ void LyXRC::output(ostream & os) const
                        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"
@@ -1385,7 +1385,7 @@ void LyXRC::output(ostream & os) const
                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) {
@@ -1512,12 +1512,12 @@ void LyXRC::output(ostream & os) const
                }
        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) {
@@ -1529,15 +1529,15 @@ void LyXRC::output(ostream & os) const
                }
        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) {
@@ -1560,7 +1560,7 @@ void LyXRC::output(ostream & os) const
 #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:
@@ -1570,12 +1570,12 @@ void LyXRC::output(ostream & os) const
        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) {
@@ -1585,7 +1585,7 @@ void LyXRC::output(ostream & os) const
        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) {
@@ -1595,7 +1595,7 @@ void LyXRC::output(ostream & os) const
                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) {
@@ -1607,7 +1607,7 @@ void LyXRC::output(ostream & os) const
                    != system_lyxrc.isp_use_input_encoding) {
                        os << "\\use_input_encoding "
                           << tostr(isp_use_input_encoding)
-                          << "\n";
+                          << '\n';
                }
 
                os << "\n#\n"
@@ -1616,7 +1616,7 @@ void LyXRC::output(ostream & os) const
 
        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) {
@@ -1659,18 +1659,18 @@ void LyXRC::output(ostream & os) const
        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"
@@ -1680,15 +1680,15 @@ void LyXRC::output(ostream & os) const
        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"
index b6c3e96d28a06ac8e085fe3701900406e0386ee7..26d11f542df95e3f2b14309ab5e1b7167bfa12f1 100644 (file)
@@ -214,7 +214,7 @@ void LyXComm::endPipe(int & fd, string const & filename, bool write)
        if (!write) {
                lyx_gui::remove_read_callback(fd);
        }
+
 #ifdef __EMX__
        APIRET rc;
        int errnum;
@@ -281,14 +281,14 @@ void LyXComm::read_ready()
                                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;
@@ -384,7 +384,8 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
                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;
@@ -460,7 +461,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
                                }
                        } else {
                                lyxerr <<"LyXServer: Undefined server command "
-                                      << cmd << "." << endl;
+                                      << cmd << '.' << endl;
                        }
                        return;
                }
@@ -486,7 +487,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
                                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 -
index 376f20975a3a8c714c03ce6974be2adcafc6994f..c3cbdc05a78461e31b6b3dfa26642ec66978140b 100644 (file)
@@ -79,7 +79,7 @@ bool LyXTextClass::do_readStyle(LyXLex & lexrc, LyXLayout & lay)
                lay.reslabelfont.realize(defaultfont());
                return false; // no errors
        }
-       lyxerr << "Error parsing style `" << lay.name() << "'" << endl;
+       lyxerr << "Error parsing style `" << lay.name() << '\'' << endl;
        return true;
 }
 
@@ -228,7 +228,8 @@ bool LyXTextClass::Read(string const & filename, bool merge)
                                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'");
                        }
@@ -898,10 +899,10 @@ ostream & operator<<(ostream & os, LyXTextClass::PageSides p)
 {
        switch (p) {
        case LyXTextClass::OneSide:
-               os << "1";
+               os << '1';
                break;
        case LyXTextClass::TwoSides:
-               os << "2";
+               os << '2';
                break;
        }
        return os;
index 389e7ddfbcf00f612c7e5a5ac0fc636909a0cf37..861b33e2617d53673fb1650fe6985e7a2fe76263 100644 (file)
@@ -80,7 +80,7 @@ bool LyXTextClassList::Read ()
        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 "
index 6211f70198115a2e18b1961600a27a54f2864cc9..cdf72c02c0ef6be90146d5e45ee0be5732576bf9 100644 (file)
@@ -1,3 +1,7 @@
+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
index 42a0f5c1e7111055d99a18ce89023a69bfb36612..5c070513c8941243fb42d8c246d72e9dde2837e2 100644 (file)
@@ -43,10 +43,10 @@ CommandInset::dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
 
 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) << '}';
 }
 
 
index 440648d582a125b7bb92a9e1d2851617ac9817d0..670cb182b110b03cb0ad24d0b8ecbd59d6ba7e13 100644 (file)
@@ -127,7 +127,7 @@ Inset * InsetFormula::clone(Buffer const &, bool) const
 void InsetFormula::write(Buffer const *, ostream & os) const
 {
        WriteStream wi(os, false, false);
-       os << par_->fileInsetLabel() << " ";
+       os << par_->fileInsetLabel() << ' ';
        par_->write(wi);
 }
 
index 3d9764da34409cba58ec3a97af1d0ff1b1f61b59..b56b8979e4a9f62dcd64ada8b471159a43753453 100644 (file)
@@ -227,17 +227,17 @@ void InsetFormulaBase::getCursorPos(BufferView *, int & x, int & y) const
        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
@@ -248,7 +248,7 @@ void InsetFormulaBase::toggleInsetCursor(BufferView * bv)
 void InsetFormulaBase::showInsetCursor(BufferView * bv, bool)
 {
        if (!mathcursor) {
-               lyxerr << "showInsetCursor impossible\n";
+               lyxerr << "showInsetCursor impossible" << endl;
                return;
        }
        if (isCursorVisible())
@@ -258,7 +258,7 @@ void InsetFormulaBase::showInsetCursor(BufferView * bv, bool)
        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;
 }
 
 
@@ -270,7 +270,7 @@ void InsetFormulaBase::hideInsetCursor(BufferView * bv)
                return;
        bv->hideLockedInsetCursor();
        setCursorVisible(false);
-       //lyxerr << "hideInsetCursor: \n";
+       //lyxerr << "hideInsetCursor: " << endl;
 }
 
 
@@ -282,7 +282,7 @@ void InsetFormulaBase::fitInsetCursor(BufferView * bv) const
        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);
 }
 
@@ -315,7 +315,7 @@ Inset::RESULT InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
        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
@@ -353,10 +353,10 @@ Inset::RESULT InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
 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);
@@ -418,7 +418,7 @@ Inset::RESULT InsetFormulaBase::localDispatch(FuncRequest const & cmd)
        //      << " arg: '" << cmd.argument
        //      << " x: '" << cmd.x
        //      << " y: '" << cmd.y
-       //      << "' button: " << cmd.button() << "\n";
+       //      << "' button: " << cmd.button() << endl;
 
        switch (cmd.action) {
                case LFUN_MOUSE_PRESS:
index 914a463db86c37a51c7207c9b0b0cd117fe87d85..0f13ce35115fa96a528a06197c1bd206dd50bab5 100644 (file)
@@ -82,16 +82,15 @@ void MathAMSArrayInset::draw(MathPainterInfo & pi, int x, int y) const
 
 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 << ']';
 }
-
index 767992f59ba6547086c10dffe018a77aa4046eac..6bddbe3be5429fd80c0ba2b69616250726649ce1 100644 (file)
@@ -84,7 +84,7 @@ void MathArrayInset::write(WriteStream & os) const
 {
        if (os.fragile())
                os << "\\protect";
-       os << "\\begin{" << name_ << "}";
+       os << "\\begin{" << name_ << '}';
 
        if (v_align_ == 't' || v_align_ == 'b')
                os << '[' << char(v_align_) << ']';
@@ -94,7 +94,7 @@ void MathArrayInset::write(WriteStream & os) const
 
        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...
 }
@@ -102,9 +102,9 @@ void MathArrayInset::write(WriteStream & os) const
 
 void MathArrayInset::normalize(NormalStream & os) const
 {
-       os << "[" << name_ << " ";
+       os << '[' << name_ << ' ';
        MathGridInset::normalize(os);
-       os << "]";
+       os << ']';
 }
 
 
@@ -112,5 +112,5 @@ void MathArrayInset::maplize(MapleStream & os) const
 {
        os << "array(";
        MathGridInset::maplize(os);
-       os << ")";
+       os << ')';
 }
index e279cb978b8abf538359ed06f2278dbc7664b5c1..e5896ea7d4883df94faa7eb535c7be820dc751b2 100644 (file)
@@ -67,21 +67,21 @@ bool Correction::read(istream & is)
 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;
 }
@@ -143,15 +143,15 @@ void initAutoCorrect()
        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);
                }
        }
index e85d6ac03c5855d57e613761319db42051219fd5..7cae97e3921011d5ca1dbd0020e0aa2905583232 100644 (file)
@@ -64,5 +64,5 @@ void MathBigInset::write(WriteStream & os) const
 
 void MathBigInset::normalize(NormalStream & os) const
 {
-       os << "[" << name_ << ' ' <<  delim_ << ']';
+       os << '[' << name_ << ' ' <<  delim_ << ']';
 }
index 61a1bf1f2b8948cb40a5bd141f457a3ea03c5e1c..af3d117053c32e652ece47537c5d91fbbf4404e7 100644 (file)
@@ -24,7 +24,7 @@ MathInset * MathBoxInset::clone() const
 
 void MathBoxInset::write(WriteStream & os) const
 {
-       os << "\\" << name_ << "{" << cell(0) << "}";
+       os << '\\' << name_ << '{' << cell(0) << '}';
 }
 
 
index 08fec53a24a2198e6d49bc417c2258dc48324f12..8fe06a6a7eb099d9fad49b8876a4dca2ee99e69c 100644 (file)
@@ -52,7 +52,7 @@ void MathCasesInset::normalize(NormalStream & os) const
 {
        os << "[cases ";
        MathGridInset::normalize(os);
-       os << "]";
+       os << ']';
 }
 
 
@@ -60,7 +60,7 @@ void MathCasesInset::maplize(MapleStream & os) const
 {
        os << "cases(";
        MathGridInset::maplize(os);
-       os << ")";
+       os << ')';
 }
 
 
index 6b6c5f8202ecea8304e6c69e6f5caa273f309072..9be9091e80613d2eb682f631483f98040183191f 100644 (file)
@@ -138,7 +138,7 @@ void MathCharInset::write(WriteStream & os) const
 
 void MathCharInset::normalize(NormalStream & os) const
 {
-       os << "[char " << char_ << " " << "mathalpha" << "]";
+       os << "[char " << char_ << ' ' << "mathalpha]";
 }
 
 
index c598d5745a8ee96bf4f9e99259cbd8a057ce2cf1..f76e0618fbf1fdb865b8022bbd7e092e34c40d42 100644 (file)
@@ -136,14 +136,14 @@ bool MathCursor::popRight()
 #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 {}
@@ -778,18 +778,19 @@ void MathCursor::normalize()
 {
        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());
@@ -1346,7 +1347,7 @@ string MathCursor::grabSelection() const
                        data += "\\\\";
                for (col_type col = c1; col <= c2; ++col) {
                        if (col > c1)
-                               data += "&";
+                               data += '&';
                        data += asString(i1.par_->cell(i1.par_->index(row, col)));
                }
        }
index 0d4a65fa3093948644165f5237e8845c4b034ebe..757b5d0a6fde06f6a0c199a390869d91bd8c0937 100644 (file)
@@ -113,7 +113,7 @@ void MathArray::dump() const
 {
        NormalStream ns(lyxerr);
        for (const_iterator it = begin(); it != end(); ++it)
-               ns << "<" << *it << ">";
+               ns << '<' << *it << '>';
 }
 
 
@@ -275,7 +275,7 @@ void MathArray::drawT(TextPainter & pain, int x, int y) const
 {
        //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;
index 1b4b4770497b23c61c88bf9c6ded4e50de188c84..514ea6ca6dd6136905f6de9b4edebb1dead30ec0 100644 (file)
@@ -36,7 +36,7 @@ string convertDelimToLatexName(string const & name)
                return name;
        if (name == "|")
                return name;
-       return "\\" + name + " ";
+       return '\\' + name + ' ';
 }
 
 }
@@ -133,9 +133,9 @@ void MathDelimInset::maplize(MapleStream & os) const
 {
        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_;
@@ -145,9 +145,9 @@ void MathDelimInset::maximize(MaximaStream & os) const
 {
        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_;
@@ -177,7 +177,7 @@ void MathDelimInset::mathmlize(MathMLStream & os) const
 void MathDelimInset::octavize(OctaveStream & os) const
 {
        if (isAbs())
-               os << "det(" << cell(0) << ")";
+               os << "det(" << cell(0) << ')';
        else
                os << left_ << cell(0) << right_;
 }
index 993e8bea27cda8cf3b08ac7571f40dbf3eeb5aa6..5075e9867216798124eadc075203db49a4b85c8f 100644 (file)
@@ -43,7 +43,7 @@ void MathEnvInset::write(WriteStream & os) const
 
 void MathEnvInset::normalize(NormalStream & os) const
 {
-       os << "[env " << name_ << " " << cell(0) << ']';
+       os << "[env " << name_ << ' ' << cell(0) << ']';
 }
 
 
index 8c887038f8de8d14249af818b3b016d264890044..c16d5cbdd8a8e9ff6b3ecfa85057973bc8a4dfb5 100644 (file)
@@ -1062,7 +1062,7 @@ namespace {
                        //                   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());
@@ -1077,7 +1077,7 @@ namespace {
                        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 + "));";
@@ -1138,7 +1138,7 @@ namespace {
                        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)
@@ -1178,15 +1178,15 @@ MathArray pipeThroughExtern(string const & lang, string const & extra,
        // 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();
        }
 
index cd569034896fe5538971f3fa294aba401d900160..1a124d08844214c014388c597d5e96b5fa6b04e0 100644 (file)
@@ -123,7 +123,7 @@ void initSymbols()
 
                // 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;
@@ -137,7 +137,7 @@ void initSymbols()
                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;
@@ -183,7 +183,7 @@ void initSymbols()
                        << "  inset: " << tmp.inset
                        << "  draw: " << int(tmp.draw.empty() ? 0 : tmp.draw[0])
                        << "  extra: " << tmp.extra
-                       << "'" << endl;
+                       << '\'' << endl;
        }
        string tmp = "cmm";
        string tmp2 = "cmsy";
@@ -216,12 +216,12 @@ latexkeys const * in_word_set(string const & str)
 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")
@@ -292,6 +292,6 @@ MathAtom createMathInset(string const & s)
        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));
 }
index 577ac4a3a435c0ae64321db93ccd762a4394a68c..c8f67c69cf44e3e7f24b536d9fa77c85ce8ac197 100644 (file)
@@ -64,7 +64,7 @@ void MathFontOldInset::write(WriteStream & os) const
 
 void MathFontOldInset::normalize(NormalStream & os) const
 {
-       os << "[font " << key_->name << " " << cell(0) << "]";
+       os << "[font " << key_->name << ' ' << cell(0) << ']';
 }
 
 
index 59584395c5fdc8e5190747ac0eb0bcb52dd1e9da..7d4ac27eafbad05bf9ab20eb91267cb39c4512b1 100644 (file)
@@ -27,7 +27,7 @@ string verboseHLine(int n)
        for (int i = 0; i < n; ++i)
                res += "\\hline";
        if (n)
-               res += " ";
+               res += ' ';
        return res;
 }
 
@@ -177,7 +177,7 @@ MathGridInset::col_type MathGridInset::guessColumns(string const & hh) const
        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;
@@ -518,7 +518,7 @@ string MathGridInset::eolString(row_type row, bool fragile) const
        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()) {
@@ -1012,7 +1012,7 @@ MathInset::result_type MathGridInset::dispatch
                        if (idx > 0)
                                --idx;
                        pos = cell(idx).size();
-               
+
                        //mathcursor->normalize();
                        //updateLocal(bv, true);
                        return DISPATCHED_POP;
@@ -1058,7 +1058,7 @@ MathInset::result_type MathGridInset::dispatch
                                copyCol(col(idx));
                        else if (cmd.argument == "swap-column")
                                swapCol(col(idx));
-                       else 
+                       else
                                return UNDISPATCHED;
                        return DISPATCHED_POP;
 
@@ -1093,7 +1093,7 @@ MathInset::result_type MathGridInset::dispatch
                        return DISPATCHED_POP;
                }
 
-               default:        
+               default:
                        return MathNestInset::dispatch(cmd, idx, pos);
        }
        return UNDISPATCHED;
index b6f743e32a9b987da3a441a4e2efde5940c82cc9..c4ba16ed6817b1b3d2082c52023db3a66ea3a0e4 100644 (file)
@@ -362,18 +362,18 @@ void MathHullInset::header_write(WriteStream & os) const
                        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) << '}';
 }
 
 
@@ -401,7 +401,7 @@ void MathHullInset::footer_write(WriteStream & os) const
                os << "\\end{" << type_ << "}\n";
 
        else
-               os << "\\end{unknown" << star(n) << "}";
+               os << "\\end{unknown" << star(n) << '}';
 }
 
 
@@ -455,7 +455,7 @@ string MathHullInset::nicelabel(row_type row) const
                return string();
        if (label_[row].empty())
                return string("(#)");
-       return "(" + label_[row] + ")";
+       return '(' + label_[row] + ')';
 }
 
 
@@ -626,7 +626,7 @@ string MathHullInset::eolString(row_type row, bool fragile) const
        string res;
        if (numberedType()) {
                if (!label_[row].empty() && !nonum_[row])
-                       res += "\\label{" + label_[row] + "}";
+                       res += "\\label{" + label_[row] + '}';
                if (nonum_[row])
                        res += "\\nonumber ";
        }
@@ -644,7 +644,7 @@ void MathHullInset::write(WriteStream & os) const
 
 void MathHullInset::normalize(NormalStream & os) const
 {
-       os << "[formula " << type_ << " ";
+       os << "[formula " << type_ << ' ';
        MathGridInset::normalize(os);
        os << "] ";
 }
index 61d49081f6e6d347aa130b95bc1ce76177a7ff3d..f25f8ee6b8599b8889f1ef92a131017e1a605aa8 100644 (file)
@@ -9,9 +9,6 @@
 #include "textpainter.h"
 
 
-using std::max;
-
-
 MathInferInset::MathInferInset()
        : MathGridInset(1, 1)
 {}
@@ -37,8 +34,6 @@ void MathInferInset::write(WriteStream & os) const
 {
        os << "\\infer";
        if (opt_.size())
-               os << "[" << opt_ << "]";
+               os << '[' << opt_ << ']';
        MathGridInset::write(os);
 }
-
-
index 04335abdebc96164e089740c14cd09d893a660ab..03c25b53c61d92cd6c5de2c0f6abea37e9477c12 100644 (file)
@@ -45,11 +45,11 @@ void MathKernInset::draw(MathPainterInfo &, int, int) const
 
 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() << ']';
 }
index 22eb9a181215e78718899d89a7108eceac3525c6..3051703c4a7d42ae0a4c84c072dff5beb4f49e9f 100644 (file)
@@ -37,7 +37,7 @@ void MathNumberInset::draw(MathPainterInfo & pi, int x, int y) const
 
 void MathNumberInset::normalize(NormalStream & os) const
 {
-       os << "[number " << str_ << "]";
+       os << "[number " << str_ << ']';
 }
 
 
index ad506e70ae98a8d3ded5463a57bc36770d7baf9d..ddadf94e19d2699c343bd9853abc278e740afcb9 100644 (file)
@@ -207,9 +207,9 @@ private:
 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;
 }
 
index 497892f7da86c1ee0e244df4518618160efcf5be..82ab4c5a4513f4e5dab28b2fa5c33ae60b188e1e 100644 (file)
@@ -1,6 +1,5 @@
-
 #ifdef __GNUG__
-#pragma implementation 
+#pragma implementation
 #endif
 
 #include "config.h"
@@ -52,7 +51,7 @@ void MathCursorPos::setPos(MathArray::pos_type pos)
 
 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;
 }
 
index 9194bbbd28e312fc5ad88409af0a3a511a661e4d..8c442d3bf7045bccd5e37f5bfbd708d748bfaa10 100644 (file)
@@ -91,13 +91,13 @@ bool MathRootInset::idxUpDown(idx_type & idx, pos_type & pos, bool up, int) cons
 
 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) << ')';
 }
 
 
index 61bfd9fe01da7eeda8f383a4b513a8ccddbaf247..f531e4e62657b096f5cbe81aefa8a943ac74d3a7 100644 (file)
@@ -319,7 +319,7 @@ bool MathScriptInset::idxUpDown(idx_type & idx, pos_type & pos, bool up,
                        return false;
                // otherwise go to last base position
                idx = 2;
-               pos = cell(2).size();   
+               pos = cell(2).size();
        }
 
        else if (idx == 0) {
@@ -327,14 +327,14 @@ bool MathScriptInset::idxUpDown(idx_type & idx, pos_type & pos, bool up,
                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;
@@ -417,18 +417,18 @@ void MathScriptInset::mathematicize(MathematicaStream & os) const
        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() << ']';
 }
 
 
index 63f934e81a6f527181e24fd595b22b7f52815ce8..a4cba68316658184d46146929e31789cc302007d 100644 (file)
@@ -48,7 +48,7 @@ void MathSizeInset::write(WriteStream & os) const
 
 void MathSizeInset::normalize(NormalStream & os) const
 {
-       os << "[" << key_->name << ' ' << cell(0) << ']';
+       os << '[' << key_->name << ' ' << cell(0) << ']';
 }
 
 
index e7d9389cc78a06dde73e174138835924490239c8..9fb25c670b9fb48744fc24ecc3107ac9334be58c 100644 (file)
@@ -36,7 +36,7 @@ void MathSplitInset::write(WriteStream & ws) const
 {
        if (ws.fragile())
                ws << "\\protect";
-       ws << "\\begin{" << name_ << "}";
+       ws << "\\begin{" << name_ << '}';
        MathGridInset::write(ws);
        if (ws.fragile())
                ws << "\\protect";
index bf01a676ae2a46b96a7e401a4e205a6cbbe46936..e28556edbc643f961b614ae68fe5c6e64c455a9d 100644 (file)
@@ -37,7 +37,7 @@ void MathStringInset::draw(MathPainterInfo & pi, int x, int y) const
 
 void MathStringInset::normalize(NormalStream & os) const
 {
-       os << "[string " << str_ << ' ' << "mathalpha" << "]";
+       os << "[string " << str_ << ' ' << "mathalpha" << ']';
 }
 
 
index 89635f8b3eefa0692bc4b62bb177e084eba7a76c..29850787be174a99d1fab6252f3c5a46ba67650d 100644 (file)
@@ -43,7 +43,7 @@ void MathSubstackInset::normalize(NormalStream & os) const
 {
        os << "[substack ";
        MathGridInset::normalize(os);
-       os << "]";
+       os << ']';
 }
 
 
@@ -51,5 +51,5 @@ void MathSubstackInset::maplize(MapleStream & os) const
 {
        os << "substack(";
        MathGridInset::maplize(os);
-       os << ")";
+       os << ')';
 }
index cdaca8d9fc4de932729762a274a70b1ab45522cf..782fd1eb194f904728772f1acb6e5d697cf5f266 100644 (file)
@@ -1,6 +1,5 @@
-
 #ifdef __GNUG__
-#pragma implementation 
+#pragma implementation
 #endif
 
 #include <config.h>
@@ -453,14 +452,14 @@ void mathed_draw_deco(MathPainterInfo & pi, int x, int y, int w, int 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);
                }
@@ -524,7 +523,7 @@ struct fontinfo {
 
 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
@@ -582,11 +581,11 @@ fontinfo fontinfos[] = {
 
 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;
index 5a2129324f1416dfcd204a749ec2763e79a7be0f..71fc0ecf16eb562f77a2e426d3a758af8533562d 100644 (file)
@@ -1,6 +1,5 @@
-
 #ifdef __GNUG__
-#pragma implementation 
+#pragma implementation
 #endif
 
 #include <config.h>
@@ -117,7 +116,7 @@ void MathSymbolInset::validate(LaTeXFeatures & features) const
 
 void MathSymbolInset::normalize(NormalStream & os) const
 {
-       os << "[symbol " << name() << "]";
+       os << "[symbol " << name() << ']';
 }
 
 
index e9d9bcdf5c19fbb855d43aa34ba94bf138893d85..f2506827ee888f74912eed29b1ef7215510a306c 100644 (file)
@@ -35,7 +35,7 @@ MathXYMatrixInset const * MathXYArrowInset::targetMatrix() const
 
 MathArray const & MathXYArrowInset::targetCell() const
 {
-#if 0  
+#if 0
        MathXYMatrixInset const * p = targetMatrix();
        int x = 0;
        int y = 0;
@@ -137,9 +137,9 @@ void MathXYArrowInset::write(WriteStream & os) const
 {
        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 << " ";
 }
 
@@ -148,5 +148,5 @@ void MathXYArrowInset::normalize(NormalStream & os) const
 {
        os << "[xyarrow ";
        MathNestInset::normalize(os);
-       os << "]";
+       os << ']';
 }
index d9ae049ca2477d636178b3c34dd9451797df2745..550621367d9cca6f98b4e47875220debb6fcb83e 100644 (file)
@@ -53,7 +53,7 @@ void MathXYMatrixInset::normalize(NormalStream & os) const
 {
        os << "[xymatrix ";
        MathGridInset::normalize(os);
-       os << "]";
+       os << ']';
 }
 
 
@@ -61,5 +61,5 @@ void MathXYMatrixInset::maplize(MapleStream & os) const
 {
        os << "xymatrix(";
        MathGridInset::maplize(os);
-       os << ")";
+       os << ')';
 }
index f90f4ac53eefce5d21a0f610e74892fe07cf9941..6edbae0e8dcf27a15563c8749cd14a8f2a54d841 100644 (file)
@@ -56,7 +56,7 @@ RefInset::dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
                                return DISPATCHED;
                        }
                        break;
-               case LFUN_MOUSE_PRESS:  
+               case LFUN_MOUSE_PRESS:
                case LFUN_MOUSE_MOTION:
                        // eat other mouse commands
                        return DISPATCHED;
@@ -97,7 +97,7 @@ void RefInset::validate(LaTeXFeatures & features) const
 
 int RefInset::ascii(std::ostream & os, int) const
 {
-       os << "[" << asString(cell(0)) << "]";
+       os << '[' << asString(cell(0)) << ']';
        return 0;
 }
 
index 5f464b57548ca34a7ffebd0d4310af63d6b59943..cdc013c384019c38e698f1aeffd85ff59c7d7d46 100644 (file)
@@ -1,6 +1,5 @@
-
 #ifdef __GNUG__
-#pragma implementation 
+#pragma implementation
 #endif
 
 #include "textpainter.h"
@@ -26,7 +25,7 @@ char TextPainter::at(int x, int y) const
 
 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();
@@ -49,7 +48,7 @@ void TextPainter::verticalLine(int x, int y, int n, char c)
 
 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();
 }
@@ -60,7 +59,7 @@ void TextPainter::show(std::ostream & os, int offset) const
        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';
index d6701c8e4bcc0b8d40170403a9c3e404ff9d3c7c..1ca0c04ef1b5575dbd0a4e2e5d4156d77e6602d1 100644 (file)
@@ -182,15 +182,15 @@ void Paragraph::write(Buffer const * buf, ostream & os,
        }
 
        // 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);
@@ -222,7 +222,8 @@ void Paragraph::write(Buffer const * buf, ostream & os,
 
        // 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) {
@@ -233,7 +234,7 @@ void Paragraph::write(Buffer const * buf, ostream & os,
                case LYX_ALIGN_CENTER: h = 3; break;
                default: h = 0; break;
                }
-               os << "\\align " << string_align[h] << " ";
+               os << "\\align " << string_align[h] << ' ';
        }
 
        // bibitem  ale970302
@@ -245,7 +246,7 @@ void Paragraph::write(Buffer const * buf, ostream & os,
        int column = 0;
        for (pos_type i = 0; i < size(); ++i) {
                if (!i) {
-                       os << "\n";
+                       os << '\n';
                        column = 0;
                }
 
@@ -293,12 +294,12 @@ void Paragraph::write(Buffer const * buf, ostream & os,
                                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
@@ -984,7 +985,7 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
 
                if (!params().spacing().isDefault()
                        && (!previous() || !previous()->hasSameLayout(this))) {
-                       os << params().spacing().writeEnvirBegin() << "\n";
+                       os << params().spacing().writeEnvirBegin() << '\n';
                        texrow.newline();
                }
 
@@ -1052,7 +1053,7 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
            language->encoding() != previous_language->encoding()) {
                os << "\\inputencoding{"
                   << language->encoding()->LatexName()
-                  << "}" << endl;
+                  << "}\n";
                texrow.newline();
        }
 
@@ -1102,12 +1103,12 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
 
        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:
@@ -1157,7 +1158,7 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
 
                if (!params().spacing().isDefault()
                        && (!next_ || !next_->hasSameLayout(this))) {
-                       os << params().spacing().writeEnvirEnd() << "\n";
+                       os << params().spacing().writeEnvirEnd() << '\n';
                        texrow.newline();
                }
        }
@@ -1459,7 +1460,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf,
                                running_font = basefont;
                                if (font.family() ==
                                    LyXFont::TYPEWRITER_FAMILY) {
-                                       os << "~";
+                                       os << '~';
                                }
                                if (moving_arg)
                                        os << "\\protect ";
index 42ec28da89bfc29a2794968895aa9ea4b034bfda..4b953cf7c71ea0f3e6e73ec26401b2ce6ba42862 100644 (file)
@@ -326,7 +326,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
                                               style.free_spacing);
 
                        if (close)
-                               os << "}";
+                               os << '}';
 
                        if (tmp) {
                                for (int j = 0; j < tmp; ++j) {
index 52ada720fc27fbdc13717fae7a31c155ad73cc27..435d71cc13cf8a57a94337d87ef17c35307d1c36 100644 (file)
@@ -89,8 +89,8 @@ int openTag(ostream & os, Paragraph::depth_type depth,
 {
        if (!latexname.empty() && latexname != "!-- --") {
                if (!mixcont)
-                       os << string(" ", depth);
-               os << "<" << latexname << ">";
+                       os << string(depth, ' ');
+               os << '<' << latexname << '>';
        }
 
        if (!mixcont)
@@ -105,8 +105,8 @@ int closeTag(ostream & os, Paragraph::depth_type depth,
 {
        if (!latexname.empty() && latexname != "!-- --") {
                if (!mixcont)
-                       os << endl << string(" ", depth);
-               os << "</" << latexname << ">";
+                       os << endl << string(depth, ' ');
+               os << "</" << latexname << '>';
        }
 
        if (!mixcont)
index 745b922eb6d77690bb4ae09c748297d620616e7b..7e58026b455143fe1693a3917fc55b0f002b9486 100644 (file)
@@ -122,8 +122,8 @@ string const MakeLatexName(string const & file)
 string const QuoteName(string const & name)
 {
        return (os::shell() == os::UNIX) ?
-               "\'" + name + "\'":
-               "\"" + name + "\"";
+               '\'' + name + '\'':
+               '"' + name + '"';
 }
 
 
@@ -213,7 +213,7 @@ vector<string> const DirList(string const & dir, string const & ext)
        // 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) {
@@ -240,7 +240,7 @@ vector<string> const DirList(string const & dir, string const & ext)
        */
        /* 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()) {
@@ -477,7 +477,7 @@ string const CreateTmpDir(string const & tempdir, string const & mask)
 {
        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
@@ -785,7 +785,7 @@ string const GetFileContents(string const & fname)
                        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();
 }
 
@@ -965,7 +965,7 @@ string const ChangeExtension(string const & oldname, string const & extension)
        string ext;
        // Make sure the extension starts with a dot
        if (!extension.empty() && extension[0] != '.')
-               ext= "." + extension;
+               ext= '.' + extension;
        else
                ext = extension;
 
@@ -1353,9 +1353,9 @@ string const findtexfile(string const & fil, string const & /*format*/)
 
        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
index a3e01df1a5ff104507d5943fa11512bd18e6f38d..3cd5eafccd65be893718d13d02182becc13ae8fa 100644 (file)
@@ -115,7 +115,7 @@ void ForkedProcess::emitSignal()
 
 
 // Wait for child process to finish.
-int ForkedProcess::runBlocking() 
+int ForkedProcess::runBlocking()
 {
        retval_  = 0;
        pid_ = generateChild();
@@ -149,7 +149,7 @@ int ForkedProcess::runNonBlocking()
 
 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;
index f3f8026c2b23f10ff8ec7738cd3cd51e991e1b0a..cbe6a7235b33079582bad290a689c4923fbd1bb1 100644 (file)
@@ -82,7 +82,7 @@ string os::external_path(string const & p) {
        lyxerr[Debug::LATEX]
                << "<Win32 path correction> ["
                << p << "]->>["
-               << dos_path << "]" << endl;
+               << dos_path << ']' << endl;
        return dos_path;
 }
 
@@ -98,7 +98,7 @@ string os::internal_path(string const &p) {
        lyxerr[Debug::DEPEND]
                << "<Win32 path correction> ["
                << p << "]->>["
-               << posix_path << "]" << endl;
+               << posix_path << ']' << endl;
        return posix_path;
 }
 
index 796f47b650412b96b13e88aac336cf29d090d764..b3906c8c58bfaa9d1f730adfd0f25b0621c56efc 100644 (file)
@@ -165,8 +165,8 @@ void LyXTabular::ReadOld(Buffer const * buf, istream & is,
     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);
@@ -184,8 +184,8 @@ void LyXTabular::ReadOld(Buffer const * buf, istream & is,
     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);
@@ -194,8 +194,8 @@ void LyXTabular::ReadOld(Buffer const * buf, istream & is,
        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) {
@@ -208,8 +208,8 @@ void LyXTabular::ReadOld(Buffer const * buf, istream & is,
            }
            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);
@@ -229,21 +229,21 @@ void LyXTabular::ReadOld(Buffer const * buf, istream & is,
                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;
        }
     }
index 519813af97d027e70e8f2a7fbc2a7b85fdc184d2..ef80cf2c7a248b391a75e0ea3ea2919b37686dd8 100644 (file)
@@ -1206,8 +1206,8 @@ void LyXTabular::ReadNew(Buffer const * buf, istream & is,
        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);
@@ -1246,8 +1246,8 @@ void LyXTabular::ReadNew(Buffer const * buf, istream & is,
        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);
@@ -1261,8 +1261,8 @@ void LyXTabular::ReadNew(Buffer const * buf, istream & is,
        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);
@@ -1275,8 +1275,8 @@ void LyXTabular::ReadNew(Buffer const * buf, istream & is,
                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);
@@ -1296,15 +1296,15 @@ void LyXTabular::ReadNew(Buffer const * buf, istream & is,
                                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;
                }
        }
@@ -1997,16 +1997,18 @@ int LyXTabular::TeXCellPreamble(ostream & os, int cell) const
                        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:
@@ -2032,13 +2034,13 @@ int LyXTabular::TeXCellPreamble(ostream & os, int cell) const
                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() << "}{";
@@ -2046,13 +2048,13 @@ int LyXTabular::TeXCellPreamble(ostream & os, int cell) const
                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";
@@ -2068,7 +2070,7 @@ int LyXTabular::TeXCellPostamble(ostream & os, int cell) const
 
        // usual cells
        if (GetUsebox(cell) == BOX_PARBOX)
-               os << "}";
+               os << '}';
        else if (GetUsebox(cell) == BOX_MINIPAGE) {
                os << "%\n\\end{minipage}";
                ret += 2;
@@ -2204,7 +2206,7 @@ int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
                        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
@@ -2255,19 +2257,19 @@ int LyXTabular::latex(Buffer const * buf,
                            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 {
@@ -2276,8 +2278,8 @@ int LyXTabular::latex(Buffer const * buf,
                                        os << 'l';
                                        break;
                                case LYX_ALIGN_RIGHT:
-                               os << 'r';
-                               break;
+                                       os << 'r';
+                                       break;
                                default:
                                        os << 'c';
                                        break;
@@ -2357,14 +2359,14 @@ int LyXTabular::docbookRow(Buffer const * buf, ostream & os, int row) const
                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;
@@ -2591,11 +2593,9 @@ int LyXTabular::asciiPrintCell(Buffer const * buf, ostream & os,
                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
@@ -2735,7 +2735,7 @@ int LyXTabular::GetCellFromInset(Inset const * inset, int maybe_cell) const
 
 void LyXTabular::Validate(LaTeXFeatures & features) const
 {
-        features.require("NeedTabularnewline");
+       features.require("NeedTabularnewline");
        if (IsLongTabular())
                features.require("longtable");
        if (NeedRotating())
index 1c1ddb63673f9899fb98ba70f4a8cda6f90982c0..46259d4d8b7b5f20dc52bf6fc9ba559670616bea 100644 (file)
@@ -2028,7 +2028,7 @@ void LyXText::insertChar(BufferView * bview, char c)
                // 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;
@@ -2395,7 +2395,7 @@ LyXText::selectNextWordToSpellcheck(BufferView * bview, float & value) const
                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
@@ -3271,7 +3271,7 @@ int LyXText::drawLengthMarker(DrawRowParams & p, string const & prefix,
        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;
index fc29b3646d6384c05a52d95b661e8164a5a4140a..027e38bf2af9ca8f833215035302e7193fe695ed 100644 (file)
@@ -1332,7 +1332,7 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
 
                                // 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 {
index ea60e323f7f7c6229bbc5353bf67d818d8a221f5..48bc0c0a7edcc4c91d81b5052a6ee7b7f0c730ed 100644 (file)
@@ -47,7 +47,7 @@ extern string current_layout;
 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;
 
 
@@ -104,7 +104,7 @@ namespace {
 
                Inset /*const*/ * inset = par.getInset(pos);
 
-               if (!isEditableInset(inset)) 
+               if (!isEditableInset(inset))
                        return 0;
 
                // get inset dimensions
@@ -124,8 +124,9 @@ namespace {
                );
 
                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;
                }
 
@@ -371,7 +372,7 @@ void specialChar(LyXText * lt, BufferView * bv, InsetSpecialChar::Kind kind)
 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();
 
@@ -561,8 +562,8 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
 
        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);
@@ -1048,7 +1049,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                if (!is)
                        lyxerr << "SETXY: Could not parse coordinates in '"
                               << cmd.argument << std::endl;
-               else 
+               else
                        setCursorFromCoordinates(bv, x, y);
                break;
        }
@@ -1290,7 +1291,8 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                // 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()) {
@@ -1421,7 +1423,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                // do nothing if we used the mouse wheel
                if (!bv->buffer())
                        break;
-       
+
                if (cmd.button() == mouse_button::button4
                 || cmd.button() == mouse_button::button5)
                        break;
@@ -1599,7 +1601,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
        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:
        {
index afa2e9b7e73308e3fed69b900c52c895ba0e4034..8b0fa7029fbdd74b9412589671bbcf1b803f1f4f 100644 (file)
@@ -123,7 +123,7 @@ int Trans::Load(LyXLex & lex)
                        if (lex.next(true)) {
                                if (lyxerr.debugging(Debug::KBMAP))
                                        lyxerr << "key\t`" << lex.text()
-                                              << "'" << endl;
+                                              << '\'' << endl;
                        } else
                                return -1;
 
@@ -132,7 +132,7 @@ int Trans::Load(LyXLex & lex)
                        if (lex.next(true)) {
                                if (lyxerr.debugging(Debug::KBMAP))
                                        lyxerr << "accent\t`" << lex.text()
-                                              << "'" << endl;
+                                              << '\'' << endl;
                        } else
                                return -1;
 
@@ -148,7 +148,7 @@ int Trans::Load(LyXLex & lex)
                        if (lex.next(true)) {
                                if (lyxerr.debugging(Debug::KBMAP))
                                        lyxerr << "allowed\t`" << lex.text()
-                                              << "'" << endl;
+                                              << '\'' << endl;
                        } else
                                return -1;
 
@@ -222,7 +222,7 @@ int Trans::Load(LyXLex & lex)
                        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;
@@ -231,7 +231,7 @@ int Trans::Load(LyXLex & lex)
                                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;
@@ -247,7 +247,7 @@ int Trans::Load(LyXLex & lex)
                                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
@@ -255,7 +255,7 @@ int Trans::Load(LyXLex & lex)
 
                        if (lex.next(true)) {
                                if (lyxerr.debugging(Debug::KBMAP))
-                                       lyxerr << "\t`" << lex.text() << "'"
+                                       lyxerr << "\t`" << lex.text() << '\''
                                               << endl;
                                key = lex.text()[0];
                        } else
@@ -263,7 +263,7 @@ int Trans::Load(LyXLex & lex)
 
                        if (lex.next(true)) {
                                if (lyxerr.debugging(Debug::KBMAP))
-                                       lyxerr << "\t`" << lex.text() << "'"
+                                       lyxerr << "\t`" << lex.text() << '\''
                                               << endl;
                                str = lex.text();
                        } else
@@ -342,7 +342,7 @@ tex_accent getkeymod(string const & p)
                        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)) {
index e81ed01b2c38f30a61e55919b431013b6a80bd64..8a9fa6bd2a21482b30848daa90014b33d93f7ce3 100644 (file)
@@ -88,7 +88,7 @@ void RCS::retrieve(string const & file)
 {
        lyxerr[Debug::LYXVC] << "LyXVC::RCS: retrieve.\n\t" << file << endl;
        VCS::doVCCommand("co -q -r \""
-                        + file + "\"",
+                        + file + '"',
                         string());
 }
 
@@ -105,7 +105,7 @@ void RCS::scanMaster()
        while (!read_enough && ifs >> token) {
                lyxerr[Debug::LYXVC]
                        << "LyXVC::scanMaster: current lex text: `"
-                       << token << "'" << endl;
+                       << token << '\'' << endl;
 
                if (token.empty())
                        continue;
@@ -163,7 +163,7 @@ void RCS::registrer(string const & msg)
        cmd += msg;
        cmd += "\" \"";
        cmd += OnlyFilename(owner_->fileName());
-       cmd += "\"";
+       cmd += '"';
        doVCCommand(cmd, owner_->filePath());
        owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
 }
@@ -172,7 +172,8 @@ void RCS::registrer(string const & msg)
 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));
 }
 
@@ -181,7 +182,8 @@ void RCS::checkOut()
 {
        owner_->markClean();
        doVCCommand("co -q -l \""
-                   + OnlyFilename(owner_->fileName()) + "\"", owner_->filePath());
+                   + OnlyFilename(owner_->fileName()) + '"',
+                   owner_->filePath());
        owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
 }
 
@@ -189,7 +191,8 @@ void RCS::checkOut()
 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));
@@ -200,7 +203,7 @@ void RCS::undoLast()
 {
        lyxerr[Debug::LYXVC] << "LyXVC: undoLast" << endl;
        doVCCommand("rcs -o" + version() + " \""
-                   + OnlyFilename(owner_->fileName()) + "\"",
+                   + OnlyFilename(owner_->fileName()) + '"',
                    owner_->filePath());
 }
 
@@ -208,7 +211,8 @@ void RCS::undoLast()
 void RCS::getLog(string const & tmpf)
 {
        doVCCommand("rlog \""
-                   + OnlyFilename(owner_->fileName()) + "\" > " + tmpf, owner_->filePath());
+                   + OnlyFilename(owner_->fileName()) + "\" > "
+                   + tmpf, owner_->filePath());
 }
 
 
@@ -227,7 +231,7 @@ string const CVS::find_file(string const & file)
        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
@@ -251,7 +255,7 @@ void CVS::scanMaster()
        // 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)) {
@@ -279,7 +283,7 @@ void CVS::scanMaster()
                        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;
@@ -298,7 +302,8 @@ void CVS::scanMaster()
 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));
 }
 
@@ -306,7 +311,7 @@ void CVS::registrer(string const & msg)
 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));
 }
@@ -325,7 +330,7 @@ void CVS::revert()
        // 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));