Hi Jean-Marc,

call me paranoid: I checked whether all patches were back-ported correctly. For that purpose, I made a diff over full ./BRANCH_1.4.X and ./trunk.

The changes due to boost update and color handling are voluminous but they don't seem to be relevant for 1.4.X. A shortened diff (500 lines) that ignores these changes is attached. It turns out that most remaining changes are caused by Martin's performance patches. There is also Abdel's tempdir patch that might be a good candidate for 1.4.1. And it seems that "isTextInset()" has been replaced by "canTrackChanges()" (Jürgen, Martin, does this cause any harm?).

Thanks for all the great updates!

Regards, Michael
diff -r --exclude=.svn lyx-devel-1.4.X/lib/symbols lyx-devel-1.5.0/lib/symbols
116,117c116,120
< begin             begin       none
< right             right       none
---
> # The commented lines in this block get misparsed as MathSymbolInset because
> # createMathInset() does not know them. I don't know if this is old cruft
> # or if it is planned to use this in the future. gb 2006-03-13
> #begin             begin       none
> #right             right       none
120,121c123
< parbox            parbox      none
< protect           protect     none
---
> #protect           protect     none
125c127
< newcommand        newcommand  none
---
> #newcommand        newcommand  none
127,128c129,130
< left              left        none
< end               end         none
---
> #left              left        none
> #end               end         none
diff -r --exclude=.svn lyx-devel-1.4.X/src/bufferlist.C lyx-devel-1.5.0/src/bufferlist.C
336c336
< 	s = AddName(MakeAbsPath("/tmp/"), buf->fileName());
---
> 	s = AddName(package().temp_dir(), buf->fileName());
diff -r --exclude=.svn lyx-devel-1.4.X/src/BufferView.C lyx-devel-1.5.0/src/BufferView.C
371a372,383
> bool const BufferView::repaintAll() const
> { 
> 	return pimpl_->repaintAll();
> }
> 
> 	
> void const BufferView::repaintAll(bool r) const
> { 
> 	pimpl_->repaintAll(r);
> }
> 
> 
diff -r --exclude=.svn lyx-devel-1.4.X/src/BufferView.h lyx-devel-1.5.0/src/BufferView.h
43c43,44
< 		SinglePar = 4
---
> 		SinglePar = 4,
> 		MultiParSel = 8
201c202,205
< 
---
> 	///
> 	bool const repaintAll() const;
> 	///
> 	void const repaintAll(bool r) const;
diff -r --exclude=.svn lyx-devel-1.4.X/src/BufferView_pimpl.C lyx-devel-1.5.0/src/BufferView_pimpl.C
660a661,671
> bool BufferView::Pimpl::multiParSel()
> {
> 	if (!cursor_.selection())
> 		return false;
> 	bool ret = multiparsel_cache_;
> 	multiparsel_cache_ = cursor_.selBegin().pit() != cursor_.selEnd().pit();
> 	// Either this, or previous selection spans paragraphs
> 	return ret || multiparsel_cache_;
> }
> 
> 
685c696
< 		bool forceupdate(flags & Update::Force);
---
> 		bool forceupdate(flags & (Update::Force | Update::SinglePar));
690a702,705
> 		if ((flags & Update::MultiParSel) && multiParSel()) {
> 			forceupdate = true;
> 			vi = metrics();
> 		}
987c1002
< 			update();
---
> 			update(Update::FitCursor | Update::MultiParSel);
1335a1351,1352
> 	lyx::pit_type size = int(text->paragraphs().size());
> 
1421a1439
>                 << "size: " << size
1424c1442
< 	return ViewMetricsInfo(pit1, pit2, y1, y2, singlepar);
---
> 	return ViewMetricsInfo(pit1, pit2, y1, y2, singlepar, size);
diff -r --exclude=.svn lyx-devel-1.4.X/src/BufferView_pimpl.h lyx-devel-1.5.0/src/BufferView_pimpl.h
61a62,63
> 	//
> 	bool multiParSel();
105a108,111
> 	/// Flag: do a full redraw of inside text of inset
> 	bool repaintAll() { return refresh_inside_; }
> 	///
> 	void repaintAll(bool r) {refresh_inside_ = r; }
185a192
> 	bool multiparsel_cache_;
192,193c199,201
< 
< 
---
> 	/// Working variable indicating a full screen refresh
> 	mutable bool refresh_inside_;
> 	
diff -r --exclude=.svn lyx-devel-1.4.X/src/client/client.C lyx-devel-1.5.0/src/client/client.C
16a17
> #include "support/package.h"
461c462
< string mainTmp("/tmp");
---
> string mainTmp(lyx::support::package().temp_dir());
diff -r --exclude=.svn lyx-devel-1.4.X/src/frontends/screen.C lyx-devel-1.5.0/src/frontends/screen.C
222c222,225
< 	expose(0, 0, workarea().workWidth(), workarea().workHeight());
---
> 	int const ymin = std::max(vi.y1, 0);
> 	int const ymax = 
> 		( vi.p2 < vi.size - 1 ?  vi.y2 : workarea().workHeight() );
> 	expose(0, ymin, workarea().workWidth(), ymax - ymin);
diff -r --exclude=.svn lyx-devel-1.4.X/src/insets/insetbase.h lyx-devel-1.5.0/src/insets/insetbase.h
23a24
> class InsetText;
219,220c220,223
< 	///
< 	virtual bool isTextInset() const { return false; }
---
> 	/// does this contain text that can be change track marked in DVI?
> 	virtual bool canTrackChanges() const { return false; }
> 	/// is this inset based on the TextInset class?
> 	virtual InsetText const * asTextInset() const { return 0; }
diff -r --exclude=.svn lyx-devel-1.4.X/src/insets/insetcollapsable.C lyx-devel-1.5.0/src/insets/insetcollapsable.C
141c141
< 			openinlined_ = (textdim_.wid + dim.wid <= mi.base.textwidth);
---
> 			openinlined_ = textdim_.wid + 2 * dim.wid <= mi.base.textwidth;
173a174
> 
diff -r --exclude=.svn lyx-devel-1.4.X/src/insets/insetcollapsable.h lyx-devel-1.5.0/src/insets/insetcollapsable.h
60,61d59
< 	bool isTextInset() const { return true; }
< 	///
diff -r --exclude=.svn lyx-devel-1.4.X/src/insets/insetenv.h lyx-devel-1.5.0/src/insets/insetenv.h
37,38d36
< 	bool isTextInset() const { return true; }
< 	///
diff -r --exclude=.svn lyx-devel-1.4.X/src/insets/insettabular.h lyx-devel-1.5.0/src/insets/insettabular.h
72c72
< 	bool isTextInset() const { return true; }
---
> 	bool canTrackChanges() const { return true; }
diff -r --exclude=.svn lyx-devel-1.4.X/src/insets/insettext.C lyx-devel-1.5.0/src/insets/insettext.C
202a203
> 	text_.background_color_ = backgroundColor();
210c211
< 		if (w > ww - 40)  {
---
> 		if (w > ww - 40 || Wide())  {
222,228c223,232
< 	if (backgroundColor() != LColor::background) {
< 		// repaint the background if needed
< 		int const w = text_.width() + 2 * border_;
< 		int const a = text_.ascent() + border_;
< 		int const h = a + text_.descent() + border_;
< 		pi.pain.fillRectangle(x, y - a, w, h, backgroundColor());
< 	}
---
> 	int const w = text_.width() + 2 * border_;
> 	int const a = text_.ascent() + border_;
> 	int const h = a + text_.descent() + border_;
> 	int const ww = pi.base.bv->workWidth();
> 	if (Wide())
> 		pi.pain.fillRectangle(0, y - a, ww, h, 
> 			backgroundColor());
> 	else
> 		pi.pain.fillRectangle(x, y - a, w, h, 
> 			backgroundColor());
256a261,266
> bool const InsetText::Tall() const
> {
> 	return text_.ascent() + text_.descent() > 2  * defaultRowHeight(); 
> }
> 
> 
diff -r --exclude=.svn lyx-devel-1.4.X/src/insets/insettext.h lyx-devel-1.5.0/src/insets/insettext.h
60c60,62
< 	bool isTextInset() const { return true; }
---
> 	bool canTrackChanges() const { return true; }
> 	///
> 	InsetText const * asTextInset() const { return this; }
139a142,145
> 	///
> 	bool & Wide() const { return wide_inset_; }
> 	///
> 	bool const Tall() const;
160a167,168
> 	///
> 	mutable bool wide_inset_;
diff -r --exclude=.svn lyx-devel-1.4.X/src/LyXAction.C lyx-devel-1.5.0/src/LyXAction.C
100c100
< 		{ LFUN_LEFTSEL, "backward-select", ReadOnly },
---
> 		{ LFUN_LEFTSEL, "backward-select", ReadOnly | SingleParUpdate },
146,147c146,147
< 		{ LFUN_DOWN, "down", ReadOnly | NoUpdate},
< 		{ LFUN_DOWNSEL, "down-select", ReadOnly },
---
> 		{ LFUN_DOWN, "down", ReadOnly | NoUpdate },
> 		{ LFUN_DOWNSEL, "down-select", ReadOnly | SingleParUpdate },
176c176
< 		{ LFUN_RIGHTSEL, "forward-select", ReadOnly },
---
> 		{ LFUN_RIGHTSEL, "forward-select", ReadOnly | SingleParUpdate },
201c201
< 		{ LFUN_HOMESEL, "line-begin-select", ReadOnly },
---
> 		{ LFUN_HOMESEL, "line-begin-select", ReadOnly | SingleParUpdate },
204c204
< 		{ LFUN_ENDSEL, "line-end-select", ReadOnly },
---
> 		{ LFUN_ENDSEL, "line-end-select", ReadOnly | SingleParUpdate },
286c286
< 		{ LFUN_UPSEL, "up-select", ReadOnly },
---
> 		{ LFUN_UPSEL, "up-select", ReadOnly | SingleParUpdate },
294c294
< 		{ LFUN_WORDLEFTSEL, "word-backward-select", ReadOnly },
---
> 		{ LFUN_WORDLEFTSEL, "word-backward-select", ReadOnly | SingleParUpdate },
301c301
< 		{ LFUN_WORDRIGHTSEL, "word-forward-select", ReadOnly },
---
> 		{ LFUN_WORDRIGHTSEL, "word-forward-select", ReadOnly | SingleParUpdate },
351c351
< 		{ LFUN_MOUSE_MOTION, "", ReadOnly },
---
> 		{ LFUN_MOUSE_MOTION, "", ReadOnly | SingleParUpdate },
diff -r --exclude=.svn lyx-devel-1.4.X/src/lyxrc.C lyx-devel-1.5.0/src/lyxrc.C
212d211
< 	tempdir_path = "/tmp";
diff -r --exclude=.svn lyx-devel-1.4.X/src/mathed/math_hullinset.h lyx-devel-1.5.0/src/mathed/math_hullinset.h
192c192
< 	virtual bool isTextInset() const { return true; }
---
> 	virtual bool canTrackChanges() const { return true; }
diff -r --exclude=.svn lyx-devel-1.4.X/src/MenuBackend.C lyx-devel-1.5.0/src/MenuBackend.C
766a767,769
> 	if (!tomenu.empty())
> 		tomenu.clear();
> 
diff -r --exclude=.svn lyx-devel-1.4.X/src/MenuBackend.h lyx-devel-1.5.0/src/MenuBackend.h
155a156,157
> 	/// Clear the menu content.
> 	void clear() { items_.clear(); }
diff -r --exclude=.svn lyx-devel-1.4.X/src/metricsinfo.h lyx-devel-1.5.0/src/metricsinfo.h
105,106c105,106
< 			bool singlepar) : p1(p1), p2(p2), y1(y1), y2(y2),
< 			singlepar(singlepar) {}
---
> 			bool singlepar, lyx::pit_type size) : p1(p1), p2(p2), 
> 			y1(y1), y2(y2), singlepar(singlepar), size(size) {}
111a112
> 	lyx::pit_type size;
diff -r --exclude=.svn lyx-devel-1.4.X/src/paragraph_pimpl.C lyx-devel-1.5.0/src/paragraph_pimpl.C
539c539
< 		if (inset->isTextInset()) {
---
> 		if (inset->canTrackChanges()) {
diff -r --exclude=.svn lyx-devel-1.4.X/src/rowpainter.C lyx-devel-1.5.0/src/rowpainter.C
167c167,175
< 	inset->drawSelection(pi, int(x_), yo_);
---
> 	InsetText const * const in = inset->asTextInset();
> 	// non-wide insets are painted completely. Recursive
> 	bool tmp = bv_.repaintAll();
> 	if (!in || !in->Wide()) {
> 		bv_.repaintAll(true);
> 		lyxerr[Debug::PAINTING] << endl << "Paint inset fully" << endl;
> 	}
> 	if (bv_.repaintAll())
> 		inset->drawSelection(pi, int(x_), yo_);
168a177
> 	bv_.repaintAll(tmp);
723c732,733
< lyx::size_type calculateRowSignature(Row const & row, Paragraph const & par)
---
> lyx::size_type calculateRowSignature(Row const & row, Paragraph const & par,
> 	int x, int y)
729a740,741
> 	const unsigned char b[] = { x, y, row.width() };
> 	crc.process_bytes(b, 3);
734c746,747
< bool isCursorOnRow(PainterInfo & pi, pit_type pit, RowList::const_iterator rit)
---
> bool CursorOnRow(PainterInfo & pi, pit_type const pit, 
> 	RowList::const_iterator rit, LyXText const & text)
735a749
> 	// Is there a cursor on this row (or inside inset on row)
737,740c751,756
< 	for (lyx::size_type d = 0; d < cur.depth(); d++)
< 		if (cur[d].pit() == pit
< 	  	    && cur[d].pos() >= rit->pos()
< 		    && cur[d].pos() <= rit->endpos())
---
> 	for (lyx::size_type d = 0; d < cur.depth(); d++) {
> 		CursorSlice const & sl = cur[d];
> 		if (sl.text() == &text
> 		    && sl.pit() == pit
> 	  	    && sl.pos() >= rit->pos()
> 		    && sl.pos() <= rit->endpos())
741a758,777
> 	}
> 	return false;
> }
> 
> 
> bool innerCursorOnRow(PainterInfo & pi, pit_type pit, 
> 	RowList::const_iterator rit, LyXText const & text)
> {
> 	// Is there a cursor inside an inset on this row, and is this inset
> 	// the only "character" on this row
> 	LCursor & cur = pi.base.bv->cursor();
> 	if (rit->pos() + 1 != rit->endpos())
> 		return false;
> 	for (lyx::size_type d = 0; d < cur.depth(); d++) {
> 		CursorSlice const & sl = cur[d];
> 		if (sl.text() == &text
> 		    && sl.pit() == pit 
> 		    && sl.pos() == rit->pos())
> 			return d < cur.depth() - 1;
> 	}
764a801,803
> 		// Allow setting of bv->repaintAll() for nested insets in
> 		// this row only
> 		bool tmp = pi.base.bv->repaintAll();
767,769c806,807
< 		lyx::size_type const row_sig = calculateRowSignature(*rit, par);
< 
< 		bool cursor_on_row = isCursorOnRow(pi, pit, rit);
---
> 		lyx::size_type const row_sig = calculateRowSignature(*rit, par, x, y);
> 		bool row_has_changed = par.rowSignature()[rowno] != row_sig;
771c809,824
< 		// If selection is on, the current row signature differs from
---
> 		bool cursor_on_row = CursorOnRow(pi, pit, rit, text);
> 		bool in_inset_alone_on_row = innerCursorOnRow(pi, pit, rit,
> 			text);
> 
> 		// If this is the only object on the row, we can make it wide
> 		for (pos_type i = rit->pos() ; i != rit->endpos(); ++i) {
> 			InsetBase const * const in = par.getInset(i);
> 			if (in) {
> 				InsetText const * const t = in->asTextInset();
> 				if (t)
> 					t->Wide() = in_inset_alone_on_row &&
> 					            t->Tall();
> 			}
> 		}
> 
> 		// If selection is on, the current row signature differs 
774,775c827
< 		if (repaintAll || par.rowSignature()[rowno] != row_sig
< 			    || cursor_on_row) {
---
> 		if (repaintAll || row_has_changed || cursor_on_row) {
784,785c836,838
< 			if (!repaintAll) {
< 				pi.pain.fillRectangle(x, y - rit->ascent(), 
---
> 			if (!repaintAll && 
> 			    (!in_inset_alone_on_row || row_has_changed)) {
> 				pi.pain.fillRectangle(( rowno ? 0 : x - 10 ), y - rit->ascent(), 
787a841,844
> 				// If outer row has changed, force nested
> 				// insets to repaint completely
> 				if (row_has_changed)
> 					pi.base.bv->repaintAll(true);
792c849,854
< 			//lyxerr << "#";
---
> 			if (text.isMainText())
>     				lyxerr[Debug::PAINTING] << "#";
> 			else
>     				lyxerr[Debug::PAINTING] << "[" <<
> 				    repaintAll << row_has_changed <<
> 				    cursor_on_row << "]";
802a865,866
> 		// Restore, see above
> 		pi.base.bv->repaintAll(tmp);
804c868
< 	//lyxerr << "." << endl;
---
> 	lyxerr[Debug::PAINTING] << "." << endl;
817,818c881,885
< 	if (select || !vi.singlepar) {
< 		// Clear background (Delegated to rows if no selection)
---
> 	// Should the whole screen, including insets, be refreshed?
> 	bool repaintAll(select || !vi.singlepar);
> 	
> 	if (repaintAll) {
> 		// Clear background (if not delegated to rows)
828a896
> 		bv.repaintAll(repaintAll);
831c899
< 		paintPar(pi, *bv.text(), pit, 0, yy, select || !vi.singlepar);
---
> 		paintPar(pi, *bv.text(), pit, 0, yy, repaintAll);
867a936,937
> 	// This flag can not be set from within same inset:
> 	bool repaintAll = pi.base.bv->repaintAll();
870c940
< 		paintPar(pi, text, pit, x, y, true);
---
> 		paintPar(pi, text, pit, x, y, repaintAll);
diff -r --exclude=.svn lyx-devel-1.4.X/src/support/filetools.C lyx-devel-1.5.0/src/support/filetools.C
599,634c599,608
< 	string TempBase;
< 	string RTemp;
< 	string Temp;
< 
< 	if (os::is_absolute_path(path))
< 		RTemp = path;
< 	else
< 		// Make implicit current directory explicit
< 		RTemp = "./" + path;
< 
< 	// Normalise paths like /foo//bar ==> /foo/bar
< 	boost::RegEx regex("/{2,}");
< 	RTemp = regex.Merge(RTemp, "/");
< 
< 	while (!RTemp.empty()) {
< 		// Split by next /
< 		RTemp = split(RTemp, Temp, '/');
< 
< 		if (Temp == ".") {
< 			TempBase = "./";
< 		} else if (Temp == "..") {
< 			// Remove one level of TempBase
< 			string::difference_type i = TempBase.length() - 2;
< 			while (i > 0 && TempBase[i] != '/')
< 				--i;
< 			if (i >= 0 && TempBase[i] == '/')
< 				TempBase.erase(i + 1, string::npos);
< 			else
< 				TempBase = "../";
< 		} else {
< 			TempBase += Temp + '/';
< 		}
< 	}
< 
< 	// returns absolute path
< 	return TempBase;
---
> 	// Normalize paths like /foo//bar ==> /foo/bar
> 	static boost::regex regex("/{2,}");
> 	string const tmppath = boost::regex_merge(path, regex, "/");
> 
> 	fs::path const npath = fs::path(tmppath, fs::no_check).normalize();
> 
> 	if (!npath.is_complete())
> 		return "./" + npath.string() + '/';
> 	
> 	return npath.string() + '/';
diff -r --exclude=.svn lyx-devel-1.4.X/src/text3.C lyx-devel-1.5.0/src/text3.C
630a631,633
> 			if (cur.pos() == cur.paragraph().size())
> 				// Par boundary, force full-screen update
> 				singleParUpdate = false;
636a640
> 			singleParUpdate = false;
658a663,665
> 				// Par boundary, full-screen update
> 				if (cur.pos() == 0)
> 					singleParUpdate = false;
665a673
> 			singleParUpdate = false;
1535c1543
< 	   	if (cur.bottom().paragraph().dim().height() 
---
> 		if (cur.bottom().paragraph().dim().height() 
1538c1546,1550
< 			cur.bv().update(Update::SinglePar | Update::Force);
---
> 			cur.bv().update(Update::SinglePar |
> 					Update::FitCursor |
> 					Update::MultiParSel);
> 			cur.noUpdate();
> 			return;

Reply via email to