if (!buffer_)
return false;
- lyxerr[Debug::WORKAREA] << "BufferView::update" << std::endl;
+ if (lyxerr.debugging(Debug::WORKAREA)) {
+ lyxerr[Debug::WORKAREA] << "BufferView::update" << std::endl;
+ }
// Update macro store
buffer_->buildMacros();
offset_ref_ = 0;
}
- lyxerr[Debug::GUI]
- << BOOST_CURRENT_FUNCTION
- << " Updating scrollbar: height: " << t.paragraphs().size()
- << " curr par: " << cursor_.bottom().pit()
- << " default height " << defaultRowHeight() << endl;
+ if (lyxerr.debugging(Debug::GUI)) {
+ lyxerr[Debug::GUI]
+ << BOOST_CURRENT_FUNCTION
+ << " Updating scrollbar: height: " << t.paragraphs().size()
+ << " curr par: " << cursor_.bottom().pit()
+ << " default height " << defaultRowHeight() << endl;
+ }
// It would be better to fix the scrollbar to understand
// values in [0..1] and divide everything by wh
ViewMetricsInfo const & vi = buffer_view_->viewMetricsInfo();
greyed_out_ = false;
- lyxerr[Debug::WORKAREA] << "WorkArea::redraw screen" << endl;
+ if (lyxerr.debugging(Debug::WORKAREA)) {
+ lyxerr[Debug::WORKAREA] << "WorkArea::redraw screen" << endl;
+ }
int const ymin = std::max(vi.y1, 0);
int const ymax = vi.p2 < vi.size - 1 ? vi.y2 : height();
bool tmp = refreshInside;
if (!in || !in->wide()) {
refreshInside = true;
- lyxerr[Debug::PAINTING] << endl << "Paint inset fully" << endl;
+ if (lyxerr.debugging(Debug::PAINTING)) {
+ lyxerr << endl << "Paint inset fully" << endl;
+ }
}
if (refreshInside)
inset->drawSelection(pi, int(x_), yo_);
// Instrumentation for testing row cache (see also
// 12 lines lower):
- if (text.isMainText(*pi.base.bv->buffer()))
- lyxerr[Debug::PAINTING] << "#";
- else
- lyxerr[Debug::PAINTING] << "[" <<
- repaintAll << row_has_changed <<
- cursor_on_row << "]";
+ if (lyxerr.debugging(Debug::PAINTING)) {
+ if (text.isMainText(*pi.base.bv->buffer()))
+ lyxerr[Debug::PAINTING] << "#";
+ else
+ lyxerr[Debug::PAINTING] << "[" <<
+ repaintAll << row_has_changed <<
+ cursor_on_row << "]";
+ }
rp.paintAppendix();
rp.paintDepthBar();
rp.paintChangeBar();
// Re-enable screen drawing for future use of the painter.
pi.pain.setDrawingEnabled(true);
- lyxerr[Debug::PAINTING] << "." << endl;
+ if (lyxerr.debugging(Debug::PAINTING)) {
+ lyxerr[Debug::PAINTING] << "." << endl;
+ }
}
} // namespace anon
if (!ptr_cmp(cur.text(), this))
return;
- lyxerr[Debug::DEBUG]
- << BOOST_CURRENT_FUNCTION
- << "draw selection at " << x
- << endl;
+ if (lyxerr.debugging(Debug::DEBUG)) {
+ lyxerr[Debug::DEBUG]
+ << BOOST_CURRENT_FUNCTION
+ << "draw selection at " << x
+ << endl;
+ }
DocIterator beg = cur.selectionBegin();
DocIterator end = cur.selectionEnd();
return;
}
- lyxerr[Debug::DEBUG] << " y1: " << y1 << " y2: " << y2
- << "X1:" << X1 << " x2: " << X2 << " wid: " << dim_.wid
- << endl;
+ if (lyxerr.debugging(Debug::DEBUG)) {
+ lyxerr[Debug::DEBUG] << " y1: " << y1 << " y2: " << y2
+ << "X1:" << X1 << " x2: " << X2 << " wid: " << dim_.wid
+ << endl;
+ }
// paint upper rectangle
pi.pain.fillRectangle(x + x1, y1, x2 - x1, y2 - y1,