diff options
author | Khaled Hosny <khaled@aliftype.com> | 2022-12-03 16:07:24 +0200 |
---|---|---|
committer | خالد حسني <khaled@aliftype.com> | 2022-12-04 08:20:35 +0000 |
commit | b6e338fe746028f82c973987eaf04280715110e4 (patch) | |
tree | 8eeb867a130518c76322ad8a906dd6588cf408ac /cui | |
parent | df57f192c03b38b834a8283b80fc9cd9610b1583 (diff) |
Add and use Feature::isCharacterVariant/isStylisticSet
Change-Id: Ifd772da1f4b81aa08440025a5c960fb226281194
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143613
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/FontFeaturesDialog.cxx | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx index e4154e640ab5..f618d0a59ef3 100644 --- a/cui/source/dialogs/FontFeaturesDialog.cxx +++ b/cui/source/dialogs/FontFeaturesDialog.cxx @@ -87,21 +87,6 @@ void FontFeaturesDialog::initialize() updateFontPreview(); } -namespace -{ -bool isCharacterVariantCode(sal_uInt32 nFeatureCode) -{ - return ((sal_uInt32(nFeatureCode) >> 24) & 0xFF) == 'c' - && ((sal_uInt32(nFeatureCode) >> 16) & 0xFF) == 'v'; -} - -bool isStylisticSetCode(sal_uInt32 nFeatureCode) -{ - return ((sal_uInt32(nFeatureCode) >> 24) & 0xFF) == 's' - && ((sal_uInt32(nFeatureCode) >> 16) & 0xFF) == 's'; -} -} - int FontFeaturesDialog::fillGrid(std::vector<vcl::font::Feature> const& rFontFeatures) { int nRowHeight(0); @@ -120,13 +105,13 @@ int FontFeaturesDialog::fillGrid(std::vector<vcl::font::Feature> const& rFontFea if (!aDefinition) aDefinition = { nFontFeatureCode, "" }; - if (isStylisticSetCode(nFontFeatureCode)) + if (rFontFeature.isStylisticSet()) { n = j++; m_xStylisticSetsBox->set_visible(true); m_aFeatureItems.emplace_back(m_xStylisticSetsGrid.get()); } - else if (isCharacterVariantCode(nFontFeatureCode)) + else if (rFontFeature.isCharacterVariant()) { n = k++; m_xCharacterVariantsBox->set_visible(true); |