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