summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2022-03-22 21:12:09 +0100
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2022-04-09 14:31:09 +0200
commit7a2bd19355d78551f9ce253fca69d37881d1d1c1 (patch)
tree5229acc31c77cbeb73ad71e0de825337e3915387 /cui/source
parent035c9fc7ecaf0fce032748f47450fb31cc62d65a (diff)
tdf#56363 - Search font family without the font feature after the colon
In the special character dialog, search font family without the font feature after the colon in order to find the correct item in the font combobox. Change-Id: I60d068bb22782bcce062365a8d4d53e15ec34c76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131953 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/dialogs/cuicharmap.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 95678899df90..42c12c5e3ce9 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -477,7 +477,7 @@ void SvxCharacterMap::init()
// the font may not be in the list =>
// try to find a font name token in list and select found font,
// else select topmost entry
- bool bFound = (m_xFontLB->find_text(aDefStr) == -1);
+ bool bFound = (m_xFontLB->find_text(aDefStr) != -1);
if (!bFound)
{
sal_Int32 nIndex = 0;
@@ -611,17 +611,21 @@ void SvxCharacterMap::SetCharFont( const vcl::Font& rFont )
// like "Times New Roman;Times" resolved
vcl::Font aTmp(m_xVirDev->GetFontMetric(rFont));
- if (aTmp.GetFamilyName() == "StarSymbol" && m_xFontLB->find_text(aTmp.GetFamilyName()) == -1)
+ // tdf#56363 - search font family without the font feature after the colon
+ OUString sFontFamilyName = aTmp.GetFamilyName();
+ if (const sal_Int32 nIndex = sFontFamilyName.indexOf(":"); nIndex != -1)
+ sFontFamilyName = sFontFamilyName.copy(0, nIndex);
+ if (sFontFamilyName == "StarSymbol" && m_xFontLB->find_text(sFontFamilyName) == -1)
{
//if for some reason, like font in an old document, StarSymbol is requested and it's not available, then
//try OpenSymbol instead
aTmp.SetFamilyName("OpenSymbol");
}
- if (m_xFontLB->find_text(aTmp.GetFamilyName()) == -1)
+ if (m_xFontLB->find_text(sFontFamilyName) == -1)
return;
- m_xFontLB->set_active_text(aTmp.GetFamilyName());
+ m_xFontLB->set_active_text(sFontFamilyName);
aFont = aTmp;
FontSelectHdl(*m_xFontLB);
if (m_xSubsetLB->get_count())