diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2024-02-05 14:12:53 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2024-02-08 08:48:08 +0100 |
commit | dcb2e2515bad3028918e0121068fac7b1d6881d3 (patch) | |
tree | b4460a84fa4d1f72c6601f39758c6e0358d490b5 | |
parent | 72ed7fa32bca2d15cf6ea5eb05c792fafa14308d (diff) |
tdf#158975 Add option to not write temp file next to local file
This causes permission issues in some setups.
See bug report for details.
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163003
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit cf616121ed48c8df96104bc35abf3b55b8862043)
Change-Id: If97030f95185ab96e21cec968b734fba8a811f9d
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 9 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 3fdf08d9e19a..b47794f128c4 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -5489,6 +5489,15 @@ </info> <value>true</value> </prop> + <prop oor:name="TempFileNextToLocalFile" oor:type="xs:boolean" oor:nillable="false"> + <info> + <desc>Determines if temp files are placed next to the local file when a file is saved. + If this is false, the temp file will be placed in the default temp directory. + Placing the temp file next to the local file will increase performance, but it might lead + to permission issues such as described in this bug: https://bugs.documentfoundation.org/show_bug.cgi?id=158975</desc> + </info> + <value>true</value> + </prop> <prop oor:name="UseDocumentOOoLockFile" oor:type="xs:boolean" oor:nillable="false"> <info> <desc>Allows to specify whether the OOo document file locking diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 8c0d101c4ea9..5c4116f2308e 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -3674,6 +3674,9 @@ OUString GetLogicBase(std::unique_ptr<SfxMedium_Impl> const & pImpl) // permission only to create the specifically named output file in that directory. #if !HAVE_FEATURE_MACOSX_SANDBOX + if (!officecfg::Office::Common::Misc::TempFileNextToLocalFile::get()) + return aLogicBase; + if (comphelper::isFileUrl(pImpl->m_aLogicName) && !pImpl->m_pInStream) { // Try to create the temp file in the same directory when storing. |