// constants for theme ids and display names. (The theme id for high contrast is used // outside of this class and hence made public in IconThemeInfo.)
if (!fname.startsWithIgnoreAsciiCase(ICON_THEME_PACKAGE_PREFIX)) { returnfalse;
}
if (!fname.endsWithIgnoreAsciiCase(EXTENSION_FOR_ICON_PACKAGES)) { returnfalse;
}
if (fname.indexOf(HELPIMG_FAKE_THEME) != -1 ) { returnfalse;
}
returntrue;
}
/*static*/ OUString
IconThemeInfo::FileNameToThemeId(std::u16string_view filename)
{
OUString r;
size_t positionOfLastDot = filename.rfind(EXTENSION_FOR_ICON_PACKAGES); if (positionOfLastDot == std::u16string_view::npos) { // means index not found throw std::runtime_error("IconThemeInfo::FileNameToThemeId() called with invalid filename.");
}
size_t positionOfFirstUnderscore = filename.find(ICON_THEME_PACKAGE_PREFIX); if (positionOfFirstUnderscore == std::u16string_view::npos) { // means index not found. Use the whole name instead throw std::runtime_error("IconThemeInfo::FileNameToThemeId() called with invalid filename.");
}
positionOfFirstUnderscore += RTL_CONSTASCII_LENGTH(ICON_THEME_PACKAGE_PREFIX);
r = filename.substr(positionOfFirstUnderscore, positionOfLastDot - positionOfFirstUnderscore); return r;
}
/*static*/ OUString
IconThemeInfo::ThemeIdToDisplayName(const OUString& themeId)
{ if (themeId.isEmpty()) { throw std::runtime_error("IconThemeInfo::ThemeIdToDisplayName() called with invalid id.");
}
// make the first letter uppercase
sal_Unicode firstLetter = aDisplayName[0]; if (rtl::isAsciiLowerCase(firstLetter))
{
aDisplayName = OUStringChar(sal_Unicode(rtl::toAsciiUpperCase(firstLetter))) + aDisplayName.subView(1);
}
// replacing underscores with spaces of multi words pack name.
aDisplayName = aDisplayName.replace('_', ' ');
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.