diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-24 16:45:01 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-24 17:58:55 +0100 |
commit | bff9f2d469736d20261ba8ff488dd98452e3fe88 (patch) | |
tree | d6208b41889d7a81799c09b7cbe764347bc0879a | |
parent | cc3d29dc412902ea8d6a85426ba72b77166a8c95 (diff) |
sw classification: name watermark objects, so later it's possible to find them
Given that they are not fields, it's necessary to re-create them every
time their textural content would change.
Change-Id: I1276ef686b1b622dccaa8ac4996af8e4cb4de329
-rw-r--r-- | include/sfx2/classificationhelper.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/classificationhelper.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/edit/edfcol.cxx | 3 |
3 files changed, 14 insertions, 3 deletions
diff --git a/include/sfx2/classificationhelper.hxx b/include/sfx2/classificationhelper.hxx index 1f37cb7dc7bb..c84f7ce22aba 100644 --- a/include/sfx2/classificationhelper.hxx +++ b/include/sfx2/classificationhelper.hxx @@ -51,6 +51,8 @@ public: static const OUString& PROP_DOCHEADER(); /// Brief text located at the bottom of each document's pages. static const OUString& PROP_DOCFOOTER(); + /// Brief text formatted as a watermark on each document's page. + static const OUString& PROP_DOCWATERMARK(); }; #endif diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx index d2e123de68cf..3ff9047db16a 100644 --- a/sfx2/source/view/classificationhelper.cxx +++ b/sfx2/source/view/classificationhelper.cxx @@ -165,7 +165,7 @@ throw (xml::sax::SAXException, uno::RuntimeException, std::exception) rCategory.m_aLabels["urn:bails:IntellectualProperty:Marking:general-distribution-statement:ext:4"].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[SfxClassificationHelper::PROP_DOCWATERMARK()].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(); rCategory.m_aLabels["urn:bails:IntellectualProperty:Marking:email-subject-prefix"].clear(); @@ -239,7 +239,7 @@ void SAL_CALL SfxClassificationParser::endElement(const OUString& rName) throw ( else if (m_aIdentifier == "Document: Footer") 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; + m_pCategory->m_aLabels[SfxClassificationHelper::PROP_DOCWATERMARK()] = m_aValue; } } } @@ -486,7 +486,7 @@ basegfx::BColor SfxClassificationHelper::GetImpactLevelColor() OUString SfxClassificationHelper::GetDocumentWatermark() { - std::map<OUString, OUString>::iterator it = m_pImpl->m_aLabels.find("urn:bails:IntellectualProperty:Marking:document-watermark"); + std::map<OUString, OUString>::iterator it = m_pImpl->m_aLabels.find(SfxClassificationHelper::PROP_DOCWATERMARK()); if (it != m_pImpl->m_aLabels.end()) return it->second; @@ -542,4 +542,10 @@ const OUString& SfxClassificationHelper::PROP_DOCFOOTER() return sProp; } +const OUString& SfxClassificationHelper::PROP_DOCWATERMARK() +{ + static OUString sProp("urn:bails:IntellectualProperty:Marking:document-watermark"); + return sProp; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 62403d8bf069..14ef65460c18 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -277,6 +277,9 @@ void SwEditShell::SetClassification(const OUString& rName) else it->Value <<= aPropertyValues; xPropertySet->setPropertyValue("CustomShapeGeometry", uno::makeAny(comphelper::containerToSequence(aGeomPropVec))); + + uno::Reference<container::XNamed> xNamed(xShape, uno::UNO_QUERY); + xNamed->setName(SfxClassificationHelper::PROP_DOCWATERMARK()); xLockable->removeActionLock(); } } |