From 8239e66c9429c1499d52be5a784fbe039b39181d Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 1 Jan 2017 10:49:22 +0100 Subject: [PATCH] Add BufferParams::bibtexCommand() This function returns the real command (either per lyxrc or bufferparam) --- src/BufferParams.cpp | 12 ++++++++++++ src/BufferParams.h | 3 +++ src/graphics/PreviewLoader.cpp | 7 +------ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 9cab407613..7a726eb49d 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -3286,6 +3286,18 @@ vector 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; diff --git a/src/BufferParams.h b/src/BufferParams.h index 29897fd975..874860006b 100644 --- a/src/BufferParams.h +++ b/src/BufferParams.h @@ -462,6 +462,9 @@ public: /// the available citation styles std::vector 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 diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index df025e4153..93ea6b79b6 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -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"; -- 2.39.5