]> git.lyx.org Git - features.git/commitdiff
reduce some debug output
authorLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 14 Jul 2005 08:20:10 +0000 (08:20 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 14 Jul 2005 08:20:10 +0000 (08:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10178 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/ChangeLog
src/factory.C
src/insets/ChangeLog
src/insets/insettext.C
src/text.C
src/text2.C

index 35ccdb24c50d9cd1c744c82d62f20b4ebe960b92..0d2d466a853235603a6543b2de55bbdadc2b4941 100644 (file)
@@ -596,7 +596,7 @@ bool BufferView::Pimpl::fitCursor()
                LyXFont const font = cursor_.getFont();
                int const asc = font_metrics::maxAscent(font);
                int const des = font_metrics::maxDescent(font);
-               Point p = bv_funcs::getPos(cursor_);
+               Point const p = bv_funcs::getPos(cursor_);
                if (p.y_ - asc >= 0 && p.y_ + des < workarea().workHeight())
                        return false;
        }
@@ -607,11 +607,12 @@ bool BufferView::Pimpl::fitCursor()
 
 void BufferView::Pimpl::update(Update::flags flags)
 {
-       lyxerr << BOOST_CURRENT_FUNCTION
-              << "[fitcursor = " << (flags & Update::FitCursor)
-              << ", forceupdate = " << (flags & Update::Force)
-              << ", singlepar = " << (flags & Update::SinglePar)
-              << "]  buffer: " << buffer_ << endl;
+       lyxerr[Debug::DEBUG]
+                << BOOST_CURRENT_FUNCTION
+                << "[fitcursor = " << (flags & Update::FitCursor)
+                << ", forceupdate = " << (flags & Update::Force)
+                << ", singlepar = " << (flags & Update::SinglePar)
+                << "]  buffer: " << buffer_ << endl;
 
        // Check needed to survive LyX startup
        if (buffer_) {
@@ -1289,11 +1290,12 @@ ViewMetricsInfo BufferView::Pimpl::metrics(bool singlepar)
        int pit2 = pit;
        size_t const npit = text->paragraphs().size();
 
-       lyxerr << BOOST_CURRENT_FUNCTION
-              << " npit: " << npit
-              << " pit1: " << pit1
-              << " pit2: " << pit2
-              << endl;
+       lyxerr[Debug::DEBUG]
+                << BOOST_CURRENT_FUNCTION
+                << " npit: " << npit
+                << " pit1: " << pit1
+                << " pit2: " << pit2
+                << endl;
 
        // Rebreak anchor par
        text->redoParagraph(pit);
@@ -1343,10 +1345,11 @@ ViewMetricsInfo BufferView::Pimpl::metrics(bool singlepar)
                y += text->getPar(pit).descent();
        }
 
-       lyxerr << BOOST_CURRENT_FUNCTION
-              << " y1: " << y1
-              << " y2: " << y2
-              << endl;
+       lyxerr[Debug::DEBUG]
+                << BOOST_CURRENT_FUNCTION
+                << " y1: " << y1
+                << " y2: " << y2
+                << endl;
 
        return ViewMetricsInfo(pit1, pit2, y1, y2, singlepar);
 }
index 736a50d3bbe24080c317cdf4ae869f6bbaf4fdb8..3ddfd73a3fd090fb4d2afa29713cbea54c733abf 100644 (file)
@@ -1,3 +1,9 @@
+2005-07-14  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * BufferView_pimpl.C (update): dampen some of the debug blabbering
+       * factory.C (readInset): ditto
+       * text.C, text2.C: ditto
+
 2005-06-21  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * buffer.C: format incremented to 242. There is no file format per
index 9b3258a59351e31c8699750d7f8949ac8ad1a471..272133df699f30572c58b365b9db799beb84f951 100644 (file)
@@ -477,7 +477,10 @@ InsetBase * readInset(LyXLex & lex, Buffer const & buf)
                                static_cast<MathMacroTemplate*>(inset.get());
                        MacroTable::globalMacros().insert
                                (tmpl->name(), tmpl->asMacroData());
-                       lyxerr << "creating local macro " << tmpl->name() << endl;
+                       lyxerr[Debug::DEBUG]
+                                << BOOST_CURRENT_FUNCTION
+                                << ": creating local macro " << tmpl->name()
+                                << endl;
                }
        }
 
index 2c5e1cada82b1a0579e63be5b357066dbe829136..f7371690d67cc3d96aa2aba87d6d9b9248fedab1 100644 (file)
@@ -1,3 +1,7 @@
+2005-07-14  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * insettext.C (doDispatch): reduce some debug blabbering
+
 2005-07-10  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
 
        * ExternalSupport.C (subst_path): adjust to latex_path changes and
index 854eedc9890385858377b81d7ee32c65e1356889..0b9f8cad59269163ca1c935af103df1c9a0c8743 100644 (file)
@@ -299,8 +299,11 @@ InsetBase * InsetText::editXY(LCursor & cur, int x, int y) const
 
 void InsetText::doDispatch(LCursor & cur, FuncRequest & cmd)
 {
-       lyxerr << BOOST_CURRENT_FUNCTION
-              << " [ cmd.action = " << cmd.action << ']' << endl;
+       lyxerr[Debug::DEBUG]
+                << BOOST_CURRENT_FUNCTION
+                << " [ cmd.action = " << cmd.action << ']'
+                << endl;
+        
        setViewCache(&cur.bv());
 
        text_.dispatch(cur, cmd);
index 517aa197781661f3c6e9d7aef4bb0ebd8f39309b..d43486d46089c3dd48654d2152b77bcd35e27298 100644 (file)
@@ -195,10 +195,14 @@ void readParToken(Buffer const & buf, Paragraph & par, LyXLex & lex,
                par.params().read(lex);
 
        } else if (token == "\\end_layout") {
-               lyxerr << "Solitary \\end_layout in line " << lex.getLineNo() << "\n"
+               lyxerr << BOOST_CURRENT_FUNCTION
+                       << ": Solitary \\end_layout in line "
+                       << lex.getLineNo() << "\n"
                       << "Missing \\begin_layout?.\n";
        } else if (token == "\\end_inset") {
-               lyxerr << "Solitary \\end_inset in line " << lex.getLineNo() << "\n"
+               lyxerr << BOOST_CURRENT_FUNCTION
+                       << ": Solitary \\end_inset in line "
+                       << lex.getLineNo() << "\n"
                       << "Missing \\begin_inset?.\n";
        } else if (token == "\\begin_inset") {
                InsetBase * inset = readInset(lex, buf);
@@ -779,7 +783,7 @@ void LyXText::setRowWidth(pit_type const pit, Row & row) const
        pos_type const end = row.endpos();
 
        Paragraph const & par = pars_[pit];
-       string labelsep = par.layout()->labelsep;
+       string const & labelsep = par.layout()->labelsep;
        int w = leftMargin(pit, row.pos());
 
        pos_type const body_pos = par.beginOfBody();
@@ -1832,7 +1836,10 @@ void LyXText::drawSelection(PainterInfo & pi, int x, int) const
        if (!ptr_cmp(cur.text(), this))
                return;
 
-       lyxerr << "draw selection at " << x << endl;
+       lyxerr[Debug::DEBUG]
+                << BOOST_CURRENT_FUNCTION
+                << "draw selection at " << x
+                << endl;
 
        // is there a better way of getting these two iterators?
        DocIterator beg = cur;
@@ -2269,8 +2276,12 @@ void LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
 {
        pit_type pit = getPitNearY(y);
        int yy = theCoords.get(this, pit).y_ - pars_[pit].ascent();
-       lyxerr << "setCursorFromCoordinates: x: " << x << " y: " << y
-               << " pit: " << pit << " yy: " << yy << endl;
+       lyxerr[Debug::DEBUG]
+                << BOOST_CURRENT_FUNCTION
+                << ": x: " << x
+                << " y: " << y
+               << " pit: " << pit
+                << " yy: " << yy << endl;
 
        Paragraph const & par = pars_[pit];
        int r = 0;
@@ -2284,8 +2295,11 @@ void LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
 
        Row const & row = par.rows()[r];
 
-       lyxerr << "setCursorFromCoordinates:  row " << r
-              << " from pos: " << row.pos() << endl;
+       lyxerr[Debug::DEBUG]
+                << BOOST_CURRENT_FUNCTION
+                << ": row " << r
+                << " from pos: " << row.pos()
+                << endl;
 
        bool bound = false;
        int xx = x;
index 7b51412d69a4f22cb796d5eb09fc8748e1cc73a6..f7fbeeaace3d491feb64460824edf68dda045c2a 100644 (file)
@@ -103,30 +103,45 @@ InsetBase * LyXText::checkInsetHit(int x, int y) const
 
        Paragraph const & par = pars_[pit];
 
-       lyxerr << "checkInsetHit: x: " << x << " y: " << y << endl;
-       lyxerr << "  pit: " << pit << endl;
+       lyxerr[Debug::DEBUG]
+                << BOOST_CURRENT_FUNCTION
+                << ": x: " << x
+                << " y: " << y
+                << "  pit: " << pit
+                << endl;
        InsetList::const_iterator iit = par.insetlist.begin();
        InsetList::const_iterator iend = par.insetlist.end();
        for (; iit != iend; ++iit) {
                InsetBase * inset = iit->inset;
 #if 1
-               lyxerr << "examining inset " << inset << endl;
+               lyxerr[Debug::DEBUG]
+                        << BOOST_CURRENT_FUNCTION
+                        << ": examining inset " << inset << endl;
+                
                if (theCoords.getInsets().has(inset))
-                       lyxerr
-                               << " xo: " << inset->xo() << "..."
+                       lyxerr[Debug::DEBUG]
+                                << BOOST_CURRENT_FUNCTION
+                               << ": xo: " << inset->xo() << "..."
                                << inset->xo() + inset->width()
                                << " yo: " << inset->yo() - inset->ascent()
                                << "..."
-                               << inset->yo() + inset->descent() << endl;
+                               << inset->yo() + inset->descent()
+                                << endl;
                else
-                       lyxerr << " inset has no cached position" << endl;
+                       lyxerr[Debug::DEBUG]
+                                << BOOST_CURRENT_FUNCTION
+                                << ": inset has no cached position" << endl;
 #endif
                if (inset->covers(x, y)) {
-                       lyxerr << "Hit inset: " << inset << endl;
+                       lyxerr[Debug::DEBUG]
+                                << BOOST_CURRENT_FUNCTION
+                                << ": Hit inset: " << inset << endl;
                        return inset;
                }
        }
-       lyxerr << "No inset hit. " << endl;
+       lyxerr[Debug::DEBUG]
+                << BOOST_CURRENT_FUNCTION
+                << ": No inset hit. " << endl;
        return 0;
 }
 
@@ -849,8 +864,10 @@ pit_type LyXText::getPitNearY(int y) const
        BOOST_ASSERT(!paragraphs().empty());
        BOOST_ASSERT(theCoords.getParPos().find(this) != theCoords.getParPos().end());
        CoordCache::InnerParPosCache const & cc = theCoords.getParPos().find(this)->second;
-       lyxerr << "LyXText::getPitNearY: y: " << y << " cache size: "
-               << cc.size() << endl;
+       lyxerr[Debug::DEBUG]
+                << BOOST_CURRENT_FUNCTION
+                << ": y: " << y << " cache size: " << cc.size()
+                << endl;
 
        // look for highest numbered paragraph with y coordinate less than given y
        pit_type pit = 0;
@@ -858,15 +875,23 @@ pit_type LyXText::getPitNearY(int y) const
        CoordCache::InnerParPosCache::const_iterator it = cc.begin();
        CoordCache::InnerParPosCache::const_iterator et = cc.end();
        for (; it != et; ++it) {
-               lyxerr << "  examining: pit: " << it->first << " y: "
-                       << it->second.y_ << endl;
+               lyxerr[Debug::DEBUG]
+                        << BOOST_CURRENT_FUNCTION
+                        << "  examining: pit: " << it->first
+                        << " y: " << it->second.y_
+                        << endl;
+                
                if (it->first >= pit && int(it->second.y_) - int(pars_[it->first].ascent()) <= y) {
                        pit = it->first;
                        yy = it->second.y_;
                }
        }
 
-       lyxerr << " found best y: " << yy << " for pit: " << pit << endl;
+       lyxerr[Debug::DEBUG]
+                << BOOST_CURRENT_FUNCTION
+                << ": found best y: " << yy << " for pit: " << pit
+                << endl;
+        
        return pit;
 }