summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-02-23 10:21:28 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-23 14:01:15 +0100
commitb84dca7cd508e806842341329456dc33d6179e28 (patch)
tree22b66db73b756c81a2e77b9f78a1fa1cf9485f84
parent02a320777f5b91f33aee364bb29ecc0151aac3e0 (diff)
sfx2 classification: add interface to set category name
Change-Id: I289b46f5f57ef000de5f482b5c8ed7bcaa89ddab
-rw-r--r--include/sfx2/classificationhelper.hxx2
-rw-r--r--sfx2/source/view/classificationhelper.cxx4
-rw-r--r--sw/source/core/edit/edfcol.cxx11
3 files changed, 15 insertions, 2 deletions
diff --git a/include/sfx2/classificationhelper.hxx b/include/sfx2/classificationhelper.hxx
index 613d35e8d1ff..e1c4252143b6 100644
--- a/include/sfx2/classificationhelper.hxx
+++ b/include/sfx2/classificationhelper.hxx
@@ -34,6 +34,8 @@ public:
SfxClassificationHelper(SfxObjectShell& rObjectShell);
~SfxClassificationHelper();
OUString GetBACName();
+ /// Setting this sets all the other properties, based on the policy.
+ void SetBACName(const OUString& rName);
/// If GetImpactLevelColor() will return something meaningful.
bool HasImpactLevel();
basegfx::BColor GetImpactLevelColor();
diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx
index d062eacdc537..86ab579ef5df 100644
--- a/sfx2/source/view/classificationhelper.cxx
+++ b/sfx2/source/view/classificationhelper.cxx
@@ -150,4 +150,8 @@ OUString SfxClassificationHelper::GetDocumentWatermark()
return OUString();
}
+void SfxClassificationHelper::SetBACName(const OUString& /*rName*/)
+{
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 8b462f7fa69b..c5ced4b8f81a 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -19,6 +19,7 @@
#include <hintids.hxx>
#include <editeng/formatbreakitem.hxx>
+#include <sfx2/classificationhelper.hxx>
#include <editsh.hxx>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
@@ -31,6 +32,7 @@
#include <numrule.hxx>
#include <swundo.hxx>
#include <docary.hxx>
+#include <docsh.hxx>
SwTextFormatColl& SwEditShell::GetDfltTextFormatColl() const
{
@@ -47,9 +49,14 @@ SwTextFormatColl& SwEditShell::GetTextFormatColl( sal_uInt16 nFormatColl) const
return *((*(GetDoc()->GetTextFormatColls()))[nFormatColl]);
}
-void SwEditShell::SetClassification(const OUString& /*rName*/)
+void SwEditShell::SetClassification(const OUString& rName)
{
- (void)this;//TODO
+ SwDocShell* pDocShell = GetDoc()->GetDocShell();
+ if (!pDocShell)
+ return;
+
+ SfxClassificationHelper aHelper(*pDocShell);
+ aHelper.SetBACName(rName);
}
// #i62675#