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

convert Link<> to typed

Change-Id: I39f08451c546865327f2f1014cfa33c78cdcdc9b
Reviewed-on: https://gerrit.libreoffice.org/18798Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst bd9adac7
...@@ -981,7 +981,7 @@ class SwCreateAuthEntryDlg_Impl : public ModalDialog ...@@ -981,7 +981,7 @@ class SwCreateAuthEntryDlg_Impl : public ModalDialog
VclPtr<OKButton> m_pOKBT; VclPtr<OKButton> m_pOKBT;
Link<> aShortNameCheckLink; Link<Edit*,bool> aShortNameCheckLink;
SwWrtShell& rWrtSh; SwWrtShell& rWrtSh;
...@@ -1003,7 +1003,7 @@ public: ...@@ -1003,7 +1003,7 @@ public:
OUString GetEntryText(ToxAuthorityField eField) const; 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) ...@@ -1332,10 +1332,10 @@ IMPL_LINK_TYPED(SwAuthorMarkPane, ChangeSourceHdl, Button*, pButton, void)
IMPL_LINK(SwAuthorMarkPane, EditModifyHdl, Edit*, pEdit) IMPL_LINK(SwAuthorMarkPane, EditModifyHdl, Edit*, pEdit)
{ {
Link<> aAllowed = LINK(this, SwAuthorMarkPane, IsEntryAllowedHdl); Link<Edit*,bool> aAllowed = LINK(this, SwAuthorMarkPane, IsEntryAllowedHdl);
long nResult = aAllowed.Call(pEdit); bool bResult = aAllowed.Call(pEdit);
m_pActionBT->Enable(nResult > 0); m_pActionBT->Enable(bResult);
if(nResult) if(bResult)
{ {
OUString sEntry(pEdit->GetText()); OUString sEntry(pEdit->GetText());
m_sFields[AUTH_FIELD_IDENTIFIER] = sEntry; m_sFields[AUTH_FIELD_IDENTIFIER] = sEntry;
...@@ -1344,14 +1344,14 @@ IMPL_LINK(SwAuthorMarkPane, EditModifyHdl, Edit*, pEdit) ...@@ -1344,14 +1344,14 @@ IMPL_LINK(SwAuthorMarkPane, EditModifyHdl, Edit*, pEdit)
return 0; return 0;
}; };
IMPL_LINK(SwAuthorMarkPane, IsEntryAllowedHdl, Edit*, pEdit) IMPL_LINK_TYPED(SwAuthorMarkPane, IsEntryAllowedHdl, Edit*, pEdit, bool)
{ {
OUString sEntry = pEdit->GetText(); OUString sEntry = pEdit->GetText();
bool bAllowed = false; bool bAllowed = false;
if(!sEntry.isEmpty()) if(!sEntry.isEmpty())
{ {
if(m_pEntryLB->GetEntryPos(sEntry) != LISTBOX_ENTRY_NOTFOUND) if(m_pEntryLB->GetEntryPos(sEntry) != LISTBOX_ENTRY_NOTFOUND)
return 0; return false;
else if(bIsFromComponent) else if(bIsFromComponent)
{ {
const SwAuthorityFieldType* pFType = static_cast<const SwAuthorityFieldType*>( const SwAuthorityFieldType* pFType = static_cast<const SwAuthorityFieldType*>(
...@@ -1363,7 +1363,7 @@ IMPL_LINK(SwAuthorMarkPane, IsEntryAllowedHdl, Edit*, pEdit) ...@@ -1363,7 +1363,7 @@ IMPL_LINK(SwAuthorMarkPane, IsEntryAllowedHdl, Edit*, pEdit)
bAllowed = !xBibAccess.is() || !xBibAccess->hasByName(sEntry); bAllowed = !xBibAccess.is() || !xBibAccess->hasByName(sEntry);
} }
} }
return bAllowed ? 1 : 0; return bAllowed;
} }
void SwAuthorMarkPane::InitControls() void SwAuthorMarkPane::InitControls()
...@@ -1581,7 +1581,7 @@ IMPL_LINK(SwCreateAuthEntryDlg_Impl, ShortNameHdl, Edit*, pEdit) ...@@ -1581,7 +1581,7 @@ IMPL_LINK(SwCreateAuthEntryDlg_Impl, ShortNameHdl, Edit*, pEdit)
{ {
if(aShortNameCheckLink.IsSet()) if(aShortNameCheckLink.IsSet())
{ {
bool bEnable = 0 != aShortNameCheckLink.Call(pEdit); bool bEnable = aShortNameCheckLink.Call(pEdit);
m_bNameAllowed |= bEnable; m_bNameAllowed |= bEnable;
m_pOKBT->Enable(pTypeListBox->GetSelectEntryCount() && bEnable); m_pOKBT->Enable(pTypeListBox->GetSelectEntryCount() && bEnable);
} }
......
...@@ -210,7 +210,7 @@ class SwAuthorMarkPane ...@@ -210,7 +210,7 @@ class SwAuthorMarkPane
DECL_LINK_TYPED(CreateEntryHdl, Button*, void); DECL_LINK_TYPED(CreateEntryHdl, Button*, void);
DECL_LINK(CompEntryHdl, ListBox*); DECL_LINK(CompEntryHdl, ListBox*);
DECL_LINK_TYPED(ChangeSourceHdl, Button*, void); DECL_LINK_TYPED(ChangeSourceHdl, Button*, void);
DECL_LINK(IsEntryAllowedHdl, Edit*); DECL_LINK_TYPED(IsEntryAllowedHdl, Edit*, bool);
DECL_LINK(EditModifyHdl, Edit*); DECL_LINK(EditModifyHdl, Edit*);
void InitControls(); void InitControls();
......
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