From 61da05ebd0cd73507484ce11c8ba6401d5c562fe Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 28 Jan 2019 17:21:32 +0000 Subject: Resolves: tdf#122992 allow pre-selected fonts not in the font list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I75c1b6d3933a5773d9e1dce40744c2342ab63ee8 Reviewed-on: https://gerrit.libreoffice.org/67024 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- cui/source/tabpages/chardlg.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cui') diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index ffcfd040493b..6a9c23bb3ef2 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -673,7 +673,12 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp if ( eState >= SfxItemState::DEFAULT ) { pFontItem = static_cast(&( rSet.Get( nWhich ) )); - pNameBox->set_active_text( pFontItem->GetFamilyName() ); + const OUString &rName = pFontItem->GetFamilyName(); + int nIndex = pNameBox->find_text(rName); + pNameBox->set_active(nIndex); + // tdf#122992 if it didn't exist in the list, set the entry text to it anyway + if (nIndex == -1) + pNameBox->set_entry_text(rName); } else { -- cgit