[Libreoffice-commits] core.git: 5 commits - desktop/inc desktop/source framework/inc framework/source include/svtools include/test include/vcl sd/source svtools/source test/source vcl/source

Noel Grandin noel at peralex.com
Tue Sep 22 11:23:36 PDT 2015


 desktop/inc/app.hxx                           |    2 -
 desktop/source/app/app.cxx                    |    4 +-
 framework/inc/dispatch/closedispatcher.hxx    |    2 -
 framework/source/dispatch/closedispatcher.cxx |    8 ++---
 framework/source/services/autorecovery.cxx    |   15 +++++------
 include/svtools/acceleratorexecute.hxx        |    2 -
 include/test/bootstrapfixture.hxx             |    2 -
 include/vcl/animate.hxx                       |    3 --
 include/vcl/bitmap.hxx                        |   31 ++++++++---------------
 include/vcl/bitmapex.hxx                      |    6 ----
 include/vcl/cvtgrf.hxx                        |    8 ++---
 include/vcl/evntpost.hxx                      |   14 ++--------
 include/vcl/gdimtf.hxx                        |    3 --
 include/vcl/svapp.hxx                         |    3 +-
 sd/source/ui/dlg/vectdlg.cxx                  |    7 ++---
 sd/source/ui/inc/vectdlg.hxx                  |    2 -
 svtools/source/misc/acceleratorexecute.cxx    |   13 +++------
 test/source/bootstrapfixture.cxx              |    6 ++--
 vcl/source/app/svapp.cxx                      |    2 -
 vcl/source/gdi/animate.cxx                    |    6 ++--
 vcl/source/gdi/bitmap3.cxx                    |    6 ++--
 vcl/source/gdi/bitmap4.cxx                    |   35 ++++++++++++--------------
 vcl/source/gdi/bitmapex.cxx                   |    4 +-
 vcl/source/gdi/cvtgrf.cxx                     |    8 ++---
 vcl/source/gdi/gdimtf.cxx                     |   11 +-------
 vcl/source/gdi/impvect.cxx                    |   16 ++---------
 vcl/source/gdi/impvect.hxx                    |    4 +-
 vcl/source/helper/evntpost.cxx                |   11 +++-----
 28 files changed, 95 insertions(+), 139 deletions(-)

New commits:
commit 4d1d60719802ae34a9fc381c8f202ca80b7388ad
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Sep 21 11:18:05 2015 +0200

    remove unused Link<> field
    
    Change-Id: Ia07a1db94bacad8c1d9c108ee6e2ac2f82b6581f

diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 4750933..9809ca6 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -22,7 +22,6 @@
 
 #include <vcl/dllapi.h>
 #include <tools/gen.hxx>
-#include <tools/link.hxx>
 #include <vcl/mapmod.hxx>
 #include <vcl/bitmap.hxx>
 #include <vcl/vclptr.hxx>
@@ -69,7 +68,6 @@ private:
 
     MapMode         aPrefMapMode;
     Size            aPrefSize;
-    Link<>          aHookHdlLink;
     GDIMetaFile*    pPrev;
     GDIMetaFile*    pNext;
     VclPtr<OutputDevice> pOutDev;
@@ -111,7 +109,6 @@ private:
 protected:
 
     void                                Linker( OutputDevice* pOut, bool bLink );
-    long                                Hook();
 
 public:
                     GDIMetaFile();
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 3201a72..4cd5334 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -126,7 +126,6 @@ GDIMetaFile::GDIMetaFile( const GDIMetaFile& rMtf ) :
     nCurrentActionElement( rMtf.nCurrentActionElement ),
     aPrefMapMode    ( rMtf.aPrefMapMode ),
     aPrefSize       ( rMtf.aPrefSize ),
-    aHookHdlLink    ( rMtf.aHookHdlLink ),
     pPrev           ( rMtf.pPrev ),
     pNext           ( rMtf.pNext ),
     pOutDev         ( NULL ),
@@ -206,7 +205,6 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )
 
         aPrefMapMode = rMtf.aPrefMapMode;
         aPrefSize = rMtf.aPrefSize;
-        aHookHdlLink = rMtf.aHookHdlLink;
         pPrev = rMtf.pPrev;
         pNext = rMtf.pNext;
         pOutDev = NULL;
@@ -295,11 +293,6 @@ void GDIMetaFile::Linker( OutputDevice* pOut, bool bLink )
     }
 }
 
-long GDIMetaFile::Hook()
-{
-    return aHookHdlLink.Call( this );
-}
-
 void GDIMetaFile::Record( OutputDevice* pOut )
 {
     if( bRecord )
@@ -325,7 +318,7 @@ void GDIMetaFile::Play( GDIMetaFile& rMtf, size_t nPos )
 
         for( size_t nCurPos = nCurrentActionElement; nCurPos < nPos; nCurPos++ )
         {
-            if( !Hook() && pAction )
+            if( pAction )
             {
                 pAction->Duplicate();
                 rMtf.AddAction( pAction );
@@ -361,7 +354,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos )
             size_t  i  = 0;
             for( size_t nCurPos = nCurrentActionElement; nCurPos < nPos; nCurPos++ )
             {
-                if( !Hook() && pAction )
+                if( pAction )
                 {
                     if( pAction->GetType() == MetaActionType::COMMENT &&
                         static_cast<MetaCommentAction*>(pAction)->GetComment() == "DELEGATE_PLUGGABLE_RENDERER" )
commit 1c061348aa573967132349736675f81bcf5e46af
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Sep 21 10:43:11 2015 +0200

    convert Link<> to typed
    
    and drop an unused parameter
    
    Change-Id: I2f3bc15e4168103a6cb2d19807d291d8da24387e

diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index b11fb64..64ff2dc 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -624,15 +624,11 @@ public:
         Whether the inline or the outline of the color areas should be
         represented by the polygon
 
-        @param pProgress
-        A callback for showing the progress of the vectorization
-
         @return true, if the operation was completed successfully.
      */
     bool                    Vectorize(
                                 tools::PolyPolygon& rPolyPoly,
-                                BmpVectorizeFlags nFlags = BmpVectorizeFlags::Outer,
-                                const Link<>* pProgress = NULL );
+                                BmpVectorizeFlags nFlags = BmpVectorizeFlags::Outer );
 
     /** Convert the bitmap to a meta file
 
@@ -659,7 +655,7 @@ public:
                                 GDIMetaFile& rMtf,
                                 sal_uInt8 cReduce = 0,
                                 BmpVectorizeFlags nFlags = BmpVectorizeFlags::Inner,
-                                const Link<>* pProgress = NULL );
+                                const Link<long,void>* pProgress = NULL );
 
     /** Change various global color characteristics
 
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx
index 82533c2..c856505 100644
--- a/sd/source/ui/dlg/vectdlg.cxx
+++ b/sd/source/ui/dlg/vectdlg.cxx
@@ -158,7 +158,7 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf )
 
     if( !!aTmp )
     {
-        const Link<> aPrgsHdl( LINK( this, SdVectorizeDlg, ProgressHdl ) );
+        const Link<long,void> aPrgsHdl( LINK( this, SdVectorizeDlg, ProgressHdl ) );
         aTmp.Vectorize( rMtf, (sal_uInt8) m_pMtReduce->GetValue(), BmpVectorizeFlags::Outer | BmpVectorizeFlags::ReduceEdges, &aPrgsHdl );
 
         if( m_pCbFillHoles->IsChecked() )
@@ -260,10 +260,9 @@ void SdVectorizeDlg::AddTile( BitmapReadAccess* pRAcc, GDIMetaFile& rMtf,
     rMtf.AddAction( new MetaRectAction( aRect ) );
 }
 
-IMPL_LINK( SdVectorizeDlg, ProgressHdl, void*, pData )
+IMPL_LINK_TYPED( SdVectorizeDlg, ProgressHdl, long, nData, void )
 {
-    m_pPrgs->SetValue( (sal_uInt16)reinterpret_cast<sal_uLong>(pData) );
-    return 0L;
+    m_pPrgs->SetValue( (sal_uInt16)nData );
 }
 
 IMPL_LINK_NOARG_TYPED(SdVectorizeDlg, ClickPreviewHdl, Button*, void)
diff --git a/sd/source/ui/inc/vectdlg.hxx b/sd/source/ui/inc/vectdlg.hxx
index 13997a7..944a1b2 100644
--- a/sd/source/ui/inc/vectdlg.hxx
+++ b/sd/source/ui/inc/vectdlg.hxx
@@ -72,7 +72,7 @@ class SdVectorizeDlg : public ModalDialog
     void                AddTile( BitmapReadAccess* pRAcc, GDIMetaFile& rMtf,
                                  long nPosX, long nPosY, long nWidth, long nHeight );
 
-                        DECL_LINK( ProgressHdl, void* );
+                        DECL_LINK_TYPED( ProgressHdl, long, void );
                         DECL_LINK_TYPED( ClickPreviewHdl, Button*, void );
                         DECL_LINK_TYPED( ClickOKHdl, Button*, void );
                         DECL_LINK_TYPED( ToggleHdl, CheckBox&, void );
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 9d1ec35..643f46b 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -2452,12 +2452,12 @@ void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal,
     }
 }
 
-bool Bitmap::Vectorize( tools::PolyPolygon& rPolyPoly, BmpVectorizeFlags nFlags, const Link<>* pProgress )
+bool Bitmap::Vectorize( tools::PolyPolygon& rPolyPoly, BmpVectorizeFlags nFlags )
 {
-    return ImplVectorizer::ImplVectorize( *this, rPolyPoly, nFlags, pProgress );
+    return ImplVectorizer::ImplVectorize( *this, rPolyPoly, nFlags );
 }
 
-bool Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, BmpVectorizeFlags nFlags, const Link<>* pProgress )
+bool Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, BmpVectorizeFlags nFlags, const Link<long,void>* pProgress )
 {
     return ImplVectorizer::ImplVectorize( *this, rMtf, cReduce, nFlags, pProgress );
 }
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index 0b3b70d..7e3c7dd 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -42,8 +42,8 @@
 #define VECT_MAP( _def_pIn, _def_pOut, _def_nVal )  _def_pOut[_def_nVal]=(_def_pIn[_def_nVal]=((_def_nVal)*4L)+1L)+5L;
 #define BACK_MAP( _def_nVal )                       ((((_def_nVal)+2)>>2)-1)
 #define VECT_PROGRESS( _def_pProgress, _def_nVal ) \
-  if(_def_pProgress&&_def_pProgress->IsSet())      \
-      (_def_pProgress->Call(reinterpret_cast<void*>(_def_nVal)));
+  if(_def_pProgress && _def_pProgress->IsSet())      \
+      (_def_pProgress->Call(_def_nVal));
 
 class ImplVectMap;
 class ImplChain;
@@ -632,7 +632,7 @@ void ImplChain::ImplPostProcess( const ImplPointArray& rArr )
 namespace ImplVectorizer {
 
 bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
-                                    sal_uInt8 cReduce, BmpVectorizeFlags nFlags, const Link<>* pProgress )
+                                    sal_uInt8 cReduce, BmpVectorizeFlags nFlags, const Link<long,void>* pProgress )
 {
     bool bRet = false;
 
@@ -735,26 +735,20 @@ bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
 
 bool ImplVectorize( const Bitmap& rMonoBmp,
                                     tools::PolyPolygon& rPolyPoly,
-                                    BmpVectorizeFlags nFlags, const Link<>* pProgress )
+                                    BmpVectorizeFlags nFlags )
 {
     std::unique_ptr<Bitmap> xBmp(new Bitmap( rMonoBmp ));
     BitmapReadAccess*   pRAcc;
     bool                bRet = false;
 
-    VECT_PROGRESS( pProgress, 10 );
-
     if( xBmp->GetBitCount() > 1 )
         xBmp->Convert( BMP_CONVERSION_1BIT_THRESHOLD );
 
-    VECT_PROGRESS( pProgress, 30 );
-
     pRAcc = xBmp->AcquireReadAccess();
     std::unique_ptr <ImplVectMap> xMap(ImplExpand( pRAcc, COL_BLACK ));
     Bitmap::ReleaseAccess( pRAcc );
     xBmp.reset();
 
-    VECT_PROGRESS( pProgress, 60 );
-
     if( xMap )
     {
         rPolyPoly.Clear();
@@ -822,8 +816,6 @@ bool ImplVectorize( const Bitmap& rMonoBmp,
         bRet = true;
     }
 
-    VECT_PROGRESS( pProgress, 100 );
-
     return bRet;
 }
 
diff --git a/vcl/source/gdi/impvect.hxx b/vcl/source/gdi/impvect.hxx
index 297023d..235b6f5 100644
--- a/vcl/source/gdi/impvect.hxx
+++ b/vcl/source/gdi/impvect.hxx
@@ -27,9 +27,9 @@
 namespace ImplVectorizer
 {
     bool     ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
-                            sal_uInt8 cReduce, BmpVectorizeFlags nFlags, const Link<>* pProgress );
+                            sal_uInt8 cReduce, BmpVectorizeFlags nFlags, const Link<long,void>* pProgress );
     bool     ImplVectorize( const Bitmap& rMonoBmp, tools::PolyPolygon& rPolyPoly,
-                            BmpVectorizeFlags nFlags, const Link<>* pProgress );
+                            BmpVectorizeFlags nFlags );
 };
 
 #endif
commit ba6cbddd8890b3a5693a187b32c9b92a67511f3d
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Sep 21 10:06:26 2015 +0200

    remove some unused params
    
    Change-Id: Id4f6da92526cea3e9b01bd23f6569843dfb17d89

diff --git a/include/vcl/animate.hxx b/include/vcl/animate.hxx
index 3bc5ecb..3aa12f5 100644
--- a/include/vcl/animate.hxx
+++ b/include/vcl/animate.hxx
@@ -184,8 +184,7 @@ public:
 
     bool            Filter(
                         BmpFilter eFilter,
-                        const BmpFilterParam* pFilterParam = NULL,
-                        const Link<>* pProgress = NULL );
+                        const BmpFilterParam* pFilterParam = NULL );
 
     friend VCL_DLLPUBLIC SvStream& ReadAnimation( SvStream& rIStream, Animation& rAnimation );
     friend VCL_DLLPUBLIC SvStream& WriteAnimation( SvStream& rOStream, const Animation& rAnimation );
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index ddb6b32..b11fb64 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -716,8 +716,7 @@ public:
      */
     bool                    Filter(
                                 BmpFilter eFilter,
-                                const BmpFilterParam* pFilterParam = NULL,
-                                const Link<>* pProgress = NULL );
+                                const BmpFilterParam* pFilterParam = NULL );
 
 public:
 
@@ -759,17 +758,15 @@ public:
                                 long nColors, long nPixels, long& rIndex );
 
     SAL_DLLPRIVATE bool     ImplConvolute3(
-                                const long* pMatrix, long nDivisor,
-                                const BmpFilterParam* pFilterParam,
-                                const Link<>* pProgress );
-
-    SAL_DLLPRIVATE bool     ImplMedianFilter( const BmpFilterParam* pFilterParam, const Link<>* pProgress );
-    SAL_DLLPRIVATE bool     ImplSobelGrey( const BmpFilterParam* pFilterParam, const Link<>* pProgress );
-    SAL_DLLPRIVATE bool     ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link<>* pProgress );
-    SAL_DLLPRIVATE bool     ImplSolarize( const BmpFilterParam* pFilterParam, const Link<>* pProgress );
-    SAL_DLLPRIVATE bool     ImplSepia( const BmpFilterParam* pFilterParam, const Link<>* pProgress );
-    SAL_DLLPRIVATE bool     ImplMosaic( const BmpFilterParam* pFilterParam, const Link<>* pProgress );
-    SAL_DLLPRIVATE bool     ImplPopArt( const BmpFilterParam* pFilterParam, const Link<>* pProgress );
+                                const long* pMatrix, long nDivisor );
+
+    SAL_DLLPRIVATE bool     ImplMedianFilter();
+    SAL_DLLPRIVATE bool     ImplSobelGrey();
+    SAL_DLLPRIVATE bool     ImplEmbossGrey( const BmpFilterParam* pFilterParam );
+    SAL_DLLPRIVATE bool     ImplSolarize( const BmpFilterParam* pFilterParam );
+    SAL_DLLPRIVATE bool     ImplSepia( const BmpFilterParam* pFilterParam );
+    SAL_DLLPRIVATE bool     ImplMosaic( const BmpFilterParam* pFilterParam );
+    SAL_DLLPRIVATE bool     ImplPopArt();
 
     SAL_DLLPRIVATE bool     ImplSeparableBlurFilter( const double aRadius = 0.7 );
     SAL_DLLPRIVATE bool     ImplSeparableUnsharpenFilter( const double aRadius = 0.7 );
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index 8d9b8ec..23d8dd9 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -361,15 +361,11 @@ public:
         @param pFilterParam
         Various parameter for the different bitmap filter algorithms
 
-        @param pProgress
-        A callback for showing the progress of the vectorization
-
         @return true, if the operation was completed successfully.
      */
     bool                Filter(
                             BmpFilter eFilter,
-                            const BmpFilterParam* pFilterParam = NULL,
-                            const Link<>* pProgress = NULL );
+                            const BmpFilterParam* pFilterParam = NULL );
 
     /** Get transparency at given position
 
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 4e5b333..0630a9c 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -666,7 +666,7 @@ bool Animation::Adjust( short nLuminancePercent, short nContrastPercent,
     return bRet;
 }
 
-bool Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link<>* pProgress )
+bool Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam )
 {
     DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
 
@@ -677,9 +677,9 @@ bool Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, c
         bRet = true;
 
         for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
-            bRet = maList[ i ]->aBmpEx.Filter( eFilter, pFilterParam, pProgress );
+            bRet = maList[ i ]->aBmpEx.Filter( eFilter, pFilterParam );
 
-        (void)maBitmapEx.Filter(eFilter, pFilterParam, pProgress);
+        (void)maBitmapEx.Filter(eFilter, pFilterParam);
     }
     else
         bRet = false;
diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx
index 24a4b08..d669f8a 100644
--- a/vcl/source/gdi/bitmap4.cxx
+++ b/vcl/source/gdi/bitmap4.cxx
@@ -38,7 +38,7 @@ static inline sal_uInt8 lcl_getDuotoneColorComponent( sal_uInt8 base, sal_uInt16
     return (sal_uInt8) (color1+color2);
 }
 
-bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link<>* pProgress )
+bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam )
 {
     bool bRet = false;
 
@@ -66,36 +66,36 @@ bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, cons
         case( BMP_FILTER_SHARPEN ):
         {
             const long pSharpenMatrix[] = { -1, -1,  -1, -1, 16, -1, -1, -1,  -1 };
-            bRet = ImplConvolute3( &pSharpenMatrix[ 0 ], 8, pFilterParam, pProgress );
+            bRet = ImplConvolute3( &pSharpenMatrix[ 0 ], 8 );
         }
         break;
 
         case( BMP_FILTER_REMOVENOISE ):
-            bRet = ImplMedianFilter( pFilterParam, pProgress );
+            bRet = ImplMedianFilter();
         break;
 
         case( BMP_FILTER_SOBEL_GREY ):
-            bRet = ImplSobelGrey( pFilterParam, pProgress );
+            bRet = ImplSobelGrey();
         break;
 
         case( BMP_FILTER_SOLARIZE ):
-            bRet = ImplSolarize( pFilterParam, pProgress );
+            bRet = ImplSolarize( pFilterParam );
         break;
 
         case( BMP_FILTER_SEPIA ):
-            bRet = ImplSepia( pFilterParam, pProgress );
+            bRet = ImplSepia( pFilterParam );
         break;
 
         case( BMP_FILTER_MOSAIC ):
-            bRet = ImplMosaic( pFilterParam, pProgress );
+            bRet = ImplMosaic( pFilterParam );
         break;
 
         case( BMP_FILTER_EMBOSS_GREY ):
-            bRet = ImplEmbossGrey( pFilterParam, pProgress );
+            bRet = ImplEmbossGrey( pFilterParam );
         break;
 
         case( BMP_FILTER_POPART ):
-            bRet = ImplPopArt( pFilterParam, pProgress );
+            bRet = ImplPopArt();
         break;
 
         case( BMP_FILTER_DUOTONE ):
@@ -110,8 +110,7 @@ bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, cons
     return bRet;
 }
 
-bool Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
-                             const BmpFilterParam* /*pFilterParam*/, const Link<>* /*pProgress*/ )
+bool Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor )
 {
     BitmapReadAccess*   pReadAcc = AcquireReadAccess();
     bool                bRet = false;
@@ -256,7 +255,7 @@ bool Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
     return bRet;
 }
 
-bool Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Link<>* /*pProgress*/ )
+bool Bitmap::ImplMedianFilter()
 {
     BitmapReadAccess*   pReadAcc = AcquireReadAccess();
     bool                bRet = false;
@@ -385,7 +384,7 @@ bool Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Lin
     return bRet;
 }
 
-bool Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link<>* /*pProgress*/ )
+bool Bitmap::ImplSobelGrey()
 {
     bool bRet = ImplMakeGreyscales( 256 );
 
@@ -511,7 +510,7 @@ bool Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link<>
     return bRet;
 }
 
-bool Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link<>* /*pProgress*/ )
+bool Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam )
 {
     bool bRet = ImplMakeGreyscales( 256 );
 
@@ -623,7 +622,7 @@ bool Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link<>* /
     return bRet;
 }
 
-bool Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link<>* /*pProgress*/ )
+bool Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam )
 {
     bool                bRet = false;
     BitmapWriteAccess*  pWriteAcc = AcquireWriteAccess();
@@ -671,7 +670,7 @@ bool Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link<>* /*p
     return bRet;
 }
 
-bool Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link<>* /*pProgress*/ )
+bool Bitmap::ImplSepia( const BmpFilterParam* pFilterParam )
 {
     BitmapReadAccess*   pReadAcc = AcquireReadAccess();
     bool                bRet = false;
@@ -756,7 +755,7 @@ bool Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link<>* /*pPro
     return bRet;
 }
 
-bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link<>* /*pProgress*/ )
+bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam )
 {
     sal_uLong               nTileWidth = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
                                      pFilterParam->maMosaicTileSize.mnTileWidth : 4;
@@ -941,7 +940,7 @@ extern "C" int SAL_CALL ImplPopArtCmpFnc( const void* p1, const void* p2 )
     return nRet;
 }
 
-bool Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link<>* /*pProgress*/ )
+bool Bitmap::ImplPopArt()
 {
     bool bRet = ( GetBitCount() <= 8 ) || Convert( BMP_CONVERSION_8BIT_COLORS );
 
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 02c29e2..804e646 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -642,9 +642,9 @@ bool BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent,
                                         fGamma, bInvert, msoBrightness );
 }
 
-bool BitmapEx::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link<>* pProgress )
+bool BitmapEx::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam )
 {
-    return !!aBitmap && aBitmap.Filter( eFilter, pFilterParam, pProgress );
+    return !!aBitmap && aBitmap.Filter( eFilter, pFilterParam );
 }
 
 void BitmapEx::Draw( OutputDevice* pOutDev, const Point& rDestPt ) const
commit 55dda8e8d0a29ae150f58168d72ab2611ed2b8a8
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Sep 21 09:14:04 2015 +0200

    convert Link<> to typed
    
    Change-Id: I92df586295c11bc9e9276770656901c2e4e714b9

diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 184c86f..92577f8 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -148,7 +148,7 @@ class Desktop : public Application
         void                    OpenSplashScreen();
         void                    CloseSplashScreen();
 
-        DECL_STATIC_LINK( Desktop, ImplInitFilterHdl, ConvertData* );
+        DECL_STATIC_LINK_TYPED( Desktop, ImplInitFilterHdl, ::ConvertData&, bool );
         DECL_STATIC_LINK_TYPED( Desktop, AsyncInitFirstRun, Timer*, void );
         /** checks if the office is run the first time
             <p>If so, <method>DoFirstRunInitializations</method> is called (asynchronously and delayed) and the
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 1531963..de739c8 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1697,9 +1697,9 @@ int Desktop::doShutdown()
     return EXIT_SUCCESS;
 }
 
-IMPL_STATIC_LINK( Desktop, ImplInitFilterHdl, ConvertData*, pData )
+IMPL_STATIC_LINK_TYPED( Desktop, ImplInitFilterHdl, ::ConvertData&, rData, bool )
 {
-    return GraphicFilter::GetGraphicFilter().GetFilterCallback().Call( pData );
+    return GraphicFilter::GetGraphicFilter().GetFilterCallback().Call( &rData );
 }
 
 bool Desktop::InitializeConfiguration()
diff --git a/include/test/bootstrapfixture.hxx b/include/test/bootstrapfixture.hxx
index 069e470..f44c5b8 100644
--- a/include/test/bootstrapfixture.hxx
+++ b/include/test/bootstrapfixture.hxx
@@ -46,7 +46,7 @@ class OOO_DLLPUBLIC_TEST BootstrapFixture : public BootstrapFixtureBase
   bool m_bAssertOnDialog;
 
 public:
-  DECL_STATIC_LINK( BootstrapFixture, ImplInitFilterHdl, ConvertData* );
+  DECL_STATIC_LINK_TYPED( BootstrapFixture, ImplInitFilterHdl, ConvertData&, bool );
 
   BootstrapFixture( bool bAssertOnDialog = true, bool bNeedUCB = true );
   virtual ~BootstrapFixture();
diff --git a/include/vcl/cvtgrf.hxx b/include/vcl/cvtgrf.hxx
index e311c39..b869a61 100644
--- a/include/vcl/cvtgrf.hxx
+++ b/include/vcl/cvtgrf.hxx
@@ -35,8 +35,8 @@ class VCL_DLLPUBLIC GraphicConverter
 {
 private:
 
-    Link<>              maFilterHdl;
-    ConvertData*        mpConvertData;
+    Link<ConvertData&,bool>  maFilterHdl;
+    ConvertData*             mpConvertData;
 
 public:
 
@@ -48,8 +48,8 @@ public:
 
     ConvertData*        GetConvertData() { return mpConvertData; }
 
-    void                SetFilterHdl( const Link<>& rLink ) { maFilterHdl = rLink; }
-    const Link<>&       GetFilterHdl() const { return maFilterHdl; }
+    void                SetFilterHdl( const Link<ConvertData&,bool>& rLink ) { maFilterHdl = rLink; }
+    const Link<ConvertData&,bool>&  GetFilterHdl() const { return maFilterHdl; }
 };
 
 #endif // INCLUDED_VCL_CVTGRF_HXX
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index c2b6d04..1d8392c 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -58,6 +58,7 @@ class MouseEvent;
 class ZoomEvent;
 class ScrollEvent;
 struct ImplSVEvent;
+struct ConvertData;
 
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/connection/XConnection.hpp>
@@ -1344,7 +1345,7 @@ public:
 
      @see GetFilterHdl
     */
-    static void                 SetFilterHdl( const Link<>& rLink );
+    static void                 SetFilterHdl( const Link<ConvertData&,bool>& rLink );
 
     ///@}
 
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index eb50025..45fb98a 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -233,10 +233,10 @@ void test::BootstrapFixture::validate(const OUString& rPath, test::ValidationFor
 #endif
 }
 
-IMPL_STATIC_LINK(
-        test::BootstrapFixture, ImplInitFilterHdl, ConvertData*, pData)
+IMPL_STATIC_LINK_TYPED(
+        test::BootstrapFixture, ImplInitFilterHdl, ConvertData&, rData, bool)
 {
-    return GraphicFilter::GetGraphicFilter().GetFilterCallback().Call( pData );
+    return GraphicFilter::GetGraphicFilter().GetFilterCallback().Call( &rData );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index b25b738..320ea64 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1430,7 +1430,7 @@ void Application::SetUnoWrapper( UnoWrapperBase* pWrapper )
     return pSVData->mxDisplayConnection.get();
 }
 
-void Application::SetFilterHdl( const Link<>& rLink )
+void Application::SetFilterHdl( const Link<ConvertData&,bool>& rLink )
 {
     ImplGetSVData()->maGDIData.mpGrfConverter->SetFilterHdl( rLink );
 }
diff --git a/vcl/source/gdi/cvtgrf.cxx b/vcl/source/gdi/cvtgrf.cxx
index 1dcd949..3d13c82 100644
--- a/vcl/source/gdi/cvtgrf.cxx
+++ b/vcl/source/gdi/cvtgrf.cxx
@@ -36,13 +36,13 @@ GraphicConverter::~GraphicConverter()
 sal_uLong GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, ConvertDataFormat nFormat )
 {
     GraphicConverter*   pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
-    sal_uLong               nRet = ERRCODE_IO_GENERAL;
+    sal_uLong           nRet = ERRCODE_IO_GENERAL;
 
     if( pCvt && pCvt->GetFilterHdl().IsSet() )
     {
         ConvertData aData( rGraphic, rIStm, nFormat );
 
-        if( pCvt->GetFilterHdl().Call( &aData ) )
+        if( pCvt->GetFilterHdl().Call( aData ) )
         {
             rGraphic = aData.maGraphic;
             nRet = ERRCODE_NONE;
@@ -57,13 +57,13 @@ sal_uLong GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, ConvertD
 sal_uLong GraphicConverter::Export( SvStream& rOStm, const Graphic& rGraphic, ConvertDataFormat nFormat )
 {
     GraphicConverter*   pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
-    sal_uLong               nRet = ERRCODE_IO_GENERAL;
+    sal_uLong           nRet = ERRCODE_IO_GENERAL;
 
     if( pCvt && pCvt->GetFilterHdl().IsSet() )
     {
         ConvertData aData( rGraphic, rOStm, nFormat );
 
-        if( pCvt->GetFilterHdl().Call( &aData ) )
+        if( pCvt->GetFilterHdl().Call( aData ) )
             nRet = ERRCODE_NONE;
         else if( rOStm.GetError() )
             nRet = rOStm.GetError();
commit 6d8124e30c6ce38219ca323f9674f242c822c360
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Sep 21 08:55:52 2015 +0200

    convert Link<> to typed
    
    and remove unused UserEvent class
    
    Change-Id: Ic61c5eef75c36393dbbaa92d93163eab89021ee3

diff --git a/framework/inc/dispatch/closedispatcher.hxx b/framework/inc/dispatch/closedispatcher.hxx
index 0617bc0..edce4d7 100644
--- a/framework/inc/dispatch/closedispatcher.hxx
+++ b/framework/inc/dispatch/closedispatcher.hxx
@@ -165,7 +165,7 @@ class CloseDispatcher : public  ::cppu::WeakImplHelper<
                     asynchronous. Otherwise our callis kill its own environment
                     during they call us ...
         */
-        DECL_LINK( impl_asyncCallback, void* );
+        DECL_LINK_TYPED( impl_asyncCallback, LinkParamNone*, void );
 
         /** @short  prepare m_xCloseFrame so it should be closeable without problems.
 
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx
index a59e201..9e7b29f 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -221,7 +221,7 @@ void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL&
     else
     {
         SolarMutexGuard g;
-        m_aAsyncCallback->Post(0);
+        m_aAsyncCallback->Post();
     }
 }
 
@@ -241,7 +241,7 @@ void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL&
                 - decide then, if we must close this frame only, establish the backing mode
                   or shutdown the whole application.
 */
-IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback)
+IMPL_LINK_NOARG_TYPED(CloseDispatcher, impl_asyncCallback, LinkParamNone*, void)
 {
     try
     {
@@ -273,7 +273,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback)
     // frame already dead ?!
     // Nothing to do !
     if (! xCloseFrame.is())
-        return 0;
+        return;
 
     bool bCloseFrame           = false;
     bool bEstablishBackingMode = false;
@@ -418,8 +418,6 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback)
     catch(const css::lang::DisposedException&)
     {
     }
-
-    return 0;
 }
 
 bool CloseDispatcher::implts_prepareFrameForClosing(const css::uno::Reference< css::frame::XFrame >& xFrame                ,
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 531c443..39110f7 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -638,7 +638,7 @@ private:
 
     /** @short  makes our dispatch() method asynchronous!
      */
-    DECL_LINK(implts_asyncDispatch, void*);
+    DECL_LINK_TYPED(implts_asyncDispatch, LinkParamNone*, void);
 
     /** @short  implements the dispatch real. */
     void implts_dispatch(const DispatchParams& aParams);
@@ -1389,7 +1389,7 @@ void SAL_CALL AutoRecovery::dispatch(const css::util::URL&
     } /* SAFE */
 
     if (bAsync)
-        m_aAsyncDispatcher.Post(0);
+        m_aAsyncDispatcher.Post();
     else
         implts_dispatch(aParams);
 }
@@ -2420,14 +2420,14 @@ IMPL_LINK_NOARG_TYPED(AutoRecovery, implts_timerExpired, Timer *, void)
     }
 }
 
-IMPL_LINK_NOARG(AutoRecovery, implts_asyncDispatch)
+IMPL_LINK_NOARG_TYPED(AutoRecovery, implts_asyncDispatch, LinkParamNone*, void)
 {
     DispatchParams aParams;
     /* SAFE */ {
-    osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
-    aParams = m_aDispatchParams;
-    css::uno::Reference< css::uno::XInterface > xHoldRefForMethodAlive = aParams.m_xHoldRefForAsyncOpAlive;
-    m_aDispatchParams.forget(); // clears all members ... including the ref-hold object .-)
+        osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
+        aParams = m_aDispatchParams;
+        css::uno::Reference< css::uno::XInterface > xHoldRefForMethodAlive = aParams.m_xHoldRefForAsyncOpAlive;
+        m_aDispatchParams.forget(); // clears all members ... including the ref-hold object .-)
     } /* SAFE */
 
     try
@@ -2437,7 +2437,6 @@ IMPL_LINK_NOARG(AutoRecovery, implts_asyncDispatch)
     catch (...)
     {
     }
-    return 0;
 }
 
 void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame::XModel >& xDocument)
diff --git a/include/svtools/acceleratorexecute.hxx b/include/svtools/acceleratorexecute.hxx
index d25df27..4b099e0 100644
--- a/include/svtools/acceleratorexecute.hxx
+++ b/include/svtools/acceleratorexecute.hxx
@@ -232,7 +232,7 @@ class SVT_DLLPUBLIC AcceleratorExecute : private TMutexInit
         /** @deprecated
                 replaced by internal class AsyncAccelExec ...
                 remove this resource here if we go forwards to next major */
-        DECL_DLLPRIVATE_LINK(impl_ts_asyncCallback, void*);
+        DECL_DLLPRIVATE_LINK_TYPED(impl_ts_asyncCallback, LinkParamNone*, void);
 };
 
 } // namespace svt
diff --git a/include/vcl/evntpost.hxx b/include/vcl/evntpost.hxx
index 55f9368..276c887 100644
--- a/include/vcl/evntpost.hxx
+++ b/include/vcl/evntpost.hxx
@@ -27,23 +27,17 @@ struct ImplSVEvent;
 
 namespace vcl
 {
-    struct UserEvent
-    {
-        sal_uLong           m_nWhich;
-        void*           m_pData;
-    };
-
     class VCL_DLLPUBLIC EventPoster
     {
-        ImplSVEvent *   m_nId;
-        Link<>          m_aLink;
+        ImplSVEvent *             m_nId;
+        Link<LinkParamNone*,void> m_aLink;
 
         DECL_DLLPRIVATE_LINK_TYPED( DoEvent_Impl, void*, void );
 
     public:
-                        EventPoster( const Link<>& rLink );
+                        EventPoster( const Link<LinkParamNone*,void>& rLink );
                         ~EventPoster();
-        void            Post( UserEvent* pEvent );
+        void            Post();
     };
 }
 
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx
index f8c67f3..f5aacd0 100644
--- a/svtools/source/misc/acceleratorexecute.cxx
+++ b/svtools/source/misc/acceleratorexecute.cxx
@@ -67,7 +67,7 @@ class SVT_DLLPRIVATE AsyncAccelExec
         SVT_DLLPRIVATE AsyncAccelExec(const css::uno::Reference< css::frame::XDispatch >& xDispatch,
                                       const css::util::URL&                               aURL     );
 
-        DECL_DLLPRIVATE_LINK(impl_ts_asyncCallback, void*);
+        DECL_DLLPRIVATE_LINK_TYPED(impl_ts_asyncCallback, LinkParamNone*, void);
 
     private:
         vcl::EventPoster m_aAsyncCallback;
@@ -425,10 +425,9 @@ css::uno::Reference< css::util::XURLTransformer > AcceleratorExecute::impl_ts_ge
 }
 
 
-IMPL_LINK_NOARG(AcceleratorExecute, impl_ts_asyncCallback)
+IMPL_LINK_NOARG_TYPED(AcceleratorExecute, impl_ts_asyncCallback, LinkParamNone*, void)
 {
     // replaced by AsyncAccelExec!
-    return 0;
 }
 
 
@@ -451,14 +450,14 @@ AsyncAccelExec* AsyncAccelExec::createOnShotInstance(const css::uno::Reference<
 
 void AsyncAccelExec::execAsync()
 {
-    m_aAsyncCallback.Post(0);
+    m_aAsyncCallback.Post();
 }
 
 
-IMPL_LINK_NOARG(AsyncAccelExec, impl_ts_asyncCallback)
+IMPL_LINK_NOARG_TYPED(AsyncAccelExec, impl_ts_asyncCallback, LinkParamNone*, void)
 {
     if (! m_xDispatch.is())
-        return 0;
+        return;
 
     try
     {
@@ -472,8 +471,6 @@ IMPL_LINK_NOARG(AsyncAccelExec, impl_ts_asyncCallback)
         {}
 
     delete this;
-
-    return 0;
 }
 
 } // namespace svt
diff --git a/vcl/source/helper/evntpost.cxx b/vcl/source/helper/evntpost.cxx
index ce84ec7..1d4a657 100644
--- a/vcl/source/helper/evntpost.cxx
+++ b/vcl/source/helper/evntpost.cxx
@@ -26,7 +26,7 @@
 namespace vcl
 {
 
-EventPoster::EventPoster( const Link<>& rLink )
+EventPoster::EventPoster( const Link<LinkParamNone*,void>& rLink )
     : m_aLink(rLink)
 {
     m_nId = 0;
@@ -39,19 +39,18 @@ EventPoster::~EventPoster()
         Application::RemoveUserEvent( m_nId );
 }
 
-void EventPoster::Post( UserEvent* pEvent )
+void EventPoster::Post()
 
 {
     DBG_TESTSOLARMUTEX();
-    m_nId = Application::PostUserEvent( ( LINK( this, EventPoster, DoEvent_Impl ) ), pEvent );
+    m_nId = Application::PostUserEvent( ( LINK( this, EventPoster, DoEvent_Impl ) ), nullptr );
 }
 
-IMPL_LINK_TYPED( EventPoster, DoEvent_Impl, void*, p, void )
+IMPL_LINK_TYPED( EventPoster, DoEvent_Impl, void*, /*p*/, void )
 {
-    UserEvent* pEvent = static_cast<UserEvent*>(p);
     DBG_TESTSOLARMUTEX();
     m_nId = 0;
-    m_aLink.Call( pEvent );
+    m_aLink.Call( nullptr );
 }
 
 }


More information about the Libreoffice-commits mailing list