diff options
Diffstat (limited to 'cui/source/tabpages/chardlg.cxx')
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 1f0e585609f4..f36ae8e323cd 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -1086,6 +1086,30 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp } nWhich = GetWhich( nSlot ); pOld = GetOldItem( rSet, nSlot ); + + // For language list boxes acting as ComboBox, check for, add and select an + // edited entry. + SvxLanguageComboBox* pLangComboBox = dynamic_cast<SvxLanguageComboBox*>(pLangBox); + if (pLangComboBox) + { + switch (pLangComboBox->GetEditedAndValid()) + { + case SvxLanguageComboBox::EDITED_NO: + ; // nothing to do + break; + case SvxLanguageComboBox::EDITED_VALID: + { + const sal_Int32 nPos = pLangComboBox->SaveEditedAsEntry(); + if (nPos != COMBOBOX_ENTRY_NOTFOUND) + pLangComboBox->SelectEntryPos( nPos); + } + break; + case SvxLanguageComboBox::EDITED_INVALID: + pLangComboBox->SelectEntryPos( pLangComboBox->GetSavedValueLBB()); + break; + } + } + sal_Int32 nLangPos = pLangBox->GetSelectEntryPosLBB(); LanguageType eLangType = (LanguageType)(sal_uLong)pLangBox->GetEntryDataLBB( nLangPos ); |