sc/source/core/data/document.cxx |    8 --------
 sc/source/ui/view/tabvwshf.cxx   |   12 ++++++++++--
 2 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 707d23e29ba130a98357c46d5b266a720d52263b
Author:     Pranam Lashkari <[email protected]>
AuthorDate: Fri Nov 28 22:52:12 2025 +0530
Commit:     Miklos Vajna <[email protected]>
CommitDate: Mon Dec 1 08:06:39 2025 +0100

    fix multiple sheet rename error dialogs appearing
    
    regression from 70d8195a2b72440fe929e4e3761d1f1d5ace0096
    
    Change-Id: I285a87f6a315034527749662eb96321afe081994
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194802
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 91d1504a6f0b..9b2297ed9918 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -916,14 +916,6 @@ bool ScDocument::RenameTab( SCTAB nTab, const OUString& 
rName, bool bExternalDoc
                 SfxLokHelper::notifyDocumentSizeChangedAllViews(pModel);
             }
         }
-        else
-        {
-            OUString aErrMsg(ScResId(STR_INVALIDTABNAME));
-            std::shared_ptr<weld::MessageDialog> 
xBox(Application::CreateMessageDialog(
-                GetDocumentShell()->GetFrame()->GetFrameWeld(), 
VclMessageType::Warning,
-                VclButtonsType::Ok, aErrMsg));
-            xBox->runAsync(xBox, [](sal_uInt32) {});
-        }
     }
 
     collectUIInformation({{"NewName", rName}}, u"Rename_Sheet"_ustr);
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 6ae204bc1782..6ec5cfd7b5ef 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -1101,6 +1101,14 @@ void 
ScTabViewShell::ExecuteAppendOrRenameTable(SfxRequest& rReq)
         {
             rReq.Done( *pReqArgs );
         }
+        else
+        {
+            OUString aErrMsg(ScResId(STR_INVALIDTABNAME));
+            std::shared_ptr<weld::MessageDialog> 
xBox(Application::CreateMessageDialog(
+                GetFrameWeld(), VclMessageType::Warning,
+                VclButtonsType::Ok, aErrMsg));
+            xBox->runAsync(xBox, [](sal_uInt32) {});
+        }
     }
     else
     {
@@ -1192,9 +1200,9 @@ bool 
ScTabViewShell::DoAppendOrRenameTableDialog(sal_Int32 nResult, const VclPtr
         else
         {
             OUString aErrMsg ( ScResId( STR_INVALIDTABNAME ) );
-            std::shared_ptr<weld::MessageDialog> 
xBox(Application::CreateMessageDialog(
+            std::unique_ptr<weld::MessageDialog> 
xBox(Application::CreateMessageDialog(
                 GetFrameWeld(), VclMessageType::Warning, VclButtonsType::Ok, 
aErrMsg));
-            xBox->runAsync(xBox, [](sal_uInt32) {});
+            xBox->run();
         }
     }
 

Reply via email to