diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-10-09 11:21:08 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2017-10-16 15:32:34 +0200 |
commit | 0716aca251bbb64fab6c8697ee0a2215461f1019 (patch) | |
tree | b93985678a5cc3dfdeab8474b2707413be0a19ee /sfx2 | |
parent | 92fad9596efb5ecbc756bdcc5f53ea4a417ece62 (diff) |
tscp: move getting the current policy type to class. helper
Change-Id: I54afcca1c1fc1a27458c75ab9fd3405d6f7e9239
Reviewed-on: https://gerrit.libreoffice.org/43360
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/classificationcontroller.cxx | 15 | ||||
-rw-r--r-- | sfx2/source/view/classificationhelper.cxx | 10 |
2 files changed, 13 insertions, 12 deletions
diff --git a/sfx2/source/view/classificationcontroller.cxx b/sfx2/source/view/classificationcontroller.cxx index 328466f908cc..1efdb2fd523f 100644 --- a/sfx2/source/view/classificationcontroller.cxx +++ b/sfx2/source/view/classificationcontroller.cxx @@ -29,8 +29,6 @@ #include <comphelper/dispatchcommand.hxx> #include <comphelper/configurationlistener.hxx> -#include <officecfg/Office/Common.hxx> - using namespace com::sun::star; namespace sfx2 @@ -104,16 +102,9 @@ public: namespace { -SfxClassificationPolicyType getPolicyType() -{ - sal_Int32 nPolicyTypeNumber = officecfg::Office::Common::Classification::Policy::get(); - auto eType = static_cast<SfxClassificationPolicyType>(nPolicyTypeNumber); - return eType; -} - OUString getCategoryType() { - return SfxClassificationHelper::policyTypeToString(getPolicyType()); + return SfxClassificationHelper::policyTypeToString(SfxClassificationHelper::getPolicyType()); } } // end anonymous namespace @@ -211,7 +202,7 @@ void ClassificationCategoriesController::statusChanged(const frame::FeatureState } // Restore state based on the doc. model. - const OUString& rCategoryName = aHelper.GetBACName(getPolicyType()); + const OUString& rCategoryName = aHelper.GetBACName(SfxClassificationHelper::getPolicyType()); if (!rCategoryName.isEmpty()) { m_pClassification->getCategory()->SelectEntry(rCategoryName); @@ -232,7 +223,7 @@ ClassificationControl::ClassificationControl(vcl::Window* pParent) m_pCategory = VclPtr<ListBox>::Create(this, WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_DROPDOWN|WB_SIMPLEMODE); OUString aText; - switch (getPolicyType()) + switch (SfxClassificationHelper::getPolicyType()) { case SfxClassificationPolicyType::IntellectualProperty: aText = SfxResId(STR_CLASSIFIED_INTELLECTUAL_PROPERTY); diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx index aa61839c06e6..3378ed0df239 100644 --- a/sfx2/source/view/classificationhelper.cxx +++ b/sfx2/source/view/classificationhelper.cxx @@ -37,6 +37,8 @@ #include <svl/fstathelper.hxx> #include <config_folders.h> +#include <officecfg/Office/Common.hxx> + using namespace com::sun::star; namespace @@ -847,4 +849,12 @@ const OUString& SfxClassificationHelper::PROP_PREFIX_INTELLECTUALPROPERTY() return sProp; } +SfxClassificationPolicyType SfxClassificationHelper::getPolicyType() +{ + sal_Int32 nPolicyTypeNumber = officecfg::Office::Common::Classification::Policy::get(); + auto eType = static_cast<SfxClassificationPolicyType>(nPolicyTypeNumber); + return eType; + +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |