cui/source/dialogs/thesdlg.cxx | 14 +++++++++++--- cui/source/inc/thesdlg.hxx | 3 +++ ucb/source/ucp/ftp/ftpcontent.cxx | 15 +++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-)
New commits: commit 660e31e98b8acd14de83b31ba5cc7ebfb5a368fb Author: Michael Stahl <[email protected]> AuthorDate: Wed Oct 26 14:58:09 2022 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Oct 27 09:09:23 2022 +0200 ucb: FTP UCP: report CURLE_URL_MALFORMAT as IllegalIdentifierException With curl 7.86, the test JunitTest_ucb_complex starts to fail: .ftp://noname:nopasswd@*nohost.invalid now executing open com.sun.star.ucb.InteractiveAugmentedIOException: at com.sun.proxy.$Proxy15.execute(Unknown Source) at complex.ucb.UCB.executeCommand(UCB.java:63) at complex.ucb.UCB.checkWrongFtpConnection(UCB.java:119) because curl_easy_perform() now returns CURLE_URL_MALFORMAT where previously it was CURLE_COULDNT_RESOLVE_HOST. Map this to an exception the test expects. Change-Id: Ifdb672946726ddb4cb4d9426b7e70eefac63f040 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141877 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 022e476af44c0dfc97403dc0f3a3b63e731903e6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141844 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index 8e02302ebc4e..4c7888e25dc6 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -62,6 +62,7 @@ #include <com/sun/star/ucb/UnsupportedDataSinkException.hpp> #include <com/sun/star/ucb/OpenCommandArgument2.hpp> #include <com/sun/star/ucb/UnsupportedOpenModeException.hpp> +#include <com/sun/star/ucb/IllegalIdentifierException.hpp> #include <com/sun/star/ucb/InteractiveNetworkConnectException.hpp> #include <com/sun/star/ucb/InteractiveNetworkResolveNameException.hpp> #include <com/sun/star/ucb/InteractiveIOException.hpp> @@ -225,6 +226,7 @@ enum ACTION { NOACTION, THROWAUTHENTICATIONREQUEST, THROWACCESSDENIED, THROWINTERACTIVECONNECT, + THROWMALFORMED, THROWRESOLVENAME, THROWQUOTE, THROWNOFILE, @@ -343,6 +345,15 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, Environment); break; } + case THROWMALFORMED: + { + IllegalIdentifierException ex; + aRet <<= ex; + ucbhelper::cancelCommandExecution( + aRet, + Environment); + break; + } case THROWRESOLVENAME: { InteractiveNetworkResolveNameException excep; @@ -537,6 +548,10 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, { if(e.code() == CURLE_COULDNT_CONNECT) action = THROWINTERACTIVECONNECT; + else if (e.code() == CURLE_URL_MALFORMAT) + { + action = THROWMALFORMED; + } else if(e.code() == CURLE_COULDNT_RESOLVE_HOST ) action = THROWRESOLVENAME; else if(e.code() == CURLE_FTP_USER_PASSWORD_INCORRECT || commit ed3a66f532710933843a0e49d6f0f4dc013aa985 Author: Caolán McNamara <[email protected]> AuthorDate: Wed Oct 26 10:34:32 2022 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Thu Oct 27 09:09:09 2022 +0200 crashreporting: crash in thesaurus dialog PostUserEvent not reproducible, but a common error to post an event that outlives the owner Change-Id: Ic2633c504d853116d03e3322f552ae66e7e7e14e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141840 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index a9f4883f4c70..1d98480973ee 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -165,8 +165,8 @@ void SvxThesaurusDialog::LookUp_Impl() m_xAlternativesCT->set_visible(m_bWordFound); m_xNotFound->set_visible(!m_bWordFound); - if (m_bWordFound) - Application::PostUserEvent(LINK(this, SvxThesaurusDialog, SelectFirstHdl_Impl)); + if (m_bWordFound && !m_nSelectFirstEvent) + m_nSelectFirstEvent = Application::PostUserEvent(LINK(this, SvxThesaurusDialog, SelectFirstHdl_Impl)); if (m_xWordCB->find_text(aText) == -1) m_xWordCB->append_text(aText); @@ -217,13 +217,15 @@ IMPL_LINK( SvxThesaurusDialog, AlternativesDoubleClickHdl_Impl, weld::TreeView&, //! workaround to set the selection since calling SelectEntryPos within //! the double click handler does not work - Application::PostUserEvent(LINK(this, SvxThesaurusDialog, SelectFirstHdl_Impl)); + if (!m_nSelectFirstEvent) + m_nSelectFirstEvent = Application::PostUserEvent(LINK(this, SvxThesaurusDialog, SelectFirstHdl_Impl)); return true; } IMPL_LINK_NOARG(SvxThesaurusDialog, SelectFirstHdl_Impl, void *, void) { + m_nSelectFirstEvent = nullptr; if (m_xAlternativesCT->n_children() >= 2) { m_xAlternativesCT->select(1); // pos 0 is a 'header' that is not selectable @@ -249,6 +251,7 @@ SvxThesaurusDialog::SvxThesaurusDialog( , m_xReplaceEdit(m_xBuilder->weld_entry("replaceed")) , m_xLangLB(m_xBuilder->weld_combo_box("langcb")) , m_xReplaceBtn(m_xBuilder->weld_button("ok")) + , m_nSelectFirstEvent(nullptr) { m_aModifyIdle.SetInvokeHandler( LINK( this, SvxThesaurusDialog, ModifyTimer_Hdl ) ); m_aModifyIdle.SetPriority( TaskPriority::LOWEST ); @@ -316,6 +319,11 @@ SvxThesaurusDialog::SvxThesaurusDialog( SvxThesaurusDialog::~SvxThesaurusDialog() { + if (m_nSelectFirstEvent) + { + Application::RemoveUserEvent(m_nSelectFirstEvent); + m_nSelectFirstEvent = nullptr; + } } IMPL_LINK_NOARG(SvxThesaurusDialog, ReplaceBtnHdl_Impl, weld::Button&, void) diff --git a/cui/source/inc/thesdlg.hxx b/cui/source/inc/thesdlg.hxx index de085d678682..05865d68d92f 100644 --- a/cui/source/inc/thesdlg.hxx +++ b/cui/source/inc/thesdlg.hxx @@ -26,6 +26,8 @@ #include <memory> #include <stack> +struct ImplSVEvent; + class SvxThesaurusDialog : public SfxDialogController { Idle m_aModifyIdle; @@ -43,6 +45,7 @@ class SvxThesaurusDialog : public SfxDialogController std::unique_ptr<weld::Entry> m_xReplaceEdit; std::unique_ptr<weld::ComboBox> m_xLangLB; std::unique_ptr<weld::Button> m_xReplaceBtn; + ImplSVEvent* m_nSelectFirstEvent; public: virtual ~SvxThesaurusDialog() override;
