Kaydet (Commit) 1c061348 authored tarafından Noel Grandin's avatar Noel Grandin

convert Link<> to typed

and drop an unused parameter

Change-Id: I2f3bc15e4168103a6cb2d19807d291d8da24387e
üst ba6cbddd
......@@ -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
......
......@@ -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)
......
......@@ -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 );
......
......@@ -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 );
}
......
......@@ -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;
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment