From f1ff990de782f1a4c3ae14902f5242bdb012b264 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Sat, 2 Aug 2003 11:30:30 +0000 Subject: [PATCH] Always use std::endl with lyxerr git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7481 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++ src/LColor.C | 6 +-- src/LyXAction.C | 6 +-- src/frontends/gnome/GView.C | 14 ++--- src/frontends/gnome/GnomeBase.C | 10 ++-- src/frontends/xforms/ChangeLog | 4 ++ src/frontends/xforms/FormDocument.C | 8 +-- src/funcrequest.C | 5 +- src/insets/ChangeLog | 10 ++-- src/insets/insetcollapsable.C | 6 +-- src/insets/insetgraphics.C | 10 ++-- src/insets/insettabular.C | 10 ++-- src/insets/insettext.C | 14 ++--- src/lyxlex_pimpl.C | 6 +-- src/lyxtextclasslist.C | 3 +- src/mathed/ChangeLog | 4 ++ src/mathed/formula.C | 17 +++--- src/mathed/formulabase.C | 32 ++++++------ src/mathed/math_charinset.C | 2 +- src/mathed/math_cursor.C | 40 +++++++-------- src/mathed/math_data.C | 5 +- src/mathed/math_diffinset.C | 9 ++-- src/mathed/math_exintinset.C | 7 +-- src/mathed/math_extern.C | 80 ++++++++++++++--------------- src/mathed/math_gridinset.C | 17 +++--- src/mathed/math_hullinset.C | 24 ++++----- src/mathed/math_inset.C | 21 ++++---- src/mathed/math_liminset.C | 9 ++-- src/mathed/math_macro.C | 10 ++-- src/mathed/math_macrotable.C | 15 +++--- src/mathed/math_macrotemplate.C | 7 ++- src/mathed/math_parboxinset.C | 7 ++- src/mathed/math_parser.C | 54 +++++++++---------- src/mathed/math_pos.C | 9 +++- src/mathed/math_scriptinset.C | 6 ++- src/mathed/math_support.C | 12 +++-- src/mathed/math_textinset.C | 17 +++--- src/mathed/math_xyarrowinset.C | 6 +-- src/mathed/ref_inset.C | 3 +- src/paragraph.C | 7 ++- src/text2.C | 10 ++-- src/text_funcs.C | 5 +- 42 files changed, 306 insertions(+), 245 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 40a5efaf8f..c6818a1b20 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-08-02 Lars Gullik Bjønnes + + * Always use std::endl with lyxerr + 2003-08-01 Lars Gullik Bjønnes * BufferView_pimpl.C: _Always_ use std::endl with lyxerr diff --git a/src/LColor.C b/src/LColor.C index 0ea92a1e12..a36d1a7d83 100644 --- a/src/LColor.C +++ b/src/LColor.C @@ -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); } diff --git a/src/LyXAction.C b/src/LyXAction.C index 89c883ed26..aa98a48ba2 100644 --- a/src/LyXAction.C +++ b/src/LyXAction.C @@ -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); diff --git a/src/frontends/gnome/GView.C b/src/frontends/gnome/GView.C index 57f72d7a1a..f7957d41a1 100644 --- a/src/frontends/gnome/GView.C +++ b/src/frontends/gnome/GView.C @@ -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(); } diff --git a/src/frontends/gnome/GnomeBase.C b/src/frontends/gnome/GnomeBase.C index dc328d9a68..fa108e7b3e 100644 --- a/src/frontends/gnome/GnomeBase.C +++ b/src/frontends/gnome/GnomeBase.C @@ -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(); } diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 40636a981c..be41cebac0 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2003-08-02 Lars Gullik Bjønnes + + * Always use std::endl with lyxerr + 2003-07-30 Martin Vermeer (with help from Juergen Spitzmueller) diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index 4799da4227..8690a0c6b3 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -669,19 +669,19 @@ bool FormDocument::class_apply(BufferParams ¶ms) 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; diff --git a/src/funcrequest.C b/src/funcrequest.C index 4eb9e3491b..e61eff285d 100644 --- a/src/funcrequest.C +++ b/src/funcrequest.C @@ -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; } diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index c6093d6b8b..fdc7c71fd7 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2003-08-02 Lars Gullik Bjønnes + + * Always use std::endl with lyxerr + 2003-08-01 Martin Vermeer * 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 * 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 - *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 @@ -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 diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index 5cb670318b..679622f408 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -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); } diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index c2b4a355f7..bf8efcff29 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -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 { diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index af9617732f..e4a1472241 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -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; } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 5ab4f3cee9..de9d275473 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -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())) { diff --git a/src/lyxlex_pimpl.C b/src/lyxlex_pimpl.C index 8ad57be9d0..d384bd8e3c 100644 --- a/src/lyxlex_pimpl.C +++ b/src/lyxlex_pimpl.C @@ -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); } } diff --git a/src/lyxtextclasslist.C b/src/lyxtextclasslist.C index c17bca534d..53ac19cb62 100644 --- a/src/lyxtextclasslist.C +++ b/src/lyxtextclasslist.C @@ -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 " diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 1083fb78ba..c6793d1566 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,7 @@ +2003-08-02 Lars Gullik Bjønnes + + * always use std::endl with lyxerr, and in some places. + 2003-07-25 Lars Gullik Bjønnes * rename Inset to InsetOld diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 2c6c4774dd..8d0d88accb 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -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 & res) const +void InsetFormula::getLabelList(vector & res) const { par()->getLabelList(res); } diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index b2dec5dbdf..1e51f0c447 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -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); } diff --git a/src/mathed/math_charinset.C b/src/mathed/math_charinset.C index de83de4271..2c02372832 100644 --- a/src/mathed/math_charinset.C +++ b/src/mathed/math_charinset.C @@ -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 } diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 8b16128444..a7ef9b09d2 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -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 diff --git a/src/mathed/math_data.C b/src/mathed/math_data.C index 5857e9d4c7..60d9833f4a 100644 --- a/src/mathed/math_data.C +++ b/src/mathed/math_data.C @@ -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; diff --git a/src/mathed/math_diffinset.C b/src/mathed/math_diffinset.C index e0838b89ef..9080dc8138 100644 --- a/src/mathed/math_diffinset.C +++ b/src/mathed/math_diffinset.C @@ -1,3 +1,5 @@ +#include + #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; } diff --git a/src/mathed/math_exintinset.C b/src/mathed/math_exintinset.C index d9f7a982a9..f044f51340 100644 --- a/src/mathed/math_exintinset.C +++ b/src/mathed/math_exintinset.C @@ -10,6 +10,7 @@ #include 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; } diff --git a/src/mathed/math_extern.C b/src/mathed/math_extern.C index a296dd1867..e0c386bc09 100644 --- a/src/mathed/math_extern.C +++ b/src/mathed/math_extern.C @@ -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 diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 35ce8c30c3..e80458db6b 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -1,3 +1,5 @@ +#include + #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) { diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 76b4a91845..5a076d3a9e 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -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(); diff --git a/src/mathed/math_inset.C b/src/mathed/math_inset.C index 675126d418..1a9b26d3e5 100644 --- a/src/mathed/math_inset.C +++ b/src/mathed/math_inset.C @@ -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 } diff --git a/src/mathed/math_liminset.C b/src/mathed/math_liminset.C index 24c85a28d2..353db5c403 100644 --- a/src/mathed/math_liminset.C +++ b/src/mathed/math_liminset.C @@ -1,3 +1,5 @@ +#include + #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; } diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index f1f6b034b6..486e29518e 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -14,6 +14,7 @@ * This code is under the GNU General Public Licence version 2 or later. */ +#include #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; } diff --git a/src/mathed/math_macrotable.C b/src/mathed/math_macrotable.C index 30c18023e1..250d42b7fc 100644 --- a/src/mathed/math_macrotable.C +++ b/src/mathed/math_macrotable.C @@ -1,8 +1,5 @@ #include -#include - - #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 + +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; } diff --git a/src/mathed/math_macrotemplate.C b/src/mathed/math_macrotemplate.C index 8ba89644f1..da2d4ff52f 100644 --- a/src/mathed/math_macrotemplate.C +++ b/src/mathed/math_macrotemplate.C @@ -1,3 +1,5 @@ +#include + #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 MathMacroTemplate::clone() const { - //lyxerr << "cloning MacroTemplate!\n"; + //lyxerr << "cloning MacroTemplate!" << endl; return auto_ptr(new MathMacroTemplate(*this)); } diff --git a/src/mathed/math_parboxinset.C b/src/mathed/math_parboxinset.C index 959be94e52..e98937b7f0 100644 --- a/src/mathed/math_parboxinset.C +++ b/src/mathed/math_parboxinset.C @@ -1,3 +1,5 @@ +#include + #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; } diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 219db10b65..e03d83dfe2 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -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; diff --git a/src/mathed/math_pos.C b/src/mathed/math_pos.C index 3caa88fd68..447e6fdf26 100644 --- a/src/mathed/math_pos.C +++ b/src/mathed/math_pos.C @@ -1,4 +1,5 @@ -#include "config.h" +#include + #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_) diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index 2efedd1724..bd054206ae 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -1,3 +1,5 @@ +#include + #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 << "{}"; } diff --git a/src/mathed/math_support.C b/src/mathed/math_support.C index b154339045..085479df10 100644 --- a/src/mathed/math_support.C +++ b/src/mathed/math_support.C @@ -18,6 +18,7 @@ #include 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; } } diff --git a/src/mathed/math_textinset.C b/src/mathed/math_textinset.C index 72fad20230..30dd96102b 100644 --- a/src/mathed/math_textinset.C +++ b/src/mathed/math_textinset.C @@ -1,8 +1,11 @@ +#include + #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_); diff --git a/src/mathed/math_xyarrowinset.C b/src/mathed/math_xyarrowinset.C index 2935ff3d62..50e80a2bff 100644 --- a/src/mathed/math_xyarrowinset.C +++ b/src/mathed/math_xyarrowinset.C @@ -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); diff --git a/src/mathed/ref_inset.C b/src/mathed/ref_inset.C index 58638c3afc..bb07534a3b 100644 --- a/src/mathed/ref_inset.C +++ b/src/mathed/ref_inset.C @@ -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; } diff --git a/src/paragraph.C b/src/paragraph.C index 8bb9c93b11..c5d0fa4a91 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -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; } diff --git a/src/text2.C b/src/text2.C index 08e68c958c..8f74f4fd18 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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(); diff --git a/src/text_funcs.C b/src/text_funcs.C index dc3f572785..e436df8327 100644 --- a/src/text_funcs.C +++ b/src/text_funcs.C @@ -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; -- 2.39.5