diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-05-17 14:39:23 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-05-17 13:40:58 +0000 |
commit | b0f964d3c32b276613b07b3cc0312ed94618169f (patch) | |
tree | 64e355df34e9141c81184a88d472d57d4d3b240b /sfx2 | |
parent | dfe7142cdd05707123c688b2a746bed63180ff52 (diff) |
sfx2 classification: make categories list independent from policy type
This needs adding the policy type prefix in
SfxClassificationHelper::SetBACName() (when selecting a category), not
early in SfxClassificationHelper::Impl::parsePolicy().
Change-Id: Id2881ecf2fa2caad58be237e3563026ae270801f
Reviewed-on: https://gerrit.libreoffice.org/25059
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/classificationhelper.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx index 0bc615f8ac59..f1e721283c4b 100644 --- a/sfx2/source/view/classificationhelper.cxx +++ b/sfx2/source/view/classificationhelper.cxx @@ -359,15 +359,7 @@ void SfxClassificationHelper::Impl::parsePolicy() { SAL_WARN("sfx.view", "parsePolicy() failed: " << rException.Message); } - m_aCategories.clear(); - for (const SfxClassificationCategory& rCategory : xClassificationParser->m_aCategories) - { - SfxClassificationCategory aCategory; - aCategory.m_aName = rCategory.m_aName; - for (const auto& rLabel : rCategory.m_aLabels) - aCategory.m_aLabels[PROP_PREFIX_INTELLECTUALPROPERTY() + rLabel.first] = rLabel.second; - m_aCategories.push_back(aCategory); - } + m_aCategories = xClassificationParser->m_aCategories; } bool lcl_containsProperty(const uno::Sequence<beans::Property>& rProperties, const OUString& rName) @@ -692,7 +684,10 @@ void SfxClassificationHelper::SetBACName(const OUString& rName) return; } - m_pImpl->m_aCategory = *it; + m_pImpl->m_aCategory.m_aName = it->m_aName; + m_pImpl->m_aCategory.m_aLabels.clear(); + for (const auto& rLabel : it->m_aLabels) + m_pImpl->m_aCategory.m_aLabels[PROP_PREFIX_INTELLECTUALPROPERTY() + rLabel.first] = rLabel.second; m_pImpl->setStartValidity(); m_pImpl->pushToDocumentProperties(); |