framework/source/interaction/quietinteraction.cxx    |   15 -----
 offapi/UnoApi_offapi.mk                              |    1 
 offapi/com/sun/star/document/ReadOnlyOpenRequest.idl |   51 -------------------
 sfx2/source/doc/docfile.cxx                          |   44 ----------------
 uui/Library_uui.mk                                   |    1 
 uui/inc/strings.hrc                                  |    5 -
 uui/source/iahndl-locking.cxx                        |   50 ------------------
 uui/source/iahndl.cxx                                |    3 -
 uui/source/iahndl.hxx                                |    3 -
 uui/source/readonlyopen.cxx                          |   38 --------------
 uui/source/readonlyopen.hxx                          |   35 -------------
 11 files changed, 1 insertion(+), 245 deletions(-)

New commits:
commit 63cb67f9e7a1920b43510df8f222c88a56fdf82d
Author:     Matt K <matt...@gmail.com>
AuthorDate: Sun Nov 14 15:33:43 2021 -0600
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Thu Nov 18 10:37:57 2021 +0100

    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.kagan...@collabora.com>
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125398
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/framework/source/interaction/quietinteraction.cxx 
b/framework/source/interaction/quietinteraction.cxx
index 3719e00dc3ec..b6f3495fff09 100644
--- a/framework/source/interaction/quietinteraction.cxx
+++ b/framework/source/interaction/quietinteraction.cxx
@@ -24,7 +24,6 @@
 #include <com/sun/star/document/XInteractionFilterSelect.hpp>
 #include <com/sun/star/document/XInteractionFilterOptions.hpp>
 #include <com/sun/star/document/FilterOptionsRequest.hpp>
-#include <com/sun/star/document/ReadOnlyOpenRequest.hpp>
 #include <com/sun/star/task/ErrorCodeRequest.hpp>
 
 #include <com/sun/star/document/LockedDocumentRequest.hpp>
@@ -78,7 +77,6 @@ void SAL_CALL QuietInteraction::handle( const 
css::uno::Reference< css::task::XI
     css::task::ErrorCodeRequest          aErrorCodeRequest;
     css::document::LockedDocumentRequest aLockedDocumentRequest;
     css::document::FilterOptionsRequest  aFilterOptionsRequest;
-    css::document::ReadOnlyOpenRequest   aReadOnlyOpenRequest;
 
     if( aRequest >>= aErrorCodeRequest )
     {
@@ -111,19 +109,6 @@ void SAL_CALL QuietInteraction::handle( const 
css::uno::Reference< css::task::XI
         }
     }
     else
-    if (aRequest >>= aReadOnlyOpenRequest)
-    {
-        // allow unit tests to run on read-only SRCDIR
-        if (xApprove.is())
-        {
-            xApprove->select();
-        }
-        else if (xAbort.is())
-        {
-            xAbort->select();
-        }
-    }
-    else
     if (xAbort.is())
         xAbort->select();
 }
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 01dd48280fea..2260be2bda38 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -2211,7 +2211,6 @@ $(eval $(call 
gb_UnoApi_add_idlfiles,offapi,com/sun/star/document,\
        NoSuchFilterRequest \
        OwnLockOnDocumentRequest \
        PrinterIndependentLayout \
-       ReadOnlyOpenRequest \
        RedlineDisplayType \
        ReloadEditableRequest \
        UndoContextNotClosedException \
diff --git a/offapi/com/sun/star/document/ReadOnlyOpenRequest.idl 
b/offapi/com/sun/star/document/ReadOnlyOpenRequest.idl
deleted file mode 100644
index 49a82b7016f9..000000000000
--- a/offapi/com/sun/star/document/ReadOnlyOpenRequest.idl
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef __com_sun_star_document_ReadOnlyOpenRequest_idl__
-#define __com_sun_star_document_ReadOnlyOpenRequest_idl__
-
-#include <com/sun/star/uno/Exception.idl>
-
-module com
-{
-    module sun
-    {
-        module star
-        {
-            module document
-            {
-                /** Is used for interaction handle to query user decision 
regarding whether to open
-                    a document read-only and whether to notify the user when 
the document becomes
-                    editable.
-
-                    @since LibreOffice 7.2
-                */
-                published exception ReadOnlyOpenRequest : 
::com::sun::star::uno::Exception
-                {
-                    /** The URL of the document that is open but was made 
editable.
-                    */
-                    string DocumentURL;
-                };
-            };
-        };
-    };
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
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;
             }
diff --git a/uui/Library_uui.mk b/uui/Library_uui.mk
index 4f664ac20dba..105c32d889e4 100644
--- a/uui/Library_uui.mk
+++ b/uui/Library_uui.mk
@@ -62,7 +62,6 @@ $(eval $(call gb_Library_add_exception_objects,uui,\
        uui/source/openlocked \
        uui/source/passwordcontainer \
        uui/source/passworddlg \
-       uui/source/readonlyopen \
        uui/source/reloadeditable \
        uui/source/requeststringresolver \
        uui/source/secmacrowarnings \
diff --git a/uui/inc/strings.hrc b/uui/inc/strings.hrc
index 096d7ef977a1..a9d2cde8c5c2 100644
--- a/uui/inc/strings.hrc
+++ b/uui/inc/strings.hrc
@@ -84,9 +84,4 @@
 #define STR_RELOADEDITABLE_MSG                  NC_("STR_RELOADEDITABLE_MSG", 
"Document file '$(ARG1)' is now editable \n\nReload this document for editing?")
 #define STR_RELOADEDITABLE_BTN                  NC_("STR_RELOADEDITABLE_BTN", 
"~Reload")
 
-#define STR_READONLYOPEN_TITLE                  NC_("STR_READONLYOPEN_TITLE", 
"Document is read-only")
-#define STR_READONLYOPEN_MSG                    NC_("STR_READONLYOPEN_MSG", 
"Document file '$(ARG1)' is read-only.\n\nOpen read-only or select Notify to 
open read-only and get notified when the document becomes editable.")
-#define STR_READONLYOPEN_BTN                    NC_("STR_READONLYOPEN_BTN", 
"Open ~Read-Only")
-#define STR_READONLYOPEN_NOTIFY_BTN             
NC_("STR_READONLYOPEN_NOTIFY_BTN", "~Notify")
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx
index 23493c16053c..f9ab943b605a 100644
--- a/uui/source/iahndl-locking.cxx
+++ b/uui/source/iahndl-locking.cxx
@@ -23,7 +23,6 @@
 #include <com/sun/star/document/LockFileIgnoreRequest.hpp>
 #include <com/sun/star/document/LockFileCorruptRequest.hpp>
 #include <com/sun/star/document/OwnLockOnDocumentRequest.hpp>
-#include <com/sun/star/document/ReadOnlyOpenRequest.hpp>
 #include <com/sun/star/document/ReloadEditableRequest.hpp>
 #include <com/sun/star/task/XInteractionApprove.hpp>
 #include <com/sun/star/task/XInteractionDisapprove.hpp>
@@ -43,7 +42,6 @@
 #include "filechanged.hxx"
 #include "lockfailed.hxx"
 #include "lockcorrupt.hxx"
-#include "readonlyopen.hxx"
 #include "reloadeditable.hxx"
 
 #include "iahndl.hxx"
@@ -57,36 +55,6 @@ using namespace com::sun::star;
 
 namespace {
 
-void handleReadOnlyOpenRequest_(
-    weld::Window* pParent, const OUString& aDocumentURL,
-    uno::Sequence<uno::Reference<task::XInteractionContinuation>> const& 
rContinuations)
-{
-    uno::Reference<task::XInteractionApprove> xApprove;
-    uno::Reference<task::XInteractionAbort> xAbort;
-    getContinuations(rContinuations, &xApprove, &xAbort);
-
-    if (!xApprove.is() || !xAbort.is())
-        return;
-
-    SolarMutexGuard aGuard;
-    std::locale aResLocale = Translate::Create("uui");
-
-    OUString aMessage;
-    std::vector<OUString> aArguments;
-    aArguments.push_back(aDocumentURL);
-
-    aMessage = Translate::get(STR_READONLYOPEN_MSG, aResLocale);
-    aMessage = UUIInteractionHelper::replaceMessageWithArguments(aMessage, 
aArguments);
-
-    ReadOnlyOpenQueryBox aDialog(pParent, aResLocale, aMessage);
-    int nResult = aDialog.run();
-
-    if (nResult == RET_YES)
-        xApprove->select();
-    else if (nResult != RET_RETRY)
-        xAbort->select();
-}
-
 void handleReloadEditableRequest_(
     weld::Window* pParent, const OUString& aDocumentURL,
     uno::Sequence<uno::Reference<task::XInteractionContinuation>> const& 
rContinuations)
@@ -357,24 +325,6 @@ UUIInteractionHelper::handleLockFileProblemRequest(
     return false;
 }
 
-bool UUIInteractionHelper::handleReadOnlyOpenRequest(
-    uno::Reference<task::XInteractionRequest> const& rRequest)
-{
-    uno::Any aAnyRequest(rRequest->getRequest());
-
-    document::ReadOnlyOpenRequest aReadOnlyOpenRequest;
-    if (aAnyRequest >>= aReadOnlyOpenRequest)
-    {
-        uno::Reference<awt::XWindow> xParent = getParentXWindow();
-        handleReadOnlyOpenRequest_(Application::GetFrameWeld(xParent),
-                                     aReadOnlyOpenRequest.DocumentURL,
-                                     rRequest->getContinuations());
-        return true;
-    }
-
-    return false;
-}
-
 bool UUIInteractionHelper::handleReloadEditableRequest(
     uno::Reference<task::XInteractionRequest> const& rRequest)
 {
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 2897a582c3e9..26b670e49fb7 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -818,9 +818,6 @@ UUIInteractionHelper::handleRequest_impl(
             if ( handleReloadEditableRequest( rRequest ) )
                 return true;
 
-            if ( handleReadOnlyOpenRequest( rRequest ) )
-                return true;
-
             task::DocumentMacroConfirmationRequest aMacroConfirmRequest;
             if (aAnyRequest >>= aMacroConfirmRequest)
             {
diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx
index 8dc828a7dd5f..cbb7efb85396 100644
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -234,9 +234,6 @@ private:
     bool handleReloadEditableRequest(
         css::uno::Reference<css::task::XInteractionRequest> const& rRequest);
 
-    bool
-    
handleReadOnlyOpenRequest(css::uno::Reference<css::task::XInteractionRequest> 
const& rRequest);
-
     bool handleCustomRequest(
                 const css::uno::Reference< css::task::XInteractionRequest >& 
i_rRequest,
                 const OUString& i_rServiceName
diff --git a/uui/source/readonlyopen.cxx b/uui/source/readonlyopen.cxx
deleted file mode 100644
index 72a3b989e079..000000000000
--- a/uui/source/readonlyopen.cxx
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <strings.hrc>
-#include "readonlyopen.hxx"
-#include <officecfg/Office/Common.hxx>
-#include <unotools/resmgr.hxx>
-#include <vcl/stdtext.hxx>
-#include <vcl/svapp.hxx>
-
-ReadOnlyOpenQueryBox::ReadOnlyOpenQueryBox(weld::Window* pParent, const 
std::locale& rResLocale,
-                                           const OUString& rMessage)
-    : m_xQueryBox(Application::CreateMessageDialog(pParent, 
VclMessageType::Question,
-                                                   VclButtonsType::NONE, 
rMessage))
-{
-    m_xQueryBox->set_title(Translate::get(STR_READONLYOPEN_TITLE, rResLocale));
-    m_xQueryBox->add_button(Translate::get(STR_READONLYOPEN_BTN, rResLocale), 
RET_YES);
-    m_xQueryBox->add_button(Translate::get(STR_READONLYOPEN_NOTIFY_BTN, 
rResLocale), RET_RETRY);
-    m_xQueryBox->add_button(GetStandardText(StandardButtonType::Cancel), 
RET_CANCEL);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/uui/source/readonlyopen.hxx b/uui/source/readonlyopen.hxx
deleted file mode 100644
index 08063d10be0e..000000000000
--- a/uui/source/readonlyopen.hxx
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#pragma once
-
-#include <vcl/weld.hxx>
-
-class ReadOnlyOpenQueryBox
-{
-private:
-    std::unique_ptr<weld::MessageDialog> m_xQueryBox;
-
-public:
-    ReadOnlyOpenQueryBox(weld::Window* pParent, const std::locale& rResLocale,
-                         const OUString& rMessage);
-    int run() { return m_xQueryBox->run(); }
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */

Reply via email to