summaryrefslogtreecommitdiff
path: root/sw/source/uibase/dochdl/gloshdl.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-01-30 15:22:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-01-30 20:12:20 +0100
commitb4e5aa7bffc32aa15359808085cc69638467f5d5 (patch)
treed6db649a57d4caef3aac097e0c5fd51e9c890233 /sw/source/uibase/dochdl/gloshdl.cxx
parent21dd07f95d7dcb95f243753306108c18d9ba115a (diff)
make glossary dialog async
Change-Id: I7ed5da9e06656bc658728b8e61b02f767ddd6bb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162750 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/dochdl/gloshdl.cxx')
-rw-r--r--sw/source/uibase/dochdl/gloshdl.cxx42
1 files changed, 26 insertions, 16 deletions
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx
index e70ed7ffc4b2..dcc90033cd9b 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -69,25 +69,35 @@ struct TextBlockInfo_Impl
void SwGlossaryHdl::GlossaryDlg()
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractGlossaryDlg> pDlg(pFact->CreateGlossaryDlg(m_rViewFrame, this, m_pWrtShell));
- OUString sName;
- OUString sShortName;
+ VclPtr<AbstractGlossaryDlg> pDlg(pFact->CreateGlossaryDlg(m_rViewFrame, this, m_pWrtShell));
- if( RET_EDIT == pDlg->Execute() )
- {
- sName = pDlg->GetCurrGrpName();
- sShortName = pDlg->GetCurrShortName();
- }
+ pDlg->StartExecuteAsync(
+ [this, pDlg] (sal_Int32 nResult)->void
+ {
+ OUString sName;
+ OUString sShortName;
+ if (nResult == RET_OK)
+ pDlg->Apply();
+ if (nResult == RET_EDIT)
+ {
+ sName = pDlg->GetCurrGrpName();
+ sShortName = pDlg->GetCurrShortName();
+ }
+ pDlg->disposeOnce();
+ m_pCurGrp.reset();
+ if(HasGlossaryList())
+ {
+ GetGlossaryList()->ClearGroups();
+ }
- pDlg.disposeAndClear();
- m_pCurGrp.reset();
- if(HasGlossaryList())
- {
- GetGlossaryList()->ClearGroups();
- }
+ if( !sName.isEmpty() || !sShortName.isEmpty() )
+ m_rStatGlossaries.EditGroupDoc( sName, sShortName );
- if( !sName.isEmpty() || !sShortName.isEmpty() )
- m_rStatGlossaries.EditGroupDoc( sName, sShortName );
+ SwGlossaryList* pList = ::GetGlossaryList();
+ if(pList->IsActive())
+ pList->Update();
+ }
+ );
}
// set the default group; if called from the dialog