lyx-devel  

Possible fix for 6502: ... LaTeX Errors Dialog highlighting wrong line.

John McCabe-Dansted
Sat, 06 Feb 2010 23:16:49 -0800

This bug was caused by r22241 no longer outputting the parent macros
in child files, but still counting them towards line numbers.

The attached patch simply stops LyX from even trying to output the
parent macros. AFAICT, This is strictly better than the current
situation where we don't get the parent macros and we also don't get
correct line numbers.

My feeling is that:
1) This sort of fix is ideal for branch, as we may not want to change
the LaTeX exported by branch this late in the cycle, and we seem to
have got on fine without the parentMacro functionality over the past
cycle.
2) In trunk we may want to fix the parentMacro functionality rather
than just remove it.

-- 
John C. McCabe-Dansted
Index: src/Buffer.cpp
===================================================================
--- src/Buffer.cpp	(revision 33347)
+++ src/Buffer.cpp	(working copy)
@@ -1319,11 +1319,6 @@
 			d->texrow.newline();
 		}
 
-		// get parent macros (if this buffer has a parent) which will be
-		// written at the document begin further down.
-		MacroSet parentMacros;
-		listParentMacros(parentMacros, features);
-
 		// Write the preamble
 		runparams.use_babel = params().writeLaTeX(os, features,
 							  d->texrow,
@@ -1338,11 +1333,6 @@
 		os << "\\begin{document}\n";
 		d->texrow.newline();
 
-		// output the parent macros
-		MacroSet::iterator it = parentMacros.begin();
-		MacroSet::iterator end = parentMacros.end();
-		for (; it != end; ++it)
-			(*it)->write(os, true);
 	} // output_preamble
 
 	d->texrow.start(paragraphs().begin()->id(), 0);