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

convert Link<> to typed

Change-Id: Ida49b6a482efa12703ce294b9665273ad2d8f68b
üst 7ffa2184
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) SAL_OVERRIDE; virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) SAL_OVERRIDE;
// belongs into class Outliner, move there before incompatible update! // belongs into class Outliner, move there before incompatible update!
Link<> aOutlinerNotifyHdl; Link<EENotify&,void> aOutlinerNotifyHdl;
NotifyList aNotifyCache; NotifyList aNotifyCache;
}; };
......
...@@ -118,7 +118,7 @@ Link<LinkParamNone*,void> Outliner::GetModifyHdl() const ...@@ -118,7 +118,7 @@ Link<LinkParamNone*,void> Outliner::GetModifyHdl() const
return pEditEngine->GetModifyHdl(); return pEditEngine->GetModifyHdl();
} }
void Outliner::SetNotifyHdl( const Link<>& rLink ) void Outliner::SetNotifyHdl( const Link<EENotify&,void>& rLink )
{ {
pEditEngine->aOutlinerNotifyHdl = rLink; pEditEngine->aOutlinerNotifyHdl = rLink;
......
...@@ -2001,7 +2001,7 @@ void Outliner::ImplBlockInsertionCallbacks( bool b ) ...@@ -2001,7 +2001,7 @@ void Outliner::ImplBlockInsertionCallbacks( bool b )
EENotify aNotify(pEditEngine->aNotifyCache.front()); EENotify aNotify(pEditEngine->aNotifyCache.front());
// Remove from list before calling, maybe we enter LeaveBlockNotifications while calling the handler... // Remove from list before calling, maybe we enter LeaveBlockNotifications while calling the handler...
pEditEngine->aNotifyCache.erase(pEditEngine->aNotifyCache.begin()); pEditEngine->aNotifyCache.erase(pEditEngine->aNotifyCache.begin());
pEditEngine->aOutlinerNotifyHdl.Call( &aNotify ); pEditEngine->aOutlinerNotifyHdl.Call( aNotify );
} }
} }
} }
...@@ -2010,7 +2010,7 @@ void Outliner::ImplBlockInsertionCallbacks( bool b ) ...@@ -2010,7 +2010,7 @@ void Outliner::ImplBlockInsertionCallbacks( bool b )
IMPL_LINK_TYPED( Outliner, EditEngineNotifyHdl, EENotify&, rNotify, void ) IMPL_LINK_TYPED( Outliner, EditEngineNotifyHdl, EENotify&, rNotify, void )
{ {
if ( !nBlockInsCallback ) if ( !nBlockInsCallback )
pEditEngine->aOutlinerNotifyHdl.Call( &rNotify ); pEditEngine->aOutlinerNotifyHdl.Call( rNotify );
else else
pEditEngine->aNotifyCache.push_back(rNotify); pEditEngine->aNotifyCache.push_back(rNotify);
} }
......
...@@ -778,7 +778,7 @@ public: ...@@ -778,7 +778,7 @@ public:
void SetModifyHdl( const Link<LinkParamNone*,void>& rLink ); void SetModifyHdl( const Link<LinkParamNone*,void>& rLink );
Link<LinkParamNone*,void> GetModifyHdl() const; Link<LinkParamNone*,void> GetModifyHdl() const;
void SetNotifyHdl( const Link<>& rLink ); void SetNotifyHdl( const Link<EENotify&,void>& rLink );
void SetStatusEventHdl( const Link<EditStatus&, void>& rLink ); void SetStatusEventHdl( const Link<EditStatus&, void>& rLink );
Link<EditStatus&, void> GetStatusEventHdl() const; Link<EditStatus&, void> GetStatusEventHdl() const;
......
...@@ -48,7 +48,7 @@ namespace accessibility ...@@ -48,7 +48,7 @@ namespace accessibility
AccessibleOutlineEditSource::~AccessibleOutlineEditSource() AccessibleOutlineEditSource::~AccessibleOutlineEditSource()
{ {
if( mpOutliner ) if( mpOutliner )
mpOutliner->SetNotifyHdl( Link<>() ); mpOutliner->SetNotifyHdl( Link<EENotify&,void>() );
Broadcast( TextHint( SFX_HINT_DYING ) ); Broadcast( TextHint( SFX_HINT_DYING ) );
} }
...@@ -196,24 +196,21 @@ namespace accessibility ...@@ -196,24 +196,21 @@ namespace accessibility
if( bDispose ) if( bDispose )
{ {
if( mpOutliner ) if( mpOutliner )
mpOutliner->SetNotifyHdl( Link<>() ); mpOutliner->SetNotifyHdl( Link<EENotify&,void>() );
mpOutliner = NULL; mpOutliner = NULL;
mpOutlinerView = NULL; mpOutlinerView = NULL;
Broadcast( TextHint( SFX_HINT_DYING ) ); Broadcast( TextHint( SFX_HINT_DYING ) );
} }
} }
IMPL_LINK(AccessibleOutlineEditSource, NotifyHdl, EENotify*, aNotify) IMPL_LINK_TYPED(AccessibleOutlineEditSource, NotifyHdl, EENotify&, rNotify, void)
{ {
if( aNotify ) ::std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( &rNotify) );
{
::std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( aNotify) );
if( aHint.get() ) if( aHint.get() )
{
Broadcast( *aHint.get() ); Broadcast( *aHint.get() );
} }
return 0;
} }
} // end of namespace accessibility } // end of namespace accessibility
......
...@@ -76,7 +76,7 @@ namespace accessibility ...@@ -76,7 +76,7 @@ namespace accessibility
AccessibleOutlineEditSource( const AccessibleOutlineEditSource& ) SAL_DELETED_FUNCTION; AccessibleOutlineEditSource( const AccessibleOutlineEditSource& ) SAL_DELETED_FUNCTION;
AccessibleOutlineEditSource& operator=( const AccessibleOutlineEditSource& ) SAL_DELETED_FUNCTION; AccessibleOutlineEditSource& operator=( const AccessibleOutlineEditSource& ) SAL_DELETED_FUNCTION;
DECL_LINK( NotifyHdl, EENotify* ); DECL_LINK_TYPED( NotifyHdl, EENotify&, void );
SdrView& mrView; SdrView& mrView;
const vcl::Window& mrWindow; const vcl::Window& mrWindow;
......
...@@ -82,7 +82,7 @@ void SdrOutlinerCache::disposeOutliner( SdrOutliner* pOutliner ) ...@@ -82,7 +82,7 @@ void SdrOutlinerCache::disposeOutliner( SdrOutliner* pOutliner )
pOutliner->SetVertical( false ); pOutliner->SetVertical( false );
// Deregister on outliner, might be reused from outliner cache // Deregister on outliner, might be reused from outliner cache
pOutliner->SetNotifyHdl( Link<>() ); pOutliner->SetNotifyHdl( Link<EENotify&,void>() );
} }
else if( (OUTLINERMODE_TEXTOBJECT == nOutlMode) && (NULL == mpModeText) ) else if( (OUTLINERMODE_TEXTOBJECT == nOutlMode) && (NULL == mpModeText) )
{ {
...@@ -91,7 +91,7 @@ void SdrOutlinerCache::disposeOutliner( SdrOutliner* pOutliner ) ...@@ -91,7 +91,7 @@ void SdrOutlinerCache::disposeOutliner( SdrOutliner* pOutliner )
pOutliner->SetVertical( false ); pOutliner->SetVertical( false );
// Deregister on outliner, might be reused from outliner cache // Deregister on outliner, might be reused from outliner cache
pOutliner->SetNotifyHdl( Link<>() ); pOutliner->SetNotifyHdl( Link<EENotify&,void>() );
} }
else else
{ {
......
...@@ -148,7 +148,7 @@ public: ...@@ -148,7 +148,7 @@ public:
Point LogicToPixel( const Point&, const MapMode& rMapMode ); Point LogicToPixel( const Point&, const MapMode& rMapMode );
Point PixelToLogic( const Point&, const MapMode& rMapMode ); Point PixelToLogic( const Point&, const MapMode& rMapMode );
DECL_LINK( NotifyHdl, EENotify* ); DECL_LINK_TYPED( NotifyHdl, EENotify&, void );
virtual void ObjectInDestruction(const SdrObject& rObject) SAL_OVERRIDE; virtual void ObjectInDestruction(const SdrObject& rObject) SAL_OVERRIDE;
...@@ -435,7 +435,7 @@ void SvxTextEditSourceImpl::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) ...@@ -435,7 +435,7 @@ void SvxTextEditSourceImpl::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
// remove as listener - outliner might outlive ourselves // remove as listener - outliner might outlive ourselves
if( mpView && mpView->GetTextEditOutliner() ) if( mpView && mpView->GetTextEditOutliner() )
mpView->GetTextEditOutliner()->SetNotifyHdl( Link<>() ); mpView->GetTextEditOutliner()->SetNotifyHdl( Link<EENotify&,void>() );
// destroy view forwarder, OutlinerView no longer // destroy view forwarder, OutlinerView no longer
// valid (no need for UpdateData(), it's been // valid (no need for UpdateData(), it's been
...@@ -1018,17 +1018,15 @@ Point SvxTextEditSourceImpl::PixelToLogic( const Point& rPoint, const MapMode& r ...@@ -1018,17 +1018,15 @@ Point SvxTextEditSourceImpl::PixelToLogic( const Point& rPoint, const MapMode& r
return Point(); return Point();
} }
IMPL_LINK(SvxTextEditSourceImpl, NotifyHdl, EENotify*, aNotify) IMPL_LINK_TYPED(SvxTextEditSourceImpl, NotifyHdl, EENotify&, rNotify, void)
{ {
if( aNotify && !mbNotificationsDisabled ) if( !mbNotificationsDisabled )
{ {
std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( aNotify) ); std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( &rNotify) );
if( aHint.get() ) if( aHint.get() )
Broadcast( *aHint.get() ); Broadcast( *aHint.get() );
} }
return 0;
} }
SvxTextEditSource::SvxTextEditSource( SdrObject* pObject, SdrText* pText ) SvxTextEditSource::SvxTextEditSource( SdrObject* pObject, SdrText* pText )
......
...@@ -55,7 +55,7 @@ class SidebarTextEditSource : public SvxEditSource, ...@@ -55,7 +55,7 @@ class SidebarTextEditSource : public SvxEditSource,
virtual void UpdateData() SAL_OVERRIDE; virtual void UpdateData() SAL_OVERRIDE;
virtual SfxBroadcaster& GetBroadcaster() const SAL_OVERRIDE; virtual SfxBroadcaster& GetBroadcaster() const SAL_OVERRIDE;
DECL_LINK( NotifyHdl, EENotify* ); DECL_LINK_TYPED( NotifyHdl, EENotify&, void );
private: private:
SidebarTextControl& mrSidebarTextControl; SidebarTextControl& mrSidebarTextControl;
...@@ -79,7 +79,7 @@ SidebarTextEditSource::~SidebarTextEditSource() ...@@ -79,7 +79,7 @@ SidebarTextEditSource::~SidebarTextEditSource()
{ {
if ( mrSidebarTextControl.GetTextView() ) if ( mrSidebarTextControl.GetTextView() )
{ {
mrSidebarTextControl.GetTextView()->GetOutliner()->SetNotifyHdl( Link<>() ); mrSidebarTextControl.GetTextView()->GetOutliner()->SetNotifyHdl( Link<EENotify&,void>() );
} }
} }
...@@ -113,19 +113,14 @@ SfxBroadcaster& SidebarTextEditSource::GetBroadcaster() const ...@@ -113,19 +113,14 @@ SfxBroadcaster& SidebarTextEditSource::GetBroadcaster() const
return *( const_cast< SidebarTextEditSource* > (this) ); return *( const_cast< SidebarTextEditSource* > (this) );
} }
IMPL_LINK(SidebarTextEditSource, NotifyHdl, EENotify*, pNotify) IMPL_LINK_TYPED(SidebarTextEditSource, NotifyHdl, EENotify&, rNotify, void)
{ {
if ( pNotify ) std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( &rNotify ) );
{
std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( pNotify ) );
if( aHint.get() ) if( aHint.get() )
{ {
Broadcast( *aHint.get() ); Broadcast( *aHint.get() );
} }
}
return 0;
} }
// declaration and implementation of accessible context for <SidebarTextControl> instance // declaration and implementation of accessible context for <SidebarTextControl> instance
......
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