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
This commit is contained in:
Abdelrazak Younes 2006-11-03 10:32:30 +00:00
parent 88fe6b36a9
commit 4416bb3609
5 changed files with 6 additions and 6 deletions

View 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.

View 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(

View 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();

View 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();
///

View 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();