summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-03-10 15:04:25 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-03-10 17:43:23 +0100
commit275443f052887f67a6d459d443293690daa3ae24 (patch)
tree88bc19dba48f4981fbfca98a7741d5381800a01c /sfx2
parentac8e83cfb41265c6d8a3f05000e2593bc01494e7 (diff)
sfx2 classification: merge common code from sw and writerfilter
The two versions were almost a duplicate. Change-Id: I3148150d62484a55fc8d59ca354998f211435c0b
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/classificationhelper.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx
index 2abcff8eda27..fc1d236d54b1 100644
--- a/sfx2/source/view/classificationhelper.cxx
+++ b/sfx2/source/view/classificationhelper.cxx
@@ -32,6 +32,7 @@
#include <sfx2/viewfrm.hxx>
#include <tools/datetime.hxx>
#include <unotools/datetime.hxx>
+#include <vcl/layout.hxx>
#include <config_folders.h>
using namespace com::sun::star;
@@ -454,6 +455,34 @@ SfxClassificationCheckPasteResult SfxClassificationHelper::CheckPaste(const uno:
return SfxClassificationCheckPasteResult::None;
}
+bool SfxClassificationHelper::ShowPasteInfo(SfxClassificationCheckPasteResult eResult)
+{
+ switch (eResult)
+ {
+ case SfxClassificationCheckPasteResult::None:
+ {
+ return true;
+ }
+ break;
+ case SfxClassificationCheckPasteResult::TargetDocNotClassified:
+ {
+ if (!Application::IsHeadlessModeEnabled())
+ ScopedVclPtrInstance<MessageDialog>::Create(nullptr, SfxResId(STR_TARGET_DOC_NOT_CLASSIFIED), VCL_MESSAGE_INFO)->Execute();
+ return false;
+ }
+ break;
+ case SfxClassificationCheckPasteResult::DocClassificationTooLow:
+ {
+ if (!Application::IsHeadlessModeEnabled())
+ ScopedVclPtrInstance<MessageDialog>::Create(nullptr, SfxResId(STR_DOC_CLASSIFICATION_TOO_LOW), VCL_MESSAGE_INFO)->Execute();
+ return false;
+ }
+ break;
+ }
+
+ return true;
+}
+
SfxClassificationHelper::SfxClassificationHelper(const uno::Reference<document::XDocumentProperties>& xDocumentProperties)
: m_pImpl(o3tl::make_unique<Impl>(xDocumentProperties))
{