cui/source/inc/dbregister.hxx | 2 +- cui/source/options/dbregister.cxx | 17 +++++++---------- cui/source/options/doclinkdialog.cxx | 2 +- cui/source/options/doclinkdialog.hxx | 12 ++++++------ 4 files changed, 15 insertions(+), 18 deletions(-)
New commits: commit 3711570da638d850251b5f672d1ee4f15ec8c960 Author: Noel Grandin <noelgran...@gmail.com> Date: Fri Sep 25 13:38:06 2015 +0200 convert Link<> to typed Change-Id: I4aad44d483cf45313b71ad2ef5800b259b358fbf Reviewed-on: https://gerrit.libreoffice.org/18862 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/cui/source/inc/dbregister.hxx b/cui/source/inc/dbregister.hxx index 75cb407..12eaceb 100644 --- a/cui/source/inc/dbregister.hxx +++ b/cui/source/inc/dbregister.hxx @@ -61,7 +61,7 @@ namespace svx DECL_LINK_TYPED( HeaderSelect_Impl, HeaderBar *, void ); DECL_LINK_TYPED( HeaderEndDrag_Impl, HeaderBar *, void ); - DECL_LINK( NameValidator, OUString*); + DECL_LINK_TYPED( NameValidator, const OUString&, bool); /** inserts a new entry in the tablistbox diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index 831ff0c..d65a3d0 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -436,19 +436,16 @@ void DbRegistrationOptionsPage::openLinkDialog(const OUString& _sOldName,const O } } -IMPL_LINK( DbRegistrationOptionsPage, NameValidator, OUString*, _pName ) +IMPL_LINK_TYPED( DbRegistrationOptionsPage, NameValidator, const OUString&, _rName, bool ) { - if ( _pName ) + sal_uLong nCount = m_pPathBox->GetEntryCount(); + for ( sal_uLong i = 0; i < nCount; ++i ) { - sal_uLong nCount = m_pPathBox->GetEntryCount(); - for ( sal_uLong i = 0; i < nCount; ++i ) - { - SvTreeListEntry* pEntry = m_pPathBox->GetEntry(i); - if ( (!m_pCurEntry || m_pCurEntry != pEntry) && SvTabListBox::GetEntryText(pEntry,0) == *_pName ) - return 0L; - } + SvTreeListEntry* pEntry = m_pPathBox->GetEntry(i); + if ( (!m_pCurEntry || m_pCurEntry != pEntry) && SvTabListBox::GetEntryText(pEntry,0) == _rName ) + return false; } - return 1L; + return true; } } diff --git a/cui/source/options/doclinkdialog.cxx b/cui/source/options/doclinkdialog.cxx index 304a74a..1ed3125 100644 --- a/cui/source/options/doclinkdialog.cxx +++ b/cui/source/options/doclinkdialog.cxx @@ -143,7 +143,7 @@ namespace svx OUString sCurrentText = m_pName->GetText(); if ( m_aNameValidator.IsSet() ) { - if ( !m_aNameValidator.Call( &sCurrentText ) ) + if ( !m_aNameValidator.Call( sCurrentText ) ) { OUString sMsg = CUI_RES(STR_NAME_CONFLICT); sMsg = sMsg.replaceFirst("$file$", sCurrentText); diff --git a/cui/source/options/doclinkdialog.hxx b/cui/source/options/doclinkdialog.hxx index a9c935c..00aae23 100644 --- a/cui/source/options/doclinkdialog.hxx +++ b/cui/source/options/doclinkdialog.hxx @@ -37,13 +37,13 @@ namespace svx { protected: VclPtr< ::svt::OFileURLControl> m_pURL; - VclPtr<PushButton> m_pBrowseFile; - VclPtr<Edit> m_pName; - VclPtr<OKButton> m_pOK; + VclPtr<PushButton> m_pBrowseFile; + VclPtr<Edit> m_pName; + VclPtr<OKButton> m_pOK; - bool m_bCreatingNew; + bool m_bCreatingNew; - Link<> m_aNameValidator; + Link<const OUString&,bool> m_aNameValidator; public: ODocumentLinkDialog( vcl::Window* _pParent, bool _bCreateNew ); @@ -53,7 +53,7 @@ namespace svx // name validation has to be done by an external instance // the validator link gets a pointer to a String, and should return 0 if the string is not // acceptable - void setNameValidator( const Link<>& _rValidator ) { m_aNameValidator = _rValidator; } + void setNameValidator( const Link<const OUString&,bool>& _rValidator ) { m_aNameValidator = _rValidator; } void setLink( const OUString& _rName, const OUString& _rURL ); void getLink( OUString& _rName, OUString& _rURL ) const; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits