Kaydet (Commit) 3ae4264a authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Replace IMPL_STATIC_LINK[_TYPED] with more useful variants

Change-Id: Iee6d0493172b7b776ac8c5b05f675cd28091f8b4
üst 65d999d2
...@@ -108,7 +108,7 @@ public: ...@@ -108,7 +108,7 @@ public:
~SfxFilterMatcher(); ~SfxFilterMatcher();
SAL_DLLPRIVATE static bool IsFilterInstalled_Impl( const SfxFilter* pFilter ); SAL_DLLPRIVATE static bool IsFilterInstalled_Impl( const SfxFilter* pFilter );
DECL_DLLPRIVATE_STATIC_LINK_TYPED( SfxFilterMatcher, MaybeFileHdl_Impl, OUString*, bool ); DECL_DLLPRIVATE_LINK_TYPED( MaybeFileHdl_Impl, OUString*, bool );
sal_uInt32 GuessFilterIgnoringContent( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; sal_uInt32 GuessFilterIgnoringContent( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
sal_uInt32 GuessFilter( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; sal_uInt32 GuessFilter( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
......
...@@ -463,45 +463,45 @@ void SvFileObject::Edit( vcl::Window* pParent, sfx2::SvBaseLink* pLink, const Li ...@@ -463,45 +463,45 @@ void SvFileObject::Edit( vcl::Window* pParent, sfx2::SvBaseLink* pLink, const Li
} }
} }
IMPL_STATIC_LINK( SvFileObject, LoadGrfReady_Impl, void*, EMPTYARG ) IMPL_LINK_NOARG( SvFileObject, LoadGrfReady_Impl )
{ {
// When we come form here there it can not be an error no more. // When we come form here there it can not be an error no more.
pThis->bLoadError = false; bLoadError = false;
pThis->bWaitForData = false; bWaitForData = false;
pThis->bInCallDownload = false; bInCallDownload = false;
if( !pThis->bInNewData && !pThis->bDataReady ) if( !bInNewData && !bDataReady )
{ {
// Graphic is finished, also send DataChanged from Status change // Graphic is finished, also send DataChanged from Status change
pThis->bDataReady = true; bDataReady = true;
pThis->SendStateChg_Impl( sfx2::LinkManager::STATE_LOAD_OK ); SendStateChg_Impl( sfx2::LinkManager::STATE_LOAD_OK );
// and then send the data again // and then send the data again
pThis->NotifyDataChanged(); NotifyDataChanged();
} }
if( pThis->bDataReady ) if( bDataReady )
{ {
pThis->bLoadAgain = true; bLoadAgain = true;
if( pThis->xMed.Is() ) if( xMed.Is() )
{ {
pThis->xMed->SetDoneLink( Link<>() ); xMed->SetDoneLink( Link<>() );
pThis->pDelMed = new SfxMediumRef(pThis->xMed); pDelMed = new SfxMediumRef(xMed);
pThis->nPostUserEventId = Application::PostUserEvent( nPostUserEventId = Application::PostUserEvent(
LINK( pThis, SvFileObject, DelMedium_Impl ), LINK( this, SvFileObject, DelMedium_Impl ),
pThis->pDelMed); pDelMed);
pThis->xMed.Clear(); xMed.Clear();
} }
} }
return 0; return 0;
} }
IMPL_STATIC_LINK( SvFileObject, DelMedium_Impl, SfxMediumRef*, pDelMed ) IMPL_LINK( SvFileObject, DelMedium_Impl, SfxMediumRef*, pDelMed )
{ {
pThis->nPostUserEventId = 0; nPostUserEventId = 0;
assert(pThis->pDelMed == pDelMed); assert(pDelMed == pDelMed);
pThis->pDelMed = NULL; pDelMed = NULL;
delete pDelMed; delete pDelMed;
return 0; return 0;
} }
......
...@@ -54,8 +54,8 @@ class SvFileObject : public sfx2::SvLinkSource ...@@ -54,8 +54,8 @@ class SvFileObject : public sfx2::SvLinkSource
bool LoadFile_Impl(); bool LoadFile_Impl();
void SendStateChg_Impl( sfx2::LinkManager::LinkState nState ); void SendStateChg_Impl( sfx2::LinkManager::LinkState nState );
DECL_STATIC_LINK( SvFileObject, DelMedium_Impl, SfxMediumRef* ); DECL_LINK( DelMedium_Impl, SfxMediumRef* );
DECL_STATIC_LINK( SvFileObject, LoadGrfReady_Impl, void* ); DECL_LINK( LoadGrfReady_Impl, void* );
DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* ); DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
protected: protected:
......
...@@ -62,7 +62,7 @@ class SvDDELinkEditDialog : public ModalDialog ...@@ -62,7 +62,7 @@ class SvDDELinkEditDialog : public ModalDialog
VclPtr<Edit> m_pEdDdeItem; VclPtr<Edit> m_pEdDdeItem;
VclPtr<OKButton> m_pOKButton; VclPtr<OKButton> m_pOKButton;
DECL_STATIC_LINK( SvDDELinkEditDialog, EditHdl_Impl, Edit* ); DECL_LINK( EditHdl_Impl, Edit* );
public: public:
SvDDELinkEditDialog( vcl::Window* pParent, SvBaseLink* ); SvDDELinkEditDialog( vcl::Window* pParent, SvBaseLink* );
virtual ~SvDDELinkEditDialog(); virtual ~SvDDELinkEditDialog();
...@@ -113,12 +113,11 @@ OUString SvDDELinkEditDialog::GetCmd() const ...@@ -113,12 +113,11 @@ OUString SvDDELinkEditDialog::GetCmd() const
return sRet; return sRet;
} }
IMPL_STATIC_LINK( SvDDELinkEditDialog, EditHdl_Impl, Edit *, pEdit ) IMPL_LINK( SvDDELinkEditDialog, EditHdl_Impl, Edit *, )
{ {
(void)pEdit; // unused variable m_pOKButton->Enable( !m_pEdDdeApp->GetText().isEmpty() &&
pThis->m_pOKButton->Enable( !pThis->m_pEdDdeApp->GetText().isEmpty() && !m_pEdDdeTopic->GetText().isEmpty() &&
!pThis->m_pEdDdeTopic->GetText().isEmpty() && !m_pEdDdeItem->GetText().isEmpty() );
!pThis->m_pEdDdeItem->GetText().isEmpty() );
return 0; return 0;
} }
......
...@@ -364,14 +364,14 @@ void ShutdownIcon::StartFileDialog() ...@@ -364,14 +364,14 @@ void ShutdownIcon::StartFileDialog()
IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYARG ) IMPL_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYARG )
{ {
DBG_ASSERT( pThis->m_pFileDlg, "ShutdownIcon, DialogClosedHdl_Impl(): no file dialog" ); DBG_ASSERT( m_pFileDlg, "ShutdownIcon, DialogClosedHdl_Impl(): no file dialog" );
// use constructor for filling up filters automatically! // use constructor for filling up filters automatically!
if ( ERRCODE_NONE == pThis->m_pFileDlg->GetError() ) if ( ERRCODE_NONE == m_pFileDlg->GetError() )
{ {
::com::sun::star::uno::Reference< XFilePicker > xPicker = pThis->m_pFileDlg->GetFilePicker(); ::com::sun::star::uno::Reference< XFilePicker > xPicker = m_pFileDlg->GetFilePicker();
try try
{ {
...@@ -404,7 +404,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR ...@@ -404,7 +404,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
// use the filedlghelper to get the current filter name, // use the filedlghelper to get the current filter name,
// because it removes the extensions before you get the filter name. // because it removes the extensions before you get the filter name.
OUString aFilterName( pThis->m_pFileDlg->GetCurrentFilter() ); OUString aFilterName( m_pFileDlg->GetCurrentFilter() );
if ( xPickerControls.is() ) if ( xPickerControls.is() )
{ {
...@@ -497,8 +497,8 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR ...@@ -497,8 +497,8 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
// the settings. // the settings.
if ( SvtMiscOptions().UseSystemFileDialog() ) if ( SvtMiscOptions().UseSystemFileDialog() )
{ {
delete pThis->m_pFileDlg; delete m_pFileDlg;
pThis->m_pFileDlg = NULL; m_pFileDlg = NULL;
} }
#endif #endif
......
...@@ -118,8 +118,7 @@ class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase ...@@ -118,8 +118,7 @@ class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase
void StartFileDialog(); void StartFileDialog();
sfx2::FileDialogHelper* GetFileDialog() const { return m_pFileDlg; } sfx2::FileDialogHelper* GetFileDialog() const { return m_pFileDlg; }
DECL_STATIC_LINK( DECL_LINK(DialogClosedHdl_Impl, sfx2::FileDialogHelper*);
ShutdownIcon, DialogClosedHdl_Impl, sfx2::FileDialogHelper*);
static bool IsQuickstarterInstalled(); static bool IsQuickstarterInstalled();
......
...@@ -862,9 +862,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const OUString& rName, ...@@ -862,9 +862,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const OUString& rName,
return NULL; return NULL;
} }
IMPL_STATIC_LINK_TYPED( SfxFilterMatcher, MaybeFileHdl_Impl, OUString*, pString, bool ) IMPL_LINK_TYPED( SfxFilterMatcher, MaybeFileHdl_Impl, OUString*, pString, bool )
{ {
const SfxFilter* pFilter = pThis->GetFilter4Extension( *pString, SfxFilterFlags::IMPORT ); const SfxFilter* pFilter = GetFilter4Extension( *pString, SfxFilterFlags::IMPORT );
if (pFilter && !pFilter->GetWildcard().Matches( OUString() ) && if (pFilter && !pFilter->GetWildcard().Matches( OUString() ) &&
!pFilter->GetWildcard().Matches(OUString("*.*")) && !pFilter->GetWildcard().Matches(OUString("*.*")) &&
!pFilter->GetWildcard().Matches(OUString('*')) !pFilter->GetWildcard().Matches(OUString('*'))
......
...@@ -154,19 +154,19 @@ void SfxTemplateControllerItem::StateChanged( sal_uInt16 nSID, SfxItemState eSta ...@@ -154,19 +154,19 @@ void SfxTemplateControllerItem::StateChanged( sal_uInt16 nSID, SfxItemState eSta
} }
} }
IMPL_STATIC_LINK(SfxTemplateControllerItem, SetWaterCanStateHdl_Impl, IMPL_LINK(SfxTemplateControllerItem, SetWaterCanStateHdl_Impl,
SfxTemplateControllerItem*, EMPTYARG) SfxTemplateControllerItem*, EMPTYARG)
{ {
pThis->nUserEventId = 0; nUserEventId = 0;
SfxBoolItem* pState = 0; SfxBoolItem* pState = 0;
switch(pThis->nWaterCanState) switch(nWaterCanState)
{ {
case 0 : case 0 :
case 1 : case 1 :
pState = new SfxBoolItem(SID_STYLE_WATERCAN, pThis->nWaterCanState != 0); pState = new SfxBoolItem(SID_STYLE_WATERCAN, nWaterCanState != 0);
break; break;
} }
pThis->rTemplateDlg.SetWaterCanState(pState); rTemplateDlg.SetWaterCanState(pState);
delete pState; delete pState;
return 0; return 0;
} }
......
...@@ -29,8 +29,7 @@ class SfxTemplateControllerItem : public SfxControllerItem { ...@@ -29,8 +29,7 @@ class SfxTemplateControllerItem : public SfxControllerItem {
sal_uInt8 nWaterCanState; sal_uInt8 nWaterCanState;
ImplSVEvent* nUserEventId; ImplSVEvent* nUserEventId;
DECL_STATIC_LINK(SfxTemplateControllerItem, SetWaterCanStateHdl_Impl, DECL_LINK(SetWaterCanStateHdl_Impl, SfxTemplateControllerItem*);
SfxTemplateControllerItem*);
protected: protected:
virtual void StateChanged(sal_uInt16, SfxItemState, const SfxPoolItem* pState) SAL_OVERRIDE; virtual void StateChanged(sal_uInt16, SfxItemState, const SfxPoolItem* pState) SAL_OVERRIDE;
......
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