cui/source/options/optjava.cxx |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 2aedb4ae1fe3efe18920a01940bad1bb014265a5
Author:     Sebastian Neagu <neagu.sebastia...@gmail.com>
AuthorDate: Fri May 9 18:33:07 2025 +0000
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Thu May 15 13:09:30 2025 +0200

    tdf#158280 Replace usage of InputDialog with SvxNameDialog
    
    Similar with commit cda4965ea65ff9fa0e63e53344f46aeac91848a9
    
    Signed-off-by: Sebastian Neagu <neagu.sebastia...@gmail.com>
    Change-Id: Iecd6c04c7944624dfcd5d069f152c7d95ffc9553
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185102
    Tested-by: Jenkins
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>

diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 5a90fdeb3a0d..94991497575f 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -44,10 +44,11 @@
 #include <svtools/imagemgr.hxx>
 #include <svtools/restartdialog.hxx>
 #include <sfx2/filedlghelper.hxx>
-#include <sfx2/inputdlg.hxx>
 #include <comphelper/diagnose_ex.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/string.hxx>
+#include <dlgname.hxx>
+#include <o3tl/string_view.hxx>
 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
 #include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
@@ -743,14 +744,17 @@ void SvxJavaParameterDlg::EditParameter()
     if (nPos == -1)
         return;
 
-    InputDialog aParamEditDlg(m_xDialog.get(), 
CuiResId(RID_CUISTR_JAVA_START_PARAM));
     OUString editableClassPath = m_xAssignedList->get_selected_text();
-    aParamEditDlg.SetEntryText(editableClassPath);
-    aParamEditDlg.HideHelpBtn();
+    SvxNameDialog aNameDialog(m_xDialog.get(), editableClassPath, OUString(),
+                            CuiResId(RID_CUISTR_JAVA_START_PARAM));
 
-    if (!aParamEditDlg.run())
+    aNameDialog.SetCheckName([](OUString sNewName) -> bool {
+        return !o3tl::trim(sNewName).empty();
+    });
+
+    if (!aNameDialog.run())
         return;
-    OUString editedClassPath = 
comphelper::string::strip(aParamEditDlg.GetEntryText(), ' ');
+    OUString editedClassPath = 
comphelper::string::strip(aNameDialog.GetName(), ' ');
 
     if ( !editedClassPath.isEmpty() && editableClassPath != editedClassPath )
     {

Reply via email to