diff options
author | Matt K <mattkse@gmail.com> | 2021-11-14 15:33:43 -0600 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2021-11-18 10:37:57 +0100 |
commit | 63cb67f9e7a1920b43510df8f222c88a56fdf82d (patch) | |
tree | 7c46629e96f03175659f469469cd50ef63426bde /sfx2 | |
parent | f0e816412c386de976228b2232c23c31fd7f2d2c (diff) |
tdf#143971 Removes pop-up dialog for read-only documents
No longer does the user get a pop-up dialog when opening
documents that are read-only, asking whether they want to be
notified when the document becomes editable. The change
removes some of the functionality introduced in commit
95eb088802562b75f8b299908160145c7e88d763 "tdf#47065 Add new
file open UI options and implement a new thread".
Change-Id: Ic25e8e293e7224fb5086249a9d4814914fa961d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125340
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125398
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 734611b9f6f1..2aa9073e37c9 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -38,7 +38,6 @@ #include <com/sun/star/document/LockFileIgnoreRequest.hpp> #include <com/sun/star/document/LockFileCorruptRequest.hpp> #include <com/sun/star/document/ChangedByOthersRequest.hpp> -#include <com/sun/star/document/ReadOnlyOpenRequest.hpp> #include <com/sun/star/document/ReloadEditableRequest.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/embed/ElementModes.hpp> @@ -1176,43 +1175,6 @@ SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog(const LockFileEntr return nResult; } -bool SfxMedium::ShowReadOnlyOpenDialog() -{ - uno::Reference<task::XInteractionHandler> xHandler = GetInteractionHandler(); - if (xHandler.is()) - { - OUString aDocumentURL - = GetURLObject().GetLastName(INetURLObject::DecodeMechanism::WithCharset); - ::rtl::Reference<::ucbhelper::InteractionRequest> xInteractionRequestImpl - = new ::ucbhelper::InteractionRequest(uno::makeAny(document::ReadOnlyOpenRequest( - OUString(), uno::Reference<uno::XInterface>(), aDocumentURL))); - if (xInteractionRequestImpl != nullptr) - { - sal_Int32 nContinuations = 2; - uno::Sequence<uno::Reference<task::XInteractionContinuation>> aContinuations( - nContinuations); - aContinuations[0] = new ::ucbhelper::InteractionAbort(xInteractionRequestImpl.get()); - aContinuations[1] = new ::ucbhelper::InteractionApprove(xInteractionRequestImpl.get()); - xInteractionRequestImpl->setContinuations(aContinuations); - xHandler->handle(xInteractionRequestImpl); - ::rtl::Reference<::ucbhelper::InteractionContinuation> xSelected - = xInteractionRequestImpl->getSelection(); - if (uno::Reference<task::XInteractionAbort>(xSelected.get(), uno::UNO_QUERY).is()) - { - SetError(ERRCODE_ABORT); - return false; - } - else if (!uno::Reference<task::XInteractionApprove>(xSelected.get(), uno::UNO_QUERY) - .is()) - // user selected "Notify" - pImpl->m_bNotifyWhenEditable = true; - - return true; - } - } - return false; -} - bool SfxMedium::ShowLockFileProblemDialog(MessageDlg nWhichDlg) { // system file locking is not active, ask user whether he wants to open the document without any locking @@ -3015,11 +2977,7 @@ void SfxMedium::Init_Impl() if (item.getFileStatus(stat) == osl::FileBase::E_None && stat.isValid(osl_FileStatus_Mask_Attributes)) { - if ((stat.getAttributes() & osl_File_Attribute_ReadOnly) != 0 -#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT - && ShowReadOnlyOpenDialog() -#endif - ) + if ((stat.getAttributes() & osl_File_Attribute_ReadOnly) != 0) { pImpl->m_bOriginallyReadOnly = true; } |