]> git.lyx.org Git - features.git/commitdiff
Add BufferParams::bibtexCommand()
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 1 Jan 2017 09:49:22 +0000 (10:49 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 1 Jan 2017 09:49:22 +0000 (10:49 +0100)
This function returns the real command (either per lyxrc or bufferparam)

src/BufferParams.cpp
src/BufferParams.h
src/graphics/PreviewLoader.cpp

index 9cab4076132cbce2d0427708fb563f8f480d48f7..7a726eb49d9bec44442ef944258b515e39aaa6f9 100644 (file)
@@ -3286,6 +3286,18 @@ vector<CitationStyle> BufferParams::citeStyles() const
        return styles;
 }
 
+
+string const & BufferParams::bibtexCommand() const
+{
+       if (bibtex_command != "default")
+               return bibtex_command;
+       else if (encoding().package() == Encoding::japanese)
+               return lyxrc.jbibtex_command;
+       else
+               return lyxrc.bibtex_command;
+}
+
+
 void BufferParams::invalidateConverterCache() const
 {
        pimpl_->isExportCacheValid = false;
index 29897fd9754f046dd37927204e45f347c0da3638..874860006b24e9939f975bfb873b090a35e14258 100644 (file)
@@ -462,6 +462,9 @@ public:
        /// the available citation styles
        std::vector<CitationStyle> citeStyles() const;
 
+       /// Return the actual bibtex command (lyxrc or buffer param)
+       std::string const & bibtexCommand() const;
+
        /// Set the default BibTeX style file for the document
        void setDefaultBiblioStyle(std::string const & s){ biblio_style = s; }
        /// Get the default BibTeX style file from the TextClass
index df025e41534b88d40226d47954988dd9e89918b6..93ea6b79b652bb7d8a3d39ad560d3d26f32d3376 100644 (file)
@@ -718,12 +718,7 @@ void PreviewLoader::Impl::startLoading(bool wait)
        }
 
        cs << latexparam;
-       if (buffer_.params().bibtex_command != "default")
-               cs << " --bibtex=" << quoteName(buffer_.params().bibtex_command);
-       else if (buffer_.params().encoding().package() == Encoding::japanese)
-               cs << " --bibtex=" << quoteName(lyxrc.jbibtex_command);
-       else
-               cs << " --bibtex=" << quoteName(lyxrc.bibtex_command);
+       cs << " --bibtex=" << quoteName(buffer_.params().bibtexCommand());
        if (buffer_.params().bufferFormat() == "lilypond-book")
                cs << " --lilypond";