summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorMatt K <mattkse@gmail.com>2021-11-14 15:33:43 -0600
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-17 10:51:00 +0100
commitf9ab31366dbe466ef739015734bb5b6a1a0deca4 (patch)
tree64fd9aeb48ce1e656ce47d41447ab0294541ec99 /uui
parent8dec2a98ce29251936cd45ebf864a89ff767ee50 (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>
Diffstat (limited to 'uui')
-rw-r--r--uui/Library_uui.mk1
-rw-r--r--uui/inc/strings.hrc5
-rw-r--r--uui/source/iahndl-locking.cxx49
-rw-r--r--uui/source/iahndl.cxx3
-rw-r--r--uui/source/iahndl.hxx3
-rw-r--r--uui/source/readonlyopen.cxx38
-rw-r--r--uui/source/readonlyopen.hxx35
7 files changed, 0 insertions, 134 deletions
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 8eaa68cb23f6..e5af3465b557 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 47b15dc5e9da..64af0961d48a 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,35 +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 { 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)
@@ -354,24 +323,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 e36598605b8f..251a642e509f 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -810,9 +810,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 790686432cef..df2bdd054b47 100644
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -233,9 +233,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: */