From 9388e76dc08442794f49468cffedf1dbf38d7867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sun, 21 Jun 2009 09:44:10 +0000 Subject: [PATCH] * Buffer.cpp: - make LaTeX logfile dialog work for child documents and master-buffer-[view|update]: if there's only a master file log or if the master file log is newer, it is displayed. * Buffer.h: typo. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30206 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 21 +++++++++++++++++++-- src/Buffer.h | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 481a7c6ab4..b7b27c4073 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -467,14 +467,31 @@ string Buffer::logName(LogType * type) const changeExtension(filename, formats.extension(bufferFormat()) + ".out")))); - // If no Latex log or Build log is newer, show Build log + // Also consider the master buffer log file + FileName masterfname = fname; + LogType mtype; + if (masterBuffer() != this) { + string const mlogfile = masterBuffer()->logName(&mtype); + masterfname = FileName(mlogfile); + } + // If no Latex log or Build log is newer, show Build log if (bname.exists() && - (!fname.exists() || fname.lastModified() < bname.lastModified())) { + ((!fname.exists() && !masterfname.exists()) + || (fname.lastModified() < bname.lastModified() + && masterfname.lastModified() < bname.lastModified()))) { LYXERR(Debug::FILES, "Log name calculated as: " << bname); if (type) *type = buildlog; return bname.absFilename(); + // If we have a newer master file log or only a master log, show this + } else if (fname != masterfname + && (!fname.exists() && masterfname.exists() + || fname.lastModified() < masterfname.lastModified())) { + LYXERR(Debug::FILES, "Log name calculated as: " << masterfname); + if (type) + *type = mtype; + return masterfname.absFilename(); } LYXERR(Debug::FILES, "Log name calculated as: " << fname); if (type) diff --git a/src/Buffer.h b/src/Buffer.h index 74c378cadc..72c0d8ca09 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -283,7 +283,7 @@ public: */ std::string latexName(bool no_path = true) const; - /// Get thee name and type of the log. + /// Get the name and type of the log. std::string logName(LogType * type = 0) const; /// Change name of buffer. Updates "read-only" flag.