diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-24 14:25:19 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-24 17:58:55 +0100 |
commit | fa72b6e97c5c60eae4a97541cde150ee0d8c0443 (patch) | |
tree | 8e131c6694bd2ed8ffec933586e5c35474cf688c /sfx2/source/view/classificationhelper.cxx | |
parent | a3a7a70811123a9d7c812952496596d7be19135b (diff) |
sw classification: put the relevant field to the footer if policy wants so
Change-Id: I61c235660366ec1aba137097600605aae76c39a7
Diffstat (limited to 'sfx2/source/view/classificationhelper.cxx')
-rw-r--r-- | sfx2/source/view/classificationhelper.cxx | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx index 5680e1a68338..d2e123de68cf 100644 --- a/sfx2/source/view/classificationhelper.cxx +++ b/sfx2/source/view/classificationhelper.cxx @@ -163,8 +163,8 @@ throw (xml::sax::SAXException, uno::RuntimeException, std::exception) rCategory.m_aLabels["urn:bails:IntellectualProperty:Marking:general-distribution-statement:ext:2"].clear(); rCategory.m_aLabels["urn:bails:IntellectualProperty:Marking:general-distribution-statement:ext:3"].clear(); rCategory.m_aLabels["urn:bails:IntellectualProperty:Marking:general-distribution-statement:ext:4"].clear(); - rCategory.m_aLabels["urn:bails:IntellectualProperty:Marking:document-footer"].clear(); - rCategory.m_aLabels["urn:bails:IntellectualProperty:Marking:document-header"].clear(); + rCategory.m_aLabels[SfxClassificationHelper::PROP_DOCHEADER()].clear(); + rCategory.m_aLabels[SfxClassificationHelper::PROP_DOCFOOTER()].clear(); rCategory.m_aLabels["urn:bails:IntellectualProperty:Marking:document-watermark"].clear(); rCategory.m_aLabels["urn:bails:IntellectualProperty:Marking:email-first-line-of-text"].clear(); rCategory.m_aLabels["urn:bails:IntellectualProperty:Marking:email-last-line-of-text"].clear(); @@ -235,9 +235,9 @@ void SAL_CALL SfxClassificationParser::endElement(const OUString& rName) throw ( if (m_pCategory) { if (m_aIdentifier == "Document: Header") - m_pCategory->m_aLabels["urn:bails:IntellectualProperty:Marking:document-header"] = m_aValue; + m_pCategory->m_aLabels[SfxClassificationHelper::PROP_DOCHEADER()] = m_aValue; else if (m_aIdentifier == "Document: Footer") - m_pCategory->m_aLabels["urn:bails:IntellectualProperty:Marking:document-footer"] = m_aValue; + m_pCategory->m_aLabels[SfxClassificationHelper::PROP_DOCFOOTER()] = m_aValue; else if (m_aIdentifier == "Document: Watermark") m_pCategory->m_aLabels["urn:bails:IntellectualProperty:Marking:document-watermark"] = m_aValue; } @@ -418,7 +418,16 @@ bool SfxClassificationHelper::HasImpactLevel() bool SfxClassificationHelper::HasDocumentHeader() { - std::map<OUString, OUString>::iterator it = m_pImpl->m_aLabels.find("urn:bails:IntellectualProperty:Marking:document-header"); + std::map<OUString, OUString>::iterator it = m_pImpl->m_aLabels.find(SfxClassificationHelper::PROP_DOCHEADER()); + if (it == m_pImpl->m_aLabels.end() || it->second.isEmpty()) + return false; + + return true; +} + +bool SfxClassificationHelper::HasDocumentFooter() +{ + std::map<OUString, OUString>::iterator it = m_pImpl->m_aLabels.find(SfxClassificationHelper::PROP_DOCFOOTER()); if (it == m_pImpl->m_aLabels.end() || it->second.isEmpty()) return false; @@ -527,4 +536,10 @@ const OUString& SfxClassificationHelper::PROP_DOCHEADER() return sProp; } +const OUString& SfxClassificationHelper::PROP_DOCFOOTER() +{ + static OUString sProp("urn:bails:IntellectualProperty:Marking:document-footer"); + return sProp; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |