From d16d9f950f8cb6d8948875372c9ff1f0aae9fb7a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 29 Jun 2015 14:04:27 +0200 Subject: remove some unnecessary typedefs to pointer that were really not helping make the code any clearer. Found with a search git grep -P 'typedef\s+\w+\s*\*\s*\w+\;' and manual inspection Change-Id: I6a5c031e9e060ad3623a7586ec8a8cc4fe6252e9 --- tools/inc/poly.h | 5 ++--- tools/source/generic/poly2.cxx | 18 +++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'tools') diff --git a/tools/inc/poly.h b/tools/inc/poly.h index d677bcd8b0ac..0a202bca1615 100644 --- a/tools/inc/poly.h +++ b/tools/inc/poly.h @@ -48,13 +48,12 @@ public: #define MAX_POLYGONS ((sal_uInt16)0x3FF0) class Polygon; -typedef Polygon* SVPPOLYGON; class SAL_WARN_UNUSED ImplPolyPolygon { public: - SVPPOLYGON* mpPolyAry; - sal_uIntPtr mnRefCount; + Polygon** mpPolyAry; + sal_uIntPtr mnRefCount; sal_uInt16 mnCount; sal_uInt16 mnSize; sal_uInt16 mnResize; diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx index d390a6e862db..d1dddb17733a 100644 --- a/tools/source/generic/poly2.cxx +++ b/tools/source/generic/poly2.cxx @@ -41,7 +41,7 @@ ImplPolyPolygon::ImplPolyPolygon( sal_uInt16 nInitSize ) mnCount = nInitSize; mnSize = nInitSize; mnResize = 16; - mpPolyAry = new SVPPOLYGON[ nInitSize ]; + mpPolyAry = new Polygon*[ nInitSize ]; } ImplPolyPolygon::ImplPolyPolygon( const ImplPolyPolygon& rImplPolyPoly ) @@ -53,7 +53,7 @@ ImplPolyPolygon::ImplPolyPolygon( const ImplPolyPolygon& rImplPolyPoly ) if ( rImplPolyPoly.mpPolyAry ) { - mpPolyAry = new SVPPOLYGON[mnSize]; + mpPolyAry = new Polygon*[mnSize]; for ( sal_uInt16 i = 0; i < mnCount; i++ ) mpPolyAry[i] = new Polygon( *rImplPolyPoly.mpPolyAry[i] ); } @@ -128,19 +128,19 @@ void PolyPolygon::Insert( const Polygon& rPoly, sal_uInt16 nPos ) nPos = mpImplPolyPolygon->mnCount; if ( !mpImplPolyPolygon->mpPolyAry ) - mpImplPolyPolygon->mpPolyAry = new SVPPOLYGON[mpImplPolyPolygon->mnSize]; + mpImplPolyPolygon->mpPolyAry = new Polygon*[mpImplPolyPolygon->mnSize]; else if ( mpImplPolyPolygon->mnCount == mpImplPolyPolygon->mnSize ) { sal_uInt16 nOldSize = mpImplPolyPolygon->mnSize; sal_uInt16 nNewSize = nOldSize + mpImplPolyPolygon->mnResize; - SVPPOLYGON* pNewAry; + Polygon** pNewAry; if ( nNewSize >= MAX_POLYGONS ) nNewSize = MAX_POLYGONS; - pNewAry = new SVPPOLYGON[nNewSize]; - memcpy( pNewAry, mpImplPolyPolygon->mpPolyAry, nPos*sizeof(SVPPOLYGON) ); + pNewAry = new Polygon*[nNewSize]; + memcpy( pNewAry, mpImplPolyPolygon->mpPolyAry, nPos*sizeof(Polygon*) ); memcpy( pNewAry+nPos+1, mpImplPolyPolygon->mpPolyAry+nPos, - (nOldSize-nPos)*sizeof(SVPPOLYGON) ); + (nOldSize-nPos)*sizeof(Polygon*) ); delete[] mpImplPolyPolygon->mpPolyAry; mpImplPolyPolygon->mpPolyAry = pNewAry; mpImplPolyPolygon->mnSize = nNewSize; @@ -149,7 +149,7 @@ void PolyPolygon::Insert( const Polygon& rPoly, sal_uInt16 nPos ) { memmove( mpImplPolyPolygon->mpPolyAry+nPos+1, mpImplPolyPolygon->mpPolyAry+nPos, - (mpImplPolyPolygon->mnCount-nPos)*sizeof(SVPPOLYGON) ); + (mpImplPolyPolygon->mnCount-nPos)*sizeof(Polygon*) ); } mpImplPolyPolygon->mpPolyAry[nPos] = new Polygon( rPoly ); @@ -170,7 +170,7 @@ void PolyPolygon::Remove( sal_uInt16 nPos ) mpImplPolyPolygon->mnCount--; memmove( mpImplPolyPolygon->mpPolyAry+nPos, mpImplPolyPolygon->mpPolyAry+nPos+1, - (mpImplPolyPolygon->mnCount-nPos)*sizeof(SVPPOLYGON) ); + (mpImplPolyPolygon->mnCount-nPos)*sizeof(Polygon*) ); } void PolyPolygon::Replace( const Polygon& rPoly, sal_uInt16 nPos ) -- cgit v1.2.3