vcl/source/app/IconThemeInfo.cxx | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-)
New commits: commit 02b740a7a047052e60274b8649f3624267eb079f Author: Zain Iftikhar <zain.iftik...@7vals.com> AuthorDate: Sat Apr 16 04:31:02 2022 +0500 Commit: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> CommitDate: Thu Apr 21 18:52:37 2022 +0200 tdf#141000 replacing underscores with spaces of multi words icon pack name patch will replace underscores with spaces of multi words icon pack name. Change-Id: If37f6617b7c90eb912ab2f58fff0f1df225efa66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133094 Tested-by: Heiko Tietze <heiko.tie...@documentfoundation.org> Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org> diff --git a/vcl/source/app/IconThemeInfo.cxx b/vcl/source/app/IconThemeInfo.cxx index 4a5ff157cfa9..4166ae0845dd 100644 --- a/vcl/source/app/IconThemeInfo.cxx +++ b/vcl/source/app/IconThemeInfo.cxx @@ -18,8 +18,6 @@ namespace { -constexpr OUStringLiteral KARASA_JAGA_ID(u"karasa_jaga"); -constexpr OUStringLiteral KARASA_JAGA_DISPLAY_NAME(u"Karasa Jaga"); constexpr OUStringLiteral HELPIMG_FAKE_THEME(u"helpimg"); OUString @@ -124,20 +122,16 @@ IconThemeInfo::ThemeIdToDisplayName(const OUString& themeId) if (!bIsSvg && bIsDark) bIsSvg = aDisplayName.endsWith("_svg", &aDisplayName); - // special cases - if (aDisplayName.equalsIgnoreAsciiCase(KARASA_JAGA_ID)) { - aDisplayName = KARASA_JAGA_DISPLAY_NAME; - } - else + // make the first letter uppercase + sal_Unicode firstLetter = aDisplayName[0]; + if (rtl::isAsciiLowerCase(firstLetter)) { - // make the first letter uppercase - sal_Unicode firstLetter = aDisplayName[0]; - if (rtl::isAsciiLowerCase(firstLetter)) - { - aDisplayName = OUStringChar(sal_Unicode(rtl::toAsciiUpperCase(firstLetter))) + aDisplayName.subView(1); - } + aDisplayName = OUStringChar(sal_Unicode(rtl::toAsciiUpperCase(firstLetter))) + aDisplayName.subView(1); } + // replacing underscores with spaces of multi words pack name. + aDisplayName = aDisplayName.replace('_', ' '); + if (bIsSvg && bIsDark) aDisplayName += " (SVG + dark)"; else if (bIsSvg)