reduce some debug output

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10178 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2005-07-14 08:20:10 +00:00
parent 5020cae63f
commit 9abff568e6
7 changed files with 98 additions and 40 deletions

View 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);
}

View 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

View 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;
}
}

View 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

View 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);

View 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;

View 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;
}