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

convert Link<> to typed

Change-Id: I047c52f37b21b1264396d7077a1f35f6d2b13f3f
üst 8f0f4faa
...@@ -79,6 +79,7 @@ class SvxEditModulesDlg : public ModalDialog ...@@ -79,6 +79,7 @@ class SvxEditModulesDlg : public ModalDialog
DECL_LINK_TYPED(ClickHdl_Impl, Button*, void); DECL_LINK_TYPED(ClickHdl_Impl, Button*, void);
DECL_LINK_TYPED(BackHdl_Impl, Button*, void); DECL_LINK_TYPED(BackHdl_Impl, Button*, void);
DECL_LINK( LangSelectHdl_Impl, ListBox* ); DECL_LINK( LangSelectHdl_Impl, ListBox* );
DECL_LINK_TYPED( BoxCheckButtonHdl_Impl2, SvLBoxButtonData*, void );
DECL_LINK( BoxCheckButtonHdl_Impl, SvTreeListBox * ); DECL_LINK( BoxCheckButtonHdl_Impl, SvTreeListBox * );
DECL_LINK(OpenURLHdl_Impl, void *); DECL_LINK(OpenURLHdl_Impl, void *);
......
...@@ -1935,7 +1935,7 @@ SvTreeListEntry* SvxEditModulesDlg::CreateEntry( OUString& rTxt, sal_uInt16 nCol ...@@ -1935,7 +1935,7 @@ SvTreeListEntry* SvxEditModulesDlg::CreateEntry( OUString& rTxt, sal_uInt16 nCol
if( !pCheckButtonData ) if( !pCheckButtonData )
{ {
pCheckButtonData = new SvLBoxButtonData(m_pModulesCLB); pCheckButtonData = new SvLBoxButtonData(m_pModulesCLB);
pCheckButtonData->SetLink( m_pModulesCLB->GetCheckButtonHdl() ); pCheckButtonData->SetLink( LINK( this, SvxEditModulesDlg, BoxCheckButtonHdl_Impl2 ) );
} }
if (CBCOL_FIRST == nCol) if (CBCOL_FIRST == nCol)
...@@ -1984,33 +1984,36 @@ IMPL_LINK( SvxEditModulesDlg, SelectHdl_Impl, SvxCheckListBox *, pBox ) ...@@ -1984,33 +1984,36 @@ IMPL_LINK( SvxEditModulesDlg, SelectHdl_Impl, SvxCheckListBox *, pBox )
return 0; return 0;
} }
IMPL_LINK( SvxEditModulesDlg, BoxCheckButtonHdl_Impl, SvTreeListBox *, pBox ) IMPL_LINK_NOARG_TYPED( SvxEditModulesDlg, BoxCheckButtonHdl_Impl2, SvLBoxButtonData*, void )
{ {
pBox = m_pModulesCLB; BoxCheckButtonHdl_Impl(NULL);
SvTreeListEntry *pCurEntry = pBox->GetCurEntry(); }
if (pCurEntry) IMPL_LINK( SvxEditModulesDlg, BoxCheckButtonHdl_Impl, SvTreeListBox *, /*pBox*/ )
{
SvTreeListEntry *pCurEntry = m_pModulesCLB->GetCurEntry();
if (pCurEntry)
{
ModuleUserData_Impl* pData = static_cast<ModuleUserData_Impl *>(
pCurEntry->GetUserData());
if (!pData->IsParent() && pData->GetType() == TYPE_HYPH)
{ {
ModuleUserData_Impl* pData = static_cast<ModuleUserData_Impl *>( // make hyphenator checkboxes function as radio-buttons
pCurEntry->GetUserData()); // (at most one box may be checked)
if (!pData->IsParent() && pData->GetType() == TYPE_HYPH) SvTreeListEntry *pEntry = m_pModulesCLB->First();
while (pEntry)
{ {
// make hyphenator checkboxes function as radio-buttons pData = static_cast<ModuleUserData_Impl*>(pEntry->GetUserData());
// (at most one box may be checked) if (!pData->IsParent() &&
SvTreeListEntry *pEntry = pBox->First(); pData->GetType() == TYPE_HYPH &&
while (pEntry) pEntry != pCurEntry)
{ {
pData = static_cast<ModuleUserData_Impl*>(pEntry->GetUserData()); lcl_SetCheckButton( pEntry, false );
if (!pData->IsParent() && m_pModulesCLB->InvalidateEntry( pEntry );
pData->GetType() == TYPE_HYPH &&
pEntry != pCurEntry)
{
lcl_SetCheckButton( pEntry, false );
pBox->InvalidateEntry( pEntry );
}
pEntry = pBox->Next( pEntry );
} }
pEntry = m_pModulesCLB->Next( pEntry );
} }
} }
}
return 0; return 0;
} }
......
...@@ -59,7 +59,7 @@ struct SvLBoxButtonData_Impl; ...@@ -59,7 +59,7 @@ struct SvLBoxButtonData_Impl;
class SVT_DLLPUBLIC SvLBoxButtonData class SVT_DLLPUBLIC SvLBoxButtonData
{ {
private: private:
Link<> aLink; Link<SvLBoxButtonData*,void> aLink;
long nWidth; long nWidth;
long nHeight; long nHeight;
SvLBoxButtonData_Impl* pImpl; SvLBoxButtonData_Impl* pImpl;
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
static SvBmp GetIndex( SvItemStateFlags nItemState ); static SvBmp GetIndex( SvItemStateFlags nItemState );
long Width(); long Width();
long Height(); long Height();
void SetLink( const Link<>& rLink) { aLink=rLink; } void SetLink( const Link<SvLBoxButtonData*,void>& rLink) { aLink=rLink; }
bool IsRadio(); bool IsRadio();
// as buttons are not derived from LinkHdl // as buttons are not derived from LinkHdl
void CallLink(); void CallLink();
......
...@@ -294,7 +294,7 @@ protected: ...@@ -294,7 +294,7 @@ protected:
private: private:
void SetBaseModel(SvTreeList* pNewModel); void SetBaseModel(SvTreeList* pNewModel);
DECL_DLLPRIVATE_LINK( CheckButtonClick, SvLBoxButtonData * ); DECL_DLLPRIVATE_LINK_TYPED( CheckButtonClick, SvLBoxButtonData *, void );
DECL_DLLPRIVATE_LINK( TextEditEndedHdl_Impl, void * ); DECL_DLLPRIVATE_LINK( TextEditEndedHdl_Impl, void * );
// Handler that is called by TreeList to clone an Entry // Handler that is called by TreeList to clone an Entry
DECL_DLLPRIVATE_LINK( CloneHdl_Impl, SvTreeListEntry* ); DECL_DLLPRIVATE_LINK( CloneHdl_Impl, SvTreeListEntry* );
......
...@@ -1781,11 +1781,10 @@ const Image& SvTreeListBox::GetCollapsedEntryBmp( const SvTreeListEntry* pEntry ...@@ -1781,11 +1781,10 @@ const Image& SvTreeListBox::GetCollapsedEntryBmp( const SvTreeListEntry* pEntry
return pItem->GetBitmap1( ); return pItem->GetBitmap1( );
} }
IMPL_LINK( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pData ) IMPL_LINK_TYPED( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pData, void )
{ {
pHdlEntry = pData->GetActEntry(); pHdlEntry = pData->GetActEntry();
CheckButtonHdl(); CheckButtonHdl();
return 0;
} }
SvTreeListEntry* SvTreeListBox::InsertEntry( SvTreeListEntry* SvTreeListBox::InsertEntry(
......
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