[Libreoffice-commits] core.git: 5 commits - basctl/source chart2/source include/svtools include/svx include/vcl reportdesign/source sc/inc sc/source sd/inc sd/source svtools/source svx/source sw/inc sw/source vcl/inc vcl/source
Noel Grandin
noel at peralex.com
Wed Sep 9 01:06:42 PDT 2015
basctl/source/basicide/baside2.hxx | 2
basctl/source/basicide/baside2b.cxx | 4 -
basctl/source/basicide/baside3.cxx | 9 +---
basctl/source/basicide/bastype3.hxx | 8 +--
basctl/source/basicide/bastypes.cxx | 5 --
basctl/source/dlged/dlgedfac.cxx | 4 -
basctl/source/inc/baside3.hxx | 3 -
basctl/source/inc/dlgedfac.hxx | 2
chart2/source/controller/inc/ChartController.hxx | 2
chart2/source/controller/main/ChartController.cxx | 5 --
include/svtools/treelistbox.hxx | 4 -
include/svx/fmobjfac.hxx | 2
include/svx/galmisc.hxx | 8 +--
include/svx/objfac3d.hxx | 2
include/svx/svdetc.hxx | 17 ++++---
include/svx/svdhdl.hxx | 6 +-
include/svx/svdmodel.hxx | 47 ++++++++++------------
include/svx/svdobj.hxx | 12 ++---
include/vcl/accel.hxx | 10 +---
reportdesign/source/ui/inc/dlgedfac.hxx | 2
reportdesign/source/ui/report/dlgedfac.cxx | 6 --
sc/inc/userdat.hxx | 2
sc/source/core/data/userdat.cxx | 5 --
sc/source/ui/docshell/docfunc.cxx | 4 -
sc/source/ui/inc/anyrefdg.hxx | 2
sc/source/ui/inc/docfunc.hxx | 2
sc/source/ui/miscdlgs/anyrefdg.cxx | 8 ---
sd/inc/sdobjfac.hxx | 2
sd/source/core/sdobjfac.cxx | 6 --
sd/source/ui/dlg/brkdlg.cxx | 9 +---
sd/source/ui/inc/BreakDlg.hxx | 3 -
svtools/source/contnr/imivctl1.cxx | 10 +---
svtools/source/contnr/treelistbox.cxx | 6 --
svx/source/engine3d/objfac3d.cxx | 4 -
svx/source/form/fmobjfac.cxx | 6 --
svx/source/gallery2/galmisc.cxx | 6 --
svx/source/svdraw/svdetc.cxx | 28 ++++---------
svx/source/svdraw/svdhdl.cxx | 3 -
svx/source/svdraw/svdobj.cxx | 10 ++--
sw/inc/dobjfac.hxx | 2
sw/inc/doc.hxx | 2
sw/source/core/doc/DocumentDrawModelManager.cxx | 2
sw/source/core/draw/dobjfac.cxx | 5 --
sw/source/core/undo/undraw.cxx | 3 -
vcl/inc/accmgr.hxx | 4 -
vcl/source/window/accel.cxx | 9 ----
vcl/source/window/accmgr.cxx | 17 +------
vcl/source/window/toolbox.cxx | 8 +--
48 files changed, 134 insertions(+), 194 deletions(-)
New commits:
commit 78b124143a3c2bd82984c1c06aa3265c211cef13
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 8 12:45:38 2015 +0200
convert Link<> to typed
Change-Id: I2f36a123662488ef5534f7bf0845d61e497fb0ec
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 81351a3..fbadefd 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -236,7 +236,7 @@ protected:
DECL_LINK_TYPED( ButtonHdl, Button *, void );
DECL_LINK_TYPED(TreeListHdl, SvTreeListBox*, void);
DECL_LINK_TYPED( implEndDragHdl, HeaderBar *, void );
- DECL_LINK_TYPED( EditAccHdl, Accelerator *, void );
+ DECL_LINK_TYPED( EditAccHdl, Accelerator&, void );
public:
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 95924e3..b389792 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1827,9 +1827,9 @@ IMPL_LINK_NOARG_TYPED( WatchWindow, implEndDragHdl, HeaderBar *, void )
}
}
-IMPL_LINK_TYPED( WatchWindow, EditAccHdl, Accelerator *, pAcc, void )
+IMPL_LINK_TYPED( WatchWindow, EditAccHdl, Accelerator&, rAcc, void )
{
- switch ( pAcc->GetCurKeyCode().GetCode() )
+ switch ( rAcc.GetCurKeyCode().GetCode() )
{
case KEY_RETURN:
{
diff --git a/basctl/source/basicide/bastype3.hxx b/basctl/source/basicide/bastype3.hxx
index 5974db7..3106cf7 100644
--- a/basctl/source/basicide/bastype3.hxx
+++ b/basctl/source/basicide/bastype3.hxx
@@ -29,19 +29,19 @@ namespace basctl
class ExtendedEdit : public Edit
{
private:
- Accelerator aAcc;
- Link<Accelerator*,void> aAccHdl;
+ Accelerator aAcc;
+ Link<Accelerator&,void> aAccHdl;
Link<ExtendedEdit*,void> aLoseFocusHdl;
protected:
- DECL_LINK( EditAccHdl, Accelerator * );
+ DECL_LINK_TYPED( EditAccHdl, Accelerator&, void );
DECL_LINK(ImplGetFocusHdl, void *);
DECL_LINK(ImplLoseFocusHdl, void *);
public:
ExtendedEdit( vcl::Window* pParent, IDEResId nRes );
- void SetAccHdl( const Link<Accelerator*,void>& rLink ) { aAccHdl = rLink; }
+ void SetAccHdl( const Link<Accelerator&,void>& rLink ) { aAccHdl = rLink; }
Accelerator& GetAccelerator() { return aAcc; }
};
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 8b88008..92f921c 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -452,10 +452,9 @@ IMPL_LINK_NOARG(ExtendedEdit, ImplLoseFocusHdl)
}
-IMPL_LINK( ExtendedEdit, EditAccHdl, Accelerator *, pAcc )
+IMPL_LINK_TYPED( ExtendedEdit, EditAccHdl, Accelerator&, rAcc, void )
{
- aAccHdl.Call( pAcc );
- return 0;
+ aAccHdl.Call( rAcc );
}
// TabBar
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index 56b9609..700a0e5 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -822,8 +822,8 @@ class SvInplaceEdit2
void CallCallBackHdl_Impl();
DECL_LINK_TYPED( Timeout_Impl, Idle *, void );
- DECL_LINK( ReturnHdl_Impl, void * );
- DECL_LINK( EscapeHdl_Impl, void * );
+ DECL_LINK_TYPED( ReturnHdl_Impl, Accelerator&, void );
+ DECL_LINK_TYPED( EscapeHdl_Impl, Accelerator&, void );
public:
SvInplaceEdit2( vcl::Window* pParent, const Point& rPos, const Size& rSize,
diff --git a/include/vcl/accel.hxx b/include/vcl/accel.hxx
index f8491bc..7e96580 100644
--- a/include/vcl/accel.hxx
+++ b/include/vcl/accel.hxx
@@ -36,9 +36,8 @@ class VCL_DLLPUBLIC Accelerator : public Resource
private:
ImplAccelData* mpData;
OUString maHelpStr;
- Link<> maActivateHdl;
- Link<> maDeactivateHdl;
- Link<> maSelectHdl;
+ Link<Accelerator&,void> maActivateHdl;
+ Link<Accelerator&,void> maSelectHdl;
// Will be set by AcceleratorManager
vcl::KeyCode maCurKeyCode;
@@ -69,7 +68,6 @@ public:
virtual ~Accelerator();
void Activate();
- void Deactivate();
void Select();
void InsertItem( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode );
@@ -84,8 +82,8 @@ public:
Accelerator* GetAccel( sal_uInt16 nItemId ) const;
- void SetActivateHdl( const Link<>& rLink ) { maActivateHdl = rLink; }
- void SetSelectHdl( const Link<>& rLink ) { maSelectHdl = rLink; }
+ void SetActivateHdl( const Link<Accelerator&,void>& rLink ) { maActivateHdl = rLink; }
+ void SetSelectHdl( const Link<Accelerator&,void>& rLink ) { maSelectHdl = rLink; }
Accelerator& operator=( const Accelerator& rAccel );
};
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 77b073a..df1f723 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -69,7 +69,7 @@ class ScFormulaReferenceHelper
bool bHighlightRef;
bool bAccInserted;
- DECL_LINK( AccelSelectHdl, Accelerator* );
+ DECL_LINK_TYPED( AccelSelectHdl, Accelerator&, void );
public:
ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindings* _pBindings);
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 422ca25..28ec44d 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -339,12 +339,9 @@ void ScFormulaReferenceHelper::Init()
}
}
-IMPL_LINK( ScFormulaReferenceHelper, AccelSelectHdl, Accelerator *, pSelAccel )
+IMPL_LINK_TYPED( ScFormulaReferenceHelper, AccelSelectHdl, Accelerator&, rSelAccel, void )
{
- if ( !pSelAccel )
- return long(false);
-
- switch ( pSelAccel->GetCurKeyCode().GetCode() )
+ switch ( rSelAccel.GetCurKeyCode().GetCode() )
{
case KEY_RETURN:
case KEY_ESCAPE:
@@ -353,7 +350,6 @@ IMPL_LINK( ScFormulaReferenceHelper, AccelSelectHdl, Accelerator *, pSelAccel )
m_pDlg->RefInputDone( true );
break;
}
- return long(true);
}
void ScFormulaReferenceHelper::RefInputDone( bool bForced )
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 81fb696..4c23286 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -65,8 +65,8 @@ class IcnViewEdit_Impl : public MultiLineEdit
void CallCallBackHdl_Impl();
DECL_LINK_TYPED(Timeout_Impl, Idle *, void);
- DECL_LINK( ReturnHdl_Impl, Accelerator * );
- DECL_LINK( EscapeHdl_Impl, Accelerator * );
+ DECL_LINK_TYPED( ReturnHdl_Impl, Accelerator&, void );
+ DECL_LINK_TYPED( EscapeHdl_Impl, Accelerator&, void );
public:
@@ -3187,20 +3187,18 @@ IMPL_LINK_NOARG_TYPED(IcnViewEdit_Impl, Timeout_Impl, Idle *, void)
CallCallBackHdl_Impl();
}
-IMPL_LINK( IcnViewEdit_Impl, ReturnHdl_Impl, Accelerator*, )
+IMPL_LINK_NOARG_TYPED( IcnViewEdit_Impl, ReturnHdl_Impl, Accelerator&, void )
{
bCanceled = false;
bGrabFocus = true;
CallCallBackHdl_Impl();
- return 1;
}
-IMPL_LINK( IcnViewEdit_Impl, EscapeHdl_Impl, Accelerator*, )
+IMPL_LINK_NOARG_TYPED( IcnViewEdit_Impl, EscapeHdl_Impl, Accelerator&, void )
{
bCanceled = true;
bGrabFocus = true;
CallCallBackHdl_Impl();
- return 1;
}
void IcnViewEdit_Impl::KeyInput( const KeyEvent& rKEvt )
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index e2b496b..d5bce70 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -185,18 +185,16 @@ void SvInplaceEdit2::Hide()
}
-IMPL_LINK_NOARG(SvInplaceEdit2, ReturnHdl_Impl)
+IMPL_LINK_NOARG_TYPED(SvInplaceEdit2, ReturnHdl_Impl, Accelerator&, void)
{
bCanceled = false;
CallCallBackHdl_Impl();
- return 1;
}
-IMPL_LINK_NOARG(SvInplaceEdit2, EscapeHdl_Impl)
+IMPL_LINK_NOARG_TYPED(SvInplaceEdit2, EscapeHdl_Impl, Accelerator&, void)
{
bCanceled = true;
CallCallBackHdl_Impl();
- return 1;
}
bool SvInplaceEdit2::KeyInput( const KeyEvent& rKEvt )
diff --git a/vcl/inc/accmgr.hxx b/vcl/inc/accmgr.hxx
index 671c347..4f8e553 100644
--- a/vcl/inc/accmgr.hxx
+++ b/vcl/inc/accmgr.hxx
@@ -45,8 +45,8 @@ public:
bool InsertAccel( Accelerator* pAccel );
void RemoveAccel( Accelerator* pAccel );
- void EndSequence( bool bCancel = false );
- void FlushAccel() { EndSequence( true ); }
+ void EndSequence();
+ void FlushAccel() { EndSequence(); }
bool IsAccelKey( const vcl::KeyCode& rKeyCode, sal_uInt16 nRepeat );
};
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index 6905142..75ea7bc 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -300,17 +300,12 @@ Accelerator::~Accelerator()
void Accelerator::Activate()
{
- maActivateHdl.Call( this );
-}
-
-void Accelerator::Deactivate()
-{
- maDeactivateHdl.Call( this );
+ maActivateHdl.Call( *this );
}
void Accelerator::Select()
{
- maSelectHdl.Call( this );
+ maSelectHdl.Call( *this );
}
void Accelerator::InsertItem( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode )
diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx
index 5bc7627..e855193 100644
--- a/vcl/source/window/accmgr.cxx
+++ b/vcl/source/window/accmgr.cxx
@@ -60,7 +60,7 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel )
Accelerator* pSubAccel = pAccel->GetAccel( pAccel->GetItemId(i) );
for ( size_t j = 0, n = mpSequenceList->size(); j < n; ++j ) {
if ( (*mpSequenceList)[ j ] == pSubAccel ) {
- EndSequence( true );
+ EndSequence();
i = pAccel->GetItemCount();
break;
}
@@ -80,25 +80,17 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel )
}
}
-void ImplAccelManager::EndSequence( bool bCancel )
+void ImplAccelManager::EndSequence()
{
// are we in a list ?
if ( !mpSequenceList )
return;
- // call all deactivate-handler of the accelerators in the list
for ( size_t i = 0, n = mpSequenceList->size(); i < n; ++i )
{
Accelerator* pTempAccel = (*mpSequenceList)[ i ];
- bool bDel = false;
- pTempAccel->mbIsCancel = bCancel;
- pTempAccel->mpDel = &bDel;
- pTempAccel->Deactivate();
- if ( !bDel )
- {
- pTempAccel->mbIsCancel = false;
- pTempAccel->mpDel = NULL;
- }
+ pTempAccel->mbIsCancel = false;
+ pTempAccel->mpDel = NULL;
}
// delete sequence-list
@@ -222,7 +214,6 @@ bool ImplAccelManager::IsAccelKey( const vcl::KeyCode& rKeyCode, sal_uInt16 nRep
{
// first call activate/deactivate-Handler
pAccel->Activate();
- pAccel->Deactivate();
// define accelerator of the actual item
// and call the handler
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 5e75a15..f6cf525 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -129,7 +129,7 @@ public:
void EndDragging( bool bOK = true );
void HideDragRect() { if ( mbShowDragRect ) mpDragBox->HideTracking(); }
void UpdateDragRect();
- DECL_LINK( SelectHdl, Accelerator* );
+ DECL_LINK_TYPED( SelectHdl, Accelerator&, void );
};
static ImplTBDragMgr* ImplGetTBDragMgr()
@@ -1336,14 +1336,12 @@ void ImplTBDragMgr::UpdateDragRect()
mpDragBox->ShowTracking( maRect );
}
-IMPL_LINK( ImplTBDragMgr, SelectHdl, Accelerator*, pAccel )
+IMPL_LINK_TYPED( ImplTBDragMgr, SelectHdl, Accelerator&, rAccel, void )
{
- if ( pAccel->GetCurItemId() == KEY_ESCAPE )
+ if ( rAccel.GetCurItemId() == KEY_ESCAPE )
EndDragging( false );
else
EndDragging();
-
- return (long) true;
}
void ToolBox::ImplInit( vcl::Window* pParent, WinBits nStyle )
commit 6f4e11a95bcd7a591cb93d1a842bbc8ad1ed31c9
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 8 11:13:25 2015 +0200
convert Link<> to typed
Change-Id: I2aeda615e39db5a3cd39e168db34425e2912be8b
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 67a20c4..92d6837 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -46,6 +46,7 @@
#include <svl/aeitem.hxx>
#include <svl/visitem.hxx>
#include <svl/whiter.hxx>
+#include <svx/svdundo.hxx>
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
#include <vcl/layout.hxx>
@@ -210,17 +211,13 @@ void DialogWindow::Command( const CommandEvent& rCEvt )
}
-
-
-IMPL_STATIC_LINK(
- DialogWindow, NotifyUndoActionHdl, SfxUndoAction *, pUndoAction )
+IMPL_STATIC_LINK_TYPED(
+ DialogWindow, NotifyUndoActionHdl, SdrUndoAction *, pUndoAction, void )
{
// #i120515# pUndoAction needs to be deleted, this hand over is an ownership
// change. As long as it does not get added to the undo manager, it needs at
// least to be deleted.
delete pUndoAction;
-
- return 0;
}
void DialogWindow::DoInit()
diff --git a/basctl/source/inc/baside3.hxx b/basctl/source/inc/baside3.hxx
index 1258fc7..fe8dabb 100644
--- a/basctl/source/inc/baside3.hxx
+++ b/basctl/source/inc/baside3.hxx
@@ -38,6 +38,7 @@ class Printer;
class StarBASIC;
class SfxItemSet;
class SfxUndoManager;
+class SdrUndoAction;
namespace basctl
{
@@ -71,7 +72,7 @@ protected:
virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
virtual void LoseFocus() SAL_OVERRIDE;
- DECL_STATIC_LINK( DialogWindow, NotifyUndoActionHdl, SfxUndoAction * );
+ DECL_STATIC_LINK_TYPED( DialogWindow, NotifyUndoActionHdl, SdrUndoAction *, void );
virtual void DoInit() SAL_OVERRIDE;
virtual void DoScroll( ScrollBar* pCurScrollBar ) SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx
index 263e309..cca4218 100644
--- a/chart2/source/controller/inc/ChartController.hxx
+++ b/chart2/source/controller/inc/ChartController.hxx
@@ -437,7 +437,7 @@ public:
ViewElementListProvider getViewElementListProvider();
DrawModelWrapper* GetDrawModelWrapper();
- DECL_LINK( NotifyUndoActionHdl, SdrUndoAction* );
+ DECL_LINK_TYPED( NotifyUndoActionHdl, SdrUndoAction*, void );
public:
//private
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 6f316e3..b99858f 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1459,9 +1459,9 @@ void SAL_CALL ChartController::modified(
//todo? update menu states ?
}
-IMPL_LINK( ChartController, NotifyUndoActionHdl, SdrUndoAction*, pUndoAction )
+IMPL_LINK_TYPED( ChartController, NotifyUndoActionHdl, SdrUndoAction*, pUndoAction, void )
{
- ENSURE_OR_RETURN( pUndoAction, "invalid Undo action", 1L );
+ ENSURE_OR_RETURN_VOID( pUndoAction, "invalid Undo action" );
OUString aObjectCID = m_aSelection.getSelectedCID();
if ( aObjectCID.isEmpty() )
@@ -1478,7 +1478,6 @@ IMPL_LINK( ChartController, NotifyUndoActionHdl, SdrUndoAction*, pUndoAction )
DBG_UNHANDLED_EXCEPTION();
}
}
- return 0L;
}
DrawModelWrapper* ChartController::GetDrawModelWrapper()
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 2c9eb47..194a3e1 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -152,11 +152,10 @@ struct SdrModelImpl;
class SVX_DLLPUBLIC SdrModel : public SfxBroadcaster, public tools::WeakBase< SdrModel >
{
protected:
- DateTime aReadDate; // date of the incoming stream
+ DateTime aReadDate; // date of the incoming stream
std::vector<SdrPage*> maMaPag; // master pages
std::vector<SdrPage*> maPages;
- Link<> aUndoLink; // link to a NotifyUndo-Handler
- Link<> aIOProgressLink;
+ Link<SdrUndoAction*,void> aUndoLink; // link to a NotifyUndo-Handler
OUString aTablePath;
Size aMaxObjSize; // e.g. for auto-growing text
Fraction aObjUnit; // description of the coordinate units for ClipBoard, Drag&Drop, ...
@@ -332,25 +331,25 @@ public:
void SetRefDevice(OutputDevice* pDev);
OutputDevice* GetRefDevice() const { return pRefOutDev.get(); }
/// Set if we are doing tiled rendering.
- void setTiledRendering(bool bTiledRendering);
+ void setTiledRendering(bool bTiledRendering);
/// Are we doing tiled rendering?
- bool isTiledRendering() const;
+ bool isTiledRendering() const;
/// The actual implementation of the vcl::ITiledRenderable::registerCallback() API.
- void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData);
+ void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData);
/// Gets the LOK callback registered by registerLibreOfficeKitCallback().
LibreOfficeKitCallback getLibreOfficeKitCallback() const;
/// Gets the LOK data registered by registerLibreOfficeKitCallback().
- void* getLibreOfficeKitData() const;
+ void* getLibreOfficeKitData() const;
/// Invokes the registered callback, if there are any.
- void libreOfficeKitCallback(int nType, const char* pPayload) const;
+ void libreOfficeKitCallback(int nType, const char* pPayload) const;
// If a new MapMode is set on the RefDevice (or similar)
void RefDeviceChanged(); // not yet implemented
// default font height in logical units
void SetDefaultFontHeight(sal_uIntPtr nVal);
- sal_uIntPtr GetDefaultFontHeight() const { return nDefTextHgt; }
+ sal_uIntPtr GetDefaultFontHeight() const { return nDefTextHgt; }
// default tabulator width for the EditEngine
void SetDefaultTabulator(sal_uInt16 nVal);
- sal_uInt16 GetDefaultTabulator() const { return nDefaultTabulator; }
+ sal_uInt16 GetDefaultTabulator() const { return nDefaultTabulator; }
// The DefaultStyleSheet will be used in every symbol object which is inserted
// in this model and does not have a StyleSheet set.
@@ -361,7 +360,7 @@ public:
SfxStyleSheet* GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj() const { return mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj; }
void SetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(SfxStyleSheet* pDefSS) { mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj = pDefSS; }
- sfx2::LinkManager* GetLinkManager() { return pLinkManager; }
+ sfx2::LinkManager* GetLinkManager() { return pLinkManager; }
void SetLinkManager( sfx2::LinkManager* pLinkMgr ) { pLinkManager = pLinkMgr; }
::comphelper::IEmbeddedHelper* GetPersist() const { return m_pEmbeddedHelper; }
@@ -406,8 +405,8 @@ public:
static void TakePercentStr(const Fraction& rVal, OUString& rStr, bool bNoPercentChar = false);
// RecalcPageNums is ordinarily only called by the Page.
- bool IsPagNumsDirty() const { return bPagNumsDirty; };
- bool IsMPgNumsDirty() const { return bMPgNumsDirty; };
+ bool IsPagNumsDirty() const { return bPagNumsDirty; };
+ bool IsMPgNumsDirty() const { return bMPgNumsDirty; };
void RecalcPageNums(bool bMaster);
// After the Insert the Page belongs to the SdrModel.
virtual void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
@@ -415,23 +414,23 @@ public:
// Remove means transferring ownership to the caller (opposite of Insert)
virtual SdrPage* RemovePage(sal_uInt16 nPgNum);
virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
- const SdrPage* GetPage(sal_uInt16 nPgNum) const;
- SdrPage* GetPage(sal_uInt16 nPgNum);
- sal_uInt16 GetPageCount() const;
+ const SdrPage* GetPage(sal_uInt16 nPgNum) const;
+ SdrPage* GetPage(sal_uInt16 nPgNum);
+ sal_uInt16 GetPageCount() const;
// #109538#
- virtual void PageListChanged();
+ virtual void PageListChanged();
// Masterpages
virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
- void DeleteMasterPage(sal_uInt16 nPgNum);
+ void DeleteMasterPage(sal_uInt16 nPgNum);
// Remove means transferring ownership to the caller (opposite of Insert)
virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum);
- void MoveMasterPage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
- const SdrPage* GetMasterPage(sal_uInt16 nPgNum) const;
- SdrPage* GetMasterPage(sal_uInt16 nPgNum);
- sal_uInt16 GetMasterPageCount() const;
+ void MoveMasterPage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
+ const SdrPage* GetMasterPage(sal_uInt16 nPgNum) const;
+ SdrPage* GetMasterPage(sal_uInt16 nPgNum);
+ sal_uInt16 GetMasterPageCount() const;
// #109538#
- virtual void MasterPageListChanged();
+ virtual void MasterPageListChanged();
// modified flag. Is set automatically when something changes on the Pages
// symbol objects. You need to reset it yourself, however, e.g. on Save().
@@ -525,7 +524,7 @@ public:
// void NotifyUndoActionHdl(SfxUndoAction* pUndoAction);
// When calling the handler ownership is transferred;
// The UndoAction belongs to the Handler, not the SdrModel.
- void SetNotifyUndoActionHdl(const Link<>& rLink) { aUndoLink=rLink; }
+ void SetNotifyUndoActionHdl(const Link<SdrUndoAction*,void>& rLink) { aUndoLink=rLink; }
/** application can set its own undo manager, BegUndo, EndUndo and AddUndoAction
calls are routed to this interface if given */
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 4ba2506..e8d6a78 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -101,7 +101,7 @@ using ::std::vector;
// STATIC DATA -----------------------------------------------------------
-IMPL_LINK( ScDocFunc, NotifyDrawUndo, SdrUndoAction*, pUndoAction )
+IMPL_LINK_TYPED( ScDocFunc, NotifyDrawUndo, SdrUndoAction*, pUndoAction, void )
{
// #i101118# if drawing layer collects the undo actions, add it there
ScDrawLayer* pDrawLayer = rDocShell.GetDocument().GetDrawLayer();
@@ -117,8 +117,6 @@ IMPL_LINK( ScDocFunc, NotifyDrawUndo, SdrUndoAction*, pUndoAction )
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
if (rDoc.IsStreamValid(nTab))
rDoc.SetStreamValid(nTab, false);
-
- return 0;
}
// Zeile ueber dem Range painten (fuer Linien nach AdjustRowHeight)
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index 07091c4..6d9c032 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -68,7 +68,7 @@ protected:
public:
virtual ~ScDocFunc() {}
- DECL_LINK( NotifyDrawUndo, SdrUndoAction* );
+ DECL_LINK_TYPED( NotifyDrawUndo, SdrUndoAction*, void );
// for grouping multiple operations into one with a new name
void EnterListAction( sal_uInt16 nNameResId );
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 1873a7d..3b4d99a 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -549,7 +549,7 @@ public:
IDocumentState & getIDocumentState();
// IDocumentDrawModelAccess
- DECL_LINK( AddDrawUndo, SdrUndoAction * );
+ DECL_LINK_TYPED( AddDrawUndo, SdrUndoAction *, void );
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const;
IDocumentDrawModelAccess & getIDocumentDrawModelAccess();
diff --git a/sw/source/core/doc/DocumentDrawModelManager.cxx b/sw/source/core/doc/DocumentDrawModelManager.cxx
index 91c6bf9..d4be336 100644
--- a/sw/source/core/doc/DocumentDrawModelManager.cxx
+++ b/sw/source/core/doc/DocumentDrawModelManager.cxx
@@ -397,7 +397,7 @@ bool DocumentDrawModelManager::Search(const SwPaM& rPaM, const SvxSearchItem& rS
void DocumentDrawModelManager::DrawNotifyUndoHdl()
{
- mpDrawModel->SetNotifyUndoActionHdl( Link<>() );
+ mpDrawModel->SetNotifyUndoActionHdl( Link<SdrUndoAction*,void>() );
}
}
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index c054c99..a5dd260 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -55,7 +55,7 @@ struct SwUndoGroupObjImpl
// Draw-Objecte
-IMPL_LINK( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo )
+IMPL_LINK_TYPED( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo, void )
{
#if OSL_DEBUG_LEVEL > 1
SAL_INFO("sw.core", "Id: " << pUndo->GetId() << "Comment: " << pUndo->GetComment());
@@ -73,7 +73,6 @@ IMPL_LINK( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo )
}
else
delete pUndo;
- return 0;
}
SwSdrUndo::SwSdrUndo( SdrUndoAction* pUndo, const SdrMarkList* pMrkLst )
commit f73144801474aa4b3d6b997ceab7fabae8bfc3e7
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 8 10:11:24 2015 +0200
convert Link<> to typed
Change-Id: I4fba6bf5b34b086a11659de3cddf46c76007a147
diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx
index ec3ef8d..1fa5641 100644
--- a/include/svx/svdhdl.hxx
+++ b/include/svx/svdhdl.hxx
@@ -258,7 +258,7 @@ private:
Color aMarkerColor;
// callback link when value changed
- Link<> aColorChangeHdl;
+ Link<SdrHdlColor*,void> aColorChangeHdl;
// use luminance values only
bool bUseLuminance : 1;
@@ -282,7 +282,7 @@ public:
void SetSize(const Size& rNew);
- void SetColorChangeHdl(const Link<>& rLink) { aColorChangeHdl = rLink; }
+ void SetColorChangeHdl(const Link<SdrHdlColor*,void>& rLink) { aColorChangeHdl = rLink; }
};
@@ -322,7 +322,7 @@ public:
void Set2ndPos(const Point& rPnt);
// the link called by the color handles
- DECL_LINK(ColorChangeHdl, SdrHdl*);
+ DECL_LINK_TYPED(ColorChangeHdl, SdrHdlColor*, void);
// transformation call, create gradient from this handle
void FromIAOToItem(SdrObject* pObj, bool bSetItemOnObject, bool bUndo);
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 0a4a9aa..f63d759 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1230,11 +1230,10 @@ void SdrHdlGradient::CreateB2dIAObject()
}
}
-IMPL_LINK(SdrHdlGradient, ColorChangeHdl, SdrHdl*, /*pHdl*/)
+IMPL_LINK_NOARG_TYPED(SdrHdlGradient, ColorChangeHdl, SdrHdlColor*, void)
{
if(GetObj())
FromIAOToItem(GetObj(), true, true);
- return 0;
}
void SdrHdlGradient::FromIAOToItem(SdrObject* _pObj, bool bSetItemOnObject, bool bUndo)
commit 5906a2a6380dc8f748a3c6f4fa0778e237abdff2
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 8 09:54:16 2015 +0200
convert Link<> to typed
Change-Id: I184d836e944d6dcfd17233a7a83680f1c1bff9bf
diff --git a/basctl/source/dlged/dlgedfac.cxx b/basctl/source/dlged/dlgedfac.cxx
index 0d60dc0..b53572f 100644
--- a/basctl/source/dlged/dlgedfac.cxx
+++ b/basctl/source/dlged/dlgedfac.cxx
@@ -43,7 +43,7 @@ DlgEdFactory::~DlgEdFactory()
}
-IMPL_LINK( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
+IMPL_LINK_TYPED( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory, void )
{
static bool bNeedsInit = true;
static uno::Reference< lang::XMultiServiceFactory > xDialogSFact;
@@ -235,8 +235,6 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
break;
}
}
-
- return 0;
}
} // namespace basctl
diff --git a/basctl/source/inc/dlgedfac.hxx b/basctl/source/inc/dlgedfac.hxx
index 13656a8..d9079d9 100644
--- a/basctl/source/inc/dlgedfac.hxx
+++ b/basctl/source/inc/dlgedfac.hxx
@@ -38,7 +38,7 @@ public:
DlgEdFactory( const css::uno::Reference< css::frame::XModel >& xModel );
~DlgEdFactory();
- DECL_LINK( MakeObject, SdrObjFactory * );
+ DECL_LINK_TYPED( MakeObject, SdrObjFactory *, void );
};
} // namespace basctl
diff --git a/include/svx/fmobjfac.hxx b/include/svx/fmobjfac.hxx
index 81b8801..c5eac5e 100644
--- a/include/svx/fmobjfac.hxx
+++ b/include/svx/fmobjfac.hxx
@@ -31,7 +31,7 @@ public:
FmFormObjFactory();
~FmFormObjFactory();
- DECL_STATIC_LINK(FmFormObjFactory, MakeObject, SdrObjFactory*);
+ DECL_STATIC_LINK_TYPED(FmFormObjFactory, MakeObject, SdrObjFactory*, void);
};
#endif // _FM_FMOBJFAC_HXX
diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx
index dce7dfa..56ff7d3 100644
--- a/include/svx/galmisc.hxx
+++ b/include/svx/galmisc.hxx
@@ -64,8 +64,6 @@ enum SgaObjKind
#define IV_IMAPINFO (sal_uInt32('S')*0x00000001+sal_uInt32('D')*0x00000100+sal_uInt32('U')*0x00010000+sal_uInt32('D')*0x01000000)
#define ID_IMAPINFO 2
-#define USERDATA_HDL() (LINK(this,SgaUserDataFactory,MakeUserData))
-
#define GAL_RES(nId) ResId(nId, *GetGalleryResMgr())
#define GAL_RESSTR(nId) GAL_RES(nId).toString()
#define STREAMBUF_SIZE 16384L
@@ -129,10 +127,10 @@ public:
class SgaUserDataFactory
{
public:
- SgaUserDataFactory() { SdrObjFactory::InsertMakeUserDataHdl( USERDATA_HDL() ); }
- ~SgaUserDataFactory() { SdrObjFactory::RemoveMakeUserDataHdl( USERDATA_HDL() ); }
+ SgaUserDataFactory() { SdrObjFactory::InsertMakeUserDataHdl( LINK(this,SgaUserDataFactory,MakeUserData) ); }
+ ~SgaUserDataFactory() { SdrObjFactory::RemoveMakeUserDataHdl( LINK(this,SgaUserDataFactory,MakeUserData) ); }
- DECL_STATIC_LINK( SgaUserDataFactory, MakeUserData, SdrObjFactory* );
+ DECL_STATIC_LINK_TYPED( SgaUserDataFactory, MakeUserData, SdrObjFactory*, void );
};
class GraphicFilter;
diff --git a/include/svx/objfac3d.hxx b/include/svx/objfac3d.hxx
index 734dc52..5b625f9 100644
--- a/include/svx/objfac3d.hxx
+++ b/include/svx/objfac3d.hxx
@@ -40,7 +40,7 @@ public:
E3dObjFactory();
~E3dObjFactory();
- DECL_STATIC_LINK(E3dObjFactory, MakeObject, SdrObjFactory*);
+ DECL_STATIC_LINK_TYPED(E3dObjFactory, MakeObject, SdrObjFactory*, void);
};
diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx
index d69ea2a..822a9be 100644
--- a/include/svx/svdetc.hxx
+++ b/include/svx/svdetc.hxx
@@ -173,21 +173,22 @@ public:
};
+class SdrObjFactory;
class SdrLinkList
{
- std::vector<Link<>*> aList;
+ std::vector<Link<SdrObjFactory*,void> > aList;
protected:
- unsigned FindEntry(const Link<>& rLink) const;
+ unsigned FindEntry(const Link<SdrObjFactory*,void>& rLink) const;
public:
SdrLinkList(): aList() {}
~SdrLinkList() { Clear(); }
SVX_DLLPUBLIC void Clear();
unsigned GetLinkCount() const { return (unsigned)aList.size(); }
- Link<>& GetLink(unsigned nNum) { return *aList[nNum]; }
- const Link<>& GetLink(unsigned nNum) const { return *aList[nNum]; }
- void InsertLink(const Link<>& rLink, unsigned nPos=0xFFFF);
- void RemoveLink(const Link<>& rLink);
+ Link<SdrObjFactory*,void>& GetLink(unsigned nNum) { return aList[nNum]; }
+ const Link<SdrObjFactory*,void>& GetLink(unsigned nNum) const { return aList[nNum]; }
+ void InsertLink(const Link<SdrObjFactory*,void>& rLink, unsigned nPos=0xFFFF);
+ void RemoveLink(const Link<SdrObjFactory*,void>& rLink);
};
SdrLinkList& ImpGetUserMakeObjHdl();
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 830cfed..50bec71 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -992,8 +992,8 @@ private:
class SVX_DLLPUBLIC SdrObjFactory
{
public:
- sal_uInt32 nInventor;
- sal_uInt16 nIdentifier;
+ sal_uInt32 nInventor;
+ sal_uInt16 nIdentifier;
// for MakeNewObj():
SdrPage* pPage;
@@ -1014,10 +1014,10 @@ private:
public:
static SdrObject* MakeNewObject(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pPage, SdrModel* pModel=NULL);
static SdrObject* MakeNewObject( sal_uInt32 nInventor, sal_uInt16 nIdentifier, const Rectangle& rSnapRect, SdrPage* pPage );
- static void InsertMakeObjectHdl(const Link<>& rLink);
- static void RemoveMakeObjectHdl(const Link<>& rLink);
- static void InsertMakeUserDataHdl(const Link<>& rLink);
- static void RemoveMakeUserDataHdl(const Link<>& rLink);
+ static void InsertMakeObjectHdl(const Link<SdrObjFactory*,void>& rLink);
+ static void RemoveMakeObjectHdl(const Link<SdrObjFactory*,void>& rLink);
+ static void InsertMakeUserDataHdl(const Link<SdrObjFactory*,void>& rLink);
+ static void RemoveMakeUserDataHdl(const Link<SdrObjFactory*,void>& rLink);
};
typedef tools::WeakReference< SdrObject > SdrObjectWeakRef;
diff --git a/reportdesign/source/ui/inc/dlgedfac.hxx b/reportdesign/source/ui/inc/dlgedfac.hxx
index d9e6067..bdee50e 100644
--- a/reportdesign/source/ui/inc/dlgedfac.hxx
+++ b/reportdesign/source/ui/inc/dlgedfac.hxx
@@ -35,7 +35,7 @@ public:
DlgEdFactory();
~DlgEdFactory();
- DECL_STATIC_LINK( DlgEdFactory, MakeObject, SdrObjFactory * );
+ DECL_STATIC_LINK_TYPED( DlgEdFactory, MakeObject, SdrObjFactory *, void );
};
}
#endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_DLGEDFAC_HXX
diff --git a/reportdesign/source/ui/report/dlgedfac.cxx b/reportdesign/source/ui/report/dlgedfac.cxx
index b9b4a02..57d4702 100644
--- a/reportdesign/source/ui/report/dlgedfac.cxx
+++ b/reportdesign/source/ui/report/dlgedfac.cxx
@@ -46,8 +46,8 @@ DlgEdFactory::~DlgEdFactory()
-IMPL_STATIC_LINK(
- DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
+IMPL_STATIC_LINK_TYPED(
+ DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory, void )
{
if ( pObjFactory->nInventor == ReportInventor )
{
@@ -96,8 +96,6 @@ IMPL_STATIC_LINK(
break;
}
}
-
- return 0;
}
}
diff --git a/sc/inc/userdat.hxx b/sc/inc/userdat.hxx
index c01cbf5..86e5a7a 100644
--- a/sc/inc/userdat.hxx
+++ b/sc/inc/userdat.hxx
@@ -35,7 +35,7 @@
class ScDrawObjFactory
{
- DECL_STATIC_LINK( ScDrawObjFactory, MakeUserData, SdrObjFactory * );
+ DECL_STATIC_LINK_TYPED( ScDrawObjFactory, MakeUserData, SdrObjFactory *, void );
public:
ScDrawObjFactory();
~ScDrawObjFactory();
diff --git a/sc/source/core/data/userdat.cxx b/sc/source/core/data/userdat.cxx
index 9cc9aed..d856e55 100644
--- a/sc/source/core/data/userdat.cxx
+++ b/sc/source/core/data/userdat.cxx
@@ -31,8 +31,8 @@ ScDrawObjFactory::~ScDrawObjFactory()
SdrObjFactory::RemoveMakeUserDataHdl( LINK ( this, ScDrawObjFactory, MakeUserData ) );
}
-IMPL_STATIC_LINK(
- ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFactory )
+IMPL_STATIC_LINK_TYPED(
+ ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFactory, void )
{
if ( pObjFactory->nInventor == SC_DRAWLAYER )
{
@@ -47,7 +47,6 @@ IMPL_STATIC_LINK(
OSL_FAIL("MakeUserData: wrong ID");
}
}
- return 0;
}
ScDrawObjData::ScDrawObjData() :
diff --git a/sd/inc/sdobjfac.hxx b/sd/inc/sdobjfac.hxx
index cfca8b0..65e642a 100644
--- a/sd/inc/sdobjfac.hxx
+++ b/sd/inc/sdobjfac.hxx
@@ -34,7 +34,7 @@ protected:
public:
SdObjectFactory() {}
- DECL_LINK( MakeUserData, SdrObjFactory * );
+ DECL_LINK_TYPED( MakeUserData, SdrObjFactory *, void );
};
extern SdObjectFactory aSdObjectFactory;
diff --git a/sd/source/core/sdobjfac.cxx b/sd/source/core/sdobjfac.cxx
index 90dbe55..6a8b24d 100644
--- a/sd/source/core/sdobjfac.cxx
+++ b/sd/source/core/sdobjfac.cxx
@@ -35,7 +35,7 @@ SdObjectFactory aSdObjectFactory;
|*
\************************************************************************/
-IMPL_LINK( SdObjectFactory, MakeUserData, SdrObjFactory *, pObjFactory )
+IMPL_LINK_TYPED( SdObjectFactory, MakeUserData, SdrObjFactory *, pObjFactory, void )
{
if ( pObjFactory->nInventor == SdUDInventor )
{
@@ -55,12 +55,10 @@ IMPL_LINK( SdObjectFactory, MakeUserData, SdrObjFactory *, pObjFactory )
}
if ( pObjFactory->pNewData )
- return 0;
+ return;
if( aOldMakeUserDataLink.IsSet() )
aOldMakeUserDataLink.Call( this );
-
- return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/engine3d/objfac3d.cxx b/svx/source/engine3d/objfac3d.cxx
index a494d89..197c77c 100644
--- a/svx/source/engine3d/objfac3d.cxx
+++ b/svx/source/engine3d/objfac3d.cxx
@@ -45,8 +45,7 @@ E3dObjFactory::~E3dObjFactory()
// Generate chart internal objects
-IMPL_STATIC_LINK(
- E3dObjFactory, MakeObject, SdrObjFactory*, pObjFactory)
+IMPL_STATIC_LINK_TYPED( E3dObjFactory, MakeObject, SdrObjFactory*, pObjFactory, void )
{
if ( pObjFactory->nInventor == E3dInventor )
{
@@ -80,7 +79,6 @@ IMPL_STATIC_LINK(
break;
}
}
- return 0;
}
diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx
index a5e370b..8944217 100644
--- a/svx/source/form/fmobjfac.cxx
+++ b/svx/source/form/fmobjfac.cxx
@@ -109,8 +109,8 @@ namespace
}
}
-IMPL_STATIC_LINK(
- FmFormObjFactory, MakeObject, SdrObjFactory*, pObjFactory)
+IMPL_STATIC_LINK_TYPED(
+ FmFormObjFactory, MakeObject, SdrObjFactory*, pObjFactory, void)
{
if (pObjFactory->nInventor == FmFormInventor)
{
@@ -232,8 +232,6 @@ IMPL_STATIC_LINK(
);
}
}
-
- return 0;
}
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index 368f955..a602f8a 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -76,13 +76,11 @@ BitmapEx GalleryResGetBitmapEx( sal_uInt32 nId )
return aBmpEx;
}
-IMPL_STATIC_LINK(
- SgaUserDataFactory, MakeUserData, SdrObjFactory*, pObjFactory )
+IMPL_STATIC_LINK_TYPED(
+ SgaUserDataFactory, MakeUserData, SdrObjFactory*, pObjFactory, void )
{
if ( pObjFactory->nInventor == IV_IMAPINFO && pObjFactory->nIdentifier == ID_IMAPINFO )
pObjFactory->pNewData = new SgaIMapInfo;
-
- return 0L;
}
GalleryGraphicImportRet GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic,
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index e69fe4b..3227bf3 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -260,14 +260,10 @@ IMPL_LINK_NOARG_TYPED(OLEObjCache, UnloadCheckHdl, Timer*, void)
void SdrLinkList::Clear()
{
- unsigned nAnz=GetLinkCount();
- for (unsigned i=0; i<nAnz; i++) {
- delete aList[i];
- }
aList.clear();
}
-unsigned SdrLinkList::FindEntry(const Link<>& rLink) const
+unsigned SdrLinkList::FindEntry(const Link<SdrObjFactory*,void>& rLink) const
{
unsigned nAnz=GetLinkCount();
for (unsigned i=0; i<nAnz; i++) {
@@ -276,15 +272,15 @@ unsigned SdrLinkList::FindEntry(const Link<>& rLink) const
return 0xFFFF;
}
-void SdrLinkList::InsertLink(const Link<>& rLink, unsigned nPos)
+void SdrLinkList::InsertLink(const Link<SdrObjFactory*,void>& rLink, unsigned nPos)
{
unsigned nFnd=FindEntry(rLink);
if (nFnd==0xFFFF) {
if (rLink.IsSet()) {
if(nPos==0xFFFF)
- aList.push_back(new Link<>(rLink));
+ aList.push_back(rLink);
else
- aList.insert(aList.begin() + nPos, new Link<>(rLink));
+ aList.insert(aList.begin() + nPos, rLink);
} else {
OSL_FAIL("SdrLinkList::InsertLink(): Tried to insert a link that was not set already.");
}
@@ -293,13 +289,11 @@ void SdrLinkList::InsertLink(const Link<>& rLink, unsigned nPos)
}
}
-void SdrLinkList::RemoveLink(const Link<>& rLink)
+void SdrLinkList::RemoveLink(const Link<SdrObjFactory*,void>& rLink)
{
unsigned nFnd=FindEntry(rLink);
if (nFnd!=0xFFFF) {
- Link<>* pLink = aList[nFnd];
aList.erase( aList.begin() + nFnd );
- delete pLink;
} else {
OSL_FAIL("SdrLinkList::RemoveLink(): Link not found.");
}
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 42042d5..6b8c00d 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -3171,7 +3171,7 @@ SdrObject* SdrObjFactory::CreateObjectFromFactory( sal_uInt32 nInventor, sal_uIn
SdrObject* pObj = NULL;
while (i < n && !pObj)
{
- rLL.GetLink(i).Call(static_cast<void*>(pFact.get()));
+ rLL.GetLink(i).Call(pFact.get());
pObj = pFact->pNewObj;
i++;
}
@@ -3331,25 +3331,25 @@ SdrObject* SdrObjFactory::MakeNewObject(
return pObj;
}
-void SdrObjFactory::InsertMakeObjectHdl(const Link<>& rLink)
+void SdrObjFactory::InsertMakeObjectHdl(const Link<SdrObjFactory*,void>& rLink)
{
SdrLinkList& rLL=ImpGetUserMakeObjHdl();
rLL.InsertLink(rLink);
}
-void SdrObjFactory::RemoveMakeObjectHdl(const Link<>& rLink)
+void SdrObjFactory::RemoveMakeObjectHdl(const Link<SdrObjFactory*,void>& rLink)
{
SdrLinkList& rLL=ImpGetUserMakeObjHdl();
rLL.RemoveLink(rLink);
}
-void SdrObjFactory::InsertMakeUserDataHdl(const Link<>& rLink)
+void SdrObjFactory::InsertMakeUserDataHdl(const Link<SdrObjFactory*,void>& rLink)
{
SdrLinkList& rLL=ImpGetUserMakeObjUserDataHdl();
rLL.InsertLink(rLink);
}
-void SdrObjFactory::RemoveMakeUserDataHdl(const Link<>& rLink)
+void SdrObjFactory::RemoveMakeUserDataHdl(const Link<SdrObjFactory*,void>& rLink)
{
SdrLinkList& rLL=ImpGetUserMakeObjUserDataHdl();
rLL.RemoveLink(rLink);
diff --git a/sw/inc/dobjfac.hxx b/sw/inc/dobjfac.hxx
index 2ea3247..52fb8bc 100644
--- a/sw/inc/dobjfac.hxx
+++ b/sw/inc/dobjfac.hxx
@@ -26,7 +26,7 @@ class SdrObjFactory;
class SwObjectFactory
{
public:
- DECL_STATIC_LINK( SwObjectFactory, MakeObject, SdrObjFactory * );
+ DECL_STATIC_LINK_TYPED( SwObjectFactory, MakeObject, SdrObjFactory *, void );
};
extern SwObjectFactory aSwObjectFactory;
diff --git a/sw/source/core/draw/dobjfac.cxx b/sw/source/core/draw/dobjfac.cxx
index 9a870e9..25d96fb 100644
--- a/sw/source/core/draw/dobjfac.cxx
+++ b/sw/source/core/draw/dobjfac.cxx
@@ -23,8 +23,8 @@
SwObjectFactory aSwObjectFactory;
-IMPL_STATIC_LINK(
- SwObjectFactory, MakeObject, SdrObjFactory*, pObjFactory )
+IMPL_STATIC_LINK_TYPED(
+ SwObjectFactory, MakeObject, SdrObjFactory*, pObjFactory, void )
{
if ( pObjFactory->nInventor == SWGInventor )
{
@@ -33,7 +33,6 @@ IMPL_STATIC_LINK(
"Wrong inventor or identifier" );
pObjFactory->pNewObj = new SwFlyDrawObj();
}
- return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 7a39ae04220d70caef0335ed47452b36cd2e98c7
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 8 08:53:52 2015 +0200
convert Link<> to typed
Change-Id: I49bf8192a2f5295890ead8ddc2452a5de4c93b20
diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx
index d026cc1..d69ea2a 100644
--- a/include/svx/svdetc.hxx
+++ b/include/svx/svdetc.hxx
@@ -144,10 +144,10 @@ private:
sal_uIntPtr nObjCount; // Count of selected objects
sal_uIntPtr nCurObj; // Current object
- Link<> *pLink;
+ Link<void*,bool> maLink;
public:
- SvdProgressInfo( Link<> *_pLink );
+ SvdProgressInfo( const Link<void*,bool>& _pLink );
void Init( sal_uIntPtr _nSumActionCount, sal_uIntPtr _nObjCount );
diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx
index f40bcce..adf53ce 100644
--- a/sd/source/ui/dlg/brkdlg.cxx
+++ b/sd/source/ui/dlg/brkdlg.cxx
@@ -45,7 +45,6 @@ BreakDlg::BreakDlg(
sal_uLong nSumActionCount,
sal_uLong nObjCount )
: SfxModalDialog(pWindow, "BreakDialog", "modules/sdraw/ui/breakdialog.ui")
- , aLink( LINK(this, BreakDlg, UpDate))
, mpProgress( NULL )
{
get(m_pFiObjInfo, "metafiles");
@@ -57,7 +56,7 @@ BreakDlg::BreakDlg(
mpProgress = new SfxProgress( pShell, SD_RESSTR(STR_BREAK_METAFILE), nSumActionCount*3 );
- pProgrInfo = new SvdProgressInfo( &aLink );
+ pProgrInfo = new SvdProgressInfo( LINK(this, BreakDlg, UpDate) );
// every action is editedt 3 times in DoImport()
pProgrInfo->Init( nSumActionCount*3, nObjCount );
@@ -96,10 +95,10 @@ IMPL_LINK_NOARG_TYPED(BreakDlg, CancelButtonHdl, Button*, void)
* Every following call should contain the finished actions since the
* last call of UpDate.
*/
-IMPL_LINK( BreakDlg, UpDate, void*, nInit )
+IMPL_LINK_TYPED( BreakDlg, UpDate, void*, nInit, bool )
{
if(pProgrInfo == NULL)
- return 1L;
+ return true;
// update status bar or show a error message?
if(nInit == reinterpret_cast<void*>(1L))
@@ -146,7 +145,7 @@ IMPL_LINK( BreakDlg, UpDate, void*, nInit )
}
Application::Reschedule();
- return( bCancel?0L:1L );
+ return bCancel;
}
/**
diff --git a/sd/source/ui/inc/BreakDlg.hxx b/sd/source/ui/inc/BreakDlg.hxx
index b537453..eb1643f 100644
--- a/sd/source/ui/inc/BreakDlg.hxx
+++ b/sd/source/ui/inc/BreakDlg.hxx
@@ -69,11 +69,10 @@ private:
Idle aIdle;
SvdProgressInfo *pProgrInfo;
- Link<> aLink;
SfxProgress *mpProgress;
DECL_LINK_TYPED( CancelButtonHdl, Button*, void );
- DECL_LINK( UpDate, void* );
+ DECL_LINK_TYPED( UpDate, void*, bool );
DECL_LINK_TYPED( InitialUpdate, Idle*, void );
};
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index c18754d..e69fe4b 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -561,11 +561,9 @@ sal_uInt16* RemoveWhichRange(const sal_uInt16* pOldWhichTable, sal_uInt16 nRange
-SvdProgressInfo::SvdProgressInfo( Link<> *_pLink )
+SvdProgressInfo::SvdProgressInfo( const Link<void*,bool>&_rLink )
{
- DBG_ASSERT(_pLink!=NULL,"SvdProgressInfo(): No Link stated!");
-
- pLink = _pLink;
+ maLink = _rLink;
nSumActionCount = 0;
nSumCurAction = 0;
@@ -592,7 +590,7 @@ bool SvdProgressInfo::ReportActions( sal_uIntPtr nAnzActions )
if(nCurAction > nActionCount)
nCurAction = nActionCount;
- return pLink->Call(NULL) == 1L;
+ return maLink.Call(NULL);
}
bool SvdProgressInfo::ReportInserts( sal_uIntPtr nAnzInserts )
@@ -600,13 +598,13 @@ bool SvdProgressInfo::ReportInserts( sal_uIntPtr nAnzInserts )
nSumCurAction += nAnzInserts;
nCurInsert += nAnzInserts;
- return pLink->Call(NULL) == 1L;
+ return maLink.Call(NULL);
}
bool SvdProgressInfo::ReportRescales( sal_uIntPtr nAnzRescales )
{
nSumCurAction += nAnzRescales;
- return pLink->Call(NULL) == 1L;
+ return maLink.Call(NULL);
}
void SvdProgressInfo::SetActionCount( sal_uIntPtr _nActionCount )
More information about the Libreoffice-commits
mailing list