diff options
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/dialogs/FontFeaturesDialog.cxx | 27 | ||||
-rw-r--r-- | cui/source/inc/FontFeaturesDialog.hxx | 2 |
2 files changed, 20 insertions, 9 deletions
diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx index 21c71ce753b7..078e9a630a80 100644 --- a/cui/source/dialogs/FontFeaturesDialog.cxx +++ b/cui/source/dialogs/FontFeaturesDialog.cxx @@ -9,7 +9,6 @@ */ #include <FontFeaturesDialog.hxx> - #include <vcl/font/FeatureParser.hxx> #include <svx/dialmgr.hxx> @@ -56,20 +55,32 @@ void FontFeaturesDialog::initialize() if (!aVDev->GetFontFeatures(rFontFeatures)) return; - vcl::font::FeatureParser aParser(m_sFontName); - std::unordered_map<sal_uInt32, sal_uInt32> aExistingFeatures = aParser.getFeaturesMap(); - std::unordered_set<sal_uInt32> aDoneFeatures; + std::vector<vcl::font::Feature> rFilteredFontFeatures; - sal_Int32 i = 0; for (vcl::font::Feature const& rFontFeature : rFontFeatures) { sal_uInt32 nFontFeatureCode = rFontFeature.m_aID.m_aFeatureCode; - if (aDoneFeatures.find(nFontFeatureCode) != aDoneFeatures.end()) continue; - aDoneFeatures.insert(nFontFeatureCode); + rFilteredFontFeatures.push_back(rFontFeature); + } + + fillGrid(rFilteredFontFeatures); + + updateFontPreview(); +} + +void FontFeaturesDialog::fillGrid(std::vector<vcl::font::Feature> const& rFontFeatures) +{ + vcl::font::FeatureParser aParser(m_sFontName); + std::unordered_map<sal_uInt32, sal_uInt32> aExistingFeatures = aParser.getFeaturesMap(); + + sal_Int32 i = 0; + for (vcl::font::Feature const& rFontFeature : rFontFeatures) + { + sal_uInt32 nFontFeatureCode = rFontFeature.m_aID.m_aFeatureCode; vcl::font::FeatureDefinition aDefinition; if (rFontFeature.m_aDefinition) @@ -138,8 +149,6 @@ void FontFeaturesDialog::initialize() i++; } - - updateFontPreview(); } void FontFeaturesDialog::updateFontPreview() diff --git a/cui/source/inc/FontFeaturesDialog.hxx b/cui/source/inc/FontFeaturesDialog.hxx index 533384d2e972..aa3a4aa22d0f 100644 --- a/cui/source/inc/FontFeaturesDialog.hxx +++ b/cui/source/inc/FontFeaturesDialog.hxx @@ -45,6 +45,8 @@ private: void initialize(); OUString createFontNameWithFeatures(); + void fillGrid(std::vector<vcl::font::Feature> const& rFontFeatures); + DECL_LINK(ComboBoxSelectedHdl, ComboBox&, void); DECL_LINK(CheckBoxToggledHdl, CheckBox&, void); |