From 075f20a4b696f9e85d11dc977806e41a49e6de61 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Thu, 10 Oct 2019 08:13:51 +0200 Subject: Add document-level option to lock down content extraction Setting this option will prevent copying/dragging any content from LO to another program or even another LO window. Change-Id: Ifbc032a4fa69ac1a17d4b500f5a30f5399d84ed7 Reviewed-on: https://gerrit.libreoffice.org/80586 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- sd/source/ui/view/drviews7.cxx | 2 +- sd/source/ui/view/drviewsj.cxx | 5 +++++ sd/source/ui/view/outlnvsh.cxx | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'sd/source/ui') diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index bb12920ef246..e405a987fc84 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -915,7 +915,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) if (pOlView) { - if (pOlView->GetSelected().isEmpty()) + if (pOlView->GetSelected().isEmpty() || GetViewShell()->isContentExtractionLocked()) { rSet.DisableItem( SID_CUT ); rSet.DisableItem( SID_COPY ); diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index addc54e4fc9f..80882a93394e 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -503,6 +503,11 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.DisableItem (SID_OBJECT_SHEAR); } + if (GetViewShell()->isContentExtractionLocked()) + { + rSet.DisableItem(SID_COPY); + rSet.DisableItem(SID_CUT); + } } } // end of namespace sd diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 53d55b60e46e..0c0ca15a4062 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -884,7 +884,8 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) } } - if (!pOlView->GetViewByWindow(GetActiveWindow())->HasSelection()) + if (!pOlView->GetViewByWindow(GetActiveWindow())->HasSelection() + || GetViewShell()->isContentExtractionLocked()) { rSet.DisableItem(SID_CUT); rSet.DisableItem(SID_COPY); -- cgit