summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-03-26 16:29:46 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-03-30 09:51:04 +0200
commit22a9d3837f3552806e0a8d149962134928f00e74 (patch)
tree63af6d001b0b80740d356be7ca6efcc531e64c49 /sfx2
parent4953968ca5507f487433b421147e9f9ad07178ec (diff)
tdf#101652 Add config option to prevent disabling readonly mode
There are various cases where people don't want users to be able to turn off readonly mode, so add a config option for it. Setting this option will remove the "Edit document" button from the readonly infobar and also disable the "Edit mode" menu entry. Change-Id: I7988da5b181455f778a6ab148e6bf32182c72618
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/viewsh.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index f7b3d2166b8b..81cc04a222f4 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -59,6 +59,7 @@
#include <vcl/commandinfoprovider.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <officecfg/Office/Common.hxx>
#include <officecfg/Setup.hxx>
#include <sfx2/app.hxx>
#include <sfx2/flatpak.hxx>
@@ -1754,6 +1755,13 @@ void SfxViewShell::SetController( SfxBaseController* pController )
pImpl->xClipboardListener = new SfxClipboardChangeListener( this, GetClipboardNotifier() );
}
+bool SfxViewShell::isEditDocLocked()
+{
+ if (!officecfg::Office::Common::Misc::AllowEditReadonlyDocs::get())
+ return true;
+ return false;
+}
+
Reference < XController > SfxViewShell::GetController()
{
return pImpl->m_pController.get();