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;
}
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_) {
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);
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);
}
+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
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;
}
}
+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
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);
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);
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();
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;
{
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;
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;
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;
}
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;
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;
}