diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-04-19 18:01:37 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-04-25 11:13:41 +0200 |
commit | 101e8309188581594bdfe1c77e0c81218a991124 (patch) | |
tree | c9078e1aee5b3e1f7ecb8f9aa9cf693386096383 /ucb | |
parent | 17de89f167a26d8d1cb560f61e92b5aef7ef3fb7 (diff) |
ucb: webdav-curl: put user name from config into LOCK request
... so that the dialog in SfxMedium::LockOrigFileOnDemand() can show
something more useful than hard-coded URL, which has been used since
commit 99bdd887a6141883878978bad9beb35e7b326cd1 in 2009 when locking
was added.
This is half of the user info that is put into LO's own lock files
(see svt::LockFileCommon::GenerateOwnEntry()).
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133186
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 70bea73ffbe815c2d5b7067f20d3eebbb98df61f)
ucb: webdav-curl: check UseUserData before sending user name
Hope this should be acceptable.
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133188
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 6d7c3848560883034a4ff12ac1ef52d2d1d28606)
Change-Id: Iefac724644a536fc37c3c79ce862e25bd9be38af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133143
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/CppunitTest_ucb_webdav_core.mk | 1 | ||||
-rw-r--r-- | ucb/Library_ucpdav1.mk | 1 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-curl/webdavcontent.cxx | 8 |
3 files changed, 8 insertions, 2 deletions
diff --git a/ucb/CppunitTest_ucb_webdav_core.mk b/ucb/CppunitTest_ucb_webdav_core.mk index fbd3f59f55f6..0df1feefff21 100644 --- a/ucb/CppunitTest_ucb_webdav_core.mk +++ b/ucb/CppunitTest_ucb_webdav_core.mk @@ -19,6 +19,7 @@ $(eval $(call gb_CppunitTest_use_libraries,ucb_webdav_core, \ cppuhelper \ sal \ salhelper \ + svl \ test \ ucbhelper \ tl \ diff --git a/ucb/Library_ucpdav1.mk b/ucb/Library_ucpdav1.mk index b8cbb2be48e1..8574c6ff47a4 100644 --- a/ucb/Library_ucpdav1.mk +++ b/ucb/Library_ucpdav1.mk @@ -23,6 +23,7 @@ $(eval $(call gb_Library_use_libraries,ucpdav1,\ cppuhelper \ sal \ salhelper \ + svl \ ucbhelper \ tl \ )) diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx index 1eb069a3480e..513626b8d73b 100644 --- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx @@ -22,12 +22,14 @@ #include <cppuhelper/queryinterface.hxx> #include <rtl/uri.hxx> #include <sal/log.hxx> +#include <officecfg/Office/Common.hxx> #include <officecfg/Inet.hxx> #include <ucbhelper/contentidentifier.hxx> #include <ucbhelper/macros.hxx> #include <ucbhelper/propertyvalueset.hxx> #include <ucbhelper/simpleinteractionrequest.hxx> #include <ucbhelper/cancelcommandexecution.hxx> +#include <svl/lockfilecommon.hxx> #include <com/sun/star/beans/IllegalTypeException.hpp> #include <com/sun/star/beans/NotRemoveableException.hpp> @@ -3236,8 +3238,10 @@ void Content::lock( } uno::Any aOwnerAny; - aOwnerAny - <<= OUString("LibreOffice - http://www.libreoffice.org/"); + OUString const user(officecfg::Office::Common::Save::Document::UseUserData::get() + ? " - " + ::svt::LockFileCommon::GetOOOUserName() + : OUString()); + aOwnerAny <<= OUString("LibreOffice" + user); ucb::Lock aLock( ucb::LockScope_EXCLUSIVE, |