diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-10 17:41:04 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-10 17:43:23 +0100 |
commit | eff3f82033b5862af6300876aa69d9de0486d61b (patch) | |
tree | b11302979fdb82586d92330ee55d8f490f2d98e1 /sd/source | |
parent | 7c9f080aca4665980e8cf25ee42ad1b5ec64624b (diff) |
sd: handle classification during copy&paste
This is the same feature as done for sw internal copy&paste and for the
sw RTF filter: if the copying would leak information, better not to do
that.
Change-Id: I39186d7b798d822f1f3a5a4b1ce2aa000c6f7906
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 28186123b4b9..cb013755c1f7 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -70,6 +70,7 @@ #include "unomodel.hxx" #include "ViewClipboard.hxx" #include <sfx2/ipclient.hxx> +#include <sfx2/classificationhelper.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/processfactory.hxx> #include <tools/stream.hxx> @@ -355,7 +356,21 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, // the work was done; this allows to check multiple formats and not just fail // when a CHECK_FORMAT_TRANS(*format*) detected format does not work. This is // e.g. necessary for SotClipboardFormatId::BITMAP - if( pOwnData && nFormat == SotClipboardFormatId::NONE ) + + if (!bReturn && pOwnData) + { + // Paste only if SfxClassificationHelper recommends so. + const SfxObjectShellRef& pSource = pOwnData->GetDocShell(); + SfxObjectShell* pDestination = mrDoc.GetDocSh(); + if (pSource && pDestination) + { + SfxClassificationCheckPasteResult eResult = SfxClassificationHelper::CheckPaste(pSource->getDocProperties(), pDestination->getDocProperties()); + if (!SfxClassificationHelper::ShowPasteInfo(eResult)) + bReturn = true; + } + } + + if( !bReturn && pOwnData && nFormat == SotClipboardFormatId::NONE ) { const View* pSourceView = pOwnData->GetView(); |