summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2023-09-11 12:54:34 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2023-09-18 16:28:18 +0200
commit4c76b9568a3d008219a3dc0818f2f6db2939e354 (patch)
tree7bd336d497615dd8d9c3979855c259002e03bd95 /sfx2
parentb47a69ebee54a4b399c90311e17b994635140002 (diff)
lok: don't convert save request to save as
Don't force save as in LOK but report that file cannot be written. Without that we go through save as process which is used for export functionality and client's browser downloads the file in the end instead of uploading to the storage. Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: I2784bfc25055934363c304b5f5a87ae4da620a4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156819 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Ashod Nakashian <ash@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157021 Tested-by: Jenkins
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objserv.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index a9c39b006564..6308de92e3c6 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1039,6 +1039,17 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
aDispatchArgs );
bool bForceSaveAs = nId == SID_SAVEDOC && IsReadOnlyMedium();
+
+ if (comphelper::LibreOfficeKit::isActive() && bForceSaveAs)
+ {
+ // Don't force save as in LOK but report that file cannot be written
+ // to avoid confusion with exporting for file download purpose
+
+ throw task::ErrorCodeIOException(
+ "SfxObjectShell::ExecFile_Impl: ERRCODE_IO_CANTWRITE",
+ uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_CANTWRITE));
+ }
+
const SfxSlot* pSlot = GetModule()->GetSlotPool()->GetSlot( bForceSaveAs ? SID_SAVEASDOC : nId );
if ( !pSlot )
throw uno::Exception("no slot", nullptr);