On Wed, 2005-03-30 at 11:41, Jean-Marc Lasgouttes wrote: 
> >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> 
> Martin> I removed the "+ 1" from Note inset and recompiled; works
> Martin> impeccably now. I propose to do this for all insets having
> Martin> this counting statement. OK?
> 
> This looks like a very good idea.
> 
> JMarc

Patch attached. Error positioning works now perfectly even at the end of
my 300+ page production test document, containing a mix of traditional
and external material graphics.

- Martin 
Index: ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/ChangeLog,v
retrieving revision 1.1122
diff -u -r1.1122 ChangeLog
--- ChangeLog	21 Mar 2005 18:21:12 -0000	1.1122
+++ ChangeLog	30 Mar 2005 11:51:44 -0000
@@ -1,4 +1,11 @@
 
+2005-03-30  Martin Vermeer  <[EMAIL PROTECTED]>
+
+	* ExternalSupport.C (writeExternal):
+	* insetgraphics.C (latex):
+	* insetnote.C (latex, linuxdoc, docbook, plaintext): fix
+	mis-count in computing latex error location
+
 2005-03-21  Alfredo Braunstein  <[EMAIL PROTECTED]>
 
 	* insettabular.[Ch]: rename setPos -> setCursorFromCoordinates and
Index: ExternalSupport.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/ExternalSupport.C,v
retrieving revision 1.16
diff -u -r1.16 ExternalSupport.C
--- ExternalSupport.C	14 Jan 2005 19:13:17 -0000	1.16
+++ ExternalSupport.C	30 Mar 2005 11:51:44 -0000
@@ -314,7 +314,7 @@
 	str = substituteCommands(params, str, format);
 	str = substituteOptions(params, str, format);
 	os << str;
-	return int(lyx::count(str.begin(), str.end(),'\n') + 1);
+	return int(lyx::count(str.begin(), str.end(),'\n'));
 }
 
 namespace {
Index: insetgraphics.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.274
diff -u -r1.274 insetgraphics.C
--- insetgraphics.C	22 Feb 2005 16:57:36 -0000	1.274
+++ insetgraphics.C	30 Mar 2005 11:51:45 -0000
@@ -750,7 +750,7 @@
 	lyxerr[Debug::GRAPHICS] << "InsetGraphics::latex outputting:\n"
 				<< latex_str << endl;
 	// Return how many newlines we issued.
-	return int(lyx::count(latex_str.begin(), latex_str.end(),'\n') + 1);
+	return int(lyx::count(latex_str.begin(), latex_str.end(),'\n'));
 }
 
 
Index: insetnote.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnote.C,v
retrieving revision 1.78
diff -u -r1.78 insetnote.C
--- insetnote.C	24 Nov 2004 21:58:39 -0000	1.78
+++ insetnote.C	30 Mar 2005 11:51:45 -0000
@@ -232,7 +232,7 @@
 	string const str = ss.str();
 	os << str;
 	// Return how many newlines we issued.
-	return int(lyx::count(str.begin(), str.end(),'\n') + 1);
+	return int(lyx::count(str.begin(), str.end(),'\n'));
 }
 
 
@@ -254,7 +254,7 @@
 	string const str = ss.str();
 	os << str;
 	// Return how many newlines we issued.
-	return int(lyx::count(str.begin(), str.end(),'\n') + 1);
+	return int(lyx::count(str.begin(), str.end(),'\n'));
 }
 
 
@@ -276,7 +276,7 @@
 	string const str = ss.str();
 	os << str;
 	// Return how many newlines we issued.
-	return int(lyx::count(str.begin(), str.end(),'\n') + 1);
+	return int(lyx::count(str.begin(), str.end(),'\n'));
 }
 
 
@@ -294,7 +294,7 @@
 	string const str = ss.str();
 	os << str;
 	// Return how many newlines we issued.
-	return int(lyx::count(str.begin(), str.end(),'\n') + 1);
+	return int(lyx::count(str.begin(), str.end(),'\n'));
 }
 
 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to