>>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
Martin> I have noticed that in many of my files, the line counter for Martin> LaTeX lags behind and the error boxes in the file are too high Martin> up. I think it is due to the XFig external insets. Looking at Martin> insets/ExternalSupport.C there appears to be line counting Martin> going on, but is it done right? Well, always returning 0 is not very nice, is it? Does the following patch (which I am too lazy to test myself :) help? JMarc
Index: src/insets/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/ChangeLog,v retrieving revision 1.552.2.22 diff -u -p -r1.552.2.22 ChangeLog --- src/insets/ChangeLog 7 Mar 2005 14:03:08 -0000 1.552.2.22 +++ src/insets/ChangeLog 29 Mar 2005 12:37:15 -0000 @@ -1,3 +1,8 @@ +2005-03-29 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * insetexternal.C (write): compute correctly the number of lines + in output. + 2005-02-26 Michael Schmitt <[EMAIL PROTECTED]> * insetbib.C: change screen label Index: src/insets/insetexternal.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetexternal.C,v retrieving revision 1.53.2.4 diff -u -p -r1.53.2.4 insetexternal.C --- src/insets/insetexternal.C 10 Jan 2005 19:17:30 -0000 1.53.2.4 +++ src/insets/insetexternal.C 29 Mar 2005 12:37:15 -0000 @@ -26,6 +26,7 @@ #include "support/filetools.h" #include "support/forkedcall.h" #include "support/lstrings.h" +#include "support/lyxalgo.h" #include "support/package.h" #include "support/path.h" @@ -146,8 +147,9 @@ int InsetExternal::write(string const & } updateExternal(format, buf); - os << doSubstitution(buf, cit->second.product); - return 0; // CHECK (FIXME check what ? - jbl) + string const outstring = doSubstitution(buf, cit->second.product); + os << outstring; + return lyx::count(outstring.begin(), outstring.end(), '\n'); }