cui/source/factory/dlgfact.cxx                         |    6 +++---
 cui/source/factory/dlgfact.hxx                         |    2 +-
 cui/source/options/optaboutconfig.cxx                  |    2 +-
 include/cui/dlgname.hxx                                |   13 ++-----------
 include/svx/svxdlg.hxx                                 |    2 +-
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx |    2 +-
 sd/source/ui/view/drviews2.cxx                         |    2 +-
 7 files changed, 10 insertions(+), 19 deletions(-)

New commits:
commit b047c9b21b75f58429c5f55d2838f154c0ea6293
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Thu Nov 9 14:01:11 2023 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Mon Nov 13 10:39:29 2023 +0100

    Fix old TODO: Remove the parameter bCheckImmediately from SvxNameDialog
    
    Change-Id: I47a6e82bab3306e8fddb8002740339dbb1965a64
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159213
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 63bfdbddbe39..42a2b19fbaee 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -552,13 +552,13 @@ void AbstractSvxNameDialog_Impl::GetName(OUString& rName)
     rName = m_xDlg->GetName();
 }
 
-void AbstractSvxNameDialog_Impl::SetCheckNameHdl( const 
Link<AbstractSvxNameDialog&,bool>& rLink, bool bCheckImmediately )
+void AbstractSvxNameDialog_Impl::SetCheckNameHdl( const 
Link<AbstractSvxNameDialog&,bool>& rLink )
 {
     aCheckNameHdl = rLink;
     if( rLink.IsSet() )
-        m_xDlg->SetCheckNameHdl( LINK(this, AbstractSvxNameDialog_Impl, 
CheckNameHdl), bCheckImmediately );
+        m_xDlg->SetCheckNameHdl( LINK(this, AbstractSvxNameDialog_Impl, 
CheckNameHdl) );
     else
-        m_xDlg->SetCheckNameHdl( Link<SvxNameDialog&,bool>(), 
bCheckImmediately );
+        m_xDlg->SetCheckNameHdl( Link<SvxNameDialog&,bool>() );
 }
 
 void AbstractSvxNameDialog_Impl::SetCheckNameTooltipHdl( const 
Link<AbstractSvxNameDialog&,OUString>& rLink)
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index b57fe2995718..137a5a033294 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -266,7 +266,7 @@ 
DECL_ABSTDLG_CLASS(AbstractSvxNewDictionaryDialog,SvxNewDictionaryDialog)
 // AbstractSvxNameDialog_Impl
 DECL_ABSTDLG_CLASS(AbstractSvxNameDialog,SvxNameDialog)
     virtual void    GetName( OUString& rName ) override ;
-    virtual void    SetCheckNameHdl( const Link<AbstractSvxNameDialog&,bool>& 
rLink, bool bCheckImmediately = false ) override ;
+    virtual void    SetCheckNameHdl( const Link<AbstractSvxNameDialog&,bool>& 
rLink ) override ;
     virtual void    SetCheckNameTooltipHdl( const Link<AbstractSvxNameDialog&, 
OUString>& rLink ) override ;
     virtual void    SetEditHelpId(const OUString&) override ;
     //from class Window
diff --git a/cui/source/options/optaboutconfig.cxx 
b/cui/source/options/optaboutconfig.cxx
index a5d6ac9757a5..bdc51afdea51 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -655,7 +655,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, 
weld::Button&, void )
         if( bOpenDialog )
         {
             SvxNameDialog aNameDialog(m_pParent, sDialogValue, sPropertyName);
-            aNameDialog.SetCheckNameHdl( LINK( this, CuiAboutConfigTabPage, 
ValidNameHdl ), true );
+            aNameDialog.SetCheckNameHdl( LINK( this, CuiAboutConfigTabPage, 
ValidNameHdl ) );
             if (aNameDialog.run() == RET_OK )
             {
                 OUString sNewValue = aNameDialog.GetName();
diff --git a/include/cui/dlgname.hxx b/include/cui/dlgname.hxx
index 9eb388caa078..7d207d281812 100644
--- a/include/cui/dlgname.hxx
+++ b/include/cui/dlgname.hxx
@@ -47,20 +47,11 @@ public:
 
         @param rLink a Callback declared with DECL_DLLPRIVATE_LINK and 
implemented with
                IMPL_LINK, that is executed on modification.
-
-        @param bCheckImmediately If true, the Link is called directly after
-               setting it. It is recommended to set this flag to true to avoid
-               an inconsistent state if the initial String (given in the CTOR)
-               does not satisfy the check condition.
-
-        @todo Remove the parameter bCheckImmediately and incorporate the 'true'
-              behaviour as default.
      */
-    void SetCheckNameHdl(const Link<SvxNameDialog&, bool>& rLink, bool 
bCheckImmediately)
+    void SetCheckNameHdl(const Link<SvxNameDialog&, bool>& rLink)
     {
         m_aCheckNameHdl = rLink;
-        if (bCheckImmediately)
-            ModifyHdl(*m_xEdtName);
+        ModifyHdl(*m_xEdtName);
     }
 
     void SetCheckNameTooltipHdl(const Link<SvxNameDialog&, OUString>& rLink)
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 436bfd430368..41158ef2a415 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -163,7 +163,7 @@ protected:
     virtual ~AbstractSvxNameDialog() override = default;
 public:
     virtual void    GetName( OUString& rName ) = 0;
-    virtual void    SetCheckNameHdl( const Link<AbstractSvxNameDialog&,bool>& 
rLink, bool bCheckImmediately = false ) = 0;
+    virtual void    SetCheckNameHdl( const Link<AbstractSvxNameDialog&,bool>& 
rLink ) = 0;
     virtual void    SetCheckNameTooltipHdl( const 
Link<AbstractSvxNameDialog&,OUString>& rLink ) = 0;
     virtual void    SetEditHelpId(const OUString&) = 0;
     virtual void    SetHelpId( const OUString& ) = 0;
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx 
b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index bd58443b80be..0a713c06da8f 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -922,7 +922,7 @@ void SlotManager::RenameSlide(const SfxRequest& rRequest)
         OUString aOldName;
         aNameDlg->GetName( aOldName );
         aNameDlg->SetText( aTitle );
-        aNameDlg->SetCheckNameHdl( LINK( this, SlotManager, RenameSlideHdl ), 
true );
+        aNameDlg->SetCheckNameHdl( LINK( this, SlotManager, RenameSlideHdl ) );
         aNameDlg->SetCheckNameTooltipHdl( LINK( this, SlotManager, 
RenameSlideTooltipHdl ) );
         aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE );
 
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index d7fefcecae72..b49e7bfc497a 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -853,7 +853,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                     SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
                     ScopedVclPtr<AbstractSvxNameDialog> 
aNameDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aPageName, aDescr));
                     aNameDlg->SetText( aTitle );
-                    aNameDlg->SetCheckNameHdl( LINK( this, DrawViewShell, 
RenameSlideHdl ), true );
+                    aNameDlg->SetCheckNameHdl( LINK( this, DrawViewShell, 
RenameSlideHdl ) );
                     aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE );
 
                     if( aNameDlg->Execute() == RET_OK )

Reply via email to