]> git.lyx.org Git - features.git/commitdiff
Refactorization: Buffer::changed() can update the metrics as well, so we don't have...
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 29 Mar 2010 15:29:26 +0000 (15:29 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 29 Mar 2010 15:29:26 +0000 (15:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33909 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/frontends/qt4/GuiWorkArea.cpp

index 6a1e25e6922b19c2d0582b92cbeb308f0c54b25c..c12e4c1a0a3187f9c2261a9235b251c1e35f0e46 100644 (file)
@@ -816,7 +816,7 @@ void BufferView::showCursor()
 void BufferView::showCursor(DocIterator const & dit, bool recenter)
 {
        if (scrollToCursor(dit, recenter)) {
-               buffer_.changed(false);
+               buffer_.changed(true);
                updateHoveredInset();
        }
 }
@@ -824,8 +824,10 @@ void BufferView::showCursor(DocIterator const & dit, bool recenter)
 
 void BufferView::scrollToCursor()
 {
-       if (scrollToCursor(d->cursor_, false))
+       if (scrollToCursor(d->cursor_, false)) {
+               buffer_.changed(true);
                updateHoveredInset();
+       }
 }
 
 
@@ -873,11 +875,7 @@ bool BufferView::scrollToCursor(DocIterator const & dit, bool recenter)
                        scrolled = scrollDown(ypos - height_ + defaultRowHeight() ); 
 
                // else, nothing to do, the cursor is already visible so we just return.
-               if (scrolled != 0) {
-                       updateMetrics();
-                       return true;
-               }
-               return false;
+               return scrolled != 0;
        }
 
        // fix inline completion position
@@ -904,7 +902,6 @@ bool BufferView::scrollToCursor(DocIterator const & dit, bool recenter)
        else
                d->anchor_ypos_ = defaultRowHeight() * 2;
 
-       updateMetrics();
        return true;
 }
 
index 0fa43708e19bd0945b23e5c662b596e5e2c712f8..52ae1e0410001aa17ad1ccb1e9bfef810298bf8c 100644 (file)
@@ -533,7 +533,8 @@ void GuiWorkArea::resizeBufferView()
        buffer_view_->resize(viewport()->width(), viewport()->height());
        if (cursor_in_view)
                buffer_view_->scrollToCursor();
-       updateScreen();
+       else
+               updateScreen();
 
        // Update scrollbars which might have changed due different
        // BufferView dimension. This is especially important when the