diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-09-22 21:48:35 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-09-23 13:05:48 +0000 |
commit | aada49a5743c298e461660420fe48ef4c220e292 (patch) | |
tree | 99bf033583600badfd4d59ea354b0989389db37b /sw/source/ui | |
parent | bd9adac7753113a9f03e52b43bf238c4889b918d (diff) |
convert Link<> to typed
Change-Id: I39f08451c546865327f2f1014cfa33c78cdcdc9b
Reviewed-on: https://gerrit.libreoffice.org/18798
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/index/swuiidxmrk.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 269731cd1dfb..879b27b470b6 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -981,7 +981,7 @@ class SwCreateAuthEntryDlg_Impl : public ModalDialog VclPtr<OKButton> m_pOKBT; - Link<> aShortNameCheckLink; + Link<Edit*,bool> aShortNameCheckLink; SwWrtShell& rWrtSh; @@ -1003,7 +1003,7 @@ public: OUString GetEntryText(ToxAuthorityField eField) const; - void SetCheckNameHdl(const Link<>& rLink) {aShortNameCheckLink = rLink;} + void SetCheckNameHdl(const Link<Edit*,bool>& rLink) {aShortNameCheckLink = rLink;} }; @@ -1332,10 +1332,10 @@ IMPL_LINK_TYPED(SwAuthorMarkPane, ChangeSourceHdl, Button*, pButton, void) IMPL_LINK(SwAuthorMarkPane, EditModifyHdl, Edit*, pEdit) { - Link<> aAllowed = LINK(this, SwAuthorMarkPane, IsEntryAllowedHdl); - long nResult = aAllowed.Call(pEdit); - m_pActionBT->Enable(nResult > 0); - if(nResult) + Link<Edit*,bool> aAllowed = LINK(this, SwAuthorMarkPane, IsEntryAllowedHdl); + bool bResult = aAllowed.Call(pEdit); + m_pActionBT->Enable(bResult); + if(bResult) { OUString sEntry(pEdit->GetText()); m_sFields[AUTH_FIELD_IDENTIFIER] = sEntry; @@ -1344,14 +1344,14 @@ IMPL_LINK(SwAuthorMarkPane, EditModifyHdl, Edit*, pEdit) return 0; }; -IMPL_LINK(SwAuthorMarkPane, IsEntryAllowedHdl, Edit*, pEdit) +IMPL_LINK_TYPED(SwAuthorMarkPane, IsEntryAllowedHdl, Edit*, pEdit, bool) { OUString sEntry = pEdit->GetText(); bool bAllowed = false; if(!sEntry.isEmpty()) { if(m_pEntryLB->GetEntryPos(sEntry) != LISTBOX_ENTRY_NOTFOUND) - return 0; + return false; else if(bIsFromComponent) { const SwAuthorityFieldType* pFType = static_cast<const SwAuthorityFieldType*>( @@ -1363,7 +1363,7 @@ IMPL_LINK(SwAuthorMarkPane, IsEntryAllowedHdl, Edit*, pEdit) bAllowed = !xBibAccess.is() || !xBibAccess->hasByName(sEntry); } } - return bAllowed ? 1 : 0; + return bAllowed; } void SwAuthorMarkPane::InitControls() @@ -1581,7 +1581,7 @@ IMPL_LINK(SwCreateAuthEntryDlg_Impl, ShortNameHdl, Edit*, pEdit) { if(aShortNameCheckLink.IsSet()) { - bool bEnable = 0 != aShortNameCheckLink.Call(pEdit); + bool bEnable = aShortNameCheckLink.Call(pEdit); m_bNameAllowed |= bEnable; m_pOKBT->Enable(pTypeListBox->GetSelectEntryCount() && bEnable); } |