From 2ad7d5cfb0288559921b0d9ccad0a23d95cde452 Mon Sep 17 00:00:00 2001 From: Sarper Akdemir Date: Fri, 21 Jun 2024 12:40:11 +0200 Subject: make additionsdialog show connection errors use non-scoped interaction handler instead of the scoped SimpleFileAccessInteraction so that errors will be handled with correct pop-up dialogs. Also throw the correct type of DAVException for USC_CONNECT_FAILED in Content::Open Change-Id: If2031dfa2796f91fad6866bc9608194c92658b96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169519 Tested-by: Jenkins Reviewed-by: Michael Stahl --- cui/source/dialogs/AdditionsDialog.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cui/source') diff --git a/cui/source/dialogs/AdditionsDialog.cxx b/cui/source/dialogs/AdditionsDialog.cxx index 61bee50455b3..3f57676a13ec 100644 --- a/cui/source/dialogs/AdditionsDialog.cxx +++ b/cui/source/dialogs/AdditionsDialog.cxx @@ -71,11 +71,12 @@ using namespace ::com::sun::star::beans; namespace { // Gets the content of the given URL and returns as a standard string -std::string ucbGet(const OUString& rURL) +std::string ucbGet(const OUString& rURL, const css::uno::Reference& xParentWin) { try { - auto const s = utl::UcbStreamHelper::CreateStream(rURL, StreamMode::STD_READ); + auto const s + = utl::UcbStreamHelper::CreateStream(rURL, StreamMode::STD_READ, xParentWin, false); if (!s) { SAL_WARN("cui.dialogs", "CreateStream <" << rURL << "> failed"); @@ -404,7 +405,10 @@ void SearchAndParseThread::execute() if (m_bIsFirstLoading) { - std::string sResponse = !m_bUITest ? ucbGet(m_pAdditionsDialog->m_sURL) : ""; + const auto pDialog = m_pAdditionsDialog->getDialog(); + std::string sResponse = !m_bUITest ? ucbGet(m_pAdditionsDialog->m_sURL, + pDialog ? pDialog->GetXWindow() : nullptr) + : ""; parseResponse(sResponse, m_pAdditionsDialog->m_aAllExtensionsVector); std::sort(m_pAdditionsDialog->m_aAllExtensionsVector.begin(), m_pAdditionsDialog->m_aAllExtensionsVector.end(), -- cgit