summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-30 10:20:00 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-30 10:20:00 +0200
commit3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed (patch)
treebdfd28afe5a452060e3d985c5f01b45f4b7bc2cd /editeng
parent57d254d42b6e1d836bd21e6fb2e968af2b511c7d (diff)
Gradually typed Link
Turn the Link class into a template abstracting over the link's argument and return types, but provide default template arguments that keep the generic, unsafe "void* in, sal_IntPtr out" behvior. That way, individual uses of the Link class can be updated over time. All the related macros are duplicated with ..._TYPED counterparts, that additionally take the RetType (except for LINK_TYPED, which manages to infer the relevant types from the supplied Member). (It would have been attractive to change the "untyped" LinkStubs from taking a void* to a properly typed ArgType parameter, too, but that would cause -fsanitize=function to flag uses of "untyped" Link::Call.) Change-Id: I3b0140378bad99abbf240140ebb4a46a05d2d2f8
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editdoc.hxx6
-rw-r--r--editeng/source/editeng/editeng.cxx32
-rw-r--r--editeng/source/editeng/editview.cxx2
-rw-r--r--editeng/source/editeng/impedit.hxx40
-rw-r--r--editeng/source/editeng/impedit5.cxx2
-rw-r--r--editeng/source/items/frmitems.cxx4
-rw-r--r--editeng/source/outliner/outleeng.hxx2
-rw-r--r--editeng/source/outliner/outlin2.cxx12
-rw-r--r--editeng/source/outliner/outliner.cxx8
-rw-r--r--editeng/source/outliner/outlvw.cxx2
-rw-r--r--editeng/source/outliner/paralist.hxx6
11 files changed, 58 insertions, 58 deletions
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index 136d94d04dfd..503b91a86b98 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -749,7 +749,7 @@ private:
boost::ptr_vector<ContentNode> maContents;
SfxItemPool* pItemPool;
- Link aModifyHdl;
+ Link<> aModifyHdl;
SvxFont aDefFont; //faster than ever from the pool!!
sal_uInt16 nDefTab;
@@ -771,8 +771,8 @@ public:
bool IsModified() const { return bModified; }
void SetModified( bool b );
- void SetModifyHdl( const Link& rLink ) { aModifyHdl = rLink; }
- Link GetModifyHdl() const { return aModifyHdl; }
+ void SetModifyHdl( const Link<>& rLink ) { aModifyHdl = rLink; }
+ Link<> GetModifyHdl() const { return aModifyHdl; }
void CreateDefFont( bool bUseStyles );
const SvxFont& GetDefFont() { return aDefFont; }
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 1b760958dba2..dd631be58fc4 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1502,53 +1502,53 @@ void EditEngine::ShowParagraph( sal_Int32 nParagraph, bool bShow )
pImpEditEngine->ShowParagraph( nParagraph, bShow );
}
-void EditEngine::SetNotifyHdl( const Link& rLink )
+void EditEngine::SetNotifyHdl( const Link<>& rLink )
{
pImpEditEngine->SetNotifyHdl( rLink );
}
-Link EditEngine::GetNotifyHdl() const
+Link<> EditEngine::GetNotifyHdl() const
{
return pImpEditEngine->GetNotifyHdl();
}
-void EditEngine::SetStatusEventHdl( const Link& rLink )
+void EditEngine::SetStatusEventHdl( const Link<>& rLink )
{
pImpEditEngine->SetStatusEventHdl( rLink );
}
-Link EditEngine::GetStatusEventHdl() const
+Link<> EditEngine::GetStatusEventHdl() const
{
return pImpEditEngine->GetStatusEventHdl();
}
-void EditEngine::SetImportHdl( const Link& rLink )
+void EditEngine::SetImportHdl( const Link<>& rLink )
{
pImpEditEngine->aImportHdl = rLink;
}
-Link EditEngine::GetImportHdl() const
+Link<> EditEngine::GetImportHdl() const
{
return pImpEditEngine->aImportHdl;
}
-void EditEngine::SetBeginMovingParagraphsHdl( const Link& rLink )
+void EditEngine::SetBeginMovingParagraphsHdl( const Link<>& rLink )
{
pImpEditEngine->aBeginMovingParagraphsHdl = rLink;
}
-void EditEngine::SetEndMovingParagraphsHdl( const Link& rLink )
+void EditEngine::SetEndMovingParagraphsHdl( const Link<>& rLink )
{
pImpEditEngine->aEndMovingParagraphsHdl = rLink;
}
-void EditEngine::SetBeginPasteOrDropHdl( const Link& rLink )
+void EditEngine::SetBeginPasteOrDropHdl( const Link<>& rLink )
{
pImpEditEngine->aBeginPasteOrDropHdl = rLink;
}
-void EditEngine::SetEndPasteOrDropHdl( const Link& rLink )
+void EditEngine::SetEndPasteOrDropHdl( const Link<>& rLink )
{
pImpEditEngine->aEndPasteOrDropHdl = rLink;
}
@@ -1609,12 +1609,12 @@ OUString EditEngine::GetText( sal_Int32 nPara ) const
return aStr;
}
-void EditEngine::SetModifyHdl( const Link& rLink )
+void EditEngine::SetModifyHdl( const Link<>& rLink )
{
pImpEditEngine->SetModifyHdl( rLink );
}
-Link EditEngine::GetModifyHdl() const
+Link<> EditEngine::GetModifyHdl() const
{
return pImpEditEngine->GetModifyHdl();
}
@@ -2703,23 +2703,23 @@ bool EditEngine::HasValidData( const ::com::sun::star::uno::Reference< ::com::su
}
/** sets a link that is called at the beginning of a drag operation at an edit view */
-void EditEngine::SetBeginDropHdl( const Link& rLink )
+void EditEngine::SetBeginDropHdl( const Link<>& rLink )
{
pImpEditEngine->SetBeginDropHdl( rLink );
}
-Link EditEngine::GetBeginDropHdl() const
+Link<> EditEngine::GetBeginDropHdl() const
{
return pImpEditEngine->GetBeginDropHdl();
}
/** sets a link that is called at the end of a drag operation at an edit view */
-void EditEngine::SetEndDropHdl( const Link& rLink )
+void EditEngine::SetEndDropHdl( const Link<>& rLink )
{
pImpEditEngine->SetEndDropHdl( rLink );
}
-Link EditEngine::GetEndDropHdl() const
+Link<> EditEngine::GetEndDropHdl() const
{
return pImpEditEngine->GetEndDropHdl();
}
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 4d96e64c8a4b..a1db68fca13e 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -760,7 +760,7 @@ bool EditView::IsWrongSpelledWordAtPos( const Point& rPosPixel, bool bMarkIfWron
return pImpEditView->IsWrongSpelledWord( aPaM , bMarkIfWrong );
}
-void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
+void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<>* pCallBack )
{
Point aPos ( pImpEditView->GetWindow()->PixelToLogic( rPosPixel ) );
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 301b6f92ea08..35fbc7ada465 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -485,16 +485,16 @@ private:
// If it is detected at one point that the StatusHdl has to be called, but
// this should not happen immediately (critical section):
Timer aStatusTimer;
- Link aStatusHdlLink;
- Link aNotifyHdl;
- Link aImportHdl;
- Link aBeginMovingParagraphsHdl;
- Link aEndMovingParagraphsHdl;
- Link aBeginPasteOrDropHdl;
- Link aEndPasteOrDropHdl;
- Link aModifyHdl;
- Link maBeginDropHdl;
- Link maEndDropHdl;
+ Link<> aStatusHdlLink;
+ Link<> aNotifyHdl;
+ Link<> aImportHdl;
+ Link<> aBeginMovingParagraphsHdl;
+ Link<> aEndMovingParagraphsHdl;
+ Link<> aBeginPasteOrDropHdl;
+ Link<> aEndPasteOrDropHdl;
+ Link<> aModifyHdl;
+ Link<> maBeginDropHdl;
+ Link<> maEndDropHdl;
rtl::Reference<SvxForbiddenCharactersTable> xForbiddenCharsTable;
@@ -827,8 +827,8 @@ public:
bool IsModified() const { return aEditDoc.IsModified(); }
void SetModifyFlag( bool b ) { aEditDoc.SetModified( b ); }
- void SetModifyHdl( const Link& rLink ) { aModifyHdl = rLink; }
- Link GetModifyHdl() const { return aModifyHdl; }
+ void SetModifyHdl( const Link<>& rLink ) { aModifyHdl = rLink; }
+ Link<> GetModifyHdl() const { return aModifyHdl; }
bool IsInSelectionMode() { return bInSelection; }
@@ -844,11 +844,11 @@ public:
EditPaM InsertParagraph( sal_Int32 nPara );
EditSelection* SelectParagraph( sal_Int32 nPara );
- void SetStatusEventHdl( const Link& rLink ) { aStatusHdlLink = rLink; }
- Link GetStatusEventHdl() const { return aStatusHdlLink; }
+ void SetStatusEventHdl( const Link<>& rLink ) { aStatusHdlLink = rLink; }
+ Link<> GetStatusEventHdl() const { return aStatusHdlLink; }
- void SetNotifyHdl( const Link& rLink ) { aNotifyHdl = rLink; }
- Link GetNotifyHdl() const { return aNotifyHdl; }
+ void SetNotifyHdl( const Link<>& rLink ) { aNotifyHdl = rLink; }
+ Link<> GetNotifyHdl() const { return aNotifyHdl; }
void FormatAndUpdate( EditView* pCurView = 0 );
inline void IdleFormatAndUpdate( EditView* pCurView = 0 );
@@ -1016,12 +1016,12 @@ public:
static void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars );
/** sets a link that is called at the beginning of a drag operation at an edit view */
- void SetBeginDropHdl( const Link& rLink ) { maBeginDropHdl = rLink; }
- Link GetBeginDropHdl() const { return maBeginDropHdl; }
+ void SetBeginDropHdl( const Link<>& rLink ) { maBeginDropHdl = rLink; }
+ Link<> GetBeginDropHdl() const { return maBeginDropHdl; }
/** sets a link that is called at the end of a drag operation at an edit view */
- void SetEndDropHdl( const Link& rLink ) { maEndDropHdl = rLink; }
- Link GetEndDropHdl() const { return maEndDropHdl; }
+ void SetEndDropHdl( const Link<>& rLink ) { maEndDropHdl = rLink; }
+ Link<> GetEndDropHdl() const { return maEndDropHdl; }
/// specifies if auto-correction should capitalize the first word or not (default is on)
void SetFirstWordCapitalization( bool bCapitalize ) { bFirstWordCapitalization = bCapitalize; }
diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx
index 2a822cb0322f..eedcc4e81064 100644
--- a/editeng/source/editeng/impedit5.cxx
+++ b/editeng/source/editeng/impedit5.cxx
@@ -802,7 +802,7 @@ void IdleFormattter::ForceTimeout()
if ( IsActive() )
{
Stop();
- ((Link&)GetIdleHdl()).Call( this );
+ ((Link<>&)GetIdleHdl()).Call( this );
}
}
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 32ccb2cc7a4e..508230231fad 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3315,7 +3315,7 @@ public:
GraphicObject* pGraphicObject;
sal_Int8 nGraphicTransparency; //contains a percentage value which is
//copied to the GraphicObject when necessary
- Link aDoneLink;
+ Link<> aDoneLink;
SvStream* pStream;
SvxBrushItem_Impl( GraphicObject* p ) : pGraphicObject( p ), nGraphicTransparency(0), pStream(0) {}
@@ -3323,7 +3323,7 @@ public:
-void SvxBrushItem::SetDoneLink( const Link& rLink )
+void SvxBrushItem::SetDoneLink( const Link<>& rLink )
{
pImpl->aDoneLink = rLink;
}
diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx
index a802eedf1fb8..09eebfacf62e 100644
--- a/editeng/source/outliner/outleeng.hxx
+++ b/editeng/source/outliner/outleeng.hxx
@@ -81,7 +81,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<> aOutlinerNotifyHdl;
NotifyList aNotifyCache;
};
diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx
index 18a27e1c5826..549f6456cfc6 100644
--- a/editeng/source/outliner/outlin2.cxx
+++ b/editeng/source/outliner/outlin2.cxx
@@ -108,33 +108,33 @@ sal_uLong Outliner::GetTextHeight() const
return pEditEngine->GetTextHeight();
}
-void Outliner::SetModifyHdl( const Link& rLink )
+void Outliner::SetModifyHdl( const Link<>& rLink )
{
pEditEngine->SetModifyHdl( rLink );
}
-Link Outliner::GetModifyHdl() const
+Link<> Outliner::GetModifyHdl() const
{
return pEditEngine->GetModifyHdl();
}
-void Outliner::SetNotifyHdl( const Link& rLink )
+void Outliner::SetNotifyHdl( const Link<>& rLink )
{
pEditEngine->aOutlinerNotifyHdl = rLink;
if ( rLink.IsSet() )
pEditEngine->SetNotifyHdl( LINK( this, Outliner, EditEngineNotifyHdl ) );
else
- pEditEngine->SetNotifyHdl( Link() );
+ pEditEngine->SetNotifyHdl( Link<>() );
}
-void Outliner::SetStatusEventHdl( const Link& rLink )
+void Outliner::SetStatusEventHdl( const Link<>& rLink )
{
pEditEngine->SetStatusEventHdl( rLink );
}
-Link Outliner::GetStatusEventHdl() const
+Link<> Outliner::GetStatusEventHdl() const
{
return pEditEngine->GetStatusEventHdl();
}
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index cecf2b2f3f0d..8f704bb192bf 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2044,25 +2044,25 @@ IMPL_LINK( Outliner, EditEngineNotifyHdl, EENotify*, pNotify )
}
/** sets a link that is called at the beginning of a drag operation at an edit view */
-void Outliner::SetBeginDropHdl( const Link& rLink )
+void Outliner::SetBeginDropHdl( const Link<>& rLink )
{
pEditEngine->SetBeginDropHdl( rLink );
}
/** sets a link that is called at the end of a drag operation at an edit view */
-void Outliner::SetEndDropHdl( const Link& rLink )
+void Outliner::SetEndDropHdl( const Link<>& rLink )
{
pEditEngine->SetEndDropHdl( rLink );
}
/** sets a link that is called before a drop or paste operation. */
-void Outliner::SetBeginPasteOrDropHdl( const Link& rLink )
+void Outliner::SetBeginPasteOrDropHdl( const Link<>& rLink )
{
maBeginPasteOrDropHdl = rLink;
}
/** sets a link that is called after a drop or paste operation. */
-void Outliner::SetEndPasteOrDropHdl( const Link& rLink )
+void Outliner::SetEndPasteOrDropHdl( const Link<>& rLink )
{
maEndPasteOrDropHdl = rLink;
}
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index a41059595a5b..7e5450d7be28 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1376,7 +1376,7 @@ bool OutlinerView::IsWrongSpelledWordAtPos( const Point& rPosPixel, bool bMarkIf
return pEditView->IsWrongSpelledWordAtPos( rPosPixel, bMarkIfWrong );
}
-void OutlinerView::ExecuteSpellPopup( const Point& rPosPixel, Link* pStartDlg )
+void OutlinerView::ExecuteSpellPopup( const Point& rPosPixel, Link<>* pStartDlg )
{
pEditView->ExecuteSpellPopup( rPosPixel, pStartDlg );
}
diff --git a/editeng/source/outliner/paralist.hxx b/editeng/source/outliner/paralist.hxx
index a19e42233bdb..fb3311d8f89b 100644
--- a/editeng/source/outliner/paralist.hxx
+++ b/editeng/source/outliner/paralist.hxx
@@ -66,12 +66,12 @@ public:
void Expand( Paragraph* pParent );
void Collapse( Paragraph* pParent );
- void SetVisibleStateChangedHdl( const Link& rLink ) { aVisibleStateChangedHdl = rLink; }
- Link GetVisibleStateChangedHdl() const { return aVisibleStateChangedHdl; }
+ void SetVisibleStateChangedHdl( const Link<>& rLink ) { aVisibleStateChangedHdl = rLink; }
+ Link<> GetVisibleStateChangedHdl() const { return aVisibleStateChangedHdl; }
private:
- Link aVisibleStateChangedHdl;
+ Link<> aVisibleStateChangedHdl;
std::vector<Paragraph*> maEntries;
};