diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-30 10:20:00 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-30 10:20:00 +0200 |
commit | 3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed (patch) | |
tree | bdfd28afe5a452060e3d985c5f01b45f4b7bc2cd /sw/source/core | |
parent | 57d254d42b6e1d836bd21e6fb2e968af2b511c7d (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 'sw/source/core')
-rw-r--r-- | sw/source/core/crsr/findattr.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/crsr/findcoll.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/crsr/findtxt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentDrawModelManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docbasic.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/swg/SwXMLTextBlocks.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtatr2.cxx | 8 |
8 files changed, 16 insertions, 16 deletions
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index aa3b2edc390b..d0cdeaa50b6c 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -1226,8 +1226,8 @@ sal_uLong SwCursor::Find( const SfxItemSet& rSet, bool bNoCollections, { // switch off OLE-notifications SwDoc* pDoc = GetDoc(); - Link aLnk( pDoc->GetOle2Link() ); - pDoc->SetOle2Link( Link() ); + Link<> aLnk( pDoc->GetOle2Link() ); + pDoc->SetOle2Link( Link<>() ); bool bReplace = ( pSearchOpt && ( !pSearchOpt->replaceString.isEmpty() || !rSet.Count() ) ) || diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx index 8468eb4e21d1..62e9e799fb18 100644 --- a/sw/source/core/crsr/findcoll.cxx +++ b/sw/source/core/crsr/findcoll.cxx @@ -70,8 +70,8 @@ sal_uLong SwCursor::Find( const SwTxtFmtColl& rFmtColl, SwDocPositions nStart, { // switch off OLE-notifications SwDoc* pDoc = GetDoc(); - Link aLnk( pDoc->GetOle2Link() ); - pDoc->SetOle2Link( Link() ); + Link<> aLnk( pDoc->GetOle2Link() ); + pDoc->SetOle2Link( Link<>() ); bool const bStartUndo = pDoc->GetIDocumentUndoRedo().DoesUndo() && pReplFmtColl; diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 6486526dc161..1d0c30e78af4 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -626,8 +626,8 @@ sal_uLong SwCursor::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes, { // switch off OLE-notifications SwDoc* pDoc = GetDoc(); - Link aLnk( pDoc->GetOle2Link() ); - pDoc->SetOle2Link( Link() ); + Link<> aLnk( pDoc->GetOle2Link() ); + pDoc->SetOle2Link( Link<>() ); bool const bStartUndo = pDoc->GetIDocumentUndoRedo().DoesUndo() && bReplace; if (bStartUndo) diff --git a/sw/source/core/doc/DocumentDrawModelManager.cxx b/sw/source/core/doc/DocumentDrawModelManager.cxx index c61482eff6ab..5cb1e0dfc637 100644 --- a/sw/source/core/doc/DocumentDrawModelManager.cxx +++ b/sw/source/core/doc/DocumentDrawModelManager.cxx @@ -366,7 +366,7 @@ SdrLayerID DocumentDrawModelManager::GetInvisibleLayerIdByVisibleOne( const SdrL void DocumentDrawModelManager::DrawNotifyUndoHdl() { - mpDrawModel->SetNotifyUndoActionHdl( Link() ); + mpDrawModel->SetNotifyUndoActionHdl( Link<>() ); } } diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx index e7519bf2caef..e28666606618 100644 --- a/sw/source/core/doc/docbasic.cxx +++ b/sw/source/core/doc/docbasic.cxx @@ -131,7 +131,7 @@ bool SwDoc::ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs ) } sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent, - bool bCheckPtr, SbxArray* pArgs, const Link* ) + bool bCheckPtr, SbxArray* pArgs, const Link<>* ) { if( !mpDocShell ) // we can't do that without a DocShell! return 0; diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index fe2089555398..be5fb3f9c861 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1836,7 +1836,7 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut, } // No Link here, we want to load the graphic synchronously! - const_cast<SvxBrushItem&>(rBrush).SetDoneLink( Link() ); + const_cast<SvxBrushItem&>(rBrush).SetDoneLink( Link<>() ); GraphicObject *pGrf = const_cast<GraphicObject*>(rBrush.GetGraphicObject()); // Outsource drawing of background with a background color @@ -1984,7 +1984,7 @@ void DrawGraphic( rSh.GetOut()->GetOutDevType() == OUTDEV_PRINTER ) { pBrush->PurgeMedium(); - const_cast<SvxBrushItem*>(pBrush)->SetDoneLink( Link() ); + const_cast<SvxBrushItem*>(pBrush)->SetDoneLink( Link<>() ); } else const_cast<SvxBrushItem*>(pBrush)->SetDoneLink( LINK( diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index f2007a1d6821..ab2b0df98d36 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -68,7 +68,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const OUString& rFile ) bReadOnly = true; pDoc = pDocSh->GetDoc(); xDocShellRef = pDocSh; - pDoc->SetOle2Link( Link() ); + pDoc->SetOle2Link( Link<>() ); pDoc->GetIDocumentUndoRedo().DoUndo(false); pDoc->acquire(); uno::Reference< embed::XStorage > refStg; @@ -114,7 +114,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const uno::Reference < embed::XStorage >& rStg bReadOnly = false; pDoc = pDocSh->GetDoc(); xDocShellRef = pDocSh; - pDoc->SetOle2Link( Link() ); + pDoc->SetOle2Link( Link<>() ); pDoc->GetIDocumentUndoRedo().DoUndo(false); pDoc->acquire(); diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 9761a38ba60c..7af7b015a9aa 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -141,11 +141,11 @@ SwCharFmt* SwTxtINetFmt::GetCharFmt() // JP 10.02.2000, Bug 72806: dont modify the doc for getting the // correct charstyle. bool bResetMod = !pDoc->getIDocumentState().IsModified(); - Link aOle2Lnk; + Link<> aOle2Lnk; if ( bResetMod ) { aOle2Lnk = pDoc->GetOle2Link(); - ( (SwDoc*) pDoc )->SetOle2Link( Link() ); + ( (SwDoc*) pDoc )->SetOle2Link( Link<>() ); } pRet = IsPoolUserFmt( nId ) @@ -263,11 +263,11 @@ SwCharFmt* SwTxtRuby::GetCharFmt() // JP 10.02.2000, Bug 72806: dont modify the doc for getting the // correct charstyle. const bool bResetMod = !pDoc->getIDocumentState().IsModified(); - Link aOle2Lnk; + Link<> aOle2Lnk; if( bResetMod ) { aOle2Lnk = pDoc->GetOle2Link(); - const_cast<SwDoc*>(pDoc)->SetOle2Link( Link() ); + const_cast<SwDoc*>(pDoc)->SetOle2Link( Link<>() ); } pRet = IsPoolUserFmt( nId ) |