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

convert Link<> to typed

Change-Id: I2573b42143078c4e72ab201392c69ee296f4974e
üst 34c55149
......@@ -519,12 +519,12 @@ IMPL_LINK_NOARG_TYPED( SvBaseLinksDlg, UpdateWaitingHdl, Idle*, void )
m_pTbLinks->SetUpdateMode(true);
}
IMPL_LINK( SvBaseLinksDlg, EndEditHdl, sfx2::SvBaseLink*, _pLink )
IMPL_LINK_TYPED( SvBaseLinksDlg, EndEditHdl, sfx2::SvBaseLink&, _rLink, void )
{
sal_uLong nPos;
GetSelEntry( &nPos );
if( _pLink && _pLink->WasLastEditOK() )
if( _rLink.WasLastEditOK() )
{
// StarImpress/Draw swap the LinkObjects themselves!
// So search for the link in the manager; if it does not exist
......@@ -532,7 +532,7 @@ IMPL_LINK( SvBaseLinksDlg, EndEditHdl, sfx2::SvBaseLink*, _pLink )
// edited link needs to be refreshed.
bool bLinkFnd = false;
for( size_t n = pLinkMgr->GetLinks().size(); n; )
if( _pLink == &(*pLinkMgr->GetLinks()[ --n ]) )
if( &_rLink == &(*pLinkMgr->GetLinks()[ --n ]) )
{
bLinkFnd = true;
break;
......@@ -543,7 +543,7 @@ IMPL_LINK( SvBaseLinksDlg, EndEditHdl, sfx2::SvBaseLink*, _pLink )
m_pTbLinks->SetUpdateMode(false);
m_pTbLinks->GetModel()->Remove( m_pTbLinks->GetEntry( nPos ) );
SvTreeListEntry* pToUnselect = m_pTbLinks->FirstSelected();
InsertEntry( *_pLink, nPos, true );
InsertEntry( _rLink, nPos, true );
if(pToUnselect)
m_pTbLinks->Select(pToUnselect, false);
m_pTbLinks->SetUpdateMode(true);
......@@ -557,7 +557,6 @@ IMPL_LINK( SvBaseLinksDlg, EndEditHdl, sfx2::SvBaseLink*, _pLink )
if (pLinkMgr && pLinkMgr->GetPersist())
pLinkMgr->GetPersist()->SetModified();
}
return 0;
}
OUString SvBaseLinksDlg::ImplGetStateStr( const SvBaseLink& rLnk )
......
......@@ -72,7 +72,7 @@ class SvBaseLinksDlg : public ModalDialog
DECL_LINK_TYPED( ChangeSourceClickHdl, Button *, void );
DECL_LINK_TYPED( BreakLinkClickHdl, Button *, void );
DECL_LINK_TYPED( UpdateWaitingHdl, Idle *, void );
DECL_LINK( EndEditHdl, sfx2::SvBaseLink* );
DECL_LINK_TYPED( EndEditHdl, sfx2::SvBaseLink&, void );
sfx2::SvBaseLink* GetSelEntry( sal_uLong* pPos );
OUString ImplGetStateStr( const sfx2::SvBaseLink& );
void SetType( sfx2::SvBaseLink& rLink, sal_uLong nPos, SfxLinkUpdateMode nType );
......
......@@ -146,7 +146,7 @@ public:
void Disconnect();
// Link impl: DECL_LINK( MyEndDialogHdl, SvBaseLink* ); <= param is this
virtual void Edit( vcl::Window*, const Link<>& rEndEditHdl );
virtual void Edit( vcl::Window*, const Link<SvBaseLink&,void>& rEndEditHdl );
// should the link appear in the dialog? (to the left in the link in the...)
bool IsVisible() const { return bVisible; }
......
......@@ -54,7 +54,7 @@ public:
virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
const OUString& rMimeType, const ::com::sun::star::uno::Any & rValue ) SAL_OVERRIDE;
virtual void Edit( vcl::Window*, const Link<>& rEndEditHdl ) SAL_OVERRIDE;
virtual void Edit( vcl::Window*, const Link<SvBaseLink&,void>& rEndEditHdl ) SAL_OVERRIDE;
bool Refresh( const OUString& rNewFile, const OUString& rNewFilter,
const OUString& rNewArea, sal_uLong nNewRefresh );
......
......@@ -70,7 +70,7 @@ public:
virtual void Closed() SAL_OVERRIDE;
virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
const OUString& rMimeType, const ::com::sun::star::uno::Any & rValue) SAL_OVERRIDE;
virtual void Edit(vcl::Window* pParent, const Link<>& rEndEditHdl) SAL_OVERRIDE;
virtual void Edit(vcl::Window* pParent, const Link<SvBaseLink&,void>& rEndEditHdl) SAL_OVERRIDE;
void SetDoReferesh(bool b);
......
......@@ -52,7 +52,7 @@ public:
virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
const OUString& rMimeType, const ::com::sun::star::uno::Any & rValue ) SAL_OVERRIDE;
virtual void Edit( vcl::Window*, const Link<>& rEndEditHdl ) SAL_OVERRIDE;
virtual void Edit( vcl::Window*, const Link<SvBaseLink&,void>& rEndEditHdl ) SAL_OVERRIDE;
bool Refresh(const OUString& rNewFile, const OUString& rNewFilter,
const OUString* pNewOptions /* = NULL */, sal_uLong nNewRefresh );
......@@ -66,7 +66,7 @@ public:
bool IsUsed() const;
DECL_LINK_TYPED( RefreshHdl, Timer*, void );
DECL_LINK( TableEndEditHdl, ::sfx2::SvBaseLink* );
DECL_LINK_TYPED( TableEndEditHdl, ::sfx2::SvBaseLink&, void );
};
class ScDocument;
......
......@@ -84,7 +84,7 @@ ScAreaLink::~ScAreaLink()
delete pImpl;
}
void ScAreaLink::Edit(vcl::Window* pParent, const Link<>& /* rEndEditHdl */ )
void ScAreaLink::Edit(vcl::Window* pParent, const Link<SvBaseLink&,void>& /* rEndEditHdl */ )
{
// use own dialog instead of SvBaseLink::Edit...
// DefModalDialogParent setzen, weil evtl. aus der DocShell beim ConvertFrom
......
......@@ -1327,9 +1327,9 @@ void ScExternalRefLink::Closed()
return SUCCESS;
}
void ScExternalRefLink::Edit(vcl::Window* pParent, const Link<>& /*rEndEditHdl*/)
void ScExternalRefLink::Edit(vcl::Window* pParent, const Link<SvBaseLink&,void>& /*rEndEditHdl*/)
{
SvBaseLink::Edit(pParent, Link<>());
SvBaseLink::Edit(pParent, Link<SvBaseLink&,void>());
}
void ScExternalRefLink::SetDoReferesh(bool b)
......
......@@ -47,9 +47,9 @@
struct TableLink_Impl
{
ScDocShell* m_pDocSh;
VclPtr<vcl::Window> m_pOldParent;
Link<> m_aEndEditLink;
ScDocShell* m_pDocSh;
VclPtr<vcl::Window> m_pOldParent;
Link<sfx2::SvBaseLink&,void> m_aEndEditLink;
TableLink_Impl() : m_pDocSh( NULL ), m_pOldParent( NULL ) {}
};
......@@ -105,7 +105,7 @@ ScTableLink::~ScTableLink()
delete pImpl;
}
void ScTableLink::Edit( vcl::Window* pParent, const Link<>& rEndEditHdl )
void ScTableLink::Edit( vcl::Window* pParent, const Link<SvBaseLink&,void>& rEndEditHdl )
{
// DefModalDialogParent setzen, weil evtl. aus der DocShell beim ConvertFrom
// ein Optionen-Dialog kommt...
......@@ -418,13 +418,12 @@ IMPL_LINK_NOARG_TYPED(ScTableLink, RefreshHdl, Timer *, void)
Refresh( aFileName, aFilterName, NULL, GetRefreshDelay() );
}
IMPL_LINK( ScTableLink, TableEndEditHdl, ::sfx2::SvBaseLink*, pLink )
IMPL_LINK_TYPED( ScTableLink, TableEndEditHdl, ::sfx2::SvBaseLink&, rLink, void )
{
if ( pImpl->m_aEndEditLink.IsSet() )
pImpl->m_aEndEditLink.Call( pLink );
pImpl->m_aEndEditLink.Call( rLink );
bInEdit = false;
Application::SetDefDialogParent( pImpl->m_pOldParent );
return 0;
}
// === ScDocumentLoader ==================================================
......
......@@ -44,7 +44,7 @@ class ImplDdeItem;
struct BaseLink_Impl
{
Link<> m_aEndEditLink;
Link<SvBaseLink&,void> m_aEndEditLink;
LinkManager* m_pLinkMgr;
VclPtr<vcl::Window> m_pParentWin;
FileDialogHelper* m_pFileDlg;
......@@ -254,7 +254,7 @@ IMPL_LINK_TYPED( SvBaseLink, EndEditHdl, const OUString&, _rNewName, void )
sNewName.clear();
bWasLastEditOK = !sNewName.isEmpty();
if ( pImpl->m_aEndEditLink.IsSet() )
pImpl->m_aEndEditLink.Call( this );
pImpl->m_aEndEditLink.Call( *this );
}
......@@ -472,7 +472,7 @@ SvBaseLink::UpdateResult SvBaseLink::DataChanged( const OUString &, const ::com:
return SUCCESS;
}
void SvBaseLink::Edit( vcl::Window* pParent, const Link<>& rEndEditHdl )
void SvBaseLink::Edit( vcl::Window* pParent, const Link<SvBaseLink&,void>& rEndEditHdl )
{
pImpl->m_pParentWin = pParent;
pImpl->m_aEndEditLink = rEndEditHdl;
......@@ -506,7 +506,7 @@ void SvBaseLink::Edit( vcl::Window* pParent, const Link<>& rEndEditHdl )
ExecuteEdit( OUString() );
bWasLastEditOK = false;
if ( pImpl->m_aEndEditLink.IsSet() )
pImpl->m_aEndEditLink.Call( this );
pImpl->m_aEndEditLink.Call( *this );
}
}
......
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