Add BufferParams::bibtexCommand()

This function returns the real command (either per lyxrc or bufferparam)
This commit is contained in:
Juergen Spitzmueller 2017-01-01 10:49:22 +01:00
parent 5d58bfadbc
commit 8239e66c94
3 changed files with 16 additions and 6 deletions

View 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;

View 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

View 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";