cui/source/dialogs/MacroManagerDialog.cxx |   33 +++++++++++-------------------
 1 file changed, 13 insertions(+), 20 deletions(-)

New commits:
commit b9fd8cc18a9cd5cd4ae86b4256cf8786ea34ea89
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Fri Jan 24 21:00:42 2025 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Jan 24 22:41:58 2025 +0100

    Revert "tdf#158280 Replace usage of InputDialog with SvxNameDialog"
    
    This reverts commit a88b3da5b01403ba593423821843a0dacda158ec.
    
    Reason for revert: it breaks the build because there was a mid-air
    collision with
    commit b811b283c254fb48d8991576dfee0bae3dc322dd
    Author: Stephan Bergmann <stephan.bergm...@allotropia.de>
    Date:   Wed Jan 22 12:54:21 2025 +0100
    
        Extend the Link DBG_UTIL support to non-member function Links
    
    Change-Id: I674b91fbfecae16204bb9d7560ec7ad56f348a5a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180728
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/cui/source/dialogs/MacroManagerDialog.cxx 
b/cui/source/dialogs/MacroManagerDialog.cxx
index 11240cc3c4dc..ebc07902dcb3 100644
--- a/cui/source/dialogs/MacroManagerDialog.cxx
+++ b/cui/source/dialogs/MacroManagerDialog.cxx
@@ -41,7 +41,6 @@
 #include <unotools/viewoptions.hxx>
 #include <vcl/commandevent.hxx>
 #include <vcl/weldutils.hxx>
-#include <dlgname.hxx>
 
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/container/XEnumerationAccess.hpp>
@@ -1229,28 +1228,22 @@ void 
MacroManagerDialog::BasicScriptsCreateLibrary(const basctl::ScriptDocument&
          aLibName = CuiResId(STR_LIBRARY) + OUString::number(++i))
         ;
 
-    OUString aDesc = CuiResId(STR_INPUTDIALOG_NEWLIBRARYLABEL);
-
-    SvxNameDialog aNameDialog(m_xDialog.get(), aLibName, aDesc,
-                              CuiResId(STR_INPUTDIALOG_NEWLIBRARYTITLE));
-
-    aNameDialog.SetCheckNameHdl(Link<SvxNameDialog&, bool>(
-        static_cast<void*>(const_cast<basctl::ScriptDocument*>(&rDocument)),
-        [](void* param, SvxNameDialog& dialog) -> bool {
-            const basctl::ScriptDocument& rDoc = *static_cast<const 
basctl::ScriptDocument*>(param);
-            OUString sNewName = dialog.GetName();
-            if (sNewName.isEmpty() || rDoc.hasLibrary(basctl::E_SCRIPTS, 
sNewName)
-                || rDoc.hasLibrary(basctl::E_DIALOGS, sNewName) || 
sNewName.getLength() > 30
-                || !basctl::IsValidSbxName(sNewName))
-                return false;
-            return true;
-        }));
-    ;
+    InputDialog aInputDlg(m_xDialog.get(), 
CuiResId(STR_INPUTDIALOG_NEWLIBRARYLABEL));
+    aInputDlg.set_title(CuiResId(STR_INPUTDIALOG_NEWLIBRARYTITLE));
+    aInputDlg.SetEntryText(aLibName);
+    aInputDlg.HideHelpBtn();
+    aInputDlg.setCheckEntry([&](OUString sNewName) {
+        if (sNewName.isEmpty() || rDocument.hasLibrary(basctl::E_SCRIPTS, 
sNewName)
+            || rDocument.hasLibrary(basctl::E_DIALOGS, sNewName) || 
sNewName.getLength() > 30
+            || !basctl::IsValidSbxName(sNewName))
+            return false;
+        return true;
+    });
 
-    if (aNameDialog.run() != RET_OK)
+    if (!aInputDlg.run())
         return;
 
-    aLibName = aNameDialog.GetName();
+    aLibName = aInputDlg.GetEntryText();
 
     try
     {

Reply via email to