summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-03-12 16:26:23 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-03-16 08:44:15 +0100
commit3621c927b4555cb437fb89d28473228cb5d8e11a (patch)
treee4bcefeaf25c97b10c386710bab864af6373eea5 /uui
parent6d40302d89e1a72841c8a64733c7a26080a65cb8 (diff)
Add option to disallow opening files locked by other users
Change-Id: I316b80a56b0d6dcb257fbc805fbac3afc93472ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90425 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'uui')
-rw-r--r--uui/source/iahndl-locking.cxx4
-rw-r--r--uui/source/openlocked.cxx3
2 files changed, 5 insertions, 2 deletions
diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx
index f4297754d6b5..07a69699e9b8 100644
--- a/uui/source/iahndl-locking.cxx
+++ b/uui/source/iahndl-locking.cxx
@@ -31,6 +31,7 @@
#include <unotools/resmgr.hxx>
#include <vcl/svapp.hxx>
+#include <officecfg/Office/Common.hxx>
#include <strings.hrc>
#include "getcontinuations.hxx"
@@ -84,7 +85,8 @@ handleLockedDocumentRequest_(
aArguments.push_back( !aInfo.isEmpty()
? aInfo
: Translate::get( STR_UNKNOWNUSER, aResLocale) );
- aArguments.push_back( xRetry.is()
+ bool bAllowOverride = xRetry.is() && officecfg::Office::Common::Misc::AllowOverrideLocking::get();
+ aArguments.push_back( bAllowOverride
? Translate::get( STR_OPENLOCKED_ALLOWIGNORE_MSG, aResLocale )
: "" );
aMessage = Translate::get(STR_OPENLOCKED_MSG, aResLocale);
diff --git a/uui/source/openlocked.cxx b/uui/source/openlocked.cxx
index eb50450adc86..fa2a4616c7c1 100644
--- a/uui/source/openlocked.cxx
+++ b/uui/source/openlocked.cxx
@@ -19,6 +19,7 @@
#include <strings.hrc>
#include "openlocked.hxx"
+#include <officecfg/Office/Common.hxx>
#include <unotools/resmgr.hxx>
#include <vcl/stdtext.hxx>
#include <vcl/svapp.hxx>
@@ -29,7 +30,7 @@ OpenLockedQueryBox::OpenLockedQueryBox(weld::Window* pParent, const std::locale&
m_xQueryBox->set_title(Translate::get(STR_OPENLOCKED_TITLE, rResLocale));
m_xQueryBox->add_button(Translate::get(STR_OPENLOCKED_OPENREADONLY_BTN, rResLocale), RET_YES);
m_xQueryBox->add_button(Translate::get(STR_OPENLOCKED_OPENCOPY_BTN, rResLocale), RET_NO);
- if (bEnableOverride)
+ if (bEnableOverride && officecfg::Office::Common::Misc::AllowOverrideLocking::get())
{
// Present option to ignore the (stale?) lock file and open the document
m_xQueryBox->add_button(Translate::get(STR_ALREADYOPEN_OPEN_BTN, rResLocale), RET_IGNORE);