summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-01-22 14:39:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-01-22 19:48:44 +0100
commit0edec422600cce2b042d5414443ad25ab515f351 (patch)
treea309ad8e9b77ca9eb1720e36c90fa5a082b563d0 /sd/source
parentdde1868544bf325a359bdf4336623ac65e6ff4e0 (diff)
make object name dialog async
Change-Id: Icf81810297dc5767cedd051cf8ccdfbb101f35ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162395 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/view/drviews2.cxx29
1 files changed, 17 insertions, 12 deletions
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 3237f808a601..8dbb3142e4c3 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -2665,24 +2665,29 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
OUString aName(pSelected->GetName());
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(GetFrameWeld(), aName));
+ VclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(GetFrameWeld(), aName));
pDlg->SetCheckNameHdl(LINK(this, DrawViewShell, NameObjectHdl));
- if(RET_OK == pDlg->Execute())
- {
- pSelected->SetName(pDlg->GetName());
+ pDlg->StartExecuteAsync(
+ [this, pDlg, pSelected] (sal_Int32 nResult)->void
+ {
+ if (nResult == RET_OK)
+ {
+ pSelected->SetName(pDlg->GetName());
- SdPage* pPage = GetActualPage();
- if (pPage)
- pPage->notifyObjectRenamed(pSelected);
- }
+ SdPage* pPage = GetActualPage();
+ if (pPage)
+ pPage->notifyObjectRenamed(pSelected);
+ }
+ pDlg->disposeOnce();
+ SfxBindings& rBindings = GetViewFrame()->GetBindings();
+ rBindings.Invalidate( SID_NAVIGATOR_STATE, true );
+ rBindings.Invalidate( SID_CONTEXT );
+ }
+ );
}
- SfxBindings& rBindings = GetViewFrame()->GetBindings();
- rBindings.Invalidate( SID_NAVIGATOR_STATE, true );
- rBindings.Invalidate( SID_CONTEXT );
-
Cancel();
rReq.Ignore();
break;