chart2/source/controller/main/ShapeController.cxx |   43 +++++---
 cui/source/factory/dlgfact.cxx                    |    4 
 cui/source/factory/dlgfact.hxx                    |    4 
 sc/source/ui/drawfunc/drawsh5.cxx                 |  112 ++++++++++++----------
 sd/source/ui/view/drviews2.cxx                    |   56 ++++++-----
 sw/source/core/access/AccessibilityIssue.cxx      |   59 +++++++----
 sw/source/uibase/shells/drwbassh.cxx              |   55 ++++++----
 sw/source/uibase/shells/frmsh.cxx                 |   34 ++++--
 8 files changed, 217 insertions(+), 150 deletions(-)

New commits:
commit 0edec422600cce2b042d5414443ad25ab515f351
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Jan 22 14:39:00 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Jan 22 19:48:44 2024 +0100

    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.gran...@collabora.co.uk>

diff --git a/chart2/source/controller/main/ShapeController.cxx 
b/chart2/source/controller/main/ShapeController.cxx
index 68483225b3bc..fe09d3e9af61 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -433,20 +433,25 @@ void ShapeController::executeDispatch_RenameObject()
     if ( !pSelectedObj )
         return;
 
-    OUString aName = pSelectedObj->GetName();
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
     weld::Window* pChartWindow(m_pChartController->GetChartFrame());
-    ScopedVclPtr< AbstractSvxObjectNameDialog > pDlg(
-        pFact->CreateSvxObjectNameDialog(pChartWindow, aName));
+    VclPtr< AbstractSvxObjectNameDialog > pDlg(
+        pFact->CreateSvxObjectNameDialog(pChartWindow, 
pSelectedObj->GetName()));
     pDlg->SetCheckNameHdl( LINK( this, ShapeController, CheckNameHdl ) );
-    if ( pDlg->Execute() == RET_OK )
-    {
-        aName = pDlg->GetName();
-        if (pSelectedObj->GetName() != aName)
+    pDlg->StartExecuteAsync(
+        [pDlg, pSelectedObj] (sal_Int32 nResult)->void
         {
-            pSelectedObj->SetName( aName );
+            if (nResult == RET_OK)
+            {
+                OUString aName = pDlg->GetName();
+                if (pSelectedObj->GetName() != aName)
+                {
+                    pSelectedObj->SetName( aName );
+                }
+            }
+            pDlg->disposeOnce();
         }
-    }
+    );
 }
 
 void ShapeController::executeDispatch_ChangeZOrder( ChartCommandID nId )
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 88da040aab34..dc61688e175e 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -121,7 +121,7 @@ IMPL_ABSTDLG_CLASS(AbstractSvxJSearchOptionsDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxMultiPathDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxNameDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxNewDictionaryDialog)
-IMPL_ABSTDLG_CLASS(AbstractSvxObjectNameDialog)
+IMPL_ABSTDLG_CLASS_ASYNC(AbstractSvxObjectNameDialog, SvxObjectNameDialog)
 IMPL_ABSTDLG_CLASS_ASYNC(AbstractSvxObjectTitleDescDialog, 
SvxObjectTitleDescDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxPathSelectDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxPostItDialog)
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index c0cf846fb3f9..cb671b40bdf3 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -284,7 +284,7 @@ class SvxObjectNameDialog;
 class SvxObjectTitleDescDialog;
 
 // AbstractSvxObjectNameDialog_Impl
-DECL_ABSTDLG_CLASS(AbstractSvxObjectNameDialog,SvxObjectNameDialog)
+DECL_ABSTDLG_CLASS_ASYNC(AbstractSvxObjectNameDialog,SvxObjectNameDialog)
     virtual OUString GetName() override;
     virtual void SetCheckNameHdl(const 
Link<AbstractSvxObjectNameDialog&,bool>& rLink) override;
 
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx 
b/sc/source/ui/drawfunc/drawsh5.cxx
index 2c0a1cf1f66d..896e7e42c783 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -509,58 +509,64 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
 
                     if(SC_LAYER_INTERN != pSelected->GetLayer())
                     {
-                        OUString aName = pSelected->GetName();
+                        OUString aOldName = pSelected->GetName();
 
                         SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
                         vcl::Window* pWin = rViewData.GetActiveWin();
-                        ScopedVclPtr<AbstractSvxObjectNameDialog> 
pDlg(pFact->CreateSvxObjectNameDialog(pWin ? pWin->GetFrameWeld() : nullptr, 
aName));
+                        VclPtr<AbstractSvxObjectNameDialog> 
pDlg(pFact->CreateSvxObjectNameDialog(pWin ? pWin->GetFrameWeld() : nullptr, 
aOldName));
 
                         pDlg->SetCheckNameHdl(LINK(this, ScDrawShell, 
NameObjectHdl));
 
-                        if(RET_OK == pDlg->Execute())
-                        {
-                            ScDocShell* pDocSh = rViewData.GetDocShell();
-                            aName = pDlg->GetName();
-
-                            if (aName != pSelected->GetName())
+                        pDlg->StartExecuteAsync(
+                            [this, pDlg, pSelected] (sal_Int32 nResult)->void
                             {
-                                // handle name change
-                                const SdrObjKind 
nObjType(pSelected->GetObjIdentifier());
-
-                                if (SdrObjKind::Graphic == nObjType && 
aName.isEmpty())
+                                if (nResult == RET_OK)
                                 {
-                                    //  graphics objects must have names
-                                    //  (all graphics are supposed to be in 
the navigator)
-                                    ScDrawLayer* pModel = 
rViewData.GetDocument().GetDrawLayer();
+                                    ScDocShell* pDocSh = 
rViewData.GetDocShell();
+                                    OUString aNewName = pDlg->GetName();
 
-                                    if(pModel)
+                                    if (aNewName != pSelected->GetName())
                                     {
-                                        aName = pModel->GetNewGraphicName();
+                                        // handle name change
+                                        const SdrObjKind 
nObjType(pSelected->GetObjIdentifier());
+
+                                        if (SdrObjKind::Graphic == nObjType && 
aNewName.isEmpty())
+                                        {
+                                            //  graphics objects must have 
names
+                                            //  (all graphics are supposed to 
be in the navigator)
+                                            ScDrawLayer* pModel = 
rViewData.GetDocument().GetDrawLayer();
+
+                                            if(pModel)
+                                            {
+                                                aNewName = 
pModel->GetNewGraphicName();
+                                            }
+                                        }
+
+                                        //  An undo action for renaming is 
missing in svdraw (99363).
+                                        //  For OLE objects (which can be 
identified using the persist name),
+                                        //  ScUndoRenameObject can be used 
until there is a common action for all objects.
+                                        if(SdrObjKind::OLE2 == nObjType)
+                                        {
+                                            const OUString aPersistName = 
static_cast<SdrOle2Obj*>(pSelected)->GetPersistName();
+
+                                            if(!aPersistName.isEmpty())
+                                            {
+                                                
pDocSh->GetUndoManager()->AddUndoAction(
+                                                    
std::make_unique<ScUndoRenameObject>(pDocSh, aPersistName, 
pSelected->GetName(), aNewName));
+                                            }
+                                        }
+
+                                        // set new name
+                                        pSelected->SetName(aNewName);
                                     }
-                                }
-
-                                //  An undo action for renaming is missing in 
svdraw (99363).
-                                //  For OLE objects (which can be identified 
using the persist name),
-                                //  ScUndoRenameObject can be used until there 
is a common action for all objects.
-                                if(SdrObjKind::OLE2 == nObjType)
-                                {
-                                    const OUString aPersistName = 
static_cast<SdrOle2Obj*>(pSelected)->GetPersistName();
 
-                                    if(!aPersistName.isEmpty())
-                                    {
-                                        
pDocSh->GetUndoManager()->AddUndoAction(
-                                            
std::make_unique<ScUndoRenameObject>(pDocSh, aPersistName, 
pSelected->GetName(), aName));
-                                    }
+                                    // ChartListenerCollectionNeedsUpdate is 
needed for Navigator update
+                                    
pDocSh->GetDocument().SetChartListenerCollectionNeedsUpdate( true );
+                                    pDocSh->SetDrawModified();
                                 }
-
-                                // set new name
-                                pSelected->SetName(aName);
+                                pDlg->disposeOnce();
                             }
-
-                            // ChartListenerCollectionNeedsUpdate is needed 
for Navigator update
-                            
pDocSh->GetDocument().SetChartListenerCollectionNeedsUpdate( true );
-                            pDocSh->SetDrawModified();
-                        }
+                        );
                     }
                 }
                 break;
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;
diff --git a/sw/source/uibase/shells/drwbassh.cxx 
b/sw/source/uibase/shells/drwbassh.cxx
index 818c3dfb3209..979f63a14369 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -586,27 +586,32 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
                 // #i68101#
                 SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0);
                 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, 
but no object (!)");
-                OUString aName(pSelected->GetName());
+                OUString aOrigName(pSelected->GetName());
 
                 SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
-                ScopedVclPtr<AbstractSvxObjectNameDialog> 
pDlg(pFact->CreateSvxObjectNameDialog(GetView().GetFrameWeld(), aName));
+                VclPtr<AbstractSvxObjectNameDialog> 
pDlg(pFact->CreateSvxObjectNameDialog(GetView().GetFrameWeld(), aOrigName));
 
                 pDlg->SetCheckNameHdl(LINK(this, SwDrawBaseShell, 
CheckGroupShapeNameHdl));
 
-                if(RET_OK == pDlg->Execute())
-                {
-                    const OUString aOrigName = aName;
-                    aName = pDlg->GetName();
-                    pSelected->SetName(aName);
-                    pSh->SetModified();
-
-                    // update accessibility sidebar object name if we modify 
the object name on the navigator bar
-                    if (!aName.isEmpty() && aOrigName != aName)
+                pDlg->StartExecuteAsync(
+                    [pDlg, pSelected, pSh, aOrigName] (sal_Int32 nResult)->void
                     {
-                        if (SwNode* pSwNode = 
FindFrameFormat(pSelected)->GetAnchor().GetAnchorNode())
-                            pSwNode->resetAndQueueAccessibilityCheck(true);
+                        if (nResult == RET_OK)
+                        {
+                            OUString aNewName = pDlg->GetName();
+                            pSelected->SetName(aNewName);
+                            pSh->SetModified();
+
+                            // update accessibility sidebar object name if we 
modify the object name on the navigator bar
+                            if (!aNewName.isEmpty() && aOrigName != aNewName)
+                            {
+                                if (SwNode* pSwNode = 
FindFrameFormat(pSelected)->GetAnchor().GetAnchorNode())
+                                    
pSwNode->resetAndQueueAccessibilityCheck(true);
+                            }
+                        }
+                        pDlg->disposeOnce();
                     }
-                }
+                );
             }
 
             break;
diff --git a/sw/source/uibase/shells/frmsh.cxx 
b/sw/source/uibase/shells/frmsh.cxx
index 6af4883d83e3..2e5d3313b635 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -675,13 +675,17 @@ void SwFrameShell::Execute(SfxRequest &rReq)
             {
                 OUString aName(rSh.GetFlyName());
                 SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
-                ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(
+                VclPtr<AbstractSvxObjectNameDialog> pDlg(
                     pFact->CreateSvxObjectNameDialog(GetView().GetFrameWeld(), 
aName));
 
-                if ( pDlg->Execute() == RET_OK )
-                {
-                    rSh.SetFlyName(pDlg->GetName());
-                }
+                pDlg->StartExecuteAsync(
+                    [this, pDlg] (sal_Int32 nResult)->void
+                    {
+                        if (nResult == RET_OK)
+                            GetShell().SetFlyName(pDlg->GetName());
+                        pDlg->disposeOnce();
+                    }
+                );
             }
         }
         break;
commit dde1868544bf325a359bdf4336623ac65e6ff4e0
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Jan 22 14:12:56 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Jan 22 19:48:35 2024 +0100

    object-title dialog can be used async
    
    Change-Id: Ia5869788ccefcd17ef561bafb41da6f0d48fd54d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162394
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/chart2/source/controller/main/ShapeController.cxx 
b/chart2/source/controller/main/ShapeController.cxx
index f977259ce77b..68483225b3bc 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -403,14 +403,20 @@ void 
ShapeController::executeDispatch_ObjectTitleDescription()
     bool isDecorative(pSelectedObj->IsDecorative());
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
     weld::Window* pChartWindow(m_pChartController->GetChartFrame());
-    ScopedVclPtr< AbstractSvxObjectTitleDescDialog > pDlg(
+    VclPtr< AbstractSvxObjectTitleDescDialog > pDlg(
         pFact->CreateSvxObjectTitleDescDialog(pChartWindow, aTitle, 
aDescription, isDecorative));
-    if ( pDlg->Execute() == RET_OK )
-    {
-        pSelectedObj->SetTitle( pDlg->GetTitle() );
-        pSelectedObj->SetDescription( pDlg->GetDescription() );
-        pSelectedObj->SetDecorative(pDlg->IsDecorative());
-    }
+    pDlg->StartExecuteAsync(
+        [pDlg, pSelectedObj] (sal_Int32 nResult)->void
+        {
+            if (nResult == RET_OK)
+            {
+                pSelectedObj->SetTitle( pDlg->GetTitle() );
+                pSelectedObj->SetDescription( pDlg->GetDescription() );
+                pSelectedObj->SetDecorative(pDlg->IsDecorative());
+            }
+            pDlg->disposeOnce();
+        }
+    );
 }
 
 void ShapeController::executeDispatch_RenameObject()
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index c0d0b1deb958..88da040aab34 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -122,7 +122,7 @@ IMPL_ABSTDLG_CLASS(AbstractSvxMultiPathDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxNameDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxNewDictionaryDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxObjectNameDialog)
-IMPL_ABSTDLG_CLASS(AbstractSvxObjectTitleDescDialog)
+IMPL_ABSTDLG_CLASS_ASYNC(AbstractSvxObjectTitleDescDialog, 
SvxObjectTitleDescDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxPathSelectDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxPostItDialog)
 
IMPL_ABSTDLG_CLASS_ASYNC(AbstractSvxSearchSimilarityDialog,SvxSearchSimilarityDialog)
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index e8e5186731c5..c0cf846fb3f9 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -294,7 +294,7 @@ private:
 };
 
 // AbstractSvxObjectTitleDescDialog_Impl
-DECL_ABSTDLG_CLASS(AbstractSvxObjectTitleDescDialog,SvxObjectTitleDescDialog)
+DECL_ABSTDLG_CLASS_ASYNC(AbstractSvxObjectTitleDescDialog,SvxObjectTitleDescDialog)
     virtual OUString GetTitle() override;
     virtual OUString GetDescription() override;
     virtual bool IsDecorative() override;
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx 
b/sc/source/ui/drawfunc/drawsh5.cxx
index 679d8a841a66..2c0a1cf1f66d 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -582,22 +582,28 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
 
                         SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
                         vcl::Window* pWin = rViewData.GetActiveWin();
-                        ScopedVclPtr<AbstractSvxObjectTitleDescDialog> 
pDlg(pFact->CreateSvxObjectTitleDescDialog(
+                        VclPtr<AbstractSvxObjectTitleDescDialog> 
pDlg(pFact->CreateSvxObjectTitleDescDialog(
                                     pWin ? pWin->GetFrameWeld() : nullptr, 
aTitle, aDescription, isDecorative));
 
-                        if(RET_OK == pDlg->Execute())
-                        {
-                            ScDocShell* pDocSh = rViewData.GetDocShell();
+                        pDlg->StartExecuteAsync(
+                            [this, pDlg, pSelected] (sal_Int32 nResult)->void
+                            {
+                                if (nResult == RET_OK)
+                                {
+                                    ScDocShell* pDocSh = 
rViewData.GetDocShell();
 
-                            // handle Title and Description
-                            pSelected->SetTitle(pDlg->GetTitle());
-                            pSelected->SetDescription(pDlg->GetDescription());
-                            pSelected->SetDecorative(pDlg->IsDecorative());
+                                    // handle Title and Description
+                                    pSelected->SetTitle(pDlg->GetTitle());
+                                    
pSelected->SetDescription(pDlg->GetDescription());
+                                    
pSelected->SetDecorative(pDlg->IsDecorative());
 
-                            // ChartListenerCollectionNeedsUpdate is needed 
for Navigator update
-                            
pDocSh->GetDocument().SetChartListenerCollectionNeedsUpdate( true );
-                            pDocSh->SetDrawModified();
-                        }
+                                    // ChartListenerCollectionNeedsUpdate is 
needed for Navigator update
+                                    
pDocSh->GetDocument().SetChartListenerCollectionNeedsUpdate( true );
+                                    pDocSh->SetDrawModified();
+                                }
+                                pDlg->disposeOnce();
+                            }
+                        );
                     }
                 }
                 break;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index d7c57a0581bc..3237f808a601 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -2700,21 +2700,26 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                 bool isDecorative(pSelected->IsDecorative());
 
                 SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
-                ScopedVclPtr<AbstractSvxObjectTitleDescDialog> 
pDlg(pFact->CreateSvxObjectTitleDescDialog(
+                VclPtr<AbstractSvxObjectTitleDescDialog> 
pDlg(pFact->CreateSvxObjectTitleDescDialog(
                             GetFrameWeld(), aTitle, aDescription, 
isDecorative));
 
-                if(RET_OK == pDlg->Execute())
-                {
-                    pSelected->SetTitle(pDlg->GetTitle());
-                    pSelected->SetDescription(pDlg->GetDescription());
-                    pSelected->SetDecorative(pDlg->IsDecorative());
-                }
+                pDlg->StartExecuteAsync(
+                    [this, pDlg, pSelected] (sal_Int32 nResult)->void
+                    {
+                        if (nResult == RET_OK)
+                        {
+                            pSelected->SetTitle(pDlg->GetTitle());
+                            pSelected->SetDescription(pDlg->GetDescription());
+                            pSelected->SetDecorative(pDlg->IsDecorative());
+                        }
+                        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/sw/source/core/access/AccessibilityIssue.cxx 
b/sw/source/core/access/AccessibilityIssue.cxx
index ab1c77d70e6b..118452543f97 100644
--- a/sw/source/core/access/AccessibilityIssue.cxx
+++ b/sw/source/core/access/AccessibilityIssue.cxx
@@ -252,6 +252,8 @@ void AccessibilityIssue::quickFixIssue() const
     if (canGotoIssue())
         gotoIssue();
 
+    bool bResetAndQueue = true;
+
     switch (m_eIssueObject)
     {
         case IssueObject::GRAPHIC:
@@ -267,18 +269,24 @@ void AccessibilityIssue::quickFixIssue() const
 
                 SwWrtShell* pWrtShell = m_pDoc->GetDocShell()->GetWrtShell();
                 SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
-                ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(
-                    
pFact->CreateSvxObjectTitleDescDialog(pWrtShell->GetView().GetFrameWeld(),
-                                                          aTitle, 
aDescription, isDecorative));
-
-                if (pDlg->Execute() == RET_OK)
-                {
-                    m_pDoc->SetFlyFrameTitle(*pFlyFormat, pDlg->GetTitle());
-                    m_pDoc->SetFlyFrameDescription(*pFlyFormat, 
pDlg->GetDescription());
-                    m_pDoc->SetFlyFrameDecorative(*pFlyFormat, 
pDlg->IsDecorative());
-
-                    pWrtShell->SetModified();
-                }
+                VclPtr<AbstractSvxObjectTitleDescDialog> 
pDlg(pFact->CreateSvxObjectTitleDescDialog(
+                    pWrtShell->GetView().GetFrameWeld(), aTitle, aDescription, 
isDecorative));
+
+                bResetAndQueue = false;
+                pDlg->StartExecuteAsync(
+                    [this, pDlg, pFlyFormat, pWrtShell](sal_Int32 nResult) -> 
void {
+                        if (nResult == RET_OK)
+                        {
+                            m_pDoc->SetFlyFrameTitle(*pFlyFormat, 
pDlg->GetTitle());
+                            m_pDoc->SetFlyFrameDescription(*pFlyFormat, 
pDlg->GetDescription());
+                            m_pDoc->SetFlyFrameDecorative(*pFlyFormat, 
pDlg->IsDecorative());
+
+                            pWrtShell->SetModified();
+                        }
+                        pDlg->disposeOnce();
+                        if (m_pNode)
+                            
m_pDoc->getOnlineAccessibilityCheck()->resetAndQueue(m_pNode);
+                    });
             }
         }
         break;
@@ -295,18 +303,23 @@ void AccessibilityIssue::quickFixIssue() const
                 bool isDecorative(pObj->IsDecorative());
 
                 SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
-                ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(
-                    
pFact->CreateSvxObjectTitleDescDialog(pWrtShell->GetView().GetFrameWeld(),
-                                                          aTitle, 
aDescription, isDecorative));
+                VclPtr<AbstractSvxObjectTitleDescDialog> 
pDlg(pFact->CreateSvxObjectTitleDescDialog(
+                    pWrtShell->GetView().GetFrameWeld(), aTitle, aDescription, 
isDecorative));
 
-                if (RET_OK == pDlg->Execute())
-                {
-                    pObj->SetTitle(pDlg->GetTitle());
-                    pObj->SetDescription(pDlg->GetDescription());
-                    pObj->SetDecorative(pDlg->IsDecorative());
+                bResetAndQueue = false;
+                pDlg->StartExecuteAsync([this, pDlg, pObj, 
pWrtShell](sal_Int32 nResult) -> void {
+                    if (nResult == RET_OK)
+                    {
+                        pObj->SetTitle(pDlg->GetTitle());
+                        pObj->SetDescription(pDlg->GetDescription());
+                        pObj->SetDecorative(pDlg->IsDecorative());
 
-                    pWrtShell->SetModified();
-                }
+                        pWrtShell->SetModified();
+                    }
+                    pDlg->disposeOnce();
+                    if (m_pNode)
+                        
m_pDoc->getOnlineAccessibilityCheck()->resetAndQueue(m_pNode);
+                });
             }
         }
         break;
@@ -371,7 +384,7 @@ void AccessibilityIssue::quickFixIssue() const
         default:
             break;
     }
-    if (m_pNode)
+    if (bResetAndQueue && m_pNode)
         m_pDoc->getOnlineAccessibilityCheck()->resetAndQueue(m_pNode);
 }
 
diff --git a/sw/source/uibase/shells/drwbassh.cxx 
b/sw/source/uibase/shells/drwbassh.cxx
index 1789b3f374d4..818c3dfb3209 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -626,17 +626,23 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
                 bool isDecorative(pSelected->IsDecorative());
 
                 SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
-                ScopedVclPtr<AbstractSvxObjectTitleDescDialog> 
pDlg(pFact->CreateSvxObjectTitleDescDialog(GetView().GetFrameWeld(),
+                VclPtr<AbstractSvxObjectTitleDescDialog> 
pDlg(pFact->CreateSvxObjectTitleDescDialog(GetView().GetFrameWeld(),
                             aTitle, aDescription, isDecorative));
 
-                if(RET_OK == pDlg->Execute())
-                {
-                    pSelected->SetTitle(pDlg->GetTitle());
-                    pSelected->SetDescription(pDlg->GetDescription());
-                    pSelected->SetDecorative(pDlg->IsDecorative());
+                pDlg->StartExecuteAsync(
+                    [pDlg, pSelected, pSh] (sal_Int32 nResult)->void
+                    {
+                        if (nResult == RET_OK)
+                        {
+                            pSelected->SetTitle(pDlg->GetTitle());
+                            pSelected->SetDescription(pDlg->GetDescription());
+                            pSelected->SetDecorative(pDlg->IsDecorative());
 
-                    pSh->SetModified();
-                }
+                            pSh->SetModified();
+                        }
+                        pDlg->disposeOnce();
+                    }
+                );
             }
 
             break;
diff --git a/sw/source/uibase/shells/frmsh.cxx 
b/sw/source/uibase/shells/frmsh.cxx
index fa0dd795447c..6af4883d83e3 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -698,16 +698,22 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                 bool isDecorative(rSh.IsObjDecorative());
 
                 SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
-                ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(
+                VclPtr<AbstractSvxObjectTitleDescDialog> pDlg(
                     
pFact->CreateSvxObjectTitleDescDialog(GetView().GetFrameWeld(),
                         aTitle, aDescription, isDecorative));
 
-                if ( pDlg->Execute() == RET_OK )
-                {
-                    rSh.SetObjDescription(pDlg->GetDescription());
-                    rSh.SetObjTitle(pDlg->GetTitle());
-                    rSh.SetObjDecorative(pDlg->IsDecorative());
-                }
+                pDlg->StartExecuteAsync(
+                    [this, pDlg] (sal_Int32 nResult)->void
+                    {
+                        if (nResult == RET_OK)
+                        {
+                            
GetShell().SetObjDescription(pDlg->GetDescription());
+                            GetShell().SetObjTitle(pDlg->GetTitle());
+                            GetShell().SetObjDecorative(pDlg->IsDecorative());
+                        }
+                        pDlg->disposeOnce();
+                    }
+                );
             }
         }
         break;

Reply via email to