Andre Poenitz wrote:

> Yes. I saw this mail too late. It seems to be simpler and faster.

Third shot.

This introduces a dumb NullPainter : public Painter which does nothing. The
NullPainter has infinite paperHeight, this means we can leave alone the
optimization of not drawing out-of-screen, which of course will only work
for the real painter.

I've declared virtual all remaining non-virtual methods in rowPainter, so
they can be overloaded by noop functions.

Then it introduces a refreshPar function in rowpainter.C, which just does a
paintPars on the outer par but passing a NullPainter. Btw, not all drawing
method honored/forwarded the passed painter, some used to build another
Painter from the bv. With the patch they honour it.

I'm reasonably satisfied with performance: it shows a small slowdown wrt
current cvs only with really big paragraphs (several screens long), and of
course will get much better than cvs once we take out the extra update on
cursor movement.

>> I think this is too slow. But I will experiment a bit more and send a
>> patch soonish.
> 
> Please do so.

It was really too slow with big paragraphs.

Comments?

Alfredo

? ChangeLog-old
? PosIterator.C-save
? PosIterator.h-save
? bfri.C
? safe
? textcursor.C-save
? textcursor.h-save
? insets/insetcollapsable-save.C
? insets/insettext-save.C
? insets/safe
? mathed/safe
Index: BufferView.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.C,v
retrieving revision 1.249
diff -u -p -u -r1.249 BufferView.C
--- BufferView.C	3 Apr 2004 08:36:53 -0000	1.249
+++ BufferView.C	7 Apr 2004 08:44:01 -0000
@@ -379,23 +379,10 @@ void BufferView::setCursor(ParIterator c
 		par[i].inset().edit(cursor(), true);
 
 	cursor().setCursor(makeDocIterator(par, pos), false);
+	par.bottom().text()->redoParagraph(par.bottom().par());
 }
 
 
-/*
-if the fitCursor call refers to some point in never-explored-land, then we
-don't have y information in insets there, then we cannot even do an update
-to get it (because we need the y infomation for setting top_y first). So
-this is solved in putSelectionAt with:
-
-- setting top_y to the y of the outerPar (that has good info)
-- calling update
-- calling cursor().updatePos()
-- then call fitCursor()
-
-Ab.
-*/
-
 void BufferView::putSelectionAt(DocIterator const & cur,
 				int length, bool backwards)
 {
@@ -403,16 +390,8 @@ void BufferView::putSelectionAt(DocItera
 
 	cursor().clearSelection();
 
-	LyXText & text = *cur[0].text();
 	setCursor(par, cur.pos());
 
-	// hack for the chicken and egg problem
-	top_y(text.getPar(par.outerPar()).y);
-
-	update();
-	//text.setCursor(cursor(), cur.par(), cur.pos());
-	cursor().updatePos();
-
 	if (length) {
 		if (backwards) {
 			cursor().setSelection(cursor(), -length);
@@ -422,9 +401,6 @@ void BufferView::putSelectionAt(DocItera
 		} else
 			cursor().setSelection(cursor(), length);
 	}
-
-	fitCursor();
-	update();
 }
 
 
Index: BufferView_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.536
diff -u -p -u -r1.536 BufferView_pimpl.C
--- BufferView_pimpl.C	5 Apr 2004 09:36:16 -0000	1.536
+++ BufferView_pimpl.C	7 Apr 2004 08:44:02 -0000
@@ -44,6 +44,7 @@
 #include "paragraph_funcs.h"
 #include "ParagraphParameters.h"
 #include "pariterator.h"
+#include "rowpainter.h"
 #include "undo.h"
 #include "vspace.h"
 
@@ -66,6 +67,7 @@
 #include "support/globbing.h"
 #include "support/path_defines.h"
 #include "support/tostr.h"
+#include "support/types.h"
 
 #include <boost/bind.hpp>
 
@@ -358,6 +360,12 @@ void BufferView::Pimpl::setBuffer(Buffer
 
 bool BufferView::Pimpl::fitCursor()
 {
+	// to get the correct y cursor info
+	lyxerr << "BufferView::fitCursor" << std::endl;
+	lyx::par_type const pit = bv_->cursor().bottom().par();
+	bv_->text()->redoParagraph(pit);
+	refreshPar(*bv_, *bv_->text(), pit);
+
 	if (!screen().fitCursor(bv_))
 		return false;
 	updateScrollbar();
@@ -388,7 +396,6 @@ void BufferView::Pimpl::resizeCurrentBuf
 
 	text->init(bv_);
 	update();
-	bv_->cursor().updatePos();
 	fitCursor();
 
 	switchKeyMap();
@@ -896,14 +903,12 @@ bool BufferView::Pimpl::workAreaDispatch
 
 	// If the request was dispatched the temp cursor should have been
 	// in a way to be used as new 'real' cursor.
-	if (res.dispatched())
+	if (res.dispatched()) {
 		bv_->cursor() = cur;
-
-	// Redraw if requested or necessary.
-	if (res.update())
-		update();
-	if (fitCursor())
-		update();
+		// Redraw if requested or necessary.
+		if (fitCursor() || res.update())
+			update();
+	}
 
 	// see workAreaKeyPress
 	cursor_timeout.restart();
@@ -1092,7 +1097,6 @@ bool BufferView::Pimpl::dispatch(FuncReq
 #endif
 		while (lyx::find::findNextChange(bv_))
 			bv_->getLyXText()->rejectChange(bv_->cursor());
-		update();
 		break;
 	}
 
@@ -1106,7 +1110,6 @@ bool BufferView::Pimpl::dispatch(FuncReq
 
 	case LFUN_MARK_OFF:
 		cur.clearSelection();
-		update();
 		cur.resetAnchor();
 		cur.message(N_("Mark off"));
 		break;
@@ -1114,7 +1117,6 @@ bool BufferView::Pimpl::dispatch(FuncReq
 	case LFUN_MARK_ON:
 		cur.clearSelection();
 		cur.mark() = true;
-		update();
 		cur.resetAnchor();
 		cur.message(N_("Mark on"));
 		break;
@@ -1129,7 +1131,6 @@ bool BufferView::Pimpl::dispatch(FuncReq
 			cur.message(N_("Mark set"));
 		}
 		cur.resetAnchor();
-		update();
 		break;
 
 	case LFUN_CENTER:
Index: cursor.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v
retrieving revision 1.90
diff -u -p -u -r1.90 cursor.C
--- cursor.C	5 Apr 2004 16:44:09 -0000	1.90
+++ cursor.C	7 Apr 2004 08:44:03 -0000
@@ -84,8 +84,7 @@ void region(CursorSlice const & i1, Curs
 
 
 LCursor::LCursor(BufferView & bv)
-	: DocIterator(), bv_(&bv),
-	  anchor_(), cached_y_(0), x_target_(-1),
+	: DocIterator(), bv_(&bv), anchor_(), x_target_(-1),
 	  selection_(false), mark_(false)
 {}
 
@@ -95,7 +94,6 @@ void LCursor::reset(InsetBase & inset)
 	clear();
 	push_back(CursorSlice(inset));
 	anchor_ = DocIterator(inset);
-	cached_y_ = 0;
 	clearTargetX();
 	selection_ = false;
 	mark_ = false;
@@ -236,15 +234,6 @@ int LCursor::currentMode()
 }
 
 
-void LCursor::updatePos()
-{
-	BOOST_ASSERT(!empty());
-	if (size() > 1)
-		cached_y_ = bv().top_y() + back().inset().yo();
-		//cached_y_ = back().inset().yo();
-}
-
-
 void LCursor::getDim(int & asc, int & des) const
 {
 	if (inMathed()) {
@@ -270,16 +259,6 @@ void LCursor::getPos(int & x, int & y) c
 	y = 0;
 	if (!empty())
 		inset().getCursorPos(back(), x, y);
-	// getCursorPos gives _screen_ coordinates. We need to add
-	// top_y to get document coordinates. This is hidden in cached_y_.
-	//y += cached_y_ - inset().yo();
-	// The rest is non-obvious. The reason we have to have these
-	// extra computation is that the getCursorPos() calls rely
-	// on the inset's own knowledge of its screen position.
-	// If we scroll up or down in a big enough increment,
-	// inset->draw() is not called: this doesn't update
-	// inset.yo_, so getCursor() returns an old value.
-	// Ugly as you like.
 }
 
 
Index: cursor.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.h,v
retrieving revision 1.57
diff -u -p -u -r1.57 cursor.h
--- cursor.h	5 Apr 2004 16:44:10 -0000	1.57
+++ cursor.h	7 Apr 2004 08:44:03 -0000
@@ -148,8 +148,6 @@ public:
 	CursorSlice & anchor();
 	/// access to selection anchor
 	CursorSlice const & anchor() const;
-	/// cache the absolute coordinate from the top inset
-	void updatePos();
 	/// sets anchor to cursor position
 	void resetAnchor();
 	/// access to owning BufferView
@@ -186,8 +184,6 @@ public:
 	DispatchResult disp_;
 
 private:
-	///
-	int cached_y_;
 	/**
 	 * The target x position of the cursor. This is used for when
 	 * we have text like :
Index: lyxfunc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.610
diff -u -p -u -r1.610 lyxfunc.C
--- lyxfunc.C	5 Apr 2004 18:34:33 -0000	1.610
+++ lyxfunc.C	7 Apr 2004 08:44:05 -0000
@@ -1372,7 +1372,6 @@ void LyXFunc::dispatch(FuncRequest const
 		if (view()->available()) {
 			view()->fitCursor();
 			view()->update();
-			view()->cursor().updatePos();
 			// if we executed a mutating lfun, mark the buffer as dirty
 			if (getStatus(cmd).enabled()
 					&& !lyxaction.funcHasFlag(cmd.action, LyXAction::NoBuffer)
Index: metricsinfo.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/metricsinfo.C,v
retrieving revision 1.12
diff -u -p -u -r1.12 metricsinfo.C
--- metricsinfo.C	15 Dec 2003 09:17:04 -0000	1.12
+++ metricsinfo.C	7 Apr 2004 08:44:05 -0000
@@ -43,8 +43,8 @@ MetricsInfo::MetricsInfo(BufferView * bv
 
 
 
-PainterInfo::PainterInfo(BufferView * bv)
-	: pain(bv->painter())
+PainterInfo::PainterInfo(BufferView * bv, Painter & pa)
+	: pain(pa)
 {
 	base.bv = bv;
 }
Index: metricsinfo.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/metricsinfo.h,v
retrieving revision 1.10
diff -u -p -u -r1.10 metricsinfo.h
--- metricsinfo.h	6 Oct 2003 15:42:29 -0000	1.10
+++ metricsinfo.h	7 Apr 2004 08:44:05 -0000
@@ -76,7 +76,7 @@ struct MetricsInfo {
 //
 struct PainterInfo {
 	///
-	explicit PainterInfo(BufferView * bv);
+	PainterInfo(BufferView * bv, Painter & pain);
 	///
 	void draw(int x, int y, char c);
 
Index: rowpainter.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/rowpainter.C,v
retrieving revision 1.125
diff -u -p -u -r1.125 rowpainter.C
--- rowpainter.C	27 Mar 2004 01:18:47 -0000	1.125
+++ rowpainter.C	7 Apr 2004 08:44:06 -0000
@@ -32,6 +32,7 @@
 #include "vspace.h"
 
 #include "frontends/font_metrics.h"
+#include "frontends/nullpainter.h"
 #include "frontends/Painter.h"
 
 #include "insets/insettext.h"
@@ -57,7 +58,7 @@ namespace {
 class RowPainter {
 public:
 	/// initialise and run painter
-	RowPainter(BufferView const & bv, LyXText const & text,
+	RowPainter(BufferView const & bv, Painter & pain, LyXText const & text,
 		par_type pit, RowList::iterator rit, int xo, int yo);
 private:
 	// paint various parts
@@ -118,9 +119,10 @@ private:
 };
 
 
-RowPainter::RowPainter(BufferView const & bv, LyXText const & text,
-     par_type pit, RowList::iterator rit, int xo, int yo)
-	: bv_(bv), pain_(bv_.painter()), text_(text), pars_(text.paragraphs()),
+RowPainter::RowPainter(BufferView const & bv, Painter & pain,
+	LyXText const & text, par_type pit, RowList::iterator rit,
+	int xo, int yo)
+	: bv_(bv), pain_(pain), text_(text), pars_(text.paragraphs()),
 		rit_(rit), row_(*rit), pit_(pit), xo_(xo), yo_(yo), width_(text_.width())
 {
 	//lyxerr << "RowPainter: x: " << x_ << " xo: " << xo << " yo: " << yo
@@ -196,7 +198,7 @@ void RowPainter::paintInset(pos_type con
 {
 	InsetBase const * inset = pars_[pit_].getInset(pos);
 	BOOST_ASSERT(inset);
-	PainterInfo pi(const_cast<BufferView *>(&bv_));
+	PainterInfo pi(const_cast<BufferView *>(&bv_), pain_);
 	pi.base.font = getFont(pos);
 	inset->drawSelection(pi, int(x_), yo_ + row_.baseline());
 	inset->draw(pi, int(x_), yo_ + row_.baseline());
@@ -844,43 +846,55 @@ void RowPainter::paintText()
 }
 
 
-int paintPars(BufferView const & bv, LyXText const & text,
-	par_type pit, int xo, int yo, int y)
+int paintPars(BufferView const & bv, Painter & pain,
+	      LyXText const & text, par_type pit, par_type end)
 {
 	//lyxerr << "  paintRows: pit: " << &*pit << endl;
-	int const y2 = bv.painter().paperHeight();
-	y -= bv.top_y();
-
 	ParagraphList & pars = text.paragraphs();
-	for ( ; pit != par_type(pars.size()); ++pit) {
+
+	int y = pars[pit].y + text.yo_ - bv.top_y();
+	int const y2 = pain.paperHeight();
+
+	for (; pit != end; ++pit) {
 		RowList::iterator row = pars[pit].rows.begin();
 		RowList::iterator rend = pars[pit].rows.end();
 
 		for ( ; row != rend; ++row) {
-			RowPainter(bv, text, pit, row, xo, y + yo);
+			RowPainter(bv, pain, text, pit, row,
+				   text.xo_, y);
 			y += row->height();
+			if (y >= y2)
+				break;
 		}
-		if (yo + y >= y2)
-			break;
-	}
 
+	}
 	return y;
 }
 
+
 } // namespace anon
 
 
+void refreshPar(BufferView const & bv, LyXText const & text, par_type pit)
+{
+	
+	static NullPainter nop;
+	paintPars(bv, nop, text, pit, pit + 1);
+}
+
+
 int paintText(BufferView const & bv)
 {
-	par_type pit;
-	bv.text()->updateParPositions();
-	bv.text()->getRowNearY(bv.top_y(), pit);
+	par_type pit, end;
+	getParsInRange(bv.text()->paragraphs(), bv.top_y(),
+		       bv.top_y() + bv.workHeight(), pit, end);
 	//lyxerr << "top_y: " << bv.top_y() << " y: " << pit->y << endl;
-	return paintPars(bv, *bv.text(), pit, 0, 0, bv.text()->paragraphs()[pit].y);
+	return paintPars(bv, bv.painter(), *bv.text(), pit, end);
 }
 
 
-void paintTextInset(LyXText const & text, PainterInfo & pi, int xo, int yo)
+void paintTextInset(LyXText const & text, PainterInfo & pi,
+		    int /*xo*/, int /*yo*/)
 {
-	paintPars(*pi.base.bv, text, 0, xo, yo, 0);
+	paintPars(*pi.base.bv, pi.pain, text, 0, text.paragraphs().size());
 }
Index: rowpainter.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/rowpainter.h,v
retrieving revision 1.18
diff -u -p -u -r1.18 rowpainter.h
--- rowpainter.h	15 Dec 2003 11:36:13 -0000	1.18
+++ rowpainter.h	7 Apr 2004 08:44:06 -0000
@@ -13,12 +13,18 @@
 #ifndef ROWPAINTER_H
 #define ROWPAINTER_H
 
+#include "support/types.h"
+
 class LyXText;
 class BufferView;
 class PainterInfo;
 
 /// paint the rows of the main text, return last drawn y value
 int paintText(BufferView const & bv);
+
+/// refresh a par of the main text
+void refreshPar(BufferView const & bv, LyXText const & text,
+		lyx::par_type pit);
 
 /// paint the rows of a text inset
 void paintTextInset(LyXText const & text, PainterInfo & pi, int x, int y);
Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.244
diff -u -p -u -r1.244 text3.C
--- text3.C	5 Apr 2004 09:36:23 -0000	1.244
+++ text3.C	7 Apr 2004 08:44:07 -0000
@@ -1140,9 +1140,6 @@ void LyXText::dispatch(LCursor & cur, Fu
 		finishUndo();
 		cur.x_target() = cursorX(cur.top());
 
-		if (bv->fitCursor())
-			selection_possible = false;
-
 		// Insert primary selection with middle mouse
 		// if there is a local selection in the current buffer,
 		// insert this
Index: frontends/Makefile.am
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/Makefile.am,v
retrieving revision 1.58
diff -u -p -u -r1.58 Makefile.am
--- frontends/Makefile.am	5 Sep 2003 10:55:42 -0000	1.58
+++ frontends/Makefile.am	7 Apr 2004 08:44:07 -0000
@@ -35,5 +35,7 @@ libfrontends_la_SOURCES = \
 	key_state.h \
 	lyx_gui.h \
 	mouse_state.h \
+	nullpainter.C \
+	nullpainter.h \
 	screen.C \
 	screen.h
Index: frontends/Painter.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/Painter.h,v
retrieving revision 1.15
diff -u -p -u -r1.15 Painter.h
--- frontends/Painter.h	6 Oct 2003 15:42:44 -0000	1.15
+++ frontends/Painter.h	7 Apr 2004 08:44:08 -0000
@@ -159,24 +159,24 @@ public:
 	 * the given color. If frame is specified, a thin frame is drawn
 	 * around the text with the given color.
 	 */
-	Painter & rectText(int x, int baseline,
+	virtual Painter & rectText(int x, int baseline,
 		std::string const & str,
 		LyXFont const & font,
 		LColor_color back,
 		LColor_color frame);
 
 	/// draw a string and enclose it inside a button frame
-	Painter & buttonText(int x,
+	virtual Painter & buttonText(int x,
 		int baseline, std::string const & s,
 		LyXFont const & font);
 
 protected:
 	/// check the font, and if set, draw an underline
-	void underline(LyXFont const & f,
+	virtual void underline(LyXFont const & f,
 		int x, int y, int width);
 
 	/// draw a bevelled button border
-	Painter & buttonFrame(int x, int y, int w, int h);
+	virtual Painter & buttonFrame(int x, int y, int w, int h);
 };
 
 #endif // PAINTER_H
Index: frontends/nullpainter.C
===================================================================
RCS file: frontends/nullpainter.C
diff -N frontends/nullpainter.C
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ frontends/nullpainter.C	7 Apr 2004 08:44:08 -0000
@@ -0,0 +1,11 @@
+#include "LColor.h"
+
+#include "nullpainter.h"
+
+#include <limits>
+
+
+int NullPainter::paperHeight() const
+{
+	return std::numeric_limits<int>::max();
+}
Index: frontends/nullpainter.h
===================================================================
RCS file: frontends/nullpainter.h
diff -N frontends/nullpainter.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ frontends/nullpainter.h	7 Apr 2004 08:44:08 -0000
@@ -0,0 +1,138 @@
+// -*- C++ -*-
+/**
+ * \file Painter.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Alfredo Braunstein
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef NULLPAINTER_H
+#define NULLPAINTER_H
+
+
+#include "Painter.h"
+
+class LColor_color;
+
+class NullPainter : public Painter {
+public:
+	///
+	NullPainter() {}
+	
+	virtual ~NullPainter() {}
+
+	/// begin painting
+	void start() {}
+
+	/// end painting
+	void end() {}
+
+	/// 
+	int paperWidth() const { return 0; }
+	/// 
+	int paperHeight() const;
+
+	
+	/// draw a line from point to point
+	Painter & line(int, int, int, int, LColor_color,
+		       line_style = line_solid, line_width = line_thin)
+		{
+			return *this;
+		}
+	///
+	Painter & lines(int const *, int const *, int, LColor_color,
+			line_style = line_solid, line_width = line_thin)
+		{
+			return *this;
+		}
+
+	///
+	Painter & rectangle(int, int, int, int,	LColor_color,
+		line_style = line_solid, line_width = line_thin)
+		{
+			return *this;
+		}
+
+	/// 
+	Painter & fillRectangle(int, int, int, int, LColor_color)
+		{
+			return *this;
+		}
+
+	/// 
+	Painter & fillPolygon(int const *, int const *, int, LColor_color)
+		{
+			return *this;
+		}
+
+	/// 
+	Painter & arc(int, int,	unsigned int, unsigned int,
+		int, int, LColor_color)
+		{
+			return *this;
+		}
+
+	/// 
+	Painter & point(int, int, LColor_color)
+		{
+			return *this;
+		}
+
+	/// 
+	Painter & button(int, int, int, int)
+		{
+			return *this;
+		}
+
+	/// 
+	Painter & image(int, int, int, int, lyx::graphics::Image const &)
+		{
+			return *this;
+		}
+
+	/// 
+	Painter & text(int, int, std::string const &, LyXFont const &)
+		{
+			return *this;
+		}
+
+	///
+	Painter & text(int, int, char const *, size_t, LyXFont const &)
+		{
+			return *this;
+		}
+
+	///
+	Painter & text(int, int, char, LyXFont const &)
+		{
+			return *this;
+		}
+
+	///
+	Painter & rectText(int, int, std::string const &,
+		LyXFont const &, LColor_color, LColor_color)
+		{
+			return *this;
+		}
+
+	///
+	Painter & buttonText(int, int, std::string const &, LyXFont const &)
+		{
+			return *this;
+		}
+
+protected:
+	///
+	void underline(LyXFont const &, int, int, int) {}
+
+	///
+	Painter & buttonFrame(int, int, int, int)
+		{
+			return *this;
+		}
+};
+
+#endif // NULLPAINTER_H
Index: frontends/screen.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/screen.C,v
retrieving revision 1.93
diff -u -p -u -r1.93 screen.C
--- frontends/screen.C	3 Apr 2004 08:37:08 -0000	1.93
+++ frontends/screen.C	7 Apr 2004 08:44:08 -0000
@@ -40,6 +40,7 @@
 #include "graphics/GraphicsLoader.h"
 
 #include "support/filetools.h" // LibFileSearch
+#include "support/types.h"
 
 #include <boost/utility.hpp>
 #include <boost/bind.hpp>
@@ -213,8 +214,8 @@ bool LyXScreen::fitCursor(BufferView * b
 
 	bv->cursor().getPos(x, y);
 	bv->cursor().getDim(asc, desc);
-	//lyxerr << "LyXScreen::fitCursor: x: " << x << " y: " << y
-	//	<< "  top_y: " << top_y << endl;
+	lyxerr << "LyXScreen::fitCursor: x: " << x << " y: " << y
+	       << "  top_y: " << top_y << endl;
 
 	bool const big_row = h / 4 < asc + desc && asc + desc < h;
 
Index: frontends/screen.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/screen.h,v
retrieving revision 1.29
diff -u -p -u -r1.29 screen.h
--- frontends/screen.h	13 Jan 2004 14:13:51 -0000	1.29
+++ frontends/screen.h	7 Apr 2004 08:44:08 -0000
@@ -13,6 +13,8 @@
 #ifndef SCREEN_H
 #define SCREEN_H
 
+#include "support/types.h"
+
 class LyXText;
 class CursorSlice;
 class WorkArea;
Index: mathed/formulamacro.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulamacro.C,v
retrieving revision 1.154
diff -u -p -u -r1.154 formulamacro.C
--- mathed/formulamacro.C	6 Apr 2004 19:25:38 -0000	1.154
+++ mathed/formulamacro.C	7 Apr 2004 08:44:09 -0000
@@ -144,7 +144,7 @@ void InsetFormulaMacro::draw(PainterInfo
 	LyXFont font = p.base.font;
 	font.setColor(LColor::math);
 
-	PainterInfo pi(p.base.bv);
+	PainterInfo pi(p.base.bv, p.pain);
 	pi.base.style = LM_ST_TEXT;
 	pi.base.font  = font;
 

Reply via email to