summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/app.hxx1
-rw-r--r--include/sfx2/genlink.hxx50
-rw-r--r--include/sfx2/hintpost.hxx12
-rw-r--r--sfx2/source/appl/app.cxx1
-rw-r--r--sfx2/source/control/dispatch.cxx2
-rw-r--r--sfx2/source/notify/hintpost.cxx22
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx1
7 files changed, 13 insertions, 76 deletions
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index cf2b13227a06..0b986c105227 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -42,7 +42,6 @@ class WorkWindow;
class ISfxTemplateCommon;
class BasicManager;
class DdeService;
-class GenLink;
class PrinterDialog;
class Point;
class Rectangle;
diff --git a/include/sfx2/genlink.hxx b/include/sfx2/genlink.hxx
deleted file mode 100644
index 5c738e3dd902..000000000000
--- a/include/sfx2/genlink.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef INCLUDED_SFX2_GENLINK_HXX
-#define INCLUDED_SFX2_GENLINK_HXX
-
-
-#include <tools/link.hxx>
-typedef long (*CFuncPtr)(void*);
-
-class GenLink
-{
- Link<> aLink;
- CFuncPtr pFunc;
-
-public:
- GenLink(): pFunc(0) {}
- GenLink( CFuncPtr pCFunc ): pFunc(pCFunc) {}
- GenLink( const Link<>& rLink ): aLink(rLink), pFunc(0) {}
- GenLink( const GenLink& rOrig ):
- aLink(rOrig.aLink), pFunc(rOrig.pFunc) {}
-
- GenLink& operator = ( const GenLink& rOrig )
- { pFunc = rOrig.pFunc; aLink = rOrig.aLink; return *this; }
-
- bool operator!() const { return !aLink && !pFunc; }
- bool IsSet() const { return aLink.IsSet() || pFunc; }
-
- long Call( void* pCaller )
- { return pFunc ? (*pFunc)(pCaller) : aLink.Call(pCaller); }
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/hintpost.hxx b/include/sfx2/hintpost.hxx
index f9950119eb02..469b190dfe4a 100644
--- a/include/sfx2/hintpost.hxx
+++ b/include/sfx2/hintpost.hxx
@@ -19,7 +19,7 @@
#ifndef INCLUDED_SFX2_HINTPOST_HXX
#define INCLUDED_SFX2_HINTPOST_HXX
-#include <sfx2/genlink.hxx>
+#include <tools/link.hxx>
#include <tools/ref.hxx>
@@ -34,13 +34,13 @@ class SfxHint;
The instances are held via Ref-Count until a possibly sent
event has arrived. If the target dies before delivery,
- the connection must be severed with SetEventHdl(GenLink()).
+ the connection must be severed with SetEventHdl(Link()).
*/
class SfxHintPoster : public SvRefBase
{
- GenLink aLink;
-
private:
+ Link<> m_Link;
+
DECL_LINK( DoEvent_Impl, SfxHint * );
protected:
@@ -48,10 +48,10 @@ protected:
void Event( SfxHint* pPostedHint );
public:
- SfxHintPoster( const GenLink& rLink );
+ SfxHintPoster(const Link<>& rLink);
void Post( SfxHint* pHint = 0 );
- void SetEventHdl( const GenLink& rLink );
+ void SetEventHdl(const Link<>& rLink);
};
typedef tools::SvRef<SfxHintPoster> SfxHintPosterRef;
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 7be02d956212..a22f36d8c6b2 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -77,7 +77,6 @@
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewsh.hxx>
-#include <sfx2/genlink.hxx>
#include <sfx2/viewfrm.hxx>
#include "appdata.hxx"
#include "openflag.hxx"
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 109d336e26f9..9f3de39ff70a 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -329,7 +329,7 @@ void SfxDispatcher::Construct_Impl( SfxDispatcher* pParent )
for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++)
xImp->aObjBars[n].nResId = 0;
- GenLink aGenLink( LINK(this, SfxDispatcher, PostMsgHandler) );
+ Link<> aGenLink( LINK(this, SfxDispatcher, PostMsgHandler) );
xImp->xPoster = new SfxHintPoster(aGenLink);
diff --git a/sfx2/source/notify/hintpost.cxx b/sfx2/source/notify/hintpost.cxx
index 2e868834e0d1..00e4290d87c6 100644
--- a/sfx2/source/notify/hintpost.cxx
+++ b/sfx2/source/notify/hintpost.cxx
@@ -17,36 +17,28 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sfx2/hintpost.hxx>
#include "arrdecl.hxx"
-#include <sfx2/hintpost.hxx>
#include <sfx2/app.hxx>
#include "sfxtypes.hxx"
-
-SfxHintPoster::SfxHintPoster( const GenLink& rLink ):
- aLink(rLink)
+SfxHintPoster::SfxHintPoster(const Link<>& rLink)
+ : m_Link(rLink)
{
}
-
-
-
SfxHintPoster::~SfxHintPoster()
{
}
-
-
void SfxHintPoster::Post( SfxHint* pHintToPost )
{
Application::PostUserEvent( ( LINK(this, SfxHintPoster, DoEvent_Impl) ), pHintToPost );
AddFirstRef();
}
-
-
IMPL_LINK( SfxHintPoster, DoEvent_Impl, SfxHint *, pPostedHint )
{
Event( pPostedHint );
@@ -56,14 +48,12 @@ IMPL_LINK( SfxHintPoster, DoEvent_Impl, SfxHint *, pPostedHint )
void SfxHintPoster::Event( SfxHint* pPostedHint )
{
- aLink.Call( pPostedHint );
+ m_Link.Call( pPostedHint );
}
-
-
-void SfxHintPoster::SetEventHdl( const GenLink& rLink )
+void SfxHintPoster::SetEventHdl(const Link<>& rLink)
{
- aLink = rLink;
+ m_Link = rLink;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 749b809b0924..17a5be0de379 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -77,7 +77,6 @@
#include "statcach.hxx"
#include <sfx2/viewfrm.hxx>
#include "sfxtypes.hxx"
-#include <sfx2/genlink.hxx>
#include <sfx2/sfxresid.hxx>
#include <sfx2/sfx.hrc>
#include <sfx2/module.hxx>