[LyX/2.3.x] Do not change bibliography processor to default if it is not found
Juergen Spitzmueller
spitz at lyx.org
Mon Oct 18 06:21:52 UTC 2021
commit c276c3e7b150eae31f58db0bdca0c307d2474e94
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Sun Oct 17 11:30:24 2021 +0200
Do not change bibliography processor to default if it is not found
Rather than that, keep it with a warning that it is not available.
Fallback procedure (which maintains security measures) is done in
the conversion step.
This prevents document properties being silently changed on sharing.
(cherry picked from commit 354362618280c8f80603672e06b650ac557b3837)
---
src/frontends/qt4/GuiDocument.cpp | 22 +++++++++++-----------
status.23x | 4 ++++
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp
index b20e16a..68b6c6b 100644
--- a/src/frontends/qt4/GuiDocument.cpp
+++ b/src/frontends/qt4/GuiDocument.cpp
@@ -3533,17 +3533,17 @@ void GuiDocument::paramsToDialog()
string options =
split(bp_.bibtex_command, command, ' ');
- int const bpos = biblioModule->bibtexCO->findData(toqstr(command));
- if (bpos != -1) {
- biblioModule->bibtexCO->setCurrentIndex(bpos);
- biblioModule->bibtexOptionsLE->setText(toqstr(options).trimmed());
- } else {
- // We reset to default if we do not know the specified compiler
- // This is for security reasons
- biblioModule->bibtexCO->setCurrentIndex(
- biblioModule->bibtexCO->findData(toqstr("default")));
- biblioModule->bibtexOptionsLE->clear();
+ int bpos = biblioModule->bibtexCO->findData(toqstr(command));
+ if (bpos == -1) {
+ // We add and set the unknown compiler, indicating that it is unavailable
+ // to assure document compilation and for security reasons, a fallback
+ // will be used on document processing stage
+ biblioModule->bibtexCO->addItem(toqstr(bformat(_("%1$s (not available)"),
+ from_utf8(command))), toqstr(command));
+ bpos = biblioModule->bibtexCO->findData(toqstr(command));
}
+ biblioModule->bibtexCO->setCurrentIndex(bpos);
+ biblioModule->bibtexOptionsLE->setText(toqstr(options).trimmed());
biblioModule->bibtexOptionsLE->setEnabled(
biblioModule->bibtexCO->currentIndex() != 0);
diff --git a/status.23x b/status.23x
index 91fc32f..5795714 100644
--- a/status.23x
+++ b/status.23x
@@ -27,6 +27,10 @@ What's new
* USER INTERFACE
+- If the bibliography processor requested by a document is not available, do not
+ silently fall back to default. Rather than that, warn the user, keep the requested
+ processor and only fall back to an alternative at processing stage.
+
- Backspace at the very start of a cell part of eqnarray or align environments
does not move the cursor out of the whole equation anymore and is now
equivalent to hitting the left arrow key (bug 11678).
More information about the lyx-cvs
mailing list