From 4416bb3609c10970eabaace6a62830728e4790a9 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 3 Nov 2006 10:32:30 +0000 Subject: [PATCH] Fix singlePar update. This should result in a nice speed improvment for Mac. * buffer.h: changed() signal now emit a singlePar boolean. * WorkArea::redraw(): acknowledge singlePar changed() boolean * LyXView.C: adapt signal connection to changed() signal change. * lyxfunc.C: transmit the singlePar flag with the Buffer::changed() signal. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15702 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/buffer.h | 2 +- src/frontends/LyXView.C | 2 +- src/frontends/WorkArea.C | 4 ++-- src/frontends/WorkArea.h | 2 +- src/lyxfunc.C | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/buffer.h b/src/buffer.h index e892192588..0707dacf5f 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -119,7 +119,7 @@ public: bool hasParWithID(int id) const; /// This signal is emitted when the buffer is changed. - boost::signal changed; + boost::signal changed; /// This signal is emitted when some parsing error shows up. boost::signal errors; /// This signal is emitted when some message shows up. diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C index 7d13fa5c8c..b5ad753103 100644 --- a/src/frontends/LyXView.C +++ b/src/frontends/LyXView.C @@ -169,7 +169,7 @@ void LyXView::connectBuffer(Buffer & buf) bufferChangedConnection_ = buf.changed.connect( - boost::bind(&WorkArea::redraw, work_area_)); + boost::bind(&WorkArea::redraw, work_area_, _1)); errorsConnection_ = buf.errors.connect( diff --git a/src/frontends/WorkArea.C b/src/frontends/WorkArea.C index debb9d852c..17fc8cfc38 100644 --- a/src/frontends/WorkArea.C +++ b/src/frontends/WorkArea.C @@ -138,7 +138,7 @@ void WorkArea::checkAndGreyOut() } -void WorkArea::redraw() +void WorkArea::redraw(bool singlePar) { if (!buffer_view_) return; @@ -148,7 +148,7 @@ void WorkArea::redraw() return; } - buffer_view_->updateMetrics(false); + buffer_view_->updateMetrics(singlePar); updateScrollbar(); diff --git a/src/frontends/WorkArea.h b/src/frontends/WorkArea.h index 2916a66760..ec7f4ba5ff 100644 --- a/src/frontends/WorkArea.h +++ b/src/frontends/WorkArea.h @@ -80,7 +80,7 @@ public: virtual void setScrollbarParams(int height, int pos, int line_height) = 0; /// redraw the screen, without using existing pixmap - virtual void redraw(); + virtual void redraw(bool singlePar = false); /// void checkAndGreyOut(); /// diff --git a/src/lyxfunc.C b/src/lyxfunc.C index fec6dc5914..ed16fc23ec 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -1721,7 +1721,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) needSecondUpdate = view()->fitCursor(); if (needSecondUpdate || updateFlags != Update::None) { - view()->buffer()->changed(); + view()->buffer()->changed(updateFlags & Update::SinglePar); } lyx_view_->updateStatusBar(); -- 2.39.2