sc/source/core/data/document.cxx  |    9 +++++++++
 sw/source/uibase/uiview/view2.cxx |    2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 70d8195a2b72440fe929e4e3761d1f1d5ace0096
Author:     Pranam Lashkari <[email protected]>
AuthorDate: Fri Nov 28 19:02:10 2025 +0530
Commit:     Pranam Lashkari <[email protected]>
CommitDate: Fri Nov 28 15:27:41 2025 +0100

    LOK: show warning/error dialogs
    
    show error dialog when invalid images are inserted
    show error dialog when sheet rename was invalid
    
    Change-Id: I9bf6bb25ac247e966da36bffcda3284d5d82ae42
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194778
    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 d1c157dece3c..91d1504a6f0b 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -23,6 +23,7 @@
 #include <editeng/editobj.hxx>
 #include <svx/svditer.hxx>
 #include <sfx2/docfile.hxx>
+#include <sfx2/viewfrm.hxx>
 #include <svl/numformat.hxx>
 #include <poolcach.hxx>
 #include <svl/zforlist.hxx>
@@ -915,6 +916,14 @@ 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/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index 2029adbacc16..fa214e0e9334 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -392,7 +392,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
     OUString sGraphicFormat = SwResId(STR_POOLFRM_GRAPHIC);
 
     const SfxStringItem* pName = 
rReq.GetArg<SfxStringItem>(SID_INSERT_GRAPHIC);
-    bool bShowError = !pName;
+    bool bShowError = !pName || comphelper::LibreOfficeKit::isActive();
 
     // No file pickers in a non-desktop (mobile app) build.
 

Reply via email to