Kaydet (Commit) 3711570d authored tarafından Noel Grandin's avatar Noel Grandin

convert Link<> to typed

Change-Id: I4aad44d483cf45313b71ad2ef5800b259b358fbf
Reviewed-on: https://gerrit.libreoffice.org/18862Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst c70a4cfa
...@@ -61,7 +61,7 @@ namespace svx ...@@ -61,7 +61,7 @@ namespace svx
DECL_LINK_TYPED( HeaderSelect_Impl, HeaderBar *, void ); DECL_LINK_TYPED( HeaderSelect_Impl, HeaderBar *, void );
DECL_LINK_TYPED( HeaderEndDrag_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 /** inserts a new entry in the tablistbox
......
...@@ -436,19 +436,16 @@ void DbRegistrationOptionsPage::openLinkDialog(const OUString& _sOldName,const O ...@@ -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(); SvTreeListEntry* pEntry = m_pPathBox->GetEntry(i);
for ( sal_uLong i = 0; i < nCount; ++i ) if ( (!m_pCurEntry || m_pCurEntry != pEntry) && SvTabListBox::GetEntryText(pEntry,0) == _rName )
{ return false;
SvTreeListEntry* pEntry = m_pPathBox->GetEntry(i);
if ( (!m_pCurEntry || m_pCurEntry != pEntry) && SvTabListBox::GetEntryText(pEntry,0) == *_pName )
return 0L;
}
} }
return 1L; return true;
} }
} }
......
...@@ -143,7 +143,7 @@ namespace svx ...@@ -143,7 +143,7 @@ namespace svx
OUString sCurrentText = m_pName->GetText(); OUString sCurrentText = m_pName->GetText();
if ( m_aNameValidator.IsSet() ) if ( m_aNameValidator.IsSet() )
{ {
if ( !m_aNameValidator.Call( &sCurrentText ) ) if ( !m_aNameValidator.Call( sCurrentText ) )
{ {
OUString sMsg = CUI_RES(STR_NAME_CONFLICT); OUString sMsg = CUI_RES(STR_NAME_CONFLICT);
sMsg = sMsg.replaceFirst("$file$", sCurrentText); sMsg = sMsg.replaceFirst("$file$", sCurrentText);
......
...@@ -37,13 +37,13 @@ namespace svx ...@@ -37,13 +37,13 @@ namespace svx
{ {
protected: protected:
VclPtr< ::svt::OFileURLControl> m_pURL; VclPtr< ::svt::OFileURLControl> m_pURL;
VclPtr<PushButton> m_pBrowseFile; VclPtr<PushButton> m_pBrowseFile;
VclPtr<Edit> m_pName; VclPtr<Edit> m_pName;
VclPtr<OKButton> m_pOK; VclPtr<OKButton> m_pOK;
bool m_bCreatingNew; bool m_bCreatingNew;
Link<> m_aNameValidator; Link<const OUString&,bool> m_aNameValidator;
public: public:
ODocumentLinkDialog( vcl::Window* _pParent, bool _bCreateNew ); ODocumentLinkDialog( vcl::Window* _pParent, bool _bCreateNew );
...@@ -53,7 +53,7 @@ namespace svx ...@@ -53,7 +53,7 @@ namespace svx
// name validation has to be done by an external instance // 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 // the validator link gets a pointer to a String, and should return 0 if the string is not
// acceptable // 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 setLink( const OUString& _rName, const OUString& _rURL );
void getLink( OUString& _rName, OUString& _rURL ) const; void getLink( OUString& _rName, OUString& _rURL ) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment