summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-01-22 14:39:00 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2024-05-09 08:47:13 +0200
commit71a99887adaa404adbf156e5894fe520b755248c (patch)
tree494fb6dfde59f2730730b0e755ce99847d762c51 /sd
parent4fe480d314ceb100f4679626fee3d60dd82a6bc6 (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167361 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/drviews2.cxx30
-rw-r--r--sd/source/ui/view/drviewsc.cxx3
2 files changed, 18 insertions, 15 deletions
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 0847df373f44..e327a9e0e949 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -2662,25 +2662,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())
- {
- pDlg->GetName(aName);
- pSelected->SetName(aName);
+ 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;
diff --git a/sd/source/ui/view/drviewsc.cxx b/sd/source/ui/view/drviewsc.cxx
index 6be86e63cb8d..46ecb31d639b 100644
--- a/sd/source/ui/view/drviewsc.cxx
+++ b/sd/source/ui/view/drviewsc.cxx
@@ -62,8 +62,7 @@ void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
IMPL_LINK( DrawViewShell, NameObjectHdl, AbstractSvxObjectNameDialog&, rDialog, bool )
{
- OUString aName;
- rDialog.GetName( aName );
+ OUString aName = rDialog.GetName();
return aName.isEmpty() || ( GetDoc() && !GetDoc()->GetObj( aName ) );
}