From: Asger Ottar Alstrup Date: Sat, 21 Oct 2006 11:29:34 +0000 (+0000) Subject: - Fix sign error in Cursor::setSelection X-Git-Tag: 1.6.10~12279 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2c0d4b31ee7b27ba9273211d76c910d8420259f0;p=features.git - 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 --- diff --git a/src/BufferView.C b/src/BufferView.C index a448a86534..5b31f80b56 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -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(); } } diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index 54595d67ec..bc9afbe980 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -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()); } diff --git a/src/cursor.C b/src/cursor.C index dbd108e6c1..a6a357201f 100644 --- a/src/cursor.C +++ b/src/cursor.C @@ -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; diff --git a/src/cursor.h b/src/cursor.h index fce13c6573..e3b019c600 100644 --- a/src/cursor.h +++ b/src/cursor.h @@ -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 diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C index b27c02c2ec..5f600ac88a 100644 --- a/src/frontends/LyXView.C +++ b/src/frontends/LyXView.C @@ -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(); } diff --git a/src/frontends/WorkArea.C b/src/frontends/WorkArea.C index 222fe48a7b..e581536ff9 100644 --- a/src/frontends/WorkArea.C +++ b/src/frontends/WorkArea.C @@ -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(); + } }