From: Vincent van Ravesteijn Date: Mon, 29 Mar 2010 15:29:26 +0000 (+0000) Subject: Refactorization: Buffer::changed() can update the metrics as well, so we don't have... X-Git-Tag: 2.0.0~3670 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6a9f44eaa2801632b4aebbb66ed6528cc1f30827;p=features.git Refactorization: Buffer::changed() can update the metrics as well, so we don't have to do it in scrollToCursor if we call Buffer::changed() anyway. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33909 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 6a1e25e692..c12e4c1a0a 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -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; } diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 0fa43708e1..52ae1e0410 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -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