summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-05-22 16:30:11 +0200
committerEike Rathke <erack@redhat.com>2014-05-22 19:35:36 +0200
commit1aad7628dcd7fd14d48814d00c3d04e4ec0c59d5 (patch)
tree9d7ea1b709a8587b19092093ab9912297a9c4c9b /cui
parent29c024afbe6a46459e37c5ceec510de1cd0ca7c8 (diff)
handle SvxLanguageComboBox edit
Change-Id: Icc2a4829b8a859756ed194f35df214f8bb55c7ae
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/chardlg.cxx24
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 );