On Tue, Aug 02, 2011 at 05:43:10AM +0200, for...@lyx.org wrote:

> Author: forenr
> Date: Tue Aug  2 05:43:09 2011
> New Revision: 39410
> URL: http://www.lyx.org/trac/changeset/39410
> 
> Log:
> When previewing a format, change to the directory of the previewed file
> and invoke the previewer with only its filename without the path.
> This solves the problem about forward search on Windows reported here:
> http://thread.gmane.org/gmane.editors.lyx.general/71130

This is also needed in branch.

> Modified:
>    lyx-devel/trunk/src/Format.cpp
> 
> Modified: lyx-devel/trunk/src/Format.cpp
> ==============================================================================
> --- lyx-devel/trunk/src/Format.cpp    Mon Aug  1 19:23:56 2011        (r39409)
> +++ lyx-devel/trunk/src/Format.cpp    Tue Aug  2 05:43:09 2011        (r39410)
> @@ -23,6 +23,7 @@
>  #include "support/gettext.h"
>  #include "support/lstrings.h"
>  #include "support/os.h"
> +#include "support/Path.h"
>  #include "support/Systemcall.h"
>  #include "support/textutils.h"
>  #include "support/Translator.h"
> @@ -312,13 +313,14 @@
>       if (!contains(command, token_from_format))
>               command += ' ' + token_from_format;
>  
> -     command = subst(command, token_from_format, 
> quoteName(filename.toFilesystemEncoding()));
> +     command = subst(command, token_from_format, 
> quoteName(onlyFileName(filename.toFilesystemEncoding())));
>       command = subst(command, token_path_format, 
> quoteName(onlyPath(filename.toFilesystemEncoding())));
>       command = subst(command, token_socket_format, 
> quoteName(theServerSocket().address()));
>       LYXERR(Debug::FILES, "Executing command: " << command);
>       // FIXME UNICODE utf8 can be wrong for files
>       buffer.message(_("Executing command: ") + from_utf8(command));
>  
> +     PathChanger p(filename.onlyPath());
>       Systemcall one;
>       one.startscript(Systemcall::DontWait, command, buffer.filePath());
>  

-- 
Enrico

Reply via email to