vcl/source/app/IconThemeInfo.cxx | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-)
New commits: commit 405cbcdcaac4ebb9e68240ef8a94821f9f21f6a8 Author: Zain Iftikhar <[email protected]> AuthorDate: Sat Apr 16 04:31:02 2022 +0500 Commit: Adolfo Jayme Barrientos <[email protected]> CommitDate: Sun May 1 10:03:41 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 <[email protected]> Reviewed-by: Heiko Tietze <[email protected]> (cherry picked from commit 02b740a7a047052e60274b8649f3624267eb079f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133280 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <[email protected]> diff --git a/vcl/source/app/IconThemeInfo.cxx b/vcl/source/app/IconThemeInfo.cxx index 139181e65a1a..47e7102adfe0 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)
