]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
* Buffer.cpp:
[lyx.git] / src / Buffer.cpp
index f09a00248dd2756e723e70c0ff16ee5678583b9a..b7b27c4073d6e5316dbe56d0a0e8126d454524d3 100644 (file)
@@ -126,7 +126,7 @@ namespace {
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-int const LYX_FORMAT = 361;  // jspitzm: bibliography custom width
+int const LYX_FORMAT = 362;  // jspitzm: support applemac encoding
 
 typedef map<string, bool> DepClean;
 typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
@@ -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)
@@ -1377,7 +1394,11 @@ void Buffer::writeLyXHTMLSource(odocstream & os,
                // FIXME Get this during validation? What about other meta-data?
                os << "<title>TBA</title>\n";
 
-               docstring styleinfo = features.getTClassHTMLStyles();
+               os << features.getTClassHTMLPreamble();
+
+               os << '\n';
+
+               docstring const styleinfo = features.getTClassHTMLStyles();
                if (!styleinfo.empty()) {
                        os << "<style type='text/css'>\n";
                        os << styleinfo;
@@ -3397,9 +3418,9 @@ int Buffer::spellCheck(DocIterator & from, DocIterator & to,
        docstring word;
        while (nextWord(from, to, word)) {
                ++progress;
-               string lang_code = lyxrc.spellchecker_use_alt_lang
-                     ? lyxrc.spellchecker_alt_lang
-                     : from.paragraph().getFontSettings(params(), from.pos()).language()->code();
+               string const lang_code = lyxrc.spellchecker_alt_lang.empty()
+                       ? from.paragraph().getFontSettings(params(), from.pos()).language()->code()
+                       : lyxrc.spellchecker_alt_lang;
                WordLangTuple wl(word, lang_code);
                res = speller->check(wl);
                // ... just bail out if the spellchecker reports an error.