summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorAshod Nakashian <ashodnakashian@yahoo.com>2017-10-30 06:05:09 -0400
committerAshod Nakashian <ashnakash@gmail.com>2017-11-03 11:15:44 +0100
commit2ecd194d091fd33c2554bfff960985b2bd5e654e (patch)
treefbe3691d0dbc8162133662a08e770e61f9d6827a /sfx2/source
parent501698657afeed006812e071a77a5228e3f7b3d5 (diff)
TSCP: use the BAC identifier as the RDF key
DOCX RDF -> SmartTag logic expects urn:bails namespace to dump the RDF, and it also needs to have the rdf file in tscp/bails.rdf, hence the move. Change-Id: I9ae496c97abe97d3596de46ffccd5f7c80e37d34 Reviewed-on: https://gerrit.libreoffice.org/44116 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/view/classificationhelper.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx
index 5e38e3885bb1..e5748a61c3ab 100644
--- a/sfx2/source/view/classificationhelper.cxx
+++ b/sfx2/source/view/classificationhelper.cxx
@@ -92,7 +92,8 @@ class SfxClassificationCategory
public:
/// PROP_BACNAME() is stored separately for easier lookup.
OUString m_aName;
- OUString m_aAbbreviatedName;
+ OUString m_aAbbreviatedName; //< An abbreviation to display instead of m_aName.
+ OUString m_aIdentifier; //< The Identifier of this entry.
size_t m_nConfidentiality; //< 0 is the lowest (least-sensitive).
std::map<OUString, OUString> m_aLabels;
};
@@ -173,7 +174,6 @@ void SAL_CALL SfxClassificationParser::startElement(const OUString& rName, const
else if (rName == "baf:BusinessAuthorizationCategory")
{
const OUString aName = xAttribs->getValueByName("Name");
- const OUString aAbbreviatedName = xAttribs->getValueByName("loextAbbreviatedName");
if (!m_pCategory && !aName.isEmpty())
{
OUString aIdentifier = xAttribs->getValueByName("Identifier");
@@ -181,9 +181,13 @@ void SAL_CALL SfxClassificationParser::startElement(const OUString& rName, const
// Create a new category and initialize it with the data that's true for all categories.
m_aCategories.emplace_back(SfxClassificationCategory());
SfxClassificationCategory& rCategory = m_aCategories.back();
+
rCategory.m_aName = aName;
// Set the abbreviated name, if any, otherwise fallback on the full name.
+ const OUString aAbbreviatedName = xAttribs->getValueByName("loextAbbreviatedName");
rCategory.m_aAbbreviatedName = !aAbbreviatedName.isEmpty() ? aAbbreviatedName : aName;
+ rCategory.m_aIdentifier = aIdentifier;
+
rCategory.m_aLabels["PolicyAuthority:Name"] = m_aPolicyAuthorityName;
rCategory.m_aLabels["Policy:Name"] = m_aPolicyName;
rCategory.m_aLabels["BusinessAuthorization:Identifier"] = m_aProgramID;
@@ -789,6 +793,19 @@ std::vector<OUString> SfxClassificationHelper::GetBACNames()
return aRet;
}
+std::vector<OUString> SfxClassificationHelper::GetBACIdentifiers()
+{
+ if (m_pImpl->m_aCategories.empty())
+ m_pImpl->parsePolicy();
+
+ std::vector<OUString> aRet;
+ std::transform(m_pImpl->m_aCategories.begin(), m_pImpl->m_aCategories.end(), std::back_inserter(aRet), [](const SfxClassificationCategory& rCategory)
+ {
+ return rCategory.m_aIdentifier;
+ });
+ return aRet;
+}
+
std::vector<OUString> SfxClassificationHelper::GetAbbreviatedBACNames()
{
if (m_pImpl->m_aCategories.empty())