summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-09-08 11:13:25 +0200
committerNoel Grandin <noel@peralex.com>2015-09-09 10:06:12 +0200
commit6f4e11a95bcd7a591cb93d1a842bbc8ad1ed31c9 (patch)
tree139df8cac0eb95a75844bec5b400affb669cc417
parentf73144801474aa4b3d6b997ceab7fabae8bfc3e7 (diff)
convert Link<> to typed
Change-Id: I2aeda615e39db5a3cd39e168db34425e2912be8b
-rw-r--r--basctl/source/basicide/baside3.cxx9
-rw-r--r--basctl/source/inc/baside3.hxx3
-rw-r--r--chart2/source/controller/inc/ChartController.hxx2
-rw-r--r--chart2/source/controller/main/ChartController.cxx5
-rw-r--r--include/svx/svdmodel.hxx47
-rw-r--r--sc/source/ui/docshell/docfunc.cxx4
-rw-r--r--sc/source/ui/inc/docfunc.hxx2
-rw-r--r--sw/inc/doc.hxx2
-rw-r--r--sw/source/core/doc/DocumentDrawModelManager.cxx2
-rw-r--r--sw/source/core/undo/undraw.cxx3
10 files changed, 36 insertions, 43 deletions
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 67a20c4b5b2d..92d6837f83ee 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 1258fc778828..fe8dabba58e3 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 263e30915232..cca42182e702 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 6f316e332f9b..b99858f6cfc4 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 2c9eb47f942d..194a3e100a97 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 4ba25063eb3d..e8d6a7832847 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 07091c4fd1b6..6d9c032f2e2e 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 1873a7d71577..3b4d99a3a148 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 91c6bf9cbf72..d4be33664b5b 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 c054c9900d29..a5dd2607298e 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 )