summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-10-05 19:21:36 +0200
committerEike Rathke <erack@redhat.com>2022-10-05 20:07:36 +0200
commit1ea19958d6fed38513b1983599c2c43ad76aae61 (patch)
tree48e76f621d09bb38c76124e389871da208aa547b /cui
parent667d61f98765dd9c5d1d8b5603c75a62dba3f795 (diff)
Add on-the-fly language tag to proper language list Western/Asian/Complex
In which combobox wherever it was added, the correct SfxItem will be updated and at least when switching to another dialog tab and back it will appear in the correct list. (shouldn't tabbing out of the combobox already trigger that?) Change-Id: I5aa78797dc24527c753c97d0357c3058271fa4d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140991 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/chardlg.cxx43
1 files changed, 26 insertions, 17 deletions
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 226fe846ee3d..e34eca07485c 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1062,31 +1062,40 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
case Asian : nSlot = SID_ATTR_CHAR_CJK_LANGUAGE; break;
case Ctl : nSlot = SID_ATTR_CHAR_CTL_LANGUAGE; break;
}
- nWhich = GetWhich( nSlot );
- pOld = GetOldItem( rSet, nSlot );
// For language list boxes acting as ComboBox, check for, add and select an
// edited entry.
- if (pLangBox == m_xWestFontLanguageLB.get())
+ switch (pLangBox->GetEditedAndValid())
{
- switch (pLangBox->GetEditedAndValid())
- {
- case SvxLanguageBox::EditedAndValid::No:
- ; // nothing to do
- break;
- case SvxLanguageBox::EditedAndValid::Valid:
+ case SvxLanguageBox::EditedAndValid::No:
+ ; // nothing to do
+ break;
+ case SvxLanguageBox::EditedAndValid::Valid:
+ {
+ SvxLanguageBox* ppBoxes[3]
+ = {m_xWestFontLanguageLB.get(), m_xEastFontLanguageLB.get(), m_xCTLFontLanguageLB.get()};
+ SvxLanguageBox* pBox = pLangBox->SaveEditedAsEntry(ppBoxes);
+ if (pBox != pLangBox)
{
- const int nPos = pLangBox->SaveEditedAsEntry();
- if (nPos != -1)
- pLangBox->set_active(nPos);
+ // Get item from corresponding slot.
+ if (pBox == m_xWestFontLanguageLB.get())
+ nSlot = SID_ATTR_CHAR_LANGUAGE;
+ else if (pBox == m_xEastFontLanguageLB.get())
+ nSlot = SID_ATTR_CHAR_CJK_LANGUAGE;
+ else if (pBox == m_xCTLFontLanguageLB.get())
+ nSlot = SID_ATTR_CHAR_CTL_LANGUAGE;
+ pLangBox = pBox;
}
- break;
- case SvxLanguageBox::EditedAndValid::Invalid:
- pLangBox->set_active_id(pLangBox->get_saved_active_id());
- break;
- }
+ }
+ break;
+ case SvxLanguageBox::EditedAndValid::Invalid:
+ pLangBox->set_active_id(pLangBox->get_saved_active_id());
+ break;
}
+ nWhich = GetWhich( nSlot );
+ pOld = GetOldItem( rSet, nSlot );
+
int nLangPos = pLangBox->get_active();
LanguageType eLangType = pLangBox->get_active_id();