From 79f92d09ec52f0777fc03ff1d057a11b45e73f6d Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 11 Nov 2023 16:00:58 +0100 Subject: tdf#158171: fix crash when double-clicking DeepL translation dialog OK button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4954357c59c7134d882fb19e9949ecbd5d60345a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159322 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/ui/misc/translatelangselect.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sw') diff --git a/sw/source/ui/misc/translatelangselect.cxx b/sw/source/ui/misc/translatelangselect.cxx index 8036cd11dec3..7b3c35528e0a 100644 --- a/sw/source/ui/misc/translatelangselect.cxx +++ b/sw/source/ui/misc/translatelangselect.cxx @@ -127,6 +127,8 @@ IMPL_LINK_NOARG(SwTranslateLangSelectDlg, LangSelectCancelHdl, weld::Button&, vo IMPL_LINK_NOARG(SwTranslateLangSelectDlg, LangSelectTranslateHdl, weld::Button&, void) { + if (m_bTranslationStarted) + return; if (SwTranslateLangSelectDlg::selectedLangIdx == -1) { m_xDialog->response(RET_CANCEL); @@ -157,6 +159,7 @@ IMPL_LINK_NOARG(SwTranslateLangSelectDlg, LangSelectTranslateHdl, weld::Button&, SwTranslateHelper::TranslateAPIConfig aConfig({ aAPIUrl, aAuthKey, aTargetLang }); SwTranslateHelper::TranslateDocumentCancellable(m_rWrtSh, aConfig, m_bCancelTranslation); m_xDialog->response(RET_OK); + m_bTranslationStarted = false; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit