[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/source

Vasily Melenchuk (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 6 11:49:48 UTC 2021


 sw/source/ui/fldui/fldtdlg.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 53e5bba49f46c6027b104b34c7c807445ee807ff
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Mon Oct 4 17:40:31 2021 +0200
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Wed Oct 6 13:49:10 2021 +0200

    tdf#144907: sw ui: allow closing of "Fields" dialog
    
    In some cases (described in task) dialog is not closed.
    This is happens due to not delivered request to
    SwTextShell::ExecField(). So we could just close dialog
    explicitly, if Execute() action did fail.
    
    Change-Id: I1c712295a21037bc8bb28e2a97e750299b41250c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123059
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit da5580369bfd15857fb21a1f610e393d07abb805)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123152
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx
index 8c1bb998fb85..454e844b0278 100644
--- a/sw/source/ui/fldui/fldtdlg.cxx
+++ b/sw/source/ui/fldui/fldtdlg.cxx
@@ -110,9 +110,16 @@ void SwFieldDlg::Close()
 {
     if (m_bClosing)
         return;
-    m_pBindings->GetDispatcher()->
+    const SfxPoolItem* pResult = m_pBindings->GetDispatcher()->
         Execute(m_bDataBaseMode ? FN_INSERT_FIELD_DATA_ONLY : FN_INSERT_FIELD,
         SfxCallMode::SYNCHRON|SfxCallMode::RECORD);
+    if (!pResult)
+    {
+        // If Execute action did fail for whatever reason, this means that request
+        // to close did fail or wasn't delivered to SwTextShell::ExecField().
+        // Just explicitly close dialog in this case.
+        SfxTabDialogController::EndDialog();
+    }
 }
 
 void SwFieldDlg::Initialize(SfxChildWinInfo const *pInfo)


More information about the Libreoffice-commits mailing list