Author: forenr
Date: Thu May 26 21:10:12 2011
New Revision: 38848
URL: http://www.lyx.org/trac/changeset/38848

Log:
When compiling with MSVC on Windows, we can't rely on the returned timestamp
being -1 if a pdf file doesn't exist.

Modified:
   lyx-devel/branches/BRANCH_2_0_X/src/frontends/qt4/GuiView.cpp
   lyx-devel/branches/BRANCH_2_0_X/status.20x

Modified: lyx-devel/branches/BRANCH_2_0_X/src/frontends/qt4/GuiView.cpp
==============================================================================
--- lyx-devel/branches/BRANCH_2_0_X/src/frontends/qt4/GuiView.cpp       Thu May 
26 19:33:36 2011        (r38847)
+++ lyx-devel/branches/BRANCH_2_0_X/src/frontends/qt4/GuiView.cpp       Thu May 
26 21:10:12 2011        (r38848)
@@ -3522,14 +3522,16 @@
                                        addExtension(mastername, "dvi")));
                        FileName const pdfname(addName(path.absFileName(),
                                        addExtension(mastername, "pdf")));
-                       if (!dviname.exists() && !pdfname.exists()) {
+                       bool const have_dvi = dviname.exists();
+                       bool const have_pdf = pdfname.exists();
+                       if (!have_dvi && !have_pdf) {
                                dr.setMessage(_("Please, preview the document 
first."));
                                break;
                        }
                        string outname = dviname.onlyFileName();
                        string command = lyxrc.forward_search_dvi;
-                       if (!dviname.exists() ||
-                           pdfname.lastModified() > dviname.lastModified()) {
+                       if (!have_dvi || (have_pdf &&
+                           pdfname.lastModified() > dviname.lastModified())) {
                                outname = pdfname.onlyFileName();
                                command = lyxrc.forward_search_pdf;
                        }

Modified: lyx-devel/branches/BRANCH_2_0_X/status.20x
==============================================================================
--- lyx-devel/branches/BRANCH_2_0_X/status.20x  Thu May 26 19:33:36 2011        
(r38847)
+++ lyx-devel/branches/BRANCH_2_0_X/status.20x  Thu May 26 21:10:12 2011        
(r38848)
@@ -86,6 +86,8 @@
 - On Windows, allow to automatically switch TeX engines without the need
   of manually saving the preferences after reconfiguring (bug 7557).
 
+- Fix dvi forward search on Windows when compiling with MSVC.
+
 
 * USER INTERFACE
 

Reply via email to