]> git.lyx.org Git - lyx.git/commitdiff
Always use std::endl with lyxerr
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 2 Aug 2003 11:30:30 +0000 (11:30 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 2 Aug 2003 11:30:30 +0000 (11:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7481 a592a061-630c-0410-9148-cb99ea01b6c8

42 files changed:
src/ChangeLog
src/LColor.C
src/LyXAction.C
src/frontends/gnome/GView.C
src/frontends/gnome/GnomeBase.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormDocument.C
src/funcrequest.C
src/insets/ChangeLog
src/insets/insetcollapsable.C
src/insets/insetgraphics.C
src/insets/insettabular.C
src/insets/insettext.C
src/lyxlex_pimpl.C
src/lyxtextclasslist.C
src/mathed/ChangeLog
src/mathed/formula.C
src/mathed/formulabase.C
src/mathed/math_charinset.C
src/mathed/math_cursor.C
src/mathed/math_data.C
src/mathed/math_diffinset.C
src/mathed/math_exintinset.C
src/mathed/math_extern.C
src/mathed/math_gridinset.C
src/mathed/math_hullinset.C
src/mathed/math_inset.C
src/mathed/math_liminset.C
src/mathed/math_macro.C
src/mathed/math_macrotable.C
src/mathed/math_macrotemplate.C
src/mathed/math_parboxinset.C
src/mathed/math_parser.C
src/mathed/math_pos.C
src/mathed/math_scriptinset.C
src/mathed/math_support.C
src/mathed/math_textinset.C
src/mathed/math_xyarrowinset.C
src/mathed/ref_inset.C
src/paragraph.C
src/text2.C
src/text_funcs.C

index 40a5efaf8f194cb42076b8e90e9058d5634f7aa4..c6818a1b2014ec8eec4870ac53b4cd089d345e14 100644 (file)
@@ -1,3 +1,7 @@
+2003-08-02  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * Always use std::endl with lyxerr
+
 2003-08-01  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * BufferView_pimpl.C: _Always_ use std::endl with lyxerr
index 0ea92a1e12052691ead27d79b74317a9ca6ea450..a36d1a7d8328b82835e8f3b63366176957e4c722 100644 (file)
@@ -172,8 +172,8 @@ string const LColor::getX11Name(LColor::color c) const
                return ici->second.x11name;
 
        lyxerr << "LyX internal error: Missing color"
-               " entry in LColor.C for " << int(c) << '\n';
-       lyxerr << "Using black.\n";
+               " entry in LColor.C for " << int(c) << endl;
+       lyxerr << "Using black." << endl;
        return "black";
 }
 
@@ -203,7 +203,7 @@ void LColor::setColor(LColor::color col, string const & x11name)
                iti->second.x11name = x11name;
                return;
        }
-       lyxerr << "LyX internal error: color and such.\n";
+       lyxerr << "LyX internal error: color and such." << endl;
        Assert(false);
 }
 
index 89c883ed2691a5978e8739c85626ef62d41ea8f1..aa98a48ba228b015594cbbccfa0c9fdae3d211c8 100644 (file)
@@ -398,7 +398,7 @@ FuncRequest LyXAction::retrieveActionArg(int pseudo) const
        if (pit != lyx_pseudo_map.end()) {
                lyxerr[Debug::ACTION] << "Found the pseudoaction: ["
                                      << pit->second.action << '|'
-                                     << pit->second.argument << "]\n";
+                                     << pit->second.argument << "]" << endl;
                return pit->second;
        } else {
                lyxerr << "Lyx Error: Unrecognized pseudo-action "
@@ -417,8 +417,8 @@ int LyXAction::LookupFunc(string const & func)
        // split action and arg
        string actstr;
        string const argstr = split(func2, actstr, ' ');
-       lyxerr[Debug::ACTION] << "Action: " << actstr << '\n';
-       lyxerr[Debug::ACTION] << "Arg   : " << argstr << '\n';
+       lyxerr[Debug::ACTION] << "Action: " << actstr << '\n'
+                             << "Arg   : " << argstr << endl;
 
        func_map::const_iterator fit = lyx_func_map.find(actstr);
 
index 57f72d7a1a867878ca9ea1e04ac42094eeaa7054..f7957d41a1028abe95d5632c1fe6c9b7437784f9 100644 (file)
@@ -23,7 +23,7 @@ GView::GView(string const & name)
          updating_(false),
          file_(name + ".glade"),
          title_(name),
-         widget_name_(name), 
+         widget_name_(name),
          xml_(0),
          dialog_(0)
 {
@@ -48,11 +48,11 @@ void GView::loadXML()
        string const file = FileOpenSearch(path, file_, "glade");
 
        if (file.empty()) {
-               lyxerr << "Cannot find glade file. Aborting." << std::endl;
+               lyxerr << "Cannot find glade file. Aborting." << endl;
                lyx::Assert(true);
        }
 
-       lyxerr[Debug::GUI] << "Glade file to open is " << file << '\n';
+       lyxerr[Debug::GUI] << "Glade file to open is " << file << endl;
 
        xml_ = Gnome::Glade::Xml::create (file, widget_name_);
 }
@@ -77,25 +77,25 @@ bool GView::isValid()
 
 void GView::OKClicked()
 {
-       lyxerr[Debug::GUI] << "GView::OKClicked()\n";
+       lyxerr[Debug::GUI] << "GView::OKClicked()" << endl;
        getController().OKButton();
 }
 
 void GView::CancelClicked()
 {
-       lyxerr[Debug::GUI] << "GView::CancelClicked()\n";
+       lyxerr[Debug::GUI] << "GView::CancelClicked()" << endl;
        getController().CancelButton();
 }
 
 void GView::ApplyClicked()
 {
-       lyxerr[Debug::GUI] << "GView::ApplyClicked()\n";
+       lyxerr[Debug::GUI] << "GView::ApplyClicked()" << endl;
        getController().ApplyButton();
 }
 
 void GView::RestoreClicked()
 {
-       lyxerr[Debug::GUI] << "GView::RestoreClicked()\n";
+       lyxerr[Debug::GUI] << "GView::RestoreClicked()" << endl;
        getController().RestoreButton();
 }
 
index dc328d9a682ed7fbb84e50335fa0ac8a98517e9c..fa108e7b3e727d2a0111e499a449d4d0b2816971 100644 (file)
@@ -52,7 +52,7 @@ void GnomeBase::loadXML()
                lyx::Assert(true);
        }
 
-       lyxerr[Debug::GUI] << "Glade file to open is " << file << '\n';
+       lyxerr[Debug::GUI] << "Glade file to open is " << file << endl;
 
        xml_ = Gnome::Glade::Xml::create (file, widget_name_);
 }
@@ -77,25 +77,25 @@ bool GnomeBase::isValid()
 
 void GnomeBase::OKClicked()
 {
-       lyxerr[Debug::GUI] << "GnomeBase::OKClicked()\n";
+       lyxerr[Debug::GUI] << "GnomeBase::OKClicked()" << endl;
        getController().OKButton();
 }
 
 void GnomeBase::CancelClicked()
 {
-       lyxerr[Debug::GUI] << "GnomeBase::CancelClicked()\n";
+       lyxerr[Debug::GUI] << "GnomeBase::CancelClicked()" << endl;
        getController().CancelButton();
 }
 
 void GnomeBase::ApplyClicked()
 {
-       lyxerr[Debug::GUI] << "GnomeBase::ApplyClicked()\n";
+       lyxerr[Debug::GUI] << "GnomeBase::ApplyClicked()" << endl;
        getController().ApplyButton();
 }
 
 void GnomeBase::RestoreClicked()
 {
-       lyxerr[Debug::GUI] << "GnomeBase::RestoreClicked()\n";
+       lyxerr[Debug::GUI] << "GnomeBase::RestoreClicked()" << endl;
        getController().RestoreButton();
 }
 
index 40636a981cc7dc40c85a4e2e7977f1d4ab4dba4c..be41cebac0aebf5bea71de58fbd8a22d70085e89 100644 (file)
@@ -1,3 +1,7 @@
+2003-08-02  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * Always use std::endl with lyxerr
+
 2003-07-30  Martin Vermeer  <martin.vermeer@hut.fi>
 
        (with help from Juergen Spitzmueller)
index 4799da42273fa751e5e8f2d220a2963b063b6564..8690a0c6b3b553324c43ade846a11433be036d21 100644 (file)
@@ -669,19 +669,19 @@ bool FormDocument::class_apply(BufferParams &params)
        Spacing tmpSpacing = params.spacing;
        switch (fl_get_choice(class_->choice_spacing)) {
        case 1:
-               lyxerr[Debug::INFO] << "Spacing: SINGLE\n";
+               lyxerr[Debug::INFO] << "Spacing: SINGLE" << endl;
                params.spacing.set(Spacing::Single);
                break;
        case 2:
-               lyxerr[Debug::INFO] << "Spacing: ONEHALF\n";
+               lyxerr[Debug::INFO] << "Spacing: ONEHALF" << endl;
                params.spacing.set(Spacing::Onehalf);
                break;
        case 3:
-               lyxerr[Debug::INFO] << "Spacing: DOUBLE\n";
+               lyxerr[Debug::INFO] << "Spacing: DOUBLE" << endl;
                params.spacing.set(Spacing::Double);
                break;
        case 4:
-               lyxerr[Debug::INFO] << "Spacing: OTHER\n";
+               lyxerr[Debug::INFO] << "Spacing: OTHER" << endl;
                params.spacing.set(Spacing::Other,
                                   getString(class_->input_spacing));
                break;
index 4eb9e3491ba373632333954e3c68ba21e80f646c..e61eff285d2cbeaaf008cea59954d69f629a8a5d 100644 (file)
@@ -18,6 +18,7 @@
 
 using std::vector;
 using std::getline;
+using std::endl;
 
 
 FuncRequest::FuncRequest()
@@ -92,7 +93,7 @@ void FuncRequest::message(string const & msg) const
        if (view_)
                view_->owner()->getLyXFunc().setMessage(msg);
        else
-               lyxerr  << "Dropping message '" << msg << "'\n";
+               lyxerr  << "Dropping message '" << msg << "'" << endl;
 }
 
 
@@ -101,7 +102,7 @@ void FuncRequest::errorMessage(string const & msg) const
        if (view_)
                view_->owner()->getLyXFunc().setErrorMessage(msg);
        else
-               lyxerr  << "Dropping error message '" << msg << "'\n";
+               lyxerr  << "Dropping error message '" << msg << "'" << endl;
 }
 
 
index c6093d6b8b2e2c3022af4445944a94a0416f2e84..fdc7c71fd7d4b6f9630b167b066e120e02711736 100644 (file)
@@ -1,3 +1,7 @@
+2003-08-02  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * Always use std::endl with lyxerr
+
 2003-08-01     Martin Vermeer  <martin.vermeer@hut.fi>
 
        * insetnote.C: update \author list
@@ -53,7 +57,7 @@
 
        * insetert.C (write): \layout -> \begin_layout.
        Add missing \end_layout.
-       
+
 2003-07-28  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * insetquotes.C: document a bit the format
@@ -64,7 +68,7 @@
        * insetnote.C: Umpf. Hope I *now* get it right :-(
 
 2003-07-28  Martin Vermeer  <martin.vermeer@hut.fi>
-       *insetnote.C: did the right fix to greyedout: \color 
+       *insetnote.C: did the right fix to greyedout: \color
        instead of \textcolor.
 
 2003-07-28  Angus Leeming  <leeming@lyx.org>
@@ -72,7 +76,7 @@
        * insetbibtex.h: remove extraneous forward declaration.
 
        * insetbibitem.h:
-       * insetbibtex.h: Also remove long-dead Holder member class 
+       * insetbibtex.h: Also remove long-dead Holder member class
        and variable.
 
 2003-07-27  Martin Vermeer  <martin.vermeer@hut.fi>
index 5cb670318b39cd368fda74b1d3171a039aa1dfe9..679622f408ada71a3b20f8a8546134e4c3197a06 100644 (file)
@@ -126,7 +126,7 @@ int InsetCollapsable::height_collapsed() const
 
 void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       //lyxerr << "InsetCollapsable::metrics:  width: " << mi.base.textwidth << "\n";
+       //lyxerr << "InsetCollapsable::metrics:  width: " << mi.base.textwidth << endl;
        dimension_collapsed(dim);
        if (!collapsed_) {
                Dimension insetdim;
@@ -297,7 +297,7 @@ InsetOld::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd)
                        if (!cmd.argument.empty()) {
                                UpdatableInset::localDispatch(cmd);
                                if (collapsed_) {
-                                       lyxerr << "branch collapsed_\n";
+                                       lyxerr << "branch collapsed_" << endl;
                                        collapsed_ = false;
                                        if (bv->lockInset(this)) {
                                                inset.setUpdateStatus(InsetText::FULL);
@@ -307,7 +307,7 @@ InsetOld::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd)
                                                first_after_edit = true;
                                        }
                                } else {
-                                       lyxerr << "branch not collapsed_\n";
+                                       lyxerr << "branch not collapsed_" << endl;
                                        if (bv->lockInset(this))
                                                inset.localDispatch(cmd);
                                }
index c2b4a355f7e43ec987f3d1cdb60b42c8b5e72877..bf8efcff294cded635e7f4f2b75b0b6c33c92512 100644 (file)
@@ -117,7 +117,7 @@ string findTargetFormat(string const & suffix, LatexRunParams const & runparams)
 {
        // Are we using latex or pdflatex).
        if (runparams.flavor == LatexRunParams::PDFLATEX) {
-               lyxerr[Debug::GRAPHICS] << "findTargetFormat: PDF mode\n";
+               lyxerr[Debug::GRAPHICS] << "findTargetFormat: PDF mode" << endl;
                if (contains(suffix, "ps") || suffix == "pdf")
                        return "pdf";
                if (suffix == "jpg")    // pdflatex can use jpeg
@@ -125,7 +125,7 @@ string findTargetFormat(string const & suffix, LatexRunParams const & runparams)
                return "png";         // and also png
        }
        // If it's postscript, we always do eps.
-       lyxerr[Debug::GRAPHICS] << "findTargetFormat: PostScript mode\n";
+       lyxerr[Debug::GRAPHICS] << "findTargetFormat: PostScript mode" << endl;
        if (suffix != "ps")     // any other than ps
                return "eps";         // is changed to eps
        return suffix;          // let ps untouched
@@ -235,7 +235,7 @@ void InsetGraphics::read(Buffer const * buf, LyXLex & lex)
        if (token == "Graphics")
                readInsetGraphics(lex, buf->filePath());
        else
-               lyxerr[Debug::GRAPHICS] << "Not a Graphics inset!\n";
+               lyxerr[Debug::GRAPHICS] << "Not a Graphics inset!" << endl;
 
        graphic_->update(params().as_grfxParams());
 }
@@ -250,7 +250,7 @@ void InsetGraphics::readInsetGraphics(LyXLex & lex, string const & bufpath)
 
                string const token = lex.getString();
                lyxerr[Debug::GRAPHICS] << "Token: '" << token << '\''
-                                   << std::endl;
+                                   << endl;
 
                if (token.empty()) {
                        continue;
@@ -264,7 +264,7 @@ void InsetGraphics::readInsetGraphics(LyXLex & lex, string const & bufpath)
                                << "This document was created with a newer Graphics widget"
                                ", You should use a newer version of LyX to read this"
                                " file."
-                               << std::endl;
+                               << endl;
                        // TODO: Possibly open up a dialog?
                }
                else {
index af9617732f8949084d2c0eb24685b125d052fd9b..e4a14722416934cd2164349b216212246266d0e8 100644 (file)
@@ -258,7 +258,7 @@ void InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const
        //lyxerr << "InsetTabular::metrics: " << mi.base.bv << " width: " <<
        //      mi.base.textwidth << "\n";
        if (!mi.base.bv) {
-               lyxerr << "InsetTabular::metrics: need bv\n";
+               lyxerr << "InsetTabular::metrics: need bv" << endl;
                Assert(0);
        }
 
@@ -273,7 +273,7 @@ void InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetTabular::draw(PainterInfo & pi, int x, int y) const
 {
-       //lyxerr << "InsetTabular::draw: " << x << " " << y << "\n";
+       //lyxerr << "InsetTabular::draw: " << x << " " << y << endl;
 
        BufferView * bv = pi.base.bv;
 
@@ -429,7 +429,7 @@ void InsetTabular::insetUnlock(BufferView * bv)
 
 void InsetTabular::updateLocal(BufferView * bv, UpdateCodes what) const
 {
-       lyxerr << "InsetTabular::updateLocal: " << what << "\n";
+       lyxerr << "InsetTabular::updateLocal: " << what << endl;
        if (!locked && what == CELL)
                what = FULL;
        if (need_update < what) // only set this if it has greater update
@@ -2634,8 +2634,8 @@ bool InsetTabular::forceDefaultParagraphs(InsetOld const * in) const
        if (owner())
                return owner()->forceDefaultParagraphs(in);
 
-       // if we're here there is really something strange going on!!!
-       lyxerr << "if we're here there is really something strange going on!\n";
+       lyxerr << "If we're here there is really something strange going on!"
+              << endl;
        return false;
 }
 
index 5ab4f3cee96ef5bf2c9bf72fd3f74be820197fe1..de9d2754735a701c08cd658c4294af5bee58680a 100644 (file)
@@ -276,7 +276,7 @@ void InsetText::read(Buffer const * buf, LyXLex & lex)
 
 void InsetText::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       //lyxerr << "InsetText::metrics: width: " << mi.base.textwidth << "\n";
+       //lyxerr << "InsetText::metrics: width: " << mi.base.textwidth << endl;
 
        textwidth_ = mi.base.textwidth;
        BufferView * bv = mi.base.bv;
@@ -510,7 +510,7 @@ void InsetText::lockInset(BufferView * /*bv*/, UpdatableInset * inset)
 bool InsetText::lockInsetInInset(BufferView * bv, UpdatableInset * inset)
 {
        lyxerr[Debug::INSETS] << "InsetText::LockInsetInInset("
-                             << inset << "): ";
+                             << inset << "): " << endl;
        if (!inset)
                return false;
        if (!the_locking_inset) {
@@ -523,23 +523,23 @@ bool InsetText::lockInsetInInset(BufferView * bv, UpdatableInset * inset)
                        InsetList::iterator const end = pit->insetlist.end();
                        for (; it != end; ++it) {
                                if (it->inset == inset) {
-                                       lyxerr << "InsetText::lockInsetInInset: 1 a\n";
+                                       lyxerr << "InsetText::lockInsetInInset: 1 a" << endl;
                                        text_.setCursorIntern(pit, it->pos);
-                                       lyxerr << "InsetText::lockInsetInInset: 1 b\n";
-                                       lyxerr << "bv: " << bv << " inset: " << inset << "\n";
+                                       lyxerr << "InsetText::lockInsetInInset: 1 b" << endl;
+                                       lyxerr << "bv: " << bv << " inset: " << inset << endl;
                                        lockInset(bv, inset);
                                        lyxerr << "InsetText::lockInsetInInset: 1 c" << endl;
                                        return true;
                                }
                                if (it->inset->getInsetFromID(id)) {
-                                       lyxerr << "InsetText::lockInsetInInset: 2\n";
+                                       lyxerr << "InsetText::lockInsetInInset: 2" << endl;
                                        text_.setCursorIntern(pit, it->pos);
                                        it->inset->localDispatch(FuncRequest(bv, LFUN_INSET_EDIT));
                                        return the_locking_inset->lockInsetInInset(bv, inset);
                                }
                        }
                }
-               lyxerr << "InsetText::lockInsetInInset: 3\n";
+               lyxerr << "InsetText::lockInsetInInset: 3" << endl;
                return false;
        }
        if (inset == cpar()->getInset(cpos())) {
index 8ad57be9d0b9bf41e5cda4544278e75c4f450d4b..d384bd8e3c4ca8d9185b855fff2c7c2cda9aebf4 100644 (file)
@@ -58,7 +58,7 @@ void LyXLex::Pimpl::printError(string const & message) const
 
 void LyXLex::Pimpl::printTable(ostream & os)
 {
-       os << "\nNumber of tags: " << no_items << '\n';
+       os << "\nNumber of tags: " << no_items << endl;
        for (int i= 0; i < no_items; ++i)
                os << "table[" << i
                   << "]:  tag: `" << table[i].tag
@@ -75,11 +75,11 @@ void LyXLex::Pimpl::verifyTable()
                lyxerr << "The table passed to LyXLex is not sorted!\n"
                       << "Tell the developers to fix it!" << endl;
                // We sort it anyway to avoid problems.
-               lyxerr << "\nUnsorted:\n";
+               lyxerr << "\nUnsorted:" << endl;
                printTable(lyxerr);
 
                sort(table, table + no_items, compare_tags());
-               lyxerr << "\nSorted:\n";
+               lyxerr << "\nSorted:" << endl;
                printTable(lyxerr);
        }
 }
index c17bca534d3785d14a13097b593976f845323b74..53ac19cb62201afc09cb111d1da6d617a0168422 100644 (file)
@@ -161,10 +161,11 @@ bool LyXTextClassList::Read()
 // Global variable: textclass table.
 LyXTextClassList textclasslist;
 
+
 // Reads the style files
 void LyXSetStyle()
 {
-       lyxerr[Debug::TCLASS] << "LyXSetStyle: parsing configuration...\n";
+       lyxerr[Debug::TCLASS] << "LyXSetStyle: parsing configuration..." << endl;
 
        if (!textclasslist.Read()) {
                lyxerr[Debug::TCLASS] << "LyXSetStyle: an error occured "
index 1083fb78ba7069a69944f9acc96cde4c4a8e31a3..c6793d156662202e829c5d0890220f8ccdfcd5d7 100644 (file)
@@ -1,3 +1,7 @@
+2003-08-02  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * always use std::endl with lyxerr, and <config.h> in some places.
+
 2003-07-25  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * rename Inset to InsetOld
index 2c6c4774dd19ef9aa9b37c3f2b83bfa1269794e5..8d0d88accb430a36808b6b064a4003904cb236e0 100644 (file)
@@ -52,6 +52,7 @@
 using std::ostream;
 using std::vector;
 using std::auto_ptr;
+using std::endl;
 
 
 class InsetFormula::PreviewImpl : public lyx::graphics::PreviewedInset {
@@ -104,7 +105,7 @@ InsetFormula::InsetFormula(string const & data)
        if (!data.size())
                return;
        if (!mathed_parse_normal(par_, data))
-               lyxerr << "cannot interpret '" << data << "' as math\n";
+               lyxerr << "cannot interpret '" << data << "' as math" << endl;
 }
 
 
@@ -185,13 +186,13 @@ void InsetFormula::read(Buffer const *, LyXLex & lex)
        // remove extra 'mathrm' for chemistry stuff.
        // will be re-added on write
        if (par_->asHullInset()->getType() =="chemistry")  {
-               lyxerr << "this is chemistry\n";
+               lyxerr << "this is chemistry" << endl;
                if (par_->cell(0).size() == 1) {
-                       lyxerr << "this is size 1\n";
-           if (par_->cell(0)[0]->asFontInset()) {
-                               lyxerr << "this is a font inset \n";
-                               lyxerr << "replacing " << par_.nucleus()->cell(0) <<
-                                       " with " << par_->cell(0)[0]->cell(0) << "\n";
+                       lyxerr << "this is size 1" << endl;
+                       if (par_->cell(0)[0]->asFontInset()) {
+                               lyxerr << "this is a font inset "
+                                      << "replacing " << par_.nucleus()->cell(0) <<
+                                       " with " << par_->cell(0)[0]->cell(0) << endl;
                        }
                }
        }
@@ -245,7 +246,7 @@ void InsetFormula::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-void InsetFormula::getLabelList(std::vector<string> & res) const
+void InsetFormula::getLabelList(vector<string> & res) const
 {
        par()->getLabelList(res);
 }
index b2dec5dbdf28354f62db5e2373dbd67cbaf51e58..1e51f0c4470f1e31f4188f8eb72c7b1279e1fdab 100644 (file)
@@ -90,10 +90,10 @@ InsetFormulaBase::InsetFormulaBase()
 {
        // This is needed as long the math parser is not re-entrant
        initMath();
-       //lyxerr << "sizeof MathInset: " << sizeof(MathInset) << "\n";
-       //lyxerr << "sizeof MetricsInfo: " << sizeof(MetricsInfo) << "\n";
-       //lyxerr << "sizeof MathCharInset: " << sizeof(MathCharInset) << "\n";
-       //lyxerr << "sizeof LyXFont: " << sizeof(LyXFont) << "\n";
+       //lyxerr << "sizeof MathInset: " << sizeof(MathInset) << endl;
+       //lyxerr << "sizeof MetricsInfo: " << sizeof(MetricsInfo) << endl;
+       //lyxerr << "sizeof MathCharInset: " << sizeof(MathCharInset) << endl;
+       //lyxerr << "sizeof LyXFont: " << sizeof(LyXFont) << endl;
 }
 
 
@@ -331,9 +331,9 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd)
 
        switch (cmd.action) {
                case LFUN_INSET_EDIT:
-                       lyxerr << "Called EDIT with '" << cmd.argument << "'\n";
+                       lyxerr << "Called EDIT with '" << cmd.argument << "'" << endl;
                        if (!bv->lockInset(this))
-                               lyxerr << "Cannot lock math inset in edit call!\n";
+                               lyxerr << "Cannot lock math inset in edit call!" << endl;
                        releaseMathCursor(bv);
                        if (!cmd.argument.empty()) {
                                mathcursor = new MathCursor(this, cmd.argument == "left");
@@ -349,16 +349,16 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd)
                        return DISPATCHED;
 
                case LFUN_MOUSE_PRESS:
-                       //lyxerr << "Mouse single press\n";
+                       //lyxerr << "Mouse single press" << endl;
                        return lfunMousePress(cmd);
                case LFUN_MOUSE_MOTION:
-                       //lyxerr << "Mouse motion\n";
+                       //lyxerr << "Mouse motion" << endl;
                        return lfunMouseMotion(cmd);
                case LFUN_MOUSE_RELEASE:
-                       //lyxerr << "Mouse single release\n";
+                       //lyxerr << "Mouse single release" << endl;
                        return lfunMouseRelease(cmd);
                case LFUN_MOUSE_DOUBLE:
-                       //lyxerr << "Mouse double\n";
+                       //lyxerr << "Mouse double" << endl;
                        return localDispatch(FuncRequest(LFUN_WORDSEL));
                default:
                        break;
@@ -398,7 +398,7 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd)
                sel = true; // fall through...
        case LFUN_RIGHT:
                result = mathcursor->right(sel) ? DISPATCHED : FINISHED_RIGHT;
-               //lyxerr << "calling scroll 20\n";
+               //lyxerr << "calling scroll 20" << endl;
                //scroll(bv, 20);
                // write something to the minibuffer
                //bv->owner()->message(mathcursor->info());
@@ -495,7 +495,7 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd)
        //      dispatch_result = dispatch_buffer;
        //      break;
        case LFUN_SETXY: {
-               lyxerr << "LFUN_SETXY broken!\n";
+               lyxerr << "LFUN_SETXY broken!" << endl;
                int x = 0;
                int y = 0;
                istringstream is(cmd.argument.c_str());
@@ -607,7 +607,7 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd)
 
        case LFUN_MATH_DELIM:
        {
-               //lyxerr << "formulabase::LFUN_MATH_DELIM, arg: '" << arg << "'\n";
+               //lyxerr << "formulabase::LFUN_MATH_DELIM, arg: '" << arg << "'" << endl;
                string ls;
                string rs = split(cmd.argument, ls, ' ');
                // Reasonable default values
@@ -829,7 +829,7 @@ bool InsetFormulaBase::searchForward(BufferView * bv, string const & str,
        static string laststr;
 
        if (lastformula != this || laststr != str) {
-               //lyxerr << "reset lastformula to " << this << "\n";
+               //lyxerr << "reset lastformula to " << this << endl;
                lastformula = this;
                laststr = str;
                current = ibegin(par().nucleus());
@@ -858,7 +858,7 @@ bool InsetFormulaBase::searchForward(BufferView * bv, string const & str,
                }
        }
 
-       //lyxerr << "not found!\n";
+       //lyxerr << "not found!" << endl;
        lastformula = 0;
        return false;
 }
@@ -867,7 +867,7 @@ bool InsetFormulaBase::searchForward(BufferView * bv, string const & str,
 bool InsetFormulaBase::searchBackward(BufferView * bv, string const & what,
                                      bool a, bool b)
 {
-       lyxerr[Debug::MATHED] << "searching backward not implemented in mathed\n";
+       lyxerr[Debug::MATHED] << "searching backward not implemented in mathed" << endl;
        return searchForward(bv, what, a, b);
 }
 
index de83de427160720b73b37e85f19132cb5775bdf5..2c02372832a62f5c84714a6c6ea3a40cb2f5552e 100644 (file)
@@ -81,7 +81,7 @@ void MathCharInset::metrics(MetricsInfo & mi, Dimension & dim) const
        mathed_char_dim(font_, char_, dim_);
        if (isBinaryOp(char_, code_))
                width_ += 2 * font_metrics::width(' ', font_);
-       lyxerr << "MathCharInset::metrics: " << dim << "\n";
+       lyxerr << "MathCharInset::metrics: " << dim << endl;
 #endif
 }
 
index 8b16128444aac97ea92545b8abe38bb7c9cdb153..a7ef9b09d2a6ca9cd8f3527f15f04df624ab40c0 100644 (file)
@@ -88,7 +88,7 @@ void MathCursor::push(MathAtom & t)
 
 void MathCursor::pushLeft(MathAtom & t)
 {
-       //lyxerr << "Entering atom " << t << " left\n";
+       //lyxerr << "Entering atom " << t << " left" << endl;
        push(t);
        t->idxFirst(idx(), pos());
 }
@@ -96,7 +96,7 @@ void MathCursor::pushLeft(MathAtom & t)
 
 void MathCursor::pushRight(MathAtom & t)
 {
-       //lyxerr << "Entering atom " << t << " right\n";
+       //lyxerr << "Entering atom " << t << " right" << endl;
        posLeft();
        push(t);
        t->idxLast(idx(), pos());
@@ -105,7 +105,7 @@ void MathCursor::pushRight(MathAtom & t)
 
 bool MathCursor::popLeft()
 {
-       //lyxerr << "Leaving atom to the left\n";
+       //lyxerr << "Leaving atom to the left" << endl;
        if (depth() <= 1) {
                if (depth() == 1)
                        inset()->notifyCursorLeaves(idx());
@@ -119,7 +119,7 @@ bool MathCursor::popLeft()
 
 bool MathCursor::popRight()
 {
-       //lyxerr << "Leaving atom "; inset()->write(cerr, false); cerr << " right\n";
+       //lyxerr << "Leaving atom "; inset()->write(cerr, false); cerr << " right" << endl;
        if (depth() <= 1) {
                if (depth() == 1)
                        inset()->notifyCursorLeaves(idx());
@@ -328,14 +328,14 @@ void MathCursor::plainErase()
 
 void MathCursor::markInsert()
 {
-       //lyxerr << "inserting mark\n";
+       //lyxerr << "inserting mark" << endl;
        array().insert(pos(), MathAtom(new MathCharInset(0)));
 }
 
 
 void MathCursor::markErase()
 {
-       //lyxerr << "deleting mark\n";
+       //lyxerr << "deleting mark" << endl;
        array().erase(pos());
 }
 
@@ -358,7 +358,7 @@ void MathCursor::insert2(string const & str)
 
 void MathCursor::insert(string const & str)
 {
-       //lyxerr << "inserting '" << str << "'\n";
+       //lyxerr << "inserting '" << str << "'" << endl;
        selClearOrDel();
        for (string::const_iterator it = str.begin(); it != str.end(); ++it)
                plainInsert(MathAtom(new MathCharInset(*it)));
@@ -367,7 +367,7 @@ void MathCursor::insert(string const & str)
 
 void MathCursor::insert(char c)
 {
-       //lyxerr << "inserting '" << c << "'\n";
+       //lyxerr << "inserting '" << c << "'" << endl;
        selClearOrDel();
        plainInsert(MathAtom(new MathCharInset(c)));
 }
@@ -533,7 +533,7 @@ void MathCursor::macroModeClose()
        // prevent entering of recursive macros
        if (formula()->lyxCode() == InsetOld::MATHMACRO_CODE
                        && formula()->getInsetName() == name)
-               lyxerr << "can't enter recursive macro\n";
+               lyxerr << "can't enter recursive macro" << endl;
 
        niceInsert(createMathInset(name));
 }
@@ -869,12 +869,12 @@ MathArray & MathCursor::array() const
        static MathArray dummy;
 
        if (idx() >= inset()->nargs()) {
-               lyxerr << "############  idx_ " << idx() << " not valid\n";
+               lyxerr << "############  idx_ " << idx() << " not valid" << endl;
                return dummy;
        }
 
        if (depth() == 0) {
-               lyxerr << "############  depth() == 0 not valid\n";
+               lyxerr << "############  depth() == 0 not valid" << endl;
                return dummy;
        }
 
@@ -961,7 +961,7 @@ bool MathCursor::goUpDown(bool up)
                        push(nextAtom());
                        idx() = up; // the superscript has index 1
                        pos() = size();
-                       ///lyxerr << "updown: handled by scriptinset to the left\n";
+                       ///lyxerr << "updown: handled by scriptinset to the left" << endl;
                        return true;
                }
        }
@@ -973,7 +973,7 @@ bool MathCursor::goUpDown(bool up)
                        push(nextAtom());
                        idx() = up;
                        pos() = 0;
-                       ///lyxerr << "updown: handled by scriptinset to the right\n";
+                       ///lyxerr << "updown: handled by scriptinset to the right" << endl;
                        return true;
                }
        }
@@ -988,13 +988,13 @@ bool MathCursor::goUpDown(bool up)
        //else
        //      ylow = yo + 4;
        //if (bruteFind(xo, yo, xlow, xhigh, ylow, yhigh)) {
-       //      lyxerr << "updown: handled by brute find in the same cell\n";
+       //      lyxerr << "updown: handled by brute find in the same cell" << endl;
        //      return true;
        //}
 
        // try to find an inset that knows better then we
        while (1) {
-               ///lyxerr << "updown: We are in " << *inset() << " idx: " << idx() << '\n';
+               ///lyxerr << "updown: We are in " << *inset() << " idx: " << idx() << endl;
                // ask inset first
                if (inset()->idxUpDown(idx(), pos(), up, targetx_)) {
                        // try to find best position within this inset
@@ -1004,7 +1004,7 @@ bool MathCursor::goUpDown(bool up)
                }
 
                // no such inset found, just take something "above"
-               ///lyxerr << "updown: handled by strange case\n";
+               ///lyxerr << "updown: handled by strange case" << endl;
                if (!popLeft())
                        return
                                bruteFind(xo, yo,
@@ -1149,7 +1149,7 @@ bool MathCursor::script(bool up)
 
 bool MathCursor::interpret(char c)
 {
-       //lyxerr << "interpret 2: '" << c << "'\n";
+       //lyxerr << "interpret 2: '" << c << "'" << endl;
        targetx_ = -1; // "no target"
        if (inMacroArgMode()) {
                --pos();
@@ -1168,7 +1168,7 @@ bool MathCursor::interpret(char c)
        // handle macroMode
        if (inMacroMode()) {
                string name = macroName();
-               //lyxerr << "interpret name: '" << name << "'\n";
+               //lyxerr << "interpret name: '" << name << "'" << endl;
 
                if (isalpha(c)) {
                        activeMacro()->setName(activeMacro()->name() + c);
@@ -1221,7 +1221,7 @@ bool MathCursor::interpret(char c)
        selClearOrDel();
 
        if (c == '\\') {
-               //lyxerr << "starting with macro\n";
+               //lyxerr << "starting with macro" << endl;
                insert(MathAtom(new MathUnknownInset("\\", false)));
                return true;
        }
@@ -1405,7 +1405,7 @@ CursorPos MathCursor::normalAnchor() const
 {
        if (Anchor_.size() < depth()) {
                Anchor_ = Cursor_;
-               lyxerr << "unusual Anchor size\n";
+               lyxerr << "unusual Anchor size" << endl;
        }
        //lyx::Assert(Anchor_.size() >= cursor.depth());
        // use Anchor on the same level as Cursor
index 5857e9d4c78743a171a6b59f4e9899e7e478d88d..60d9833f4acc9a4b011169f873ac5e0004084875 100644 (file)
@@ -21,6 +21,7 @@ using namespace lyx::support;
 using std::max;
 using std::min;
 using std::abs;
+using std::endl;
 
 
 MathArray::MathArray()
@@ -144,7 +145,7 @@ void MathArray::replace(ReplaceData & rep)
        for (size_type i = 0; i < size(); ++i) {
                if (find1(rep.from, i)) {
                        // match found
-                       lyxerr << "match found!\n";
+                       lyxerr << "match found!" << endl;
                        erase(i, i + rep.from.size());
                        insert(i, rep.to);
                }
@@ -160,7 +161,7 @@ void MathArray::replace(ReplaceData & rep)
 
 bool MathArray::find1(MathArray const & ar, size_type pos) const
 {
-       //lyxerr << "finding '" << ar << "' in '" << *this << "'\n";
+       //lyxerr << "finding '" << ar << "' in '" << *this << "'" << endl;
        for (size_type i = 0, n = ar.size(); i < n; ++i)
                if (!operator[](pos + i)->match(ar[i]))
                        return false;
index e0838b89ef5c42d253bc4107964855444a022b6d..9080dc8138f9a198b69c3a76ad96800a424679a5 100644 (file)
@@ -1,3 +1,5 @@
+#include <config.h>
+
 #include "math_diffinset.h"
 #include "math_support.h"
 #include "math_mathmlstream.h"
@@ -5,6 +7,7 @@
 #include "debug.h"
 
 using std::auto_ptr;
+using std::endl;
 
 
 MathDiffInset::MathDiffInset()
@@ -35,13 +38,13 @@ void MathDiffInset::normalize(NormalStream & os) const
 
 void MathDiffInset::metrics(MetricsInfo &, Dimension &) const
 {
-       lyxerr << "should not happen\n";
+       lyxerr << "should not happen" << endl;
 }
 
 
 void MathDiffInset::draw(PainterInfo &, int, int) const
 {
-       lyxerr << "should not happen\n";
+       lyxerr << "should not happen" << endl;
 }
 
 
@@ -83,5 +86,5 @@ void MathDiffInset::mathmlize(MathMLStream & os) const
 
 void MathDiffInset::write(WriteStream &) const
 {
-       lyxerr << "should not happen\n";
+       lyxerr << "should not happen" << endl;
 }
index d9f7a982a971eedb5ddf4aacffab2c6c9aeb8573..f044f5134048cf6ca8d293d50963d9c00f778a8e 100644 (file)
@@ -10,6 +10,7 @@
 #include <boost/scoped_ptr.hpp>
 
 using std::auto_ptr;
+using std::endl;
 
 
 MathExIntInset::MathExIntInset(string const & name)
@@ -51,13 +52,13 @@ void MathExIntInset::normalize(NormalStream & os) const
 
 void MathExIntInset::metrics(MetricsInfo &, Dimension &) const
 {
-       lyxerr << "should not happen\n";
+       lyxerr << "should not happen" << endl;
 }
 
 
 void MathExIntInset::draw(PainterInfo &, int, int) const
 {
-       lyxerr << "should not happen\n";
+       lyxerr << "should not happen" << endl;
 }
 
 
@@ -127,5 +128,5 @@ void MathExIntInset::mathmlize(MathMLStream & os) const
 
 void MathExIntInset::write(WriteStream &) const
 {
-       lyxerr << "should not happen\n";
+       lyxerr << "should not happen" << endl;
 }
index a296dd1867311acd8b881f3d4ba111feac22e3b7..e0c386bc0902567977a3a39c7477a3adcb04fdfe 100644 (file)
@@ -130,7 +130,7 @@ string charSequence
 
 void extractStrings(MathArray & ar)
 {
-       //lyxerr << "\nStrings from: " << ar << "\n";
+       //lyxerr << "\nStrings from: " << ar << endl;
        for (MathArray::size_type i = 0; i < ar.size(); ++i) {
                if (!ar[i]->asCharInset())
                        continue;
@@ -138,13 +138,13 @@ void extractStrings(MathArray & ar)
                ar[i] = MathAtom(new MathStringInset(s));
                ar.erase(i + 1, i + s.size());
        }
-       //lyxerr << "\nStrings to: " << ar << "\n";
+       //lyxerr << "\nStrings to: " << ar << endl;
 }
 
 
 void extractMatrices(MathArray & ar)
 {
-       //lyxerr << "\nMatrices from: " << ar << "\n";
+       //lyxerr << "\nMatrices from: " << ar << endl;
        // first pass for explicitly delimited stuff
        for (MathArray::size_type i = 0; i < ar.size(); ++i) {
                if (!ar[i]->asDelimInset())
@@ -161,7 +161,7 @@ void extractMatrices(MathArray & ar)
        for (MathArray::size_type i = 0; i < ar.size(); ++i)
                if (ar[i]->asAMSArrayInset())
                        ar[i] = MathAtom(new MathMatrixInset(*(ar[i]->asGridInset())));
-       //lyxerr << "\nMatrices to: " << ar << "\n";
+       //lyxerr << "\nMatrices to: " << ar << endl;
 }
 
 
@@ -260,7 +260,7 @@ void replaceNested(
 
 void splitScripts(MathArray & ar)
 {
-       //lyxerr << "\nScripts from: " << ar << "\n";
+       //lyxerr << "\nScripts from: " << ar << endl;
        for (MathArray::size_type i = 0; i < ar.size(); ++i) {
                // is this script inset?
                if (!ar[i]->asScriptInset())
@@ -282,7 +282,7 @@ void splitScripts(MathArray & ar)
                ++i;
                ar.insert(i, MathAtom(q));
        }
-       //lyxerr << "\nScripts to: " << ar << "\n";
+       //lyxerr << "\nScripts to: " << ar << endl;
 }
 
 
@@ -292,7 +292,7 @@ void splitScripts(MathArray & ar)
 
 void extractExps(MathArray & ar)
 {
-       //lyxerr << "\nExps from: " << ar << "\n";
+       //lyxerr << "\nExps from: " << ar << endl;
        for (MathArray::size_type i = 0; i + 1 < ar.size(); ++i) {
                // is this 'e'?
                if (ar[i]->getChar() != 'e')
@@ -307,7 +307,7 @@ void extractExps(MathArray & ar)
                ar[i] = MathAtom(new MathExFuncInset("exp", sup->cell(1)));
                ar.erase(i + 1);
        }
-       //lyxerr << "\nExps to: " << ar << "\n";
+       //lyxerr << "\nExps to: " << ar << endl;
 }
 
 
@@ -316,7 +316,7 @@ void extractExps(MathArray & ar)
 //
 void extractDets(MathArray & ar)
 {
-       //lyxerr << "\ndet from: " << ar << "\n";
+       //lyxerr << "\ndet from: " << ar << endl;
        for (MathArray::iterator it = ar.begin(); it != ar.end(); ++it) {
                MathDelimInset const * del = (*it)->asDelimInset();
                if (!del)
@@ -325,7 +325,7 @@ void extractDets(MathArray & ar)
                        continue;
                *it = MathAtom(new MathExFuncInset("det", del->cell(0)));
        }
-       //lyxerr << "\ndet to: " << ar << "\n";
+       //lyxerr << "\ndet to: " << ar << endl;
 }
 
 
@@ -355,7 +355,7 @@ string digitSequence
 
 void extractNumbers(MathArray & ar)
 {
-       //lyxerr << "\nNumbers from: " << ar << "\n";
+       //lyxerr << "\nNumbers from: " << ar << endl;
        for (MathArray::size_type i = 0; i < ar.size(); ++i) {
                if (!ar[i]->asCharInset())
                        continue;
@@ -367,7 +367,7 @@ void extractNumbers(MathArray & ar)
                ar[i] = MathAtom(new MathNumberInset(s));
                ar.erase(i + 1, i + s.size());
        }
-       //lyxerr << "\nNumbers to: " << ar << "\n";
+       //lyxerr << "\nNumbers to: " << ar << endl;
 }
 
 
@@ -397,9 +397,9 @@ MathAtom replaceDelims(const MathArray & ar)
 // replace '('...')' sequences by a real MathDelimInset
 void extractDelims(MathArray & ar)
 {
-       //lyxerr << "\nDelims from: " << ar << "\n";
+       //lyxerr << "\nDelims from: " << ar << endl;
        replaceNested(ar, testOpenParan, testCloseParan, replaceDelims);
-       //lyxerr << "\nDelims to: " << ar << "\n";
+       //lyxerr << "\nDelims to: " << ar << endl;
 }
 
 
@@ -417,7 +417,7 @@ void extractFunctions(MathArray & ar)
        if (ar.size() < 2)
                return;
 
-       //lyxerr << "\nFunctions from: " << ar << "\n";
+       //lyxerr << "\nFunctions from: " << ar << endl;
        for (MathArray::size_type i = 0; i + 1 < ar.size(); ++i) {
                MathArray::iterator it = ar.begin() + i;
                MathArray::iterator jt = it + 1;
@@ -462,7 +462,7 @@ void extractFunctions(MathArray & ar)
 
                // re-insert exponent
                ar.insert(i + 1, exp);
-               //lyxerr << "\nFunctions to: " << ar << "\n";
+               //lyxerr << "\nFunctions to: " << ar << endl;
        }
 }
 
@@ -508,7 +508,7 @@ void extractIntegrals(MathArray & ar)
        if (ar.size() < 3)
                return;
 
-       //lyxerr << "\nIntegrals from: " << ar << "\n";
+       //lyxerr << "\nIntegrals from: " << ar << endl;
        for (MathArray::size_type i = 0; i + 1 < ar.size(); ++i) {
                MathArray::iterator it = ar.begin() + i;
 
@@ -541,7 +541,7 @@ void extractIntegrals(MathArray & ar)
                ar.erase(it + 1, tt);
                *it = MathAtom(p);
        }
-       //lyxerr << "\nIntegrals to: " << ar << "\n";
+       //lyxerr << "\nIntegrals to: " << ar << endl;
 }
 
 
@@ -580,7 +580,7 @@ void extractSums(MathArray & ar)
        if (ar.size() < 2)
                return;
 
-       //lyxerr << "\nSums from: " << ar << "\n";
+       //lyxerr << "\nSums from: " << ar << endl;
        for (MathArray::size_type i = 0; i + 1 < ar.size(); ++i) {
                MathArray::iterator it = ar.begin() + i;
 
@@ -620,7 +620,7 @@ void extractSums(MathArray & ar)
                ar.erase(it + 1, tt);
                *it = MathAtom(p);
        }
-       //lyxerr << "\nSums to: " << ar << "\n";
+       //lyxerr << "\nSums to: " << ar << endl;
 }
 
 
@@ -652,7 +652,7 @@ bool testDiffFrac(MathAtom const & at)
 
 void extractDiff(MathArray & ar)
 {
-       //lyxerr << "\nDiffs from: " << ar << "\n";
+       //lyxerr << "\nDiffs from: " << ar << endl;
        for (MathArray::size_type i = 0; i < ar.size(); ++i) {
                MathArray::iterator it = ar.begin() + i;
 
@@ -662,7 +662,7 @@ void extractDiff(MathArray & ar)
 
                MathFracInset const * f = (*it)->asFracInset();
                if (!f) {
-                       lyxerr << "should not happen\n";
+                       lyxerr << "should not happen" << endl;
                        continue;
                }
 
@@ -718,7 +718,7 @@ void extractDiff(MathArray & ar)
                ar.erase(it + 1, jt);
                *it = MathAtom(diff);
        }
-       //lyxerr << "\nDiffs to: " << ar << "\n";
+       //lyxerr << "\nDiffs to: " << ar << endl;
 }
 
 
@@ -742,7 +742,7 @@ void extractLims(MathArray & ar)
        if (ar.size() < 3)
                return;
 
-       //lyxerr << "\nLimits from: " << ar << "\n";
+       //lyxerr << "\nLimits from: " << ar << endl;
        for (MathArray::size_type i = 0; i + 2 < ar.size(); ++i) {
                MathArray::iterator it = ar.begin() + i;
 
@@ -775,7 +775,7 @@ void extractLims(MathArray & ar)
                // create a proper inset as replacement
                *it = MathAtom(new MathLimInset(f, x, x0));
        }
-       //lyxerr << "\nLimits to: " << ar << "\n";
+       //lyxerr << "\nLimits to: " << ar << endl;
 }
 
 
@@ -785,7 +785,7 @@ void extractLims(MathArray & ar)
 
 void extractStructure(MathArray & ar)
 {
-       //lyxerr << "\nStructure from: " << ar << "\n";
+       //lyxerr << "\nStructure from: " << ar << endl;
        extractIntegrals(ar);
        extractSums(ar);
        splitScripts(ar);
@@ -798,7 +798,7 @@ void extractStructure(MathArray & ar)
        extractExps(ar);
        extractLims(ar);
        extractStrings(ar);
-       //lyxerr << "\nStructure to: " << ar << "\n";
+       //lyxerr << "\nStructure to: " << ar << endl;
 }
 
 
@@ -937,7 +937,7 @@ namespace {
                        // 2x;
                        //  ^
                        //
-                       lyxerr << "checking expr: '" << expr << "'\n";
+                       lyxerr << "checking expr: '" << expr << "'" << endl;
                        string full = header + "tex(" + expr + ");";
                        out = captureOutput("maxima", full);
 
@@ -958,7 +958,7 @@ namespace {
                        getline(is, line);
                        getline(is, line);
                        string::size_type pos = line.find('^');
-                       lyxerr << "found caret at pos: '" << pos << "'\n";
+                       lyxerr << "found caret at pos: '" << pos << "'" << endl;
                        if (pos == string::npos || pos < 4)
                                break; // caret position not found
                        pos -= 4; // skip the "tex(" part
@@ -972,7 +972,7 @@ namespace {
                        return MathArray();
 
                out = subst(tmp[1],"\\>", "");
-               lyxerr << "out: '" << out << "'\n";
+               lyxerr << "out: '" << out << "'" << endl;
 
                // Ugly code that tries to make the result prettier
 
@@ -1048,8 +1048,8 @@ namespace {
                MapleStream ms(os);
                ms << ar;
                string expr = STRCONV(os.str());
-               lyxerr << "ar: '" << ar << "'\n";
-               lyxerr << "ms: '" << os.str() << "'\n";
+               lyxerr << "ar: '" << ar << "'\n"
+                      << "ms: '" << os.str() << "'" << endl;
 
                for (int i = 0; i < 100; ++i) { // at most 100 attempts
                        // try to fix missing '*' the hard way by using mint
@@ -1059,7 +1059,7 @@ namespace {
                        //                 ^ syntax error -
                        //                   Probably missing an operator such as * p
                        //
-                       lyxerr << "checking expr: '" << expr << "'\n";
+                       lyxerr << "checking expr: '" << expr << "'" << endl;
                        string out = captureOutput("mint -i 1 -S -s -q -q", expr + ';');
                        if (out.empty())
                                break; // expression syntax is ok
@@ -1098,8 +1098,8 @@ namespace {
                string expr = STRCONV(os.str());
                string out;
 
-               lyxerr << "pipe: ar: '" << ar << "'\n";
-               lyxerr << "pipe: expr: '" << expr << "'\n";
+               lyxerr << "pipe: ar: '" << ar << "'\n"
+                      << "pipe: expr: '" << expr << "'" << endl;
 
                for (int i = 0; i < 100; ++i) { // at most 100 attempts
                        //
@@ -1108,9 +1108,9 @@ namespace {
                        // >>> ([[1 2 3 ];[2 3 1 ];[3 1 2 ]])([[1 2 3 ];[2 3 1 ];[3 1 2 ]])
                        //                                   ^
                        //
-                       lyxerr << "checking expr: '" << expr << "'\n";
+                       lyxerr << "checking expr: '" << expr << "'" << endl;
                        out = captureOutput("octave -q 2>&1", expr);
-                       lyxerr << "checking out: '" << out << "'\n";
+                       lyxerr << "checking out: '" << out << "'" << endl;
 
                        // leave loop if expression syntax is probably ok
                        if (out.find("parse error:") == string::npos)
@@ -1121,7 +1121,7 @@ namespace {
                        string line;
                        while (is) {
                                getline(is, line);
-                               lyxerr << "skipping line: '" << line << "'\n";
+                               lyxerr << "skipping line: '" << line << "'" << endl;
                                if (line.find(">>> ") != string::npos)
                                        break;
                        }
@@ -1129,8 +1129,8 @@ namespace {
                        // found line with error, next line is the one with caret
                        getline(is, line);
                        string::size_type pos = line.find('^');
-                       lyxerr << "caret line: '" << line << "'\n";
-                       lyxerr << "found caret at pos: '" << pos << "'\n";
+                       lyxerr << "caret line: '" << line << "'" << endl;
+                       lyxerr << "found caret at pos: '" << pos << "'" << endl;
                        if (pos == string::npos || pos < 4)
                                break; // caret position not found
                        pos -= 4; // skip the ">>> " part
index 35ce8c30c3f9d9a1b0dcbddb19ba94009c0f4d71..e80458db6b63be2892a60af79ce2479ea6fb9536 100644 (file)
@@ -1,3 +1,5 @@
+#include <config.h>
+
 #include "math_gridinset.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
@@ -16,6 +18,7 @@ using std::min;
 using std::vector;
 using std::istream;
 using std::auto_ptr;
+using std::endl;
 
 
 class GridInsetMailer : public MailInset {
@@ -115,7 +118,7 @@ MathGridInset::MathGridInset(char v, string const & h)
        setDefaults();
        valign(v);
        halign(h);
-       //lyxerr << "created grid with " << ncols() << " columns\n";
+       //lyxerr << "created grid with " << ncols() << " columns" << endl;
 }
 
 
@@ -176,9 +179,9 @@ MathInset::idx_type MathGridInset::index(row_type row, col_type col) const
 void MathGridInset::setDefaults()
 {
        if (ncols() <= 0)
-               lyxerr << "positive number of columns expected\n";
+               lyxerr << "positive number of columns expected" << endl;
        //if (nrows() <= 0)
-       //      lyxerr << "positive number of rows expected\n";
+       //      lyxerr << "positive number of rows expected" << endl;
        for (col_type col = 0; col < ncols(); ++col) {
                colinfo_[col].align_ = defaultColAlign(col);
                colinfo_[col].skip_  = defaultColSpace(col);
@@ -200,7 +203,7 @@ void MathGridInset::halign(string const & hh)
                        ++col;
                        colinfo_[col].lines_ = 0;
                } else {
-                       lyxerr << "unknown column separator: '" << c << "'\n";
+                       lyxerr << "unknown column separator: '" << c << "'" << endl;
                }
        }
 
@@ -1078,7 +1081,7 @@ dispatch_result MathGridInset::dispatch
                }
 
                case LFUN_TABULAR_FEATURE: {
-                       //lyxerr << "handling tabular-feature " << cmd.argument << "\n";
+                       //lyxerr << "handling tabular-feature " << cmd.argument << endl;
                        istringstream is(STRCONV(cmd.argument));
                        string s;
                        is >> s;
@@ -1130,12 +1133,12 @@ dispatch_result MathGridInset::dispatch
                                swapCol(col(idx));
                        else
                                return UNDISPATCHED;
-                       lyxerr << "returning DISPATCHED_POP\n";
+                       lyxerr << "returning DISPATCHED_POP" << endl;
                        return DISPATCHED_POP;
                }
 
                case LFUN_PASTE: {
-                       //lyxerr << "pasting '" << cmd.argument << "'\n";
+                       //lyxerr << "pasting '" << cmd.argument << "'" << endl;
                        MathGridInset grid(1, 1);
                        mathed_parse_normal(grid, cmd.argument);
                        if (grid.nargs() == 1) {
index 76b4a91845c9f6d45ddcce9a252ff83f42b8e65d..5a076d3a9e43cdcc9d9a50aaf4e933eaab8cb6a3 100644 (file)
@@ -80,7 +80,7 @@ namespace {
                if (s == "multline")  return 8;
                if (s == "gather")    return 9;
                if (s == "flalign")   return 10;
-               lyxerr << "unknown hull type '" << s << "'\n";
+               lyxerr << "unknown hull type '" << s << "'" << endl;
                return 0;
        }
 
@@ -435,7 +435,7 @@ void MathHullInset::addCol(col_type col)
        if (colChangeOK())
                MathGridInset::addCol(col);
        else
-               lyxerr << "Can't change number of columns in '" << type_ << "'\n";
+               lyxerr << "Can't change number of columns in '" << type_ << "'" << endl;
 }
 
 
@@ -444,7 +444,7 @@ void MathHullInset::delCol(col_type col)
        if (colChangeOK())
                MathGridInset::delCol(col);
        else
-               lyxerr << "Can't change number of columns in '" << type_ << "'\n";
+               lyxerr << "Can't change number of columns in '" << type_ << "'" << endl;
 }
 
 
@@ -485,7 +485,7 @@ void MathHullInset::setType(string const & type)
 
 void MathHullInset::mutate(string const & newtype)
 {
-       //lyxerr << "mutating from '" << type_ << "' to '" << newtype << "'\n";
+       //lyxerr << "mutating from '" << type_ << "' to '" << newtype << "'" << endl;
 
        // we try to move along the chain
        // none <-> simple <-> equation <-> eqnarray
@@ -683,7 +683,7 @@ void MathHullInset::doExtern
        //if (selection()) {
        //      MathArray ar;
        //      selGet(ar);
-       //      lyxerr << "use selection: " << ar << "\n";
+       //      lyxerr << "use selection: " << ar << endl;
        //      insert(pipeThroughExtern(lang, extra, ar));
        //      return;
        //}
@@ -703,10 +703,10 @@ void MathHullInset::doExtern
                        asArray(mathcursor->grabAndEraseSelection(), ar);
                } else if (pos == cell(idx).size()) {
                        ar = cell(idx);
-                       lyxerr << "use whole cell: " << ar << "\n";
+                       lyxerr << "use whole cell: " << ar << endl;
                } else {
                        ar = MathArray(cell(idx).begin() + pos + 1, cell(idx).end());
-                       lyxerr << "use partial cell form pos: " << pos << "\n";
+                       lyxerr << "use partial cell form pos: " << pos << endl;
                }
                cell(idx).append(eq);
                cell(idx).append(pipeThroughExtern(lang, extra, ar));
@@ -715,10 +715,10 @@ void MathHullInset::doExtern
        }
 
        if (getType() == "equation") {
-               lyxerr << "use equation inset\n";
+               lyxerr << "use equation inset" << endl;
                mutate("eqnarray");
                MathArray & ar = cell(idx);
-               lyxerr << "use cell: " << ar << "\n";
+               lyxerr << "use cell: " << ar << endl;
                cell(idx + 1) = eq;
                cell(idx + 2) = pipeThroughExtern(lang, extra, ar);
                // move to end of line
@@ -728,12 +728,12 @@ void MathHullInset::doExtern
        }
 
        {
-               lyxerr << "use eqnarray\n";
+               lyxerr << "use eqnarray" << endl;
                idx -= idx % ncols();
                idx += 2;
                pos = 0;
                MathArray ar = cell(idx);
-               lyxerr << "use cell: " << ar << "\n";
+               lyxerr << "use cell: " << ar << endl;
 #ifdef WITH_WARNINGS
 #warning temporarily disabled
 #endif
@@ -761,7 +761,7 @@ dispatch_result MathHullInset::dispatch
                        return MathGridInset::dispatch(cmd, idx, pos);
 
                case LFUN_MATH_NUMBER:
-                       //lyxerr << "toggling all numbers\n";
+                       //lyxerr << "toggling all numbers" << endl;
                        if (display()) {
                                //recordUndo(bv, Undo::INSERT);
                                bool old = numberedType();
index 675126d418dd2e94535451991e1b165fafd5e1eb..1a9b26d3e5d3924af921f8105d1240eea70ff8fd 100644 (file)
@@ -29,6 +29,7 @@
 #include "formulabase.h"
 
 using std::ostream;
+using std::endl;
 
 
 BufferView * MathInset::view() const
@@ -47,14 +48,14 @@ MathArray dummyCell;
 
 MathArray & MathInset::cell(idx_type)
 {
-       lyxerr << "I don't have a cell 1\n";
+       lyxerr << "I don't have a cell 1" << endl;
        return dummyCell;
 }
 
 
 MathArray const & MathInset::cell(idx_type) const
 {
-       lyxerr << "I don't have a cell 2\n";
+       lyxerr << "I don't have a cell 2" << endl;
        return dummyCell;
 }
 
@@ -62,9 +63,9 @@ MathArray const & MathInset::cell(idx_type) const
 MathInset::idx_type MathInset::index(row_type row, col_type col) const
 {
        if (row != 0)
-               lyxerr << "illegal row: " << row << "\n";
+               lyxerr << "illegal row: " << row << endl;
        if (col != 0)
-               lyxerr << "illegal col: " << col << "\n";
+               lyxerr << "illegal col: " << col << endl;
        return 0;
 }
 
@@ -134,17 +135,17 @@ bool MathInset::idxEnd(idx_type &, pos_type &) const
 
 void MathInset::getPos(idx_type, pos_type, int & x, int & y) const
 {
-       lyxerr << "MathInset::getPos() called directly!\n";
+       lyxerr << "MathInset::getPos() called directly!" << endl;
        x = y = 0;
 }
 
 
 void MathInset::dump() const
 {
-       lyxerr << "---------------------------------------------\n";
+       lyxerr << "---------------------------------------------" << endl;
        WriteStream wi(lyxerr, false, true);
        write(wi);
-       lyxerr << "\n---------------------------------------------\n";
+       lyxerr << "\n---------------------------------------------" << endl;
 }
 
 
@@ -157,14 +158,14 @@ bool MathInset::idxBetween(idx_type idx, idx_type from, idx_type to) const
 void MathInset::drawSelection(PainterInfo &,
        idx_type, pos_type, idx_type, pos_type) const
 {
-       lyxerr << "MathInset::drawSelection() called directly!\n";
+       lyxerr << "MathInset::drawSelection() called directly!" << endl;
 }
 
 
 void MathInset::metricsT(TextMetricsInfo const &, Dimension &) const
 {
 #ifdef WITH_WARNINGS
-       lyxerr << "MathInset::metricsT(Text) called directly!\n";
+       lyxerr << "MathInset::metricsT(Text) called directly!" << endl;
 #endif
 }
 
@@ -172,7 +173,7 @@ void MathInset::metricsT(TextMetricsInfo const &, Dimension &) const
 void MathInset::drawT(TextPainter &, int, int) const
 {
 #ifdef WITH_WARNINGS
-       lyxerr << "MathInset::drawT(Text) called directly!\n";
+       lyxerr << "MathInset::drawT(Text) called directly!" << endl;
 #endif
 }
 
index 24c85a28d28845209f73305c802ab95cfc065b2d..353db5c4033b2cfbb5fd713d3746aef3252ee5de 100644 (file)
@@ -1,3 +1,5 @@
+#include <config.h>
+
 #include "math_liminset.h"
 #include "math_support.h"
 #include "math_mathmlstream.h"
@@ -5,6 +7,7 @@
 #include "debug.h"
 
 using std::auto_ptr;
+using std::endl;
 
 
 MathLimInset::MathLimInset
@@ -31,13 +34,13 @@ void MathLimInset::normalize(NormalStream & os) const
 
 void MathLimInset::metrics(MetricsInfo &, Dimension &) const
 {
-       lyxerr << "should not happen\n";
+       lyxerr << "should not happen" << endl;
 }
 
 
 void MathLimInset::draw(PainterInfo &, int, int) const
 {
-       lyxerr << "should not happen\n";
+       lyxerr << "should not happen" << endl;
 }
 
 
@@ -61,5 +64,5 @@ void MathLimInset::mathmlize(MathMLStream & os) const
 
 void MathLimInset::write(WriteStream &) const
 {
-       lyxerr << "should not happen\n";
+       lyxerr << "should not happen" << endl;
 }
index f1f6b034b666baeeb135b6ecb7c0a081b32eb118..486e29518ee04afa5b3b1455416bef73def71262 100644 (file)
@@ -14,6 +14,7 @@
  *  This code is under the GNU General Public Licence version 2 or later.
  */
 
+#include <config.h>
 
 #include "math_macro.h"
 #include "math_support.h"
@@ -30,6 +31,7 @@
 
 using std::max;
 using std::auto_ptr;
+using std::endl;
 
 
 MathMacro::MathMacro(string const & name)
@@ -151,12 +153,12 @@ void MathMacro::draw(PainterInfo & pi, int x, int y) const
 void MathMacro::dump() const
 {
        MathMacroTable::dump();
-       lyxerr << "\n macro: '" << this << "'\n";
-       lyxerr << " name: '" << name() << "'\n";
-       lyxerr << " template: '";
+       lyxerr << "\n macro: '" << this << "'\n"
+              << " name: '" << name() << "'\n"
+              << " template: '";
        WriteStream wi(lyxerr);
        tmplate_->write(wi);
-       lyxerr << "'\n";
+       lyxerr << "'" << endl;
 }
 
 
index 30c18023e1d2d44aaba47c63de0149a000fe317b..250d42b7fc5c46bab41fe82193cfbb68d2f37c06 100644 (file)
@@ -1,8 +1,5 @@
 #include <config.h>
 
-#include <iostream>
-
-
 #include "math_macrotable.h"
 #include "math_macro.h"
 #include "math_macrotemplate.h"
@@ -11,6 +8,10 @@
 #include "debug.h"
 #include "math_support.h" // math_font_available
 
+#include <iostream>
+
+using std::endl;
+
 
 MathMacroTable::table_type MathMacroTable::macro_table;
 
@@ -18,13 +19,13 @@ MathMacroTable::table_type MathMacroTable::macro_table;
 void MathMacroTable::dump()
 {
 /*
-       lyxerr << "\n------------------------------------------\n";
+       lyxerr << "\n------------------------------------------" << endl;
        table_type::const_iterator it;
        for (it = macro_table.begin(); it != macro_table.end(); ++it)
                lyxerr << it->first
                        << " [" << it->second->asMacroTemplate()->nargs() << "] : "
-                       << it->second->cell(0) << "\n";
-       lyxerr << "------------------------------------------\n";
+                       << it->second->cell(0) << endl;
+       lyxerr << "------------------------------------------" << endl;
 */
 }
 
@@ -34,7 +35,7 @@ MathAtom & MathMacroTable::provide(string const & name)
        table_type::iterator pos = macro_table.find(name);
        if (pos == macro_table.end()) {
                lyxerr << "MathMacroTable::provideTemplate: no template with name '"
-                      << name << "' available.\n";
+                      << name << "' available." << endl;
        }
        return pos->second;
 }
index 8ba89644f13345fca3f965b10fe6abc09d6eae2b..da2d4ff52f750797612392bbe76bf18e891c4e07 100644 (file)
@@ -1,3 +1,5 @@
+#include <config.h>
+
 #include "math_macrotemplate.h"
 #include "math_mathmlstream.h"
 #include "math_parser.h"
@@ -5,6 +7,7 @@
 #include "debug.h"
 
 using std::auto_ptr;
+using std::endl;
 
 
 MathMacroTemplate::MathMacroTemplate()
@@ -31,7 +34,7 @@ MathMacroTemplate::MathMacroTemplate(std::istream & is)
        MathArray ar;
        mathed_parse_cell(ar, is);
        if (ar.size() != 1 || !ar[0]->asMacroTemplate()) {
-               lyxerr << "cannot read macro from '" << ar << "'\n";
+               lyxerr << "cannot read macro from '" << ar << "'" << endl;
                return;
        }
        operator=( *(ar[0]->asMacroTemplate()) );
@@ -40,7 +43,7 @@ MathMacroTemplate::MathMacroTemplate(std::istream & is)
 
 auto_ptr<InsetBase> MathMacroTemplate::clone() const
 {
-       //lyxerr << "cloning MacroTemplate!\n";
+       //lyxerr << "cloning MacroTemplate!" << endl;
        return auto_ptr<InsetBase>(new MathMacroTemplate(*this));
 }
 
index 959be94e5271e33876efb15c3817ee8970f7b26e..e98937b7f00d8c4020dfff0b95f08154018f71e7 100644 (file)
@@ -1,3 +1,5 @@
+#include <config.h>
+
 #include "math_parboxinset.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
@@ -5,12 +7,13 @@
 #include "debug.h"
 
 using std::auto_ptr;
+using std::endl;
 
 
 MathParboxInset::MathParboxInset()
        : lyx_width_(0), tex_width_("0mm"), position_('c')
 {
-       lyxerr << "constructing MathParboxInset\n";
+       lyxerr << "constructing MathParboxInset" << endl;
 }
 
 
@@ -30,7 +33,7 @@ void MathParboxInset::setWidth(string const & w)
 {
        tex_width_ = w;
        lyx_width_ = LyXLength(w).inBP();
-       lyxerr << "setting " << w << " to " << lyx_width_ << " pixel\n";
+       lyxerr << "setting " << w << " to " << lyx_width_ << " pixel" << endl;
 }
 
 
index 219db10b656b57ea877597bae6f8b9d90457f125..e03d83dfe27b0563c01a15d30218b7be836fb47f 100644 (file)
@@ -84,7 +84,7 @@ namespace {
 
 MathInset::mode_type asMode(MathInset::mode_type oldmode, string const & str)
 {
-       //lyxerr << "handling mode: '" << str << "'\n";
+       //lyxerr << "handling mode: '" << str << "'" << endl;
        if (str == "mathmode")
                return MathInset::MATH_MODE;
        if (str == "textmode" || str == "forcetext")
@@ -329,7 +329,7 @@ Token const & Parser::nextToken() const
 Token const & Parser::getToken()
 {
        static const Token dummy;
-       //lyxerr << "looking at token " << tokens_[pos_] << " pos: " << pos_ << '\n';
+       //lyxerr << "looking at token " << tokens_[pos_] << " pos: " << pos_ << endl;
        return good() ? tokens_[pos_++] : dummy;
 }
 
@@ -384,7 +384,7 @@ void Parser::skipSpaceTokens(istream & is, char c)
        while (catcode(c) == catSpace || catcode(c) == catNewline)
                if (!is.get(c))
                        break;
-       //lyxerr << "putting back: " << c << "\n";
+       //lyxerr << "putting back: " << c << endl;
        is.putback(c);
 }
 
@@ -424,7 +424,7 @@ void Parser::tokenize(string const & buffer)
 
        char c;
        while (is.get(c)) {
-               //lyxerr << "reading c: " << c << "\n";
+               //lyxerr << "reading c: " << c << endl;
 
                switch (catcode(c)) {
                        case catNewline: {
@@ -474,7 +474,7 @@ void Parser::tokenize(string const & buffer)
                        }
 
                        case catIgnore: {
-                               lyxerr << "ignoring a char: " << int(c) << "\n";
+                               lyxerr << "ignoring a char: " << int(c) << endl;
                                break;
                        }
 
@@ -497,7 +497,7 @@ void Parser::dump() const
                        lyxerr << " <#> ";
                lyxerr << tokens_[i];
        }
-       lyxerr << " pos: " << pos_ << "\n";
+       lyxerr << " pos: " << pos_ << endl;
 }
 
 
@@ -600,18 +600,18 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                grid.asHullInset()->numbered(cellrow, numbered);
 
        //dump();
-       //lyxerr << " flags: " << flags << "\n";
-       //lyxerr << " mode: " << mode  << "\n";
+       //lyxerr << " flags: " << flags << endl;
+       //lyxerr << " mode: " << mode  << endl;
        //lyxerr << "grid: " << grid << endl;
 
        while (good()) {
                Token const & t = getToken();
 
 #ifdef FILEDEBUG
-               lyxerr << "t: " << t << " flags: " << flags << "\n";
-               lyxerr << "mode: " << mode  << "\n";
+               lyxerr << "t: " << t << " flags: " << flags << endl;
+               lyxerr << "mode: " << mode  << endl;
                cell->dump();
-               lyxerr << "\n";
+               lyxerr << endl;
 #endif
 
                if (flags & FLAG_ITEM) {
@@ -681,7 +681,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                        }
 
                        else {
-                               error("something strange in the parser\n");
+                               error("something strange in the parser");
                                break;
                        }
                }
@@ -728,9 +728,9 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
 
                else if (t.cat() == catAlign) {
                        ++cellcol;
-                       //lyxerr << " column now " << cellcol << " max: " << grid.ncols() << "\n";
+                       //lyxerr << " column now " << cellcol << " max: " << grid.ncols() << endl;
                        if (cellcol == grid.ncols()) {
-                               //lyxerr << "adding column " << cellcol << "\n";
+                               //lyxerr << "adding column " << cellcol << endl;
                                grid.addCol(cellcol - 1);
                        }
                        cell = &grid.cell(grid.index(cellrow, cellcol));
@@ -764,7 +764,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                }
 
                else if (t.character() == ']' && (flags & FLAG_BRACK_LAST)) {
-                       //lyxerr << "finished reading option\n";
+                       //lyxerr << "finished reading option" << endl;
                        return;
                }
 
@@ -810,19 +810,19 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                                        ++nargs;
                                }
                                nargs /= 2;
-                               //lyxerr << "read \\def parameter list '" << pars << "'\n";
+                               //lyxerr << "read \\def parameter list '" << pars << "'" << endl;
 
                        } else { // t.cs() == "newcommand" || t.cs() == "renewcommand"
 
                                if (getToken().cat() != catBegin) {
-                                       error("'{' in \\newcommand expected (1) \n");
+                                       error("'{' in \\newcommand expected (1) ");
                                        return;
                                }
 
                                name = getToken().cs();
 
                                if (getToken().cat() != catEnd) {
-                                       error("'}' in \\newcommand expected\n");
+                                       error("'}' in \\newcommand expected");
                                        return;
                                }
 
@@ -839,7 +839,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                        //MathArray test;
                        //test.push_back(createMathInset(name));
                        //if (ar1.contains(test)) {
-                       //      error("we cannot handle recursive macros at all.\n");
+                       //      error("we cannot handle recursive macros at all.");
                        //      return;
                        //}
 
@@ -908,13 +908,13 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                        parse(count, FLAG_ITEM, mode);
                        int cols = 1;
                        if (!extractNumber(count, cols)) {
-                               lyxerr << " can't extract number of cells from " << count << "\n";
+                               lyxerr << " can't extract number of cells from " << count << endl;
                        }
                        // resize the table if necessary
                        for (int i = 0; i < cols; ++i) {
                                ++cellcol;
                                if (cellcol == grid.ncols()) {
-                                       //lyxerr << "adding column " << cellcol << "\n";
+                                       //lyxerr << "adding column " << cellcol << endl;
                                        grid.addCol(cellcol - 1);
                                }
                                cell = &grid.cell(grid.index(cellrow, cellcol));
@@ -993,7 +993,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                else if (t.cs() == "right") {
                        if (flags & FLAG_RIGHT)
                                return;
-                       //lyxerr << "got so far: '" << cell << "'\n";
+                       //lyxerr << "got so far: '" << cell << "'" << endl;
                        error("Unmatched right delimiter");
                        return;
                }
@@ -1087,7 +1087,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
 
                        else {
                                dump();
-                               lyxerr << "found unknown math environment '" << name << "'\n";
+                               lyxerr << "found unknown math environment '" << name << "'" << endl;
                                // create generic environment inset
                                cell->push_back(MathAtom(new MathEnvInset(name)));
                                parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
@@ -1163,11 +1163,11 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                                p->up_ = nextToken().cat() == catSuper;
                                getToken();
                                parse(p->cell(1), FLAG_ITEM, mode);
-                               //lyxerr << "read label: " << p->cell(1) << "\n";
+                               //lyxerr << "read label: " << p->cell(1) << endl;
                        }
 
                        cell->push_back(MathAtom(p));
-                       //lyxerr << "read cell: " << cell << "\n";
+                       //lyxerr << "read cell: " << cell << endl;
                }
 #endif
 
@@ -1213,10 +1213,10 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                                MathAtom at = createMathInset(t.cs());
                                MathInset::mode_type m = mode;
                                //if (m == MathInset::UNDECIDED_MODE)
-                               //lyxerr << "default creation: m1: " << m << "\n";
+                               //lyxerr << "default creation: m1: " << m << endl;
                                if (at->currentMode() != MathInset::UNDECIDED_MODE)
                                        m = at->currentMode();
-                               //lyxerr << "default creation: m2: " << m << "\n";
+                               //lyxerr << "default creation: m2: " << m << endl;
                                MathInset::idx_type start = 0;
                                // this fails on \bigg[...\bigg]
                                //MathArray opt;
index 3caa88fd68ad697a3b9f9b43baae4189e37ea3e7..447e6fdf26aa8e8f12be469da5f005faeae77a1a 100644 (file)
@@ -1,4 +1,5 @@
-#include "config.h"
+#include <config.h>
+
 #include "math_pos.h"
 #include "math_inset.h"
 #include "debug.h"
@@ -7,6 +8,9 @@
 
 using namespace lyx::support;
 
+using std::endl;
+
+
 CursorPos::CursorPos()
        : inset_(0), idx_(0), pos_(0)
 {}
@@ -68,7 +72,8 @@ bool operator!=(CursorPos const & p, CursorPos const & q)
 bool operator<(CursorPos const & p, CursorPos const & q)
 {
        if (p.inset_ != q.inset_) {
-               lyxerr << "can't compare cursor and anchor in different insets\n";
+               lyxerr << "can't compare cursor and anchor in different insets"
+                      << endl;
                return true;
        }
        if (p.idx_ != q.idx_)
index 2efedd1724dda88315ca5a546e4546a9a3abe256..bd054206ae745b1b3486979b1794e925812581a4 100644 (file)
@@ -1,3 +1,5 @@
+#include <config.h>
+
 #include "math_scriptinset.h"
 #include "math_support.h"
 #include "math_symbolinset.h"
@@ -10,6 +12,7 @@ using namespace lyx::support;
 
 using std::max;
 using std::auto_ptr;
+using std::endl;
 
 
 MathScriptInset::MathScriptInset()
@@ -359,7 +362,8 @@ void MathScriptInset::write(WriteStream & os) const
                //}
        } else {
                if (os.firstitem())
-                       lyxerr[Debug::MATHED] << "suppressing {} when writing\n";
+                       lyxerr[Debug::MATHED] << "suppressing {} when writing"
+                                             << endl;
                else
                        os << "{}";
        }
index b154339045b8f96edbdb731274816e7ca535d038..085479df10532afa4ec7f94b6d0e1491827291ef 100644 (file)
@@ -18,6 +18,7 @@
 #include <map>
 
 using std::max;
+using std::endl;
 
 
 ///
@@ -407,8 +408,8 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
 
        deco_struct const * mds = search_deco(name);
        if (!mds) {
-               lyxerr << "Deco was not found. Programming error?\n";
-               lyxerr << "name: '" << name << "'\n";
+               lyxerr << "Deco was not found. Programming error?" << endl;
+               lyxerr << "name: '" << name << "'" << endl;
                return;
        }
 
@@ -608,11 +609,11 @@ fontinfo fontinfos[] = {
 
 fontinfo * lookupFont(string const & name)
 {
-       //lyxerr << "searching font '" << name << "'\n";
+       //lyxerr << "searching font '" << name << "'" << endl;
        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 << "'" << endl;
                        return fontinfos + i;
                }
        return 0;
@@ -652,7 +653,8 @@ void fakeFont(string const & orig, string const & fake)
                forig->shape_  = ffake->shape_;
                forig->color_  = ffake->color_;
        } else {
-               lyxerr << "Can't fake font '" << orig << "' with '" << fake << "'\n";
+               lyxerr << "Can't fake font '" << orig << "' with '"
+                      << fake << "'" << endl;
        }
 }
 
index 72fad202305d943305e20cc16a88c7576cc38737..30dd96102b0aaaf1b1b1ea56571a74ac49174a13 100644 (file)
@@ -1,8 +1,11 @@
+#include <config.h>
+
 #include "math_textinset.h"
 #include "metricsinfo.h"
 #include "debug.h"
 
 using std::auto_ptr;
+using std::endl;
 
 
 MathTextInset::MathTextInset()
@@ -21,7 +24,7 @@ MathInset::idx_type MathTextInset::pos2row(pos_type pos) const
        for (pos_type r = 0, n = cache_.nargs(); r < n; ++r)
                if (pos >= cache_.cellinfo_[r].begin_ && pos <= cache_.cellinfo_[r].end_)
                        return r;
-       lyxerr << "illegal row for pos " << pos << "\n";
+       lyxerr << "illegal row for pos " << pos << endl;
        return 0;
 }
 
@@ -89,7 +92,7 @@ void MathTextInset::metrics(MetricsInfo & mi, Dimension & dim) const
                // Special handling of spaces. We reached a safe position for breaking.
                char const c = cell(0)[i]->getChar();
                if (c == ' ') {
-                       //lyxerr << "reached safe pos\n";
+                       //lyxerr << "reached safe pos" << endl;
                        // we don't count the space into the safe pos
                        safe += curr;
                        // we reset to this safepos if the next chunk does not fit
@@ -109,7 +112,7 @@ void MathTextInset::metrics(MetricsInfo & mi, Dimension & dim) const
                }
 
                // We passed the limit. Create a row entry.
-               //lyxerr << "passed limit\n";
+               //lyxerr << "passed limit" << endl;
                cache_.appendRow();
                MathArray & ar = cache_.cell(cache_.nargs() - 1);
                MathGridInset::CellInfo & row = cache_.cellinfo_.back();
@@ -122,7 +125,7 @@ void MathTextInset::metrics(MetricsInfo & mi, Dimension & dim) const
                } else if (spaces) {
                        // but we had a space break before this position.
                        // so retreat to this position
-                       //lyxerr << "... but had safe pos.\n";
+                       //lyxerr << "... but had safe pos." << endl;
                        row.begin_ = begin;
                        row.end_   = safepos;  // this is position of the safe space
                        i          = safepos;  // i gets incremented at end of loop
@@ -131,13 +134,13 @@ void MathTextInset::metrics(MetricsInfo & mi, Dimension & dim) const
                } else {
                        // This item is too large and it is the only one.
                        // We have no choice but to produce an overfull box.
-                       lyxerr << "... without safe pos\n";
+                       lyxerr << "... without safe pos" << endl;
                        row.begin_ = begin;
                        row.end_   = i + 1;
                        begin      = i + 1;
                }
                ar = MathArray(cell(0).begin() + row.begin_, cell(0).begin() + row.end_);
-               //lyxerr << "line: " << ar << "\n";
+               //lyxerr << "line: " << ar << endl;
                // in any case, start the new row with empty boxes
                curr = 0;
                safe = 0;
@@ -149,7 +152,7 @@ void MathTextInset::metrics(MetricsInfo & mi, Dimension & dim) const
        row.begin_ = begin;
        row.end_   = cell(0).size();
        ar = MathArray(cell(0).begin() + row.begin_, cell(0).begin() + row.end_);
-       //lyxerr << "last line: " << ar.data() << "\n";
+       //lyxerr << "last line: " << ar.data() << endl;
 
        // what to report?
        cache_.metrics(mi, dim_);
index 2935ff3d6267380a13e47b4aedca5ed89c590d16..50e80a2bff5ebc7a306311f7229ea88782342516 100644 (file)
@@ -45,11 +45,11 @@ MathArray const & MathXYArrowInset::targetCell() const
                        case 'd': ++y; break;
                }
        }
-       //lyxerr << "target: x: " << x << " y: " << y << "\n";
+       //lyxerr << "target: x: " << x << " y: " << y << endl;
        MathInset::idx_type n = mi_.idx + p->ncols() * y + x;
        if (n >= p->nargs()) {
-               lyxerr << "source: n: " << mi_.idx << "\n";
-               lyxerr << "target: n: " << n << " out of range\n";
+               lyxerr << "source: n: " << mi_.idx << "\n"
+                      << "target: n: " << n << " out of range" << endl;
                n = 0;
        }
   return p->cell(n);
index 58638c3afcddc501a60a235ac5ba15371bf08d3c..bb07534a3b888046719715719ef6cf7bd5745a01 100644 (file)
@@ -16,6 +16,7 @@
 #include "support/LOstream.h"
 
 using std::auto_ptr;
+using std::endl;
 
 
 RefInset::RefInset()
@@ -46,7 +47,7 @@ RefInset::dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
        switch (cmd.action) {
                case LFUN_MOUSE_RELEASE:
                        if (cmd.button() == mouse_button::button3) {
-                               lyxerr << "trying to goto ref" << cell(0) << "\n";
+                               lyxerr << "trying to goto ref" << cell(0) << endl;
                                cmd.view()->dispatch(FuncRequest(LFUN_REF_GOTO, asString(cell(0))));
                                return DISPATCHED;
                        }
index 8bb9c93b115cee9315d599c31842ea35a7def631..c5d0fa4a919a87273f716ad1a629584da24b1197 100644 (file)
@@ -94,7 +94,9 @@ void Paragraph::operator=(Paragraph const & lp)
        // needed as we will destroy the pimpl_ before copying it
        if (&lp != this)
                return;
-       lyxerr << "Paragraph::operator=()\n";
+
+       lyxerr << "Paragraph::operator=()" << endl;
+
        delete pimpl_;
        pimpl_ = new Pimpl(*lp.pimpl_, this);
 
@@ -347,7 +349,8 @@ lyx::pos_type Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
                        return cit->pos();
 
        // This should not happen, but if so, we take no chances.
-       lyxerr << "Pararaph::getEndPosOfFontSpan: This should not happen!\n";
+       lyxerr << "Pararaph::getEndPosOfFontSpan: This should not happen!"
+              << endl;
        return pos;
 }
 
index 08e68c958c816463d1b7ee194bacdd0e521f0adb..8f74f4fd18fa2f5bc67260b696fd012558660e37 100644 (file)
@@ -684,7 +684,7 @@ void LyXText::redoParagraph(ParagraphList::iterator pit)
 
 void LyXText::fullRebreak()
 {
-       lyxerr << "fullRebreak\n";
+       lyxerr << "fullRebreak" << endl;
        redoParagraphs(ownerParagraphs().begin(), ownerParagraphs().end());
        setCursorIntern(cursor.par(), cursor.pos());
        selection.cursor = cursor;
@@ -693,7 +693,7 @@ void LyXText::fullRebreak()
 
 void LyXText::metrics(MetricsInfo & mi, Dimension & dim)
 {
-       //lyxerr << "LyXText::metrics: width: " << mi.base.textwidth << "\n";
+       //lyxerr << "LyXText::metrics: width: " << mi.base.textwidth << endl;
        //Assert(mi.base.textwidth);
 
        // rebuild row cache
@@ -713,7 +713,7 @@ void LyXText::metrics(MetricsInfo & mi, Dimension & dim)
                        Dimension dim;
                        MetricsInfo m = mi;
 #warning FIXME: pos != 0
-                       m.base.font = getFont(pit, 0); 
+                       m.base.font = getFont(pit, 0);
                        ii->inset->metrics(m, dim);
                }
 
@@ -726,11 +726,11 @@ void LyXText::metrics(MetricsInfo & mi, Dimension & dim)
        }
 
        // compute height
-       //lyxerr << "height 0: " << height << "\n";
+       //lyxerr << "height 0: " << height << endl;
        //for (RowList::iterator rit = rows().begin(); rit != rows().end(); ++rit) {
        //      height += rit->height();
        //}
-       //lyxerr << "height 1: " << height << "\n";
+       //lyxerr << "height 1: " << height << endl;
 
        // final dimension
        dim.asc = rows().begin()->ascent_of_text();
index dc3f572785b3a38531d57d109f89c1d46a405da3..e436df8327776cac0a0101a8e374b60ee866a613 100644 (file)
@@ -25,6 +25,8 @@
 using lyx::pos_type;
 using lyx::word_location;
 
+using std::endl;
+
 
 bool transposeChars(LyXCursor const & cursor)
 {
@@ -152,7 +154,8 @@ void getWord(LyXCursor & from, LyXCursor & to, word_location const loc,
                cursorLeftOneWord(from, pars);
                break;
        case lyx::NEXT_WORD:
-               lyxerr << "LyXText::getWord: NEXT_WORD not implemented yet\n";
+               lyxerr << "LyXText::getWord: NEXT_WORD not implemented yet"
+                      << endl;
                break;
        case lyx::PARTIAL_WORD:
                break;