]> git.lyx.org Git - lyx.git/blobdiff - src/bufferparams.C
reduce number of calls to LyXText::getFont
[lyx.git] / src / bufferparams.C
index c8f659b6e1eedc9983402418f5cf89b08e1295bf..b09857e5f7c973bc9f4f6eb45a7ba8ede18557fc 100644 (file)
@@ -38,7 +38,7 @@
 #include "frontends/Alert.h"
 
 #include "support/lyxalgo.h" // for lyx::count
-#include "support/tostr.h"
+#include "support/convert.h"
 #include "support/translator.h"
 
 #include <boost/array.hpp>
@@ -278,8 +278,9 @@ SpaceTranslator const & spacetranslator()
 }
 
 
-struct BufferParams::Impl
+class BufferParams::Impl
 {
+public:
        Impl();
 
        AuthorList authorlist;
@@ -340,6 +341,7 @@ BufferParams::BufferParams()
        cite_engine = biblio::ENGINE_BASIC;
        use_bibtopic = false;
        tracking_changes = false;
+       output_changes = false;
        secnumdepth = 3;
        tocdepth = 3;
        language = default_language;
@@ -507,6 +509,8 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
                lex >> use_bibtopic;
        } else if (token == "\\tracking_changes") {
                lex >> tracking_changes;
+       } else if (token == "\\output_changes") {
+               lex >> output_changes;
        } else if (token == "\\branch") {
                lex.next();
                string branch = lex.getString();
@@ -710,6 +714,7 @@ void BufferParams::writeFile(ostream & os) const
        }
 
        os << "\\tracking_changes " << convert<string>(tracking_changes) << "\n";
+       os << "\\output_changes " << convert<string>(output_changes) << "\n";
 
        if (tracking_changes) {
                AuthorList::Authors::const_iterator it = pimpl_->authorlist.begin();
@@ -1099,7 +1104,7 @@ bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
        lyxpreamble += "\\makeatother\n";
 
        // dvipost settings come after everything else
-       if (tracking_changes) {
+       if (features.isAvailable("dvipost") && tracking_changes && output_changes) {
                lyxpreamble +=
                        "\\dvipostlayout\n"
                        "\\dvipost{osstart color push Red}\n"
@@ -1219,7 +1224,7 @@ void BufferParams::readGraphicsDriver(LyXLex & lex)
                if (test == tmptok) {
                        graphicsDriver = tmptok;
                        break;
-               } else if (test == "last_item") {
+               } else if (test == "") {
                        lex.printError(
                                "Warning: graphics driver `$$Token' not recognized!\n"
                                "         Setting graphics driver to `default'.\n");