Skip to content

Commit

Permalink
lok: don't convert save request to save as
Browse files Browse the repository at this point in the history
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 <[email protected]>
Change-Id: I2784bfc25055934363c304b5f5a87ae4da620a4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156819
Tested-by: Jenkins CollaboraOffice <[email protected]>
Reviewed-by: Ashod Nakashian <[email protected]>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157021
Tested-by: Jenkins
  • Loading branch information
eszkadev committed Sep 18, 2023
1 parent b47a69e commit 4c76b95
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sfx2/source/doc/objserv.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4c76b95

Please sign in to comment.