- Fix sign error in Cursor::setSelection

- Add debugging input
- If cursor::dispatch does not handle the func, then it should not request an update
- Dump metrics cache after redraw


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15443 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Asger Ottar Alstrup 2006-10-21 11:29:34 +00:00
parent d12c1f4b22
commit 2c0d4b31ee
6 changed files with 11 additions and 5 deletions

View File

@ -1365,6 +1365,7 @@ void BufferView::updateMetrics(bool singlepar)
metrics_info_ = ViewMetricsInfo(pit1, pit2, y1, y2, singlepar, size);
if (lyxerr.debugging(Debug::WORKAREA)) {
lyxerr[Debug::WORKAREA] << "BufferView::updateMetrics" << endl;
coord_cache_.dump();
}
}

View File

@ -684,7 +684,7 @@ void replaceSelectionWithString(LCursor & cur, string const & str, bool backward
// select the replacement
if (backwards) {
selbeg.pos() += str.length();
cur.setSelection(selbeg, -str.length());
cur.setSelection(selbeg, -int(str.length()));
} else
cur.setSelection(selbeg, str.length());
}

View File

@ -296,6 +296,7 @@ void LCursor::dispatch(FuncRequest const & cmd0)
if (!disp_.dispatched()) {
lyxerr[Debug::DEBUG] << "RESTORING OLD CURSOR!" << endl;
operator=(safe);
disp_.update(false);
disp_.dispatched(false);
}
}
@ -477,7 +478,7 @@ void LCursor::setSelection()
}
void LCursor::setSelection(DocIterator const & where, size_t n)
void LCursor::setSelection(DocIterator const & where, int n)
{
setCursor(where);
selection() = true;

View File

@ -74,7 +74,7 @@ public:
///
void setSelection();
/// set selection at given position
void setSelection(DocIterator const & where, size_t n);
void setSelection(DocIterator const & where, int n);
///
void clearSelection();
/// access start of selection

View File

@ -96,7 +96,7 @@ void LyXView::setWorkArea(WorkArea * work_area)
void LyXView::redrawWorkArea()
{
lyxerr[Debug::WORKAREA] << "redrawWorkArea" << std::endl;
lyxerr[Debug::WORKAREA] << "LyXView::redrawWorkArea" << std::endl;
work_area_->redraw();
updateStatusBar();
}

View File

@ -223,9 +223,13 @@ void WorkArea::redraw()
expose(0, ymin, width(), ymax - ymin);
getPainter().end();
lyxerr[Debug::DEBUG]
lyxerr[Debug::WORKAREA]
<< " ymin = " << ymin << " width() = " << width()
<< " ymax-ymin = " << ymax-ymin << std::endl;
if (lyxerr.debugging(Debug::WORKAREA)) {
buffer_view_->coordCache().dump();
}
}