diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2023-11-11 16:00:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-12 21:57:33 +0100 |
commit | 79f92d09ec52f0777fc03ff1d057a11b45e73f6d (patch) | |
tree | 16d74b538ab0c4d10c0e303df39e01459abd5fb6 /sw | |
parent | 5dac0fe157a5c35824cab2c27e391ff7a0d1d421 (diff) |
tdf#158171: fix crash when double-clicking DeepL translation dialog OK button
Change-Id: I4954357c59c7134d882fb19e9949ecbd5d60345a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159322
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/misc/translatelangselect.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
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: */ |