]> git.lyx.org Git - lyx.git/blobdiff - src/bufferparams.C
remove redundant lyxerr.debugging checks; macro LYXERR already checks whether the...
[lyx.git] / src / bufferparams.C
index 28d56613bccd7c89948b537227e883a19ea119a6..62406698b453988f8b355e0733f09372dff6211b 100644 (file)
@@ -303,7 +303,7 @@ BufferParams::BufferParams()
        use_geometry = false;
        use_amsmath = package_auto;
        use_esint = package_auto;
-       cite_engine = biblio::ENGINE_BASIC;
+       cite_engine_ = biblio::ENGINE_BASIC;
        use_bibtopic = false;
        trackChanges = false;
        outputChanges = false;
@@ -495,7 +495,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
        } else if (token == "\\cite_engine") {
                string engine;
                lex >> engine;
-               cite_engine = citeenginetranslator().find(engine);
+               cite_engine_ = citeenginetranslator().find(engine);
        } else if (token == "\\use_bibtopic") {
                lex >> use_bibtopic;
        } else if (token == "\\tracking_changes") {
@@ -642,7 +642,7 @@ void BufferParams::writeFile(ostream & os) const
           << "\n\\use_geometry " << convert<string>(use_geometry)
           << "\n\\use_amsmath " << use_amsmath
           << "\n\\use_esint " << use_esint
-          << "\n\\cite_engine " << citeenginetranslator().find(cite_engine)
+          << "\n\\cite_engine " << citeenginetranslator().find(cite_engine_)
           << "\n\\use_bibtopic " << convert<string>(use_bibtopic)
           << "\n\\paperorientation " << string_orientation[orientation]
           << '\n';
@@ -1482,4 +1482,21 @@ Encoding const & BufferParams::encoding() const
        return *(language->encoding());
 }
 
+
+biblio::CiteEngine BufferParams::getEngine() const
+{
+       // FIXME the class should provide the numerical/
+       // authoryear choice
+       if (getLyXTextClass().provides(LyXTextClass::natbib)
+           && cite_engine_ != biblio::ENGINE_NATBIB_NUMERICAL)
+               return biblio::ENGINE_NATBIB_AUTHORYEAR;
+       return cite_engine_;
+}
+
+
+void BufferParams::setCiteEngine(biblio::CiteEngine const cite_engine)
+{
+       cite_engine_ = cite_engine;
+}
+
 } // namespace lyx