From: Michael Schmitt Date: Sun, 1 Apr 2007 14:51:13 +0000 (+0000) Subject: remove redundant lyxerr.debugging checks; macro LYXERR already checks whether the... X-Git-Tag: 1.6.10~10380 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ee47f918c2476098ac0db18e19a649714efa7f68;p=lyx.git remove redundant lyxerr.debugging checks; macro LYXERR already checks whether the output is actually needed git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17681 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/insetcommandparams.C b/src/insets/insetcommandparams.C index bd0c208ef2..713ad3c673 100644 --- a/src/insets/insetcommandparams.C +++ b/src/insets/insetcommandparams.C @@ -243,13 +243,12 @@ void InsetCommandParams::scanCommand(string const & cmd) if (!tsecoptions.empty()) setSecOptions(tsecoptions); if (!tcontents.empty()) setContents(tcontents); - if (lyxerr.debugging(Debug::PARSER)) - lyxerr << "Command <" << cmd - << "> == <" << to_utf8(getCommand()) - << "> == <" << getCmdName() - << '|' << getContents() - << '|' << getOptions() - << '|' << getSecOptions() << '>' << endl; + LYXERR(Debug::PARSER) << "Command <" << cmd + << "> == <" << to_utf8(getCommand()) + << "> == <" << getCmdName() + << '|' << getContents() + << '|' << getOptions() + << '|' << getSecOptions() << '>' << endl; } diff --git a/src/kbmap.C b/src/kbmap.C index fd6b898507..a9d1460c85 100644 --- a/src/kbmap.C +++ b/src/kbmap.C @@ -57,11 +57,9 @@ string const kb_keymap::printKeySym(LyXKeySym const & key, string::size_type kb_keymap::bind(string const & seq, FuncRequest const & func) { - if (lyxerr.debugging(Debug::KBMAP)) { - lyxerr << "BIND: Sequence `" - << seq << "' Action `" - << func.action << '\'' << endl; - } + LYXERR(Debug::KBMAP) << "BIND: Sequence `" + << seq << "' Action `" + << func.action << '\'' << endl; kb_sequence k(0, 0); diff --git a/src/lyx_main.C b/src/lyx_main.C index da1f557629..c22e4c14ba 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -923,9 +923,7 @@ bool LyX::init() return false; } - if (lyxerr.debugging(Debug::INIT)) { - lyxerr << "LyX tmp dir: `" << package().temp_dir() << '\'' << endl; - } + LYXERR(Debug::INIT) << "LyX tmp dir: `" << package().temp_dir() << '\'' << endl; LYXERR(Debug::INIT) << "Reading session information '.lyx/session'..." << endl; pimpl_->session_.reset(new Session(lyxrc.num_lastfiles)); diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 5b5c3f3912..33d3ef2cb4 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -324,13 +324,11 @@ void LyXFunc::processKeySym(LyXKeySymPtr keysym, key_modifier::state state) func = FuncRequest(LFUN_COMMAND_PREFIX); } - if (lyxerr.debugging(Debug::KEY)) { - lyxerr << BOOST_CURRENT_FUNCTION - << " Key [action=" - << func.action << "][" - << to_utf8(keyseq->print(false)) << ']' - << endl; - } + LYXERR(Debug::KEY) << BOOST_CURRENT_FUNCTION + << " Key [action=" + << func.action << "][" + << to_utf8(keyseq->print(false)) << ']' + << endl; // already here we know if it any point in going further // why not return already here if action == -1 and diff --git a/src/rowpainter.C b/src/rowpainter.C index ca35c85e31..af58063cc7 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -191,9 +191,7 @@ void RowPainter::paintInset(pos_type const pos, LyXFont const & font) bool tmp = refreshInside; if (!in || !in->wide()) { refreshInside = true; - if (lyxerr.debugging(Debug::PAINTING)) { - lyxerr << endl << "Paint inset fully" << endl; - } + LYXERR(Debug::PAINTING) << endl << "Paint inset fully" << endl; } if (refreshInside) inset->drawSelection(pi, int(x_), yo_); @@ -977,9 +975,7 @@ void paintPar // Re-enable screen drawing for future use of the painter. pi.pain.setDrawingEnabled(true); - if (lyxerr.debugging(Debug::PAINTING)) { - LYXERR(Debug::PAINTING) << "." << endl; - } + LYXERR(Debug::PAINTING) << "." << endl; } } // namespace anon diff --git a/src/text.C b/src/text.C index 6e3c35ce3e..80cf983ff3 100644 --- a/src/text.C +++ b/src/text.C @@ -1366,12 +1366,10 @@ void LyXText::drawSelection(PainterInfo & pi, int x, int) const if (!ptr_cmp(cur.text(), this)) return; - if (lyxerr.debugging(Debug::DEBUG)) { - LYXERR(Debug::DEBUG) - << BOOST_CURRENT_FUNCTION - << "draw selection at " << x - << endl; - } + LYXERR(Debug::DEBUG) + << BOOST_CURRENT_FUNCTION + << "draw selection at " << x + << endl; DocIterator beg = cur.selectionBegin(); DocIterator end = cur.selectionEnd();