Sorry... off to the summer cottage... other takers?

- Martin


On Fri, 2006-11-03 at 11:08 +0100, Abdelrazak Younes wrote:
> Martin Vermeer wrote:
> 
> > The culprit appears to be the statement
> > 
> >     view()->buffer()->changed()
> > 
> > in lyxfunc.C. This sends a signal LyXView to redraw the whole screen in
> > WorkArea. There is no way to specify anything less than a full screen. 
> > 
> > Unfortunately commenting out this line isn't good either: then not even
> > the current row gets updated (but it will be if you cover and expose
> > theLyX window...)
> > 
> > This should be redone somehow to do a current-paragraph update if
> > Update::SinglePar is set. Can you do that with signal-slot?
> 
> Here is a patch that does so. Please test and commit if it works.
> 
> Abdel.
> plain text document attachment (singlePar_update.patch)
> Index: buffer.h
> ===================================================================
> --- buffer.h  (revision 15694)
> +++ buffer.h  (working copy)
> @@ -119,7 +119,7 @@
>       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: frontends/LyXView.C
> ===================================================================
> --- frontends/LyXView.C       (revision 15694)
> +++ frontends/LyXView.C       (working copy)
> @@ -169,7 +169,7 @@
>  
>       bufferChangedConnection_ =
>               buf.changed.connect(
> -                     boost::bind(&WorkArea::redraw, work_area_));
> +                     boost::bind(&WorkArea::redraw, work_area_, _1));
>  
>       errorsConnection_ =
>               buf.errors.connect(
> Index: frontends/WorkArea.C
> ===================================================================
> --- frontends/WorkArea.C      (revision 15694)
> +++ frontends/WorkArea.C      (working copy)
> @@ -138,7 +138,7 @@
>  }
>  
> 
> -void WorkArea::redraw()
> +void WorkArea::redraw(bool singlePar)
>  {
>       if (!buffer_view_)
>               return;
> @@ -148,7 +148,7 @@
>               return;
>       }
>  
> -     buffer_view_->updateMetrics(false);
> +     buffer_view_->updateMetrics(singlePar);
>  
>       updateScrollbar();
>  
> Index: frontends/WorkArea.h
> ===================================================================
> --- frontends/WorkArea.h      (revision 15694)
> +++ frontends/WorkArea.h      (working copy)
> @@ -80,7 +80,7 @@
>       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: lyxfunc.C
> ===================================================================
> --- lyxfunc.C (revision 15694)
> +++ lyxfunc.C (working copy)
> @@ -1723,7 +1723,7 @@
>                               needSecondUpdate = view()->fitCursor();
>  
>                       if (needSecondUpdate || updateFlags != Update::None) {
> -                             view()->buffer()->changed();
> +                             view()->buffer()->changed(updateFlags & 
> Update::SinglePar);
>                       }
>                       lyx_view_->updateStatusBar();
>  

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to