Edwin Leuven schrieb:
if i creat a selection that spans more than one line and then type something (so that the selection gets replace with my new text), the selection before the line where cursor is isn't crossed out. there is a missing screen update here.
This is now bug #3992.

second thing is when i delete a collapsed footnote. the collapse footnote gets crossed out in lyx but not the text inside. in the dvi the footnote isn't crossed out.
Ouch. This is a very serious CT problem!

Luckily, I have a tentative patch at hand :-) The idea is that the inset's content inherits the change information from the complete (deleted) inset during LaTeX output. (Note: Marking the complete inset content as deleted in LyX is not preferable. Imagine, you spend a lot of time on the rewrite of a footnote and then your co-author decides to delete the complete footnote. Certainly, you still want to preserve the change status of the footnote content just in case your co-author changes his mind).

Gentlemen, the problem raised by Edwin should definitely be fixed for 1.5.0. Please have a look at the attached patch.

Comments, suggestions for improvement, testing, and even OKs are welcome :-)

Thanks! Michael

PS: This is my fourth uncommitted patch. Looks like we have more patches than OKs at the moment.
Index: src/OutputParams.h
===================================================================
--- src/OutputParams.h	(Revision 19005)
+++ src/OutputParams.h	(Arbeitskopie)
@@ -16,6 +16,7 @@
 
 #include "support/types.h"
 #include <boost/shared_ptr.hpp>
+#include "Changes.h"
 
 
 namespace lyx {
@@ -120,6 +121,16 @@
 	 */
 	bool inComment;
 
+	/** Whether we are inside an inset that is logically deleted.
+	 *  A value > 0 indicates a deleted inset.
+         */
+	int inDeletedInset;
+
+	/** The change information of the outermost, logically deleted inset.
+	 *  changeOfDeletedInset shall only be evaluated if inDeletedInset > 0.
+         */ 
+	Change changeOfDeletedInset;
+
 	/** allow output of only part of the top-level paragraphs
 	 *  par_begin: beginning paragraph
 	 */
Index: src/Paragraph.cpp
===================================================================
--- src/Paragraph.cpp	(Revision 19005)
+++ src/Paragraph.cpp	(Arbeitskopie)
@@ -189,7 +189,7 @@
 	///
 	void simpleTeXSpecialChars(Buffer const &, BufferParams const &,
 				   odocstream &,
-				   TexRow & texrow, OutputParams const &,
+				   TexRow & texrow, OutputParams &,
 				   Font & running_font,
 				   Font & basefont,
 				   Font const & outerfont,
@@ -660,7 +660,7 @@
 					     BufferParams const & bparams,
 					     odocstream & os,
 					     TexRow & texrow,
-					     OutputParams const & runparams,
+					     OutputParams & runparams,
 					     Font & running_font,
 					     Font & basefont,
 					     Font const & outerfont,
@@ -724,6 +724,11 @@
 			break;
 		}
 
+		if (lookupChange(i).type == Change::DELETED) {
+			if( ++runparams.inDeletedInset == 1)
+				runparams.changeOfDeletedInset = lookupChange(i);
+		}
+
 		if (inset->canTrackChanges()) {
 			column += Changes::latexMarkChange(os, bparams, running_change,
 				Change(Change::UNCHANGED));
@@ -778,6 +783,10 @@
 		} else {
 			column += os.tellp() - len;
 		}
+
+		if (lookupChange(i).type == Change::DELETED) {
+			--runparams.inDeletedInset;
+		}
 	}
 	break;
 
@@ -1917,7 +1926,7 @@
 				BufferParams const & bparams,
 				Font const & outerfont,
 				odocstream & os, TexRow & texrow,
-				OutputParams const & runparams) const
+				OutputParams & runparams) const
 {
 	LYXERR(Debug::LATEX) << "SimpleTeXOnePar...     " << this << endl;
 
@@ -2011,7 +2020,8 @@
 							    runparams.moving_arg);
 		}
 
-		Change const & change = pimpl_->lookupChange(i);
+		Change const & change = runparams.inDeletedInset ? runparams.changeOfDeletedInset
+		                                                 : pimpl_->lookupChange(i);
 
 		if (bparams.outputChanges && runningChange != change) {
 			if (open_font) {
Index: src/OutputParams.cpp
===================================================================
--- src/OutputParams.cpp	(Revision 19005)
+++ src/OutputParams.cpp	(Arbeitskopie)
@@ -22,7 +22,7 @@
 	  local_font(0), encoding(enc), free_spacing(false), use_babel(false),
 	  linelen(0), depth(0),
 	  exportdata(new ExportData),
-	  inComment(false),
+	  inComment(false), inDeletedInset(0), changeOfDeletedInset(Change::UNCHANGED),
 	  par_begin(0), par_end(0),
 	  dryrun(false)
 {}
Index: src/Paragraph.h
===================================================================
--- src/Paragraph.h	(Revision 19005)
+++ src/Paragraph.h	(Arbeitskopie)
@@ -126,7 +126,7 @@
 	///
 	bool simpleTeXOnePar(Buffer const &, BufferParams const &,
 			     Font const & outerfont, odocstream &,
-			     TexRow & texrow, OutputParams const &) const;
+			     TexRow & texrow, OutputParams &) const;
 
 	/// Can we drop the standard paragraph wrapper?
 	bool emptyTag() const;

Reply via email to