Fix bug #8013: updateDefaultFormat() checks the osFontsCB state, so the fonts UI needs to be set in advance of the output UI.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40689 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2012-01-31 11:30:52 +00:00
parent cd765d1d02
commit 72f56d7309

View File

@ -2987,31 +2987,13 @@ void GuiDocument::paramsToDialog()
InsetListingsParams(bp_.listings_params).separatedParams(); InsetListingsParams(bp_.listings_params).separatedParams();
listingsModule->listingsED->setPlainText(toqstr(lstparams)); listingsModule->listingsED->setPlainText(toqstr(lstparams));
// Output // Fonts
// update combobox with formats
updateDefaultFormat();
int index = outputModule->defaultFormatCO->findData(toqstr(
bp_.default_output_format));
// set to default if format is not found
if (index == -1)
index = 0;
outputModule->defaultFormatCO->setCurrentIndex(index);
bool const os_fonts_available = bool const os_fonts_available =
bp_.baseClass()->outputType() == lyx::LATEX bp_.baseClass()->outputType() == lyx::LATEX
&& LaTeXFeatures::isAvailable("fontspec"); && LaTeXFeatures::isAvailable("fontspec");
fontModule->osFontsCB->setEnabled(os_fonts_available); fontModule->osFontsCB->setEnabled(os_fonts_available);
fontModule->osFontsCB->setChecked( fontModule->osFontsCB->setChecked(
os_fonts_available && bp_.useNonTeXFonts); os_fonts_available && bp_.useNonTeXFonts);
outputModule->outputsyncCB->setChecked(bp_.output_sync);
outputModule->synccustomCB->setEditText(toqstr(bp_.output_sync_macro));
outputModule->mathimgSB->setValue(bp_.html_math_img_scale);
outputModule->mathoutCB->setCurrentIndex(bp_.html_math_output);
outputModule->strictCB->setChecked(bp_.html_be_strict);
outputModule->cssCB->setChecked(bp_.html_css_as_file);
// Fonts
updateFontsize(documentClass().opt_fontsize(), updateFontsize(documentClass().opt_fontsize(),
bp_.fontsize); bp_.fontsize);
@ -3078,6 +3060,26 @@ void GuiDocument::paramsToDialog()
fontModule->fontencLE->setText(toqstr(bp_.fontenc)); fontModule->fontencLE->setText(toqstr(bp_.fontenc));
} }
// Output
// This must be set _after_ fonts since updateDefaultFormat()
// checks osFontsCB settings.
// update combobox with formats
updateDefaultFormat();
int index = outputModule->defaultFormatCO->findData(toqstr(
bp_.default_output_format));
// set to default if format is not found
if (index == -1)
index = 0;
outputModule->defaultFormatCO->setCurrentIndex(index);
outputModule->outputsyncCB->setChecked(bp_.output_sync);
outputModule->synccustomCB->setEditText(toqstr(bp_.output_sync_macro));
outputModule->mathimgSB->setValue(bp_.html_math_img_scale);
outputModule->mathoutCB->setCurrentIndex(bp_.html_math_output);
outputModule->strictCB->setChecked(bp_.html_be_strict);
outputModule->cssCB->setChecked(bp_.html_css_as_file);
// paper // paper
bool const extern_geometry = bool const extern_geometry =
documentClass().provides("geometry"); documentClass().provides("geometry");