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>
This commit is contained in:
committed by
Caolán McNamara
parent
5dac0fe157
commit
79f92d09ec
@@ -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: */
|
||||
|
||||
Reference in New Issue
Block a user