cui/source/dialogs/dlgname.cxx               |    5 ++++-
 cui/source/factory/dlgfact.cxx               |    4 ++--
 cui/source/factory/dlgfact.hxx               |    2 +-
 include/cui/dlgname.hxx                      |    3 ++-
 include/svx/svxdlg.hxx                       |    2 +-
 sw/inc/AccessibilityCheckStrings.hrc         |    3 ++-
 sw/source/core/access/AccessibilityIssue.cxx |    6 +++---
 7 files changed, 15 insertions(+), 10 deletions(-)

New commits:
commit c7a608a6691c790783c63f504010bc796c36af25
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Thu Sep 7 12:49:46 2023 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Fri Sep 8 13:24:21 2023 +0200

    tdf#155503 Add title to document title dialog
    
    Otherwise the title was just "Name"
    
    Change-Id: I883d2468c7bd97782b0aef4165a6afe4ff39ce31
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156659
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index fa12a158445f..4e6847e0f5cc 100644
--- a/cui/source/dialogs/dlgname.cxx
+++ b/cui/source/dialogs/dlgname.cxx
@@ -25,7 +25,8 @@
 |*
 \************************************************************************/
 
-SvxNameDialog::SvxNameDialog(weld::Window* pParent, const OUString& rName, 
const OUString& rDesc)
+SvxNameDialog::SvxNameDialog(weld::Window* pParent, const OUString& rName, 
const OUString& rDesc,
+                             const OUString& rTitle)
     : GenericDialogController(pParent, "cui/ui/namedialog.ui", "NameDialog")
     , m_xEdtName(m_xBuilder->weld_entry("name_entry"))
     , m_xFtDescription(m_xBuilder->weld_label("description_label"))
@@ -36,6 +37,8 @@ SvxNameDialog::SvxNameDialog(weld::Window* pParent, const 
OUString& rName, const
     m_xEdtName->select_region(0, -1);
     ModifyHdl(*m_xEdtName);
     m_xEdtName->connect_changed(LINK(this, SvxNameDialog, ModifyHdl));
+    if (!rTitle.isEmpty())
+        set_title(rTitle);
 }
 
 IMPL_LINK_NOARG(SvxNameDialog, ModifyHdl, weld::Entry&, void)
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index d0b0fceed8a3..f558f9e4a37d 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1092,9 +1092,9 @@ VclPtr<VclAbstractDialog> 
AbstractDialogFactory_Impl::CreateSvxEditDictionaryDia
 }
 
 VclPtr<AbstractSvxNameDialog> 
AbstractDialogFactory_Impl::CreateSvxNameDialog(weld::Window* pParent,
-                                    const OUString& rName, const OUString& 
rDesc)
+                                    const OUString& rName, const OUString& 
rDesc, const OUString& rTitle)
 {
-    return 
VclPtr<AbstractSvxNameDialog_Impl>::Create(std::make_unique<SvxNameDialog>(pParent,
 rName, rDesc));
+    return 
VclPtr<AbstractSvxNameDialog_Impl>::Create(std::make_unique<SvxNameDialog>(pParent,
 rName, rDesc, rTitle));
 }
 
 VclPtr<AbstractSvxObjectNameDialog> 
AbstractDialogFactory_Impl::CreateSvxObjectNameDialog(weld::Window* pParent, 
const OUString& rName)
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index cd3f638aced5..4adc0d82ee47 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -521,7 +521,7 @@ public:
     virtual VclPtr<AbstractSvxNewDictionaryDialog> 
CreateSvxNewDictionaryDialog(weld::Window* pParent) override;
     virtual VclPtr<VclAbstractDialog>     
CreateSvxEditDictionaryDialog(weld::Window* pParent, const OUString& rName) 
override;
     virtual VclPtr<AbstractSvxNameDialog> CreateSvxNameDialog(weld::Window* 
pParent,
-                                            const OUString& rName, const 
OUString& rDesc) override;
+                                            const OUString& rName, const 
OUString& rDesc, const OUString& rTitle = "") override;
     // #i68101#
     virtual VclPtr<AbstractSvxObjectNameDialog> 
CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) 
override;
     virtual VclPtr<AbstractSvxObjectTitleDescDialog> 
CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, 
const OUString& rDescription, bool isDecorative) override;
diff --git a/include/cui/dlgname.hxx b/include/cui/dlgname.hxx
index 9083177ee980..16938734ff97 100644
--- a/include/cui/dlgname.hxx
+++ b/include/cui/dlgname.hxx
@@ -36,7 +36,8 @@ private:
     DECL_LINK(ModifyHdl, weld::Entry&, void);
 
 public:
-    SvxNameDialog(weld::Window* pWindow, const OUString& rName, const 
OUString& rDesc);
+    SvxNameDialog(weld::Window* pWindow, const OUString& rName, const 
OUString& rDesc,
+                  const OUString& rTitle = "");
 
     OUString GetName() const { return m_xEdtName->get_text(); }
 
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index d5a0b5fec7fc..436bfd430368 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -377,7 +377,7 @@ public:
     virtual VclPtr<AbstractSvxNewDictionaryDialog> 
CreateSvxNewDictionaryDialog(weld::Window* pParent) = 0;
     virtual VclPtr<VclAbstractDialog>     
CreateSvxEditDictionaryDialog(weld::Window* pParent, const OUString& rName) = 0;
     virtual VclPtr<AbstractSvxNameDialog> CreateSvxNameDialog(weld::Window* 
pParent,
-                                            const OUString& rName, const 
OUString& rDesc ) = 0;
+                                            const OUString& rName, const 
OUString& rDesc, const OUString& rTitle = "" ) = 0;
 
     // #i68101#
     virtual VclPtr<AbstractSvxObjectNameDialog> 
CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) = 0;
diff --git a/sw/inc/AccessibilityCheckStrings.hrc 
b/sw/inc/AccessibilityCheckStrings.hrc
index 66370cd9e4b0..200d63965665 100644
--- a/sw/inc/AccessibilityCheckStrings.hrc
+++ b/sw/inc/AccessibilityCheckStrings.hrc
@@ -42,7 +42,8 @@
 #define STR_DOCUMENT_DEFAULT_LANGUAGE   NC_("STR_DOCUMENT_DEFAULT_LANGUAGE", 
"Document default language is not set.")
 #define STR_STYLE_NO_LANGUAGE           NC_("STR_STYLE_NO_LANGUAGE", "Style 
“%STYLE_NAME%” has no language set.")
 #define STR_DOCUMENT_TITLE              NC_("STR_DOCUMENT_TITLE", "Document 
title is not set.")
-#define STR_ENTER_DOCUMENT_TITLE        NC_("STR_ENTER_DOCUMENT_TITLE", "Enter 
document title:")
+#define STR_DOCUMENT_TITLE_DLG_TITLE    NC_("STR_DOCUMENT_TITLE_DLG_TITLE", 
"Document title")
+#define STR_DOCUMENT_TITLE_DLG_DESC     NC_("STR_DOCUMENT_TITLE_DLG_DESC", 
"Enter document title:")
 
 #define STR_ENTER_ALT                   NC_("STR_ENTER_ALT", "Enter 
alternative text:")
 
diff --git a/sw/source/core/access/AccessibilityIssue.cxx 
b/sw/source/core/access/AccessibilityIssue.cxx
index a915289f26ea..731930a9500e 100644
--- a/sw/source/core/access/AccessibilityIssue.cxx
+++ b/sw/source/core/access/AccessibilityIssue.cxx
@@ -235,11 +235,11 @@ void AccessibilityIssue::quickFixIssue() const
         break;
         case IssueObject::DOCUMENT_TITLE:
         {
-            OUString aDesc = SwResId(STR_ENTER_DOCUMENT_TITLE);
             SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
             SwWrtShell* pWrtShell = m_pDoc->GetDocShell()->GetWrtShell();
-            ScopedVclPtr<AbstractSvxNameDialog> aNameDialog(
-                
pFact->CreateSvxNameDialog(pWrtShell->GetView().GetFrameWeld(), "", aDesc));
+            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)
             {
                 SwDocShell* pShell = m_pDoc->GetDocShell();

Reply via email to