]> git.lyx.org Git - features.git/commitdiff
Fix singlePar update. This should result in a nice speed improvment for Mac.
authorAbdelrazak Younes <younes@lyx.org>
Fri, 3 Nov 2006 10:32:30 +0000 (10:32 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 3 Nov 2006 10:32:30 +0000 (10:32 +0000)
* 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
src/frontends/LyXView.C
src/frontends/WorkArea.C
src/frontends/WorkArea.h
src/lyxfunc.C

index e8921925882cf3818dd9d997305e10d6fea58a49..0707dacf5fb3c96619e85b00d17901d72750ffaa 100644 (file)
@@ -119,7 +119,7 @@ public:
        bool hasParWithID(int id) const;
 
        /// This signal is emitted when the buffer is changed.
-       boost::signal<void()> changed;
+       boost::signal<void(bool)> changed;
        /// This signal is emitted when some parsing error shows up.
        boost::signal<void(std::string)> errors;
        /// This signal is emitted when some message shows up.
index 7d13fa5c8cc6f1fc55f6dc1338dd422774ef5490..b5ad7531031a15cd22c946ab752d033c98fcdc52 100644 (file)
@@ -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(
index debb9d852cb8650a1dda29124e02c760f04ca989..17fc8cfc386fa8464641680536ca76ecf723757d 100644 (file)
@@ -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();
 
index 2916a66760a0f0f544c55a3b83551f21cb64c73a..ec7f4ba5ff02f834c6604ecff5686b6539407332 100644 (file)
@@ -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();
        ///
index fec6dc59140c9a8bfec32ea7473d06eeb65b478c..ed16fc23ec3f7b8038401c67e794016e589e1bd8 100644 (file)
@@ -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();