]> git.lyx.org Git - features.git/commitdiff
- Fix sign error in Cursor::setSelection
authorAsger Ottar Alstrup <alstrup@lyx.org>
Sat, 21 Oct 2006 11:29:34 +0000 (11:29 +0000)
committerAsger Ottar Alstrup <alstrup@lyx.org>
Sat, 21 Oct 2006 11:29:34 +0000 (11:29 +0000)
- 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

src/BufferView.C
src/CutAndPaste.C
src/cursor.C
src/cursor.h
src/frontends/LyXView.C
src/frontends/WorkArea.C

index a448a86534cd91375f03ad40db31755749563a11..5b31f80b567bbca33edb3caaa838bf412b342ba2 100644 (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();
        }
 }
index 54595d67ec33375f2a57ebc8570b127602f9c745..bc9afbe980afb2b18f7ae7034cb49720b82ce296 100644 (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());
 }
index dbd108e6c112036d8fbf4de322325789190b5866..a6a357201f11a226e1b4e98955e1e6b63835c110 100644 (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;
index fce13c657377b83fb51bd3370acdbbc8ec0f91b0..e3b019c60066968486a14847c34cb8bafb9c8efa 100644 (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
index b27c02c2ec56dd301802142e9c4e6c2d8b5bf2f0..5f600ac88af2015a9cebace10cf5d04980e3be13 100644 (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();
 }
index 222fe48a7b761687f5816746c48f8554746df0ff..e581536ff9ef35dfbf3bca8e1ec20da9d8ed347c 100644 (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();
+       }
 }