uwesto...@lyx.org wrote:
> Author: uwestoehr
> Date: Thu Dec  2 05:05:35 2010
> New Revision: 36654
> URL: http://www.lyx.org/trac/changeset/36654
> 
> Log:
> ExternalSupport.cpp: fix #4398 (omit the newline in the LaTeX output behind 
> the ExternalInset inset if the inset type is a date)
> 
> Modified:
>    lyx-devel/trunk/src/insets/ExternalSupport.cpp
> 
> Modified: lyx-devel/trunk/src/insets/ExternalSupport.cpp
> ==============================================================================
> --- lyx-devel/trunk/src/insets/ExternalSupport.cpp    Thu Dec  2 03:47:03 
> 2010        (r36653)
> +++ lyx-devel/trunk/src/insets/ExternalSupport.cpp    Thu Dec  2 05:05:35 
> 2010        (r36654)
> @@ -381,6 +381,17 @@
>  
>       str = substituteCommands(params, str, format);
>       str = substituteOptions(params, str, format);
> +     // If the template is a date, we must remove the newline at the end to
> +     // avoid LaTeX errors like the one described in bug #4398
> +     if (params.templatename() == "Date") {
> +             // depending on the OS we have either \r\n or only \n
> +             size_t pos = str.rfind('\r');
> +             if (pos != string::npos)
> +                     str.erase(pos);
> +             pos = str.rfind('\n');
> +             if (pos != string::npos)
> +                     str.erase(pos);
> +     }

ugh. instead of hardcoding such hacks we should go for date inside insetinfo...

pavel

Reply via email to