chart2/source/controller/main/ShapeController.cxx |   26 +++---
 cui/source/factory/dlgfact.cxx                    |    8 +-
 cui/source/factory/dlgfact.hxx                    |    6 -
 desktop/source/lib/init.cxx                       |    2 
 include/svx/svxdlg.hxx                            |    2 
 sc/source/ui/drawfunc/drawsh5.cxx                 |   85 +++++++++++-----------
 sd/source/ui/view/drviews2.cxx                    |   65 ++++++++++------
 sd/source/ui/view/drviewsc.cxx                    |    3 
 sfx2/source/control/unoctitm.cxx                  |    2 
 sw/source/uibase/shells/drwbassh.cxx              |   76 ++++++++++++-------
 sw/source/uibase/shells/frmsh.cxx                 |   15 ++-
 vcl/jsdialog/enabled.cxx                          |    2 
 12 files changed, 171 insertions(+), 121 deletions(-)

New commits:
commit 48bfdbe7512a880983d04ec9143ae881dfae58f4
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue May 7 21:59:04 2024 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Thu May 9 08:47:21 2024 +0200

    jsdialog: enable Object Name and Description dialog
    
    and send uno command enable/disable status
    
    Signed-off-by: Szymon Kłos <szymon.k...@collabora.com>
    Change-Id: Id643a27308809b6960be72fb368b9f078ff9cf6c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167296
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d5476cfe7666..962d676694ac 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3756,6 +3756,8 @@ static void doc_iniUnoCommands ()
         u".uno:Context"_ustr,
         u".uno:WrapText"_ustr,
         u".uno:ToggleMergeCells"_ustr,
+        u".uno:NameGroup"_ustr,
+        u".uno:ObjectTitleDescription"_ustr,
         u".uno:NumberFormatCurrency"_ustr,
         u".uno:NumberFormatPercent"_ustr,
         u".uno:NumberFormatDecimal"_ustr,
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index e327a9e0e949..a7ed100977bf 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -2657,7 +2657,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
             if(1 == mpDrawView->GetMarkedObjectCount())
             {
                 // #i68101#
-                SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0);
+                rtl::Reference<SdrObject> pSelected = 
mpDrawView->GetMarkedObjectByIndex(0);
                 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, 
but no object (!)");
                 OUString aName(pSelected->GetName());
 
@@ -2675,7 +2675,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
                             SdPage* pPage = GetActualPage();
                             if (pPage)
-                                pPage->notifyObjectRenamed(pSelected);
+                                pPage->notifyObjectRenamed(pSelected.get());
                         }
                         pDlg->disposeOnce();
                         SfxBindings& rBindings = GetViewFrame()->GetBindings();
@@ -2695,25 +2695,36 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         {
             if(1 == mpDrawView->GetMarkedObjectCount())
             {
-                SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0);
+                rtl::Reference<SdrObject> pSelected = 
mpDrawView->GetMarkedObjectByIndex(0);
                 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, 
but no object (!)");
                 OUString aTitle(pSelected->GetTitle());
                 OUString aDescription(pSelected->GetDescription());
                 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())
-                {
-                    pDlg->GetTitle(aTitle);
-                    pDlg->GetDescription(aDescription);
-                    pDlg->IsDecorative(isDecorative);
-                    pSelected->SetTitle(aTitle);
-                    pSelected->SetDescription(aDescription);
-                    pSelected->SetDecorative(isDecorative);
-                }
+                pDlg->StartExecuteAsync(
+                    [pDlg, pSelected] (sal_Int32 nResult)->void
+                    {
+                        if (nResult == RET_OK)
+                        {
+                            OUString aTitle;
+                            OUString aDescription;
+                            bool isDecorative;
+
+                            pDlg->GetTitle(aTitle);
+                            pDlg->GetDescription(aDescription);
+                            pDlg->IsDecorative(isDecorative);
+
+                            pSelected->SetTitle(aTitle);
+                            pSelected->SetDescription(aDescription);
+                            pSelected->SetDecorative(isDecorative);
+                        }
+                        pDlg->disposeOnce();
+                    }
+                );
             }
 
             SfxBindings& rBindings = GetViewFrame()->GetBindings();
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 19bc307a1011..6572761c11ea 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1002,6 +1002,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
              aEvent.FeatureURL.Path == "InsertRowsAfter" ||
              aEvent.FeatureURL.Path == "InsertColumnsBefore" ||
              aEvent.FeatureURL.Path == "InsertColumnsAfter" ||
+             aEvent.FeatureURL.Path == "NameGroup" ||
+             aEvent.FeatureURL.Path == "ObjectTitleDescription" ||
              aEvent.FeatureURL.Path == "MergeCells" ||
              aEvent.FeatureURL.Path == "InsertObjectChart" ||
              aEvent.FeatureURL.Path == "InsertSection" ||
diff --git a/sw/source/uibase/shells/drwbassh.cxx 
b/sw/source/uibase/shells/drwbassh.cxx
index de5351d9f4bc..ebd1eb3ce705 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -594,7 +594,7 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
             if(1 == pSdrView->GetMarkedObjectCount())
             {
                 // #i68101#
-                SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0);
+                rtl::Reference<SdrObject> pSelected = 
pSdrView->GetMarkedObjectByIndex(0);
                 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, 
but no object (!)");
                 OUString aOrigName(pSelected->GetName());
 
@@ -615,8 +615,12 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
                             // 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);
+                                auto pFrameFormat = 
FindFrameFormat(pSelected.get());
+                                if (pFrameFormat)
+                                {
+                                    if (SwNode* pSwNode = 
pFrameFormat->GetAnchor().GetAnchorNode())
+                                        
pSwNode->resetAndQueueAccessibilityCheck(true);
+                                }
                             }
                         }
                         pDlg->disposeOnce();
@@ -634,28 +638,38 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
 
             if(1 == pSdrView->GetMarkedObjectCount())
             {
-                SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0);
+                rtl::Reference<SdrObject> pSelected = 
pSdrView->GetMarkedObjectByIndex(0);
                 OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, 
but no object (!)");
                 OUString aTitle(pSelected->GetTitle());
                 OUString aDescription(pSelected->GetDescription());
                 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())
-                {
-                    pDlg->GetTitle(aTitle);
-                    pDlg->GetDescription(aDescription);
-                    pDlg->IsDecorative(isDecorative);
+                pDlg->StartExecuteAsync(
+                    [pDlg, pSelected, pSh] (sal_Int32 nResult)->void
+                    {
+                        if (nResult == RET_OK)
+                        {
+                            OUString aTitle;
+                            OUString aDescription;
+                            bool isDecorative;
 
-                    pSelected->SetTitle(aTitle);
-                    pSelected->SetDescription(aDescription);
-                    pSelected->SetDecorative(isDecorative);
+                            pDlg->GetTitle(aTitle);
+                            pDlg->GetDescription(aDescription);
+                            pDlg->IsDecorative(isDecorative);
 
-                    pSh->SetModified();
-                }
+                            pSelected->SetTitle(aTitle);
+                            pSelected->SetDescription(aDescription);
+                            pSelected->SetDecorative(isDecorative);
+
+                            pSh->SetModified();
+                        }
+                        pDlg->disposeOnce();
+                    }
+                );
             }
 
             break;
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 309d547a72dc..636def88df05 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -58,6 +58,8 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
         || rUIFile == u"cui/ui/numberingformatpage.ui"
         || rUIFile == u"cui/ui/numberingoptionspage.ui"
         || rUIFile == u"cui/ui/numberingpositionpage.ui"
+        || rUIFile == u"cui/ui/objectnamedialog.ui"
+        || rUIFile == u"cui/ui/objecttitledescdialog.ui"
         || rUIFile == u"cui/ui/optlingupage.ui"
         || rUIFile == u"cui/ui/pageformatpage.ui"
         || rUIFile == u"cui/ui/paragalignpage.ui"
commit 71a99887adaa404adbf156e5894fe520b755248c
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Jan 22 14:39:00 2024 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Thu May 9 08:47:13 2024 +0200

    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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167361
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/chart2/source/controller/main/ShapeController.cxx 
b/chart2/source/controller/main/ShapeController.cxx
index 115229de0e57..359488c24c76 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -217,8 +217,7 @@ void ShapeController::describeSupportedFeatures()
 
 IMPL_LINK( ShapeController, CheckNameHdl, AbstractSvxObjectNameDialog&, 
rDialog, bool )
 {
-    OUString aName;
-    rDialog.GetName( aName );
+    OUString aName = rDialog.GetName();
 
     if ( !aName.isEmpty() )
     {
@@ -431,20 +430,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 )
-    {
-        pDlg->GetName(aName);
-        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 c53e3432a2a4..62d50eb96d85 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -122,8 +122,8 @@ IMPL_ABSTDLG_CLASS(AbstractSvxJSearchOptionsDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxMultiPathDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxNameDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxNewDictionaryDialog)
-IMPL_ABSTDLG_CLASS(AbstractSvxObjectNameDialog)
-IMPL_ABSTDLG_CLASS(AbstractSvxObjectTitleDescDialog)
+IMPL_ABSTDLG_CLASS_ASYNC(AbstractSvxObjectNameDialog, SvxObjectNameDialog)
+IMPL_ABSTDLG_CLASS_ASYNC(AbstractSvxObjectTitleDescDialog, 
SvxObjectTitleDescDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxPathSelectDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxPostItDialog)
 
IMPL_ABSTDLG_CLASS_ASYNC(AbstractSvxSearchSimilarityDialog,SvxSearchSimilarityDialog)
@@ -595,9 +595,9 @@ IMPL_LINK_NOARG(AbstractSvxNameDialog_Impl, 
CheckNameTooltipHdl, SvxNameDialog&,
     return aCheckNameTooltipHdl.Call(*this);
 }
 
-void AbstractSvxObjectNameDialog_Impl::GetName(OUString& rName)
+OUString AbstractSvxObjectNameDialog_Impl::GetName()
 {
-    rName = m_xDlg->GetName();
+    return m_xDlg->GetName();
 }
 
 void AbstractSvxObjectNameDialog_Impl::SetCheckNameHdl(const 
Link<AbstractSvxObjectNameDialog&,bool>& rLink)
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 02ba9a1b0f9d..3ffba25bebae 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -285,8 +285,8 @@ class SvxObjectNameDialog;
 class SvxObjectTitleDescDialog;
 
 // AbstractSvxObjectNameDialog_Impl
-DECL_ABSTDLG_CLASS(AbstractSvxObjectNameDialog,SvxObjectNameDialog)
-    virtual void GetName(OUString& rName) override ;
+DECL_ABSTDLG_CLASS_ASYNC(AbstractSvxObjectNameDialog,SvxObjectNameDialog)
+    virtual OUString GetName() override;
     virtual void SetCheckNameHdl(const 
Link<AbstractSvxObjectNameDialog&,bool>& rLink) override;
 
 private:
@@ -295,7 +295,7 @@ private:
 };
 
 // AbstractSvxObjectTitleDescDialog_Impl
-DECL_ABSTDLG_CLASS(AbstractSvxObjectTitleDescDialog,SvxObjectTitleDescDialog)
+DECL_ABSTDLG_CLASS_ASYNC(AbstractSvxObjectTitleDescDialog,SvxObjectTitleDescDialog)
     virtual void GetTitle(OUString& rName) override;
     virtual void GetDescription(OUString& rName) override;
     virtual void IsDecorative(bool & rIsDecorative) override;
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 2e6c7d672fc6..6c9017688b62 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -175,7 +175,7 @@ class AbstractSvxObjectNameDialog :public VclAbstractDialog
 protected:
     virtual ~AbstractSvxObjectNameDialog() override = default;
 public:
-    virtual void GetName(OUString& rName) = 0;
+    virtual OUString GetName() = 0;
     virtual void SetCheckNameHdl(const 
Link<AbstractSvxObjectNameDialog&,bool>& rLink) = 0;
 };
 
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx 
b/sc/source/ui/drawfunc/drawsh5.cxx
index 7c39afc2de0d..0ff2cf6fc468 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();
-                            pDlg->GetName(aName);
-
-                            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;
@@ -647,8 +653,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
 
 IMPL_LINK( ScDrawShell, NameObjectHdl, AbstractSvxObjectNameDialog&, rDialog, 
bool )
 {
-    OUString aName;
-    rDialog.GetName( aName );
+    OUString aName = rDialog.GetName();
 
     ScDrawLayer* pModel = rViewData.GetDocument().GetDrawLayer();
     if ( !aName.isEmpty() && pModel )
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 ) );
 }
 
diff --git a/sw/source/uibase/shells/drwbassh.cxx 
b/sw/source/uibase/shells/drwbassh.cxx
index 225584160752..de5351d9f4bc 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -596,27 +596,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;
-                    pDlg->GetName(aName);
-                    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;
@@ -727,8 +732,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, 
AbstractSvxObjectNameDialog&
     OSL_ENSURE(rMarkList.GetMarkCount() == 1, "wrong draw selection");
     SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
     const OUString sCurrentName = pObj->GetName();
-    OUString sNewName;
-    rNameDialog.GetName(sNewName);
+    OUString sNewName = rNameDialog.GetName();
     bool bRet = false;
     if (sNewName.isEmpty() || sCurrentName == sNewName)
         bRet = true;
diff --git a/sw/source/uibase/shells/frmsh.cxx 
b/sw/source/uibase/shells/frmsh.cxx
index ac5ee0d80835..fc41058cd62e 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -675,14 +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 )
-                {
-                    pDlg->GetName(aName);
-                    rSh.SetFlyName(aName);
-                }
+                pDlg->StartExecuteAsync(
+                    [this, pDlg] (sal_Int32 nResult)->void
+                    {
+                        if (nResult == RET_OK)
+                            GetShell().SetFlyName(pDlg->GetName());
+                        pDlg->disposeOnce();
+                    }
+                );
             }
         }
         break;

Reply via email to