summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-09-25 13:38:06 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-09-26 05:29:27 +0000
commit3711570da638d850251b5f672d1ee4f15ec8c960 (patch)
tree068b94e3ba215eb50cac4767456162e6dada9f2a /cui
parentc70a4cfac88ae28a4ae2408ad3557f7fc08dce94 (diff)
convert Link<> to typed
Change-Id: I4aad44d483cf45313b71ad2ef5800b259b358fbf Reviewed-on: https://gerrit.libreoffice.org/18862 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/dbregister.hxx2
-rw-r--r--cui/source/options/dbregister.cxx17
-rw-r--r--cui/source/options/doclinkdialog.cxx2
-rw-r--r--cui/source/options/doclinkdialog.hxx12
4 files changed, 15 insertions, 18 deletions
diff --git a/cui/source/inc/dbregister.hxx b/cui/source/inc/dbregister.hxx
index 75cb407b8372..12eaceb30cfd 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 831ff0c39df2..d65a3d02fa95 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 304a74ad285e..1ed31255d216 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 a9c935c3a085..00aae23e0c19 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;