mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Disable language package choice if the class preloads a package
This commit is contained in:
parent
c3c96a446b
commit
5477451e36
@ -4217,7 +4217,21 @@ void GuiDocument::paramsToDialog()
|
||||
|
||||
// LaTeX input encoding: set after the fonts (see below)
|
||||
|
||||
int p = langModule->languagePackageCO->findData(toqstr(bp_.lang_package));
|
||||
// If the class provides babel or polyglossia, do not allow
|
||||
// to change that
|
||||
bool const extern_babel =
|
||||
documentClass().provides("babel");
|
||||
bool const extern_polyglossia =
|
||||
documentClass().provides("polyglossia");
|
||||
|
||||
int p = -1;
|
||||
if (extern_babel)
|
||||
p = langModule->languagePackageCO->findData(toqstr("babel"));
|
||||
else if (extern_polyglossia)
|
||||
p = langModule->languagePackageCO->findData(toqstr("polyglossia"));
|
||||
else
|
||||
p = langModule->languagePackageCO->findData(toqstr(bp_.lang_package));
|
||||
|
||||
if (p == -1) {
|
||||
langModule->languagePackageCO->setCurrentIndex(
|
||||
langModule->languagePackageCO->findData("custom"));
|
||||
@ -4226,6 +4240,7 @@ void GuiDocument::paramsToDialog()
|
||||
langModule->languagePackageCO->setCurrentIndex(p);
|
||||
langModule->languagePackageLE->clear();
|
||||
}
|
||||
langModule->languagePackageCO->setEnabled(!extern_babel && !extern_polyglossia);
|
||||
|
||||
//color
|
||||
if (bp_.isfontcolor) {
|
||||
|
Loading…
Reference in New Issue
Block a user