sw/source/core/access/AccessibilityIssue.cxx |   25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

New commits:
commit ed50960724fa6fa5ed1106783ffcd175c5298d76
Author:     Michael Weghorn <[email protected]>
AuthorDate: Tue Feb 17 16:48:47 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed Feb 18 16:43:17 2026 +0100

    tdf#158280 Use SvxNameDialog directly in AccessibilityIssue
    
    As mentioned in previous commit
    
        Change-Id: I26023712b09bcd7c303053e88cce40a3e1cae964
        Author: Michael Weghorn <[email protected]>
        Date:   Tue Feb 17 15:43:22 2026 +0100
    
            tdf#158280 Move SvxNameDialog etc. from cui to svtools
    
    , SvxNameDialog can now be used directly instead
    of via the AbstractSvxNameDialog abstraction.
    
    Do so in AccessibilityIssue::quickFixIssue.
    
    Change-Id: I4817b7f971773c9fe7e8507403bafce9ba901657
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199563
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/sw/source/core/access/AccessibilityIssue.cxx 
b/sw/source/core/access/AccessibilityIssue.cxx
index 9633d7db4350..0940484298a5 100644
--- a/sw/source/core/access/AccessibilityIssue.cxx
+++ b/sw/source/core/access/AccessibilityIssue.cxx
@@ -24,6 +24,7 @@
 #include <docsh.hxx>
 #include <view.hxx>
 #include <comphelper/lok.hxx>
+#include <svtools/dlgname.hxx>
 #include <svx/svdpage.hxx>
 #include <svx/svxdlg.hxx>
 
@@ -339,12 +340,11 @@ void AccessibilityIssue::quickFixIssue() const
         case IssueObject::HYPERLINKTEXT:
         case IssueObject::HYPERLINKFLY:
         {
-            SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
             SwWrtShell* pWrtShell = pShell->GetWrtShell();
-            ScopedVclPtr<AbstractSvxNameDialog> 
aNameDialog(pFact->CreateSvxNameDialog(
-                pWrtShell->GetView().GetFrameWeld(), OUString(), 
SwResId(STR_HYPERLINK_NO_NAME_DLG),
-                SwResId(STR_HYPERLINK_NO_NAME_DLG)));
-            if (aNameDialog->Execute() == RET_OK)
+            SvxNameDialog aNameDialog(pWrtShell->GetView().GetFrameWeld(), 
OUString(),
+                                      SwResId(STR_HYPERLINK_NO_NAME_DLG),
+                                      SwResId(STR_HYPERLINK_NO_NAME_DLG));
+            if (aNameDialog.run() == RET_OK)
             {
                 if (m_eIssueObject == IssueObject::HYPERLINKTEXT)
                 {
@@ -357,7 +357,7 @@ void AccessibilityIssue::quickFixIssue() const
                         && 
xRun->getPropertySetInfo()->hasPropertyByName(u"HyperLinkName"_ustr))
                     {
                         xRun->setPropertyValue(u"HyperLinkName"_ustr,
-                                               
uno::Any(aNameDialog->GetName()));
+                                               
uno::Any(aNameDialog.GetName()));
                     }
                 }
                 else
@@ -367,7 +367,7 @@ void AccessibilityIssue::quickFixIssue() const
                     if (pFlyFormat)
                     {
                         SwFormatURL item{ pFlyFormat->GetURL() };
-                        item.SetName(aNameDialog->GetName());
+                        item.SetName(aNameDialog.GetName());
                         SwAttrSet set{ m_pDoc->GetAttrPool(), 
svl::Items<RES_URL, RES_URL> };
                         set.Put(item);
                         m_pDoc->SetFlyFrameAttr(*pFlyFormat, set);
@@ -379,18 +379,17 @@ void AccessibilityIssue::quickFixIssue() const
         break;
         case IssueObject::DOCUMENT_TITLE:
         {
-            SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
             SwWrtShell* pWrtShell = pShell->GetWrtShell();
-            ScopedVclPtr<AbstractSvxNameDialog> 
aNameDialog(pFact->CreateSvxNameDialog(
-                pWrtShell->GetView().GetFrameWeld(), OUString(),
-                SwResId(STR_DOCUMENT_TITLE_DLG_DESC), 
SwResId(STR_DOCUMENT_TITLE_DLG_TITLE)));
-            if (aNameDialog->Execute() == RET_OK)
+            SvxNameDialog aNameDialog(pWrtShell->GetView().GetFrameWeld(), 
OUString(),
+                                      SwResId(STR_DOCUMENT_TITLE_DLG_DESC),
+                                      SwResId(STR_DOCUMENT_TITLE_DLG_TITLE));
+            if (aNameDialog.run() == RET_OK)
             {
                 const uno::Reference<document::XDocumentPropertiesSupplier> 
xDPS(
                     pShell->GetModel(), uno::UNO_QUERY_THROW);
                 const uno::Reference<document::XDocumentProperties> 
xDocumentProperties(
                     xDPS->getDocumentProperties());
-                xDocumentProperties->setTitle(aNameDialog->GetName());
+                xDocumentProperties->setTitle(aNameDialog.GetName());
 
                 
m_pDoc->getOnlineAccessibilityCheck()->resetAndQueueDocumentLevel();
             }

Reply via email to