From a5a571307fb3306b74ab46b085cde6388270a770 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 30 Mar 2017 20:27:55 +0200 Subject: tdf#82580 tools: rename Rectangle to tools::Rectangle Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- filter/source/graphicfilter/eps/eps.cxx | 22 ++++++------- filter/source/graphicfilter/icgm/bitmap.cxx | 8 ++--- filter/source/graphicfilter/icgm/class4.cxx | 4 +-- filter/source/graphicfilter/idxf/dxf2mtf.cxx | 4 +-- filter/source/graphicfilter/ieps/ieps.cxx | 2 +- filter/source/graphicfilter/ios2met/ios2met.cxx | 36 ++++++++++---------- filter/source/graphicfilter/ipict/ipict.cxx | 44 ++++++++++++------------- filter/source/graphicfilter/ipict/shape.cxx | 20 +++++------ filter/source/graphicfilter/ipict/shape.hxx | 8 ++--- 9 files changed, 74 insertions(+), 74 deletions(-) (limited to 'filter/source/graphicfilter') diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index 33bf466a2972..6bfb2476f3bd 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -189,8 +189,8 @@ private: void ImplWriteLineInfo( double fLineWidth, double fMiterLimit, SvtGraphicStroke::CapType eLineCap, SvtGraphicStroke::JoinType eJoinType, SvtGraphicStroke::DashArray& rDashArray ); void ImplWriteLineInfo( const LineInfo& rLineInfo ); - void ImplRect( const Rectangle & rRectangle ); - void ImplRectFill ( const Rectangle & rRectangle ); + void ImplRect( const tools::Rectangle & rRectangle ); + void ImplRectFill ( const tools::Rectangle & rRectangle ); void ImplWriteGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient, VirtualDevice& rVDev ); void ImplIntersect( const tools::PolyPolygon& rPolyPoly ); void ImplPolyPoly( const tools::PolyPolygon & rPolyPolygon, bool bTextOutline = false ); @@ -664,7 +664,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) case MetaActionType::ELLIPSE : { - Rectangle aRect = static_cast(pMA)->GetRect(); + tools::Rectangle aRect = static_cast(pMA)->GetRect(); Point aCenter = aRect.Center(); tools::Polygon aPoly( aCenter, aRect.GetWidth() / 2, aRect.GetHeight() / 2 ); tools::PolyPolygon aPolyPoly( aPoly ); @@ -816,7 +816,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) case MetaActionType::BMPSCALEPART : { Bitmap aBitmap( static_cast(pMA)->GetBitmap() ); - aBitmap.Crop( Rectangle( static_cast(pMA)->GetSrcPoint(), + aBitmap.Crop( tools::Rectangle( static_cast(pMA)->GetSrcPoint(), static_cast(pMA)->GetSrcSize() ) ); if ( mbGrayScale ) aBitmap.Convert( BmpConversion::N8BitGreys ); @@ -855,7 +855,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) case MetaActionType::BMPEXSCALEPART : { BitmapEx aBitmapEx( static_cast(pMA)->GetBitmapEx() ); - aBitmapEx.Crop( Rectangle( static_cast(pMA)->GetSrcPoint(), + aBitmapEx.Crop( tools::Rectangle( static_cast(pMA)->GetSrcPoint(), static_cast(pMA)->GetSrcSize() ) ); Bitmap aBitmap( aBitmapEx.GetBitmap() ); if ( mbGrayScale ) @@ -905,7 +905,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) case MetaActionType::WALLPAPER : { const MetaWallpaperAction* pA = static_cast(pMA); - Rectangle aRect = pA->GetRect(); + tools::Rectangle aRect = pA->GetRect(); Wallpaper aWallpaper = pA->GetWallpaper(); if ( aWallpaper.IsBitmap() ) @@ -1450,7 +1450,7 @@ void PSWriter::ImplScale( const double& fX, const double& fY ) ImplExecMode( PS_RET ); } -void PSWriter::ImplRect( const Rectangle & rRect ) +void PSWriter::ImplRect( const tools::Rectangle & rRect ) { if ( bFillColor ) ImplRectFill( rRect ); @@ -1473,7 +1473,7 @@ void PSWriter::ImplRect( const Rectangle & rRect ) mnCursorPos = 0; } -void PSWriter::ImplRectFill( const Rectangle & rRect ) +void PSWriter::ImplRectFill( const tools::Rectangle & rRect ) { double nWidth = rRect.GetWidth(); double nHeight = rRect.GetHeight(); @@ -1672,7 +1672,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi bool bDoTrans = false; - Rectangle aRect; + tools::Rectangle aRect; vcl::Region aRegion; if ( pMaskBitmap ) @@ -1685,7 +1685,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi if ( nHeight > 10 ) nHeight = 8; } - aRect = Rectangle( Point( 0, nHeightOrg - nHeightLeft ), Size( (long)nWidth, (long)nHeight ) ); + aRect = tools::Rectangle( Point( 0, nHeightOrg - nHeightLeft ), Size( (long)nWidth, (long)nHeight ) ); aRegion = vcl::Region( pMaskBitmap->CreateRegion( COL_BLACK, aRect ) ); if( mnLevel == 1 ) @@ -1707,7 +1707,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi if ( nHeight != nHeightOrg ) { nYHeight = nYHeightOrg * nHeight / nHeightOrg; - aTileBitmap.Crop( Rectangle( Point( 0, nHeightOrg - nHeightLeft ), Size( nWidth, nHeight ) ) ); + aTileBitmap.Crop( tools::Rectangle( Point( 0, nHeightOrg - nHeightLeft ), Size( nWidth, nHeight ) ) ); } if ( bDoTrans ) { diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx b/filter/source/graphicfilter/icgm/bitmap.cxx index 44c8169562f4..215b46a17019 100644 --- a/filter/source/graphicfilter/icgm/bitmap.cxx +++ b/filter/source/graphicfilter/icgm/bitmap.cxx @@ -323,8 +323,8 @@ void CGMBitmap::ImplInsert( CGMBitmapDescriptor& rSource, CGMBitmapDescriptor& r if ( mpCGM->mnVDCYmul == -1 ) rDest.mnOrigin = rSource.mnOrigin; // new origin rDest.mpBitmap->Expand( 0, rSource.mnY ); - rDest.mpBitmap->CopyPixel( Rectangle( Point( 0, rDest.mnY ), Size( rSource.mnX, rSource.mnY ) ), - Rectangle( Point( 0, 0 ), Size( rSource.mnX, rSource.mnY ) ), rSource.mpBitmap ); + rDest.mpBitmap->CopyPixel( tools::Rectangle( Point( 0, rDest.mnY ), Size( rSource.mnX, rSource.mnY ) ), + tools::Rectangle( Point( 0, 0 ), Size( rSource.mnX, rSource.mnY ) ), rSource.mpBitmap ); FloatPoint aFloatPoint; aFloatPoint.X = rSource.mnQ.X - rSource.mnR.X; aFloatPoint.Y = rSource.mnQ.Y - rSource.mnR.Y; @@ -338,8 +338,8 @@ void CGMBitmap::ImplInsert( CGMBitmapDescriptor& rSource, CGMBitmapDescriptor& r if ( mpCGM->mnVDCYmul == 1 ) rDest.mnOrigin = rSource.mnOrigin; // new origin rDest.mpBitmap->Expand( 0, rSource.mnY ); - rDest.mpBitmap->CopyPixel( Rectangle( Point( 0, rDest.mnY ), Size( rSource.mnX, rSource.mnY ) ), - Rectangle( Point( 0, 0 ), Size( rSource.mnX, rSource.mnY ) ), rSource.mpBitmap ); + rDest.mpBitmap->CopyPixel( tools::Rectangle( Point( 0, rDest.mnY ), Size( rSource.mnX, rSource.mnY ) ), + tools::Rectangle( Point( 0, 0 ), Size( rSource.mnX, rSource.mnY ) ), rSource.mpBitmap ); rDest.mnP = rSource.mnP; rDest.mnR = rSource.mnR; } diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx index 805b92785fd3..c74333123c6b 100644 --- a/filter/source/graphicfilter/icgm/class4.cxx +++ b/filter/source/graphicfilter/icgm/class4.cxx @@ -404,7 +404,7 @@ void CGM::ImplDoClass4() if ( mbFigure ) { - Rectangle aBoundingBox( Point( (long)( aCenterPoint.X - fRadius ), long( aCenterPoint.Y - fRadius ) ), + tools::Rectangle aBoundingBox( Point( (long)( aCenterPoint.X - fRadius ), long( aCenterPoint.Y - fRadius ) ), Size( ( static_cast< long >( 2 * fRadius ) ), (long)( 2 * fRadius) ) ); tools::Polygon aPolygon( aBoundingBox, Point( (long)aStartingPoint.X, (long)aStartingPoint.Y ) ,Point( (long)aEndingPoint.X, (long)aEndingPoint.Y ), PolyStyle::Arc ); if ( nSwitch ) @@ -520,7 +520,7 @@ void CGM::ImplDoClass4() if ( mbFigure ) { - Rectangle aBoundingBox( + tools::Rectangle aBoundingBox( Point( (long)( aCenter.X - aRadius.X ), long( aCenter.Y - aRadius.X ) ), Size( static_cast< long >( 2 * aRadius.X ), (long)( 2 * aRadius.X ) ) ); tools::Polygon aPolygon( aBoundingBox, diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx index b867bca6e372..3ceab9525257 100644 --- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx +++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx @@ -264,7 +264,7 @@ void DXF2GDIMetaFile::DrawCircleEntity(const DXFCircleEntity & rE, const DXFTran rTransform.Transform(rE.aP0,aC); if (rE.fThickness==0 && rTransform.TransCircleToEllipse(rE.fRadius,frx,fry)) { pVirDev->DrawEllipse( - Rectangle((long)(aC.fx-frx+0.5),(long)(aC.fy-fry+0.5), + tools::Rectangle((long)(aC.fx-frx+0.5),(long)(aC.fy-fry+0.5), (long)(aC.fx+frx+0.5),(long)(aC.fy+fry+0.5))); } else { @@ -324,7 +324,7 @@ void DXF2GDIMetaFile::DrawArcEntity(const DXFArcEntity & rE, const DXFTransform rTransform.Transform(aVE,aPS); } pVirDev->DrawArc( - Rectangle((long)(aC.fx-frx+0.5),(long)(aC.fy-fry+0.5), + tools::Rectangle((long)(aC.fx-frx+0.5),(long)(aC.fy-fry+0.5), (long)(aC.fx+frx+0.5),(long)(aC.fy+fry+0.5)), aPS,aPE ); diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index af4ab68457ea..3ab880a9ae3a 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -470,7 +470,7 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead, pVDev->Push( PushFlags::FONT ); pVDev->SetFont( aFont ); - Rectangle aRect( Point( 1, 1 ), Size( nWidth - 2, nHeight - 2 ) ); + tools::Rectangle aRect( Point( 1, 1 ), Size( nWidth - 2, nHeight - 2 ) ); pVDev->DrawRect( aRect ); OUString aString; diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index 9ba110cd8ec7..e2ebb601d1d6 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -350,8 +350,8 @@ private: // While doing this a recording in the GDIMetaFile // will take place. sal_uLong nOrigPos; // initial position in pOS2MET - Rectangle aBoundingRect; // bounding rectangle as stored in the file - Rectangle aCalcBndRect; // bounding rectangle calculated on our own + tools::Rectangle aBoundingRect; // bounding rectangle as stored in the file + tools::Rectangle aCalcBndRect; // bounding rectangle calculated on our own MapMode aGlobMapMode; // resolution of the picture bool bCoord32; @@ -853,7 +853,7 @@ Point OS2METReader::ReadPoint( const bool bAdjustBoundRect ) y=aBoundingRect.Bottom()-y; if ( bAdjustBoundRect ) - aCalcBndRect.Union(Rectangle(x,y,x+1,y+1)); + aCalcBndRect.Union(tools::Rectangle(x,y,x+1,y+1)); return Point(x,y); } @@ -908,7 +908,7 @@ void OS2METReader::ReadRelLine(bool bGivenPos, sal_uInt16 nOrderLen) sal_Int8 nsignedbyte; pOS2MET->ReadSChar( nsignedbyte ); aP0.X()+=(long)nsignedbyte; pOS2MET->ReadSChar( nsignedbyte ); aP0.Y()-=(long)nsignedbyte; - aCalcBndRect.Union(Rectangle(aP0,Size(1,1))); + aCalcBndRect.Union(tools::Rectangle(aP0,Size(1,1))); aPolygon.SetPoint(aP0,i); } aAttr.aCurPos=aPolygon.GetPoint(nPolySize-1); @@ -940,7 +940,7 @@ void OS2METReader::ReadBox(bool bGivenPos) nHRound=ReadCoord(bCoord32); nVRound=ReadCoord(bCoord32); - Rectangle aBoxRect( P0, aAttr.aCurPos ); + tools::Rectangle aBoxRect( P0, aAttr.aCurPos ); if ( pAreaStack ) AddPointsToArea( tools::Polygon( aBoxRect ) ); @@ -1057,7 +1057,7 @@ void OS2METReader::ReadChrStr(bool bGivenPos, bool bMove, bool bExtra, sal_uInt1 aSize = Size( pVirDev->GetTextWidth(aStr), pVirDev->GetTextHeight() ); if ( aAttr.nChrAng == 0 ) { - aCalcBndRect.Union(Rectangle( Point(aP0.X(),aP0.Y()-aSize.Height()), + aCalcBndRect.Union(tools::Rectangle( Point(aP0.X(),aP0.Y()-aSize.Height()), Size(aSize.Width(),aSize.Height()*2))); if (bMove) aAttr.aCurPos = Point( aP0.X() + aSize.Width(), aP0.Y()); @@ -1073,8 +1073,8 @@ void OS2METReader::ReadChrStr(bool bGivenPos, bool bMove, bool bExtra, sal_uInt1 aDummyPoly.Rotate( aP0, (short)aAttr.nChrAng ); if ( bMove ) aAttr.aCurPos = aDummyPoly.GetPoint( 0 ); - aCalcBndRect.Union( Rectangle( aDummyPoly.GetPoint( 0 ), aDummyPoly.GetPoint( 3 ) ) ); - aCalcBndRect.Union( Rectangle( aDummyPoly.GetPoint( 1 ), aDummyPoly.GetPoint( 2 ) ) ); + aCalcBndRect.Union( tools::Rectangle( aDummyPoly.GetPoint( 0 ), aDummyPoly.GetPoint( 3 ) ) ); + aCalcBndRect.Union( tools::Rectangle( aDummyPoly.GetPoint( 1 ), aDummyPoly.GetPoint( 2 ) ) ); } } @@ -1113,11 +1113,11 @@ void OS2METReader::ReadArc(bool bGivenPos) w1=fmod((atan2(x1-cx,y1-cy)-atan2(x2-cx,y2-cy)),6.28318530718); if (w1<0) w1+=6.28318530718; w3=fmod((atan2(x3-cx,y3-cy)-atan2(x2-cx,y2-cy)),6.28318530718); if (w3<0) w3+=6.28318530718; if (w3DrawArc(Rectangle((long)(cx-rx),(long)(cy-ry), + pVirDev->DrawArc(tools::Rectangle((long)(cx-rx),(long)(cy-ry), (long)(cx+rx),(long)(cy+ry)),aP1,aP3); } else { - pVirDev->DrawArc(Rectangle((long)(cx-rx),(long)(cy-ry), + pVirDev->DrawArc(tools::Rectangle((long)(cx-rx),(long)(cy-ry), (long)(cx+rx),(long)(cy+ry)),aP3,aP1); } } @@ -1126,7 +1126,7 @@ void OS2METReader::ReadFullArc(bool bGivenPos, sal_uInt16 nOrderSize) { Point aCenter; long nP,nQ; - Rectangle aRect; + tools::Rectangle aRect; sal_uInt32 nMul; sal_uInt16 nMulS; if (bGivenPos) { @@ -1145,7 +1145,7 @@ void OS2METReader::ReadFullArc(bool bGivenPos, sal_uInt16 nOrderSize) nQ=(nQ*nMul)>>16; } - aRect=Rectangle(aCenter.X()-nP,aCenter.Y()-nQ, + aRect=tools::Rectangle(aCenter.X()-nP,aCenter.Y()-nQ, aCenter.X()+nP,aCenter.Y()+nQ); aCalcBndRect.Union(aRect); @@ -1170,7 +1170,7 @@ void OS2METReader::ReadPartialArc(bool bGivenPos, sal_uInt16 nOrderSize) { Point aP0, aCenter,aPStart,aPEnd; sal_Int32 nP,nQ,nStart, nSweep; - Rectangle aRect; + tools::Rectangle aRect; sal_uInt32 nMul; sal_uInt16 nMulS; double fStart, fEnd; @@ -1199,7 +1199,7 @@ void OS2METReader::ReadPartialArc(bool bGivenPos, sal_uInt16 nOrderSize) aPEnd= Point(aCenter.X()+(sal_Int32)( cos(fEnd)*nP), aCenter.Y()+(sal_Int32)(-sin(fEnd)*nQ)); - aRect=Rectangle(aCenter.X()-nP,aCenter.Y()-nQ, + aRect=tools::Rectangle(aCenter.X()-nP,aCenter.Y()-nQ, aCenter.X()+nP,aCenter.Y()+nQ); aCalcBndRect.Union(aRect); @@ -1387,7 +1387,7 @@ void OS2METReader::ReadMarker(bool bGivenPos, sal_uInt16 nOrderLen) if (i!=0 || bGivenPos) aAttr.aCurPos=ReadPoint(); const long x = aAttr.aCurPos.X(); const long y=aAttr.aCurPos.Y(); - aCalcBndRect.Union(Rectangle(x-5,y-5,x+5,y+5)); + aCalcBndRect.Union(tools::Rectangle(x-5,y-5,x+5,y+5)); switch (aAttr.nMrkSymbol) { case 2: // PLUS pVirDev->DrawLine(Point(x-4,y),Point(x+4,y)); @@ -1452,10 +1452,10 @@ void OS2METReader::ReadMarker(bool bGivenPos, sal_uInt16 nOrderLen) break; } case 9: // DOT - pVirDev->DrawEllipse(Rectangle(x-1,y-1,x+1,y+1)); + pVirDev->DrawEllipse(tools::Rectangle(x-1,y-1,x+1,y+1)); break; case 10: // SMALLCIRCLE - pVirDev->DrawEllipse(Rectangle(x-2,y-2,x+2,y+2)); + pVirDev->DrawEllipse(tools::Rectangle(x-2,y-2,x+2,y+2)); break; case 64: // BLANK break; @@ -2233,7 +2233,7 @@ void OS2METReader::ReadDsc(sal_uInt16 nDscID, sal_uInt16 /*nDscLen*/) aBoundingRect.Bottom() = y2; // no output beside this bounding rect - pVirDev->IntersectClipRegion( Rectangle( Point(), aBoundingRect.GetSize() ) ); + pVirDev->IntersectClipRegion( tools::Rectangle( Point(), aBoundingRect.GetSize() ) ); break; } diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index bcdbc3caa867..08fa3b6a9a5c 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -150,7 +150,7 @@ private: sal_uLong nOrigPos; // Initial position in pPict. bool IsVersion2; // If it is a version 2 Pictfile. - Rectangle aBoundingRect; // Min/Max-Rectangle for the whole drawing. + tools::Rectangle aBoundingRect; // Min/Max-Rectangle for the whole drawing. Point aPenPosition; Point aTextPosition; @@ -183,21 +183,21 @@ private: Color ReadRGBColor(); - void ReadRectangle(Rectangle & rRect); + void ReadRectangle(tools::Rectangle & rRect); sal_uLong ReadPolygon(tools::Polygon & rPoly); sal_uLong ReadPixPattern(Pattern &pattern); - Rectangle aLastRect; + tools::Rectangle aLastRect; sal_uLong ReadAndDrawRect(PictDrawingMethod eMethod); sal_uLong ReadAndDrawSameRect(PictDrawingMethod eMethod); - Rectangle aLastRoundRect; + tools::Rectangle aLastRoundRect; sal_uLong ReadAndDrawRoundRect(PictDrawingMethod eMethod); sal_uLong ReadAndDrawSameRoundRect(PictDrawingMethod eMethod); - Rectangle aLastOval; + tools::Rectangle aLastOval; sal_uLong ReadAndDrawOval(PictDrawingMethod eMethod); sal_uLong ReadAndDrawSameOval(PictDrawingMethod eMethod); @@ -205,7 +205,7 @@ private: sal_uLong ReadAndDrawPolygon(PictDrawingMethod eMethod); sal_uLong ReadAndDrawSamePolygon(PictDrawingMethod eMethod); - Rectangle aLastArcRect; + tools::Rectangle aLastArcRect; sal_uLong ReadAndDrawArc(PictDrawingMethod eMethod); sal_uLong ReadAndDrawSameArc(PictDrawingMethod eMethod); @@ -224,7 +224,7 @@ private: sal_uLong ReadAndDrawText(); sal_uLong ReadPixMapEtc(Bitmap & rBitmap, bool bBaseAddr, bool bColorTable, - Rectangle * pSrcRect, Rectangle * pDestRect, + tools::Rectangle * pSrcRect, tools::Rectangle * pDestRect, bool bMode, bool bMaskRgn); void ReadHeader(); @@ -443,13 +443,13 @@ Color PictReader::ReadRGBColor() } -void PictReader::ReadRectangle(Rectangle & rRect) +void PictReader::ReadRectangle(tools::Rectangle & rRect) { Point aTopLeft, aBottomRight; aTopLeft=ReadPoint(); aBottomRight=ReadPoint(); - rRect=Rectangle(aTopLeft,aBottomRight); + rRect=tools::Rectangle(aTopLeft,aBottomRight); SAL_INFO("filter.pict", "ReadRectangle: " << rRect); } @@ -721,8 +721,8 @@ namespace } } -sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColorTable, Rectangle* pSrcRect, - Rectangle* pDestRect, bool bMode, bool bMaskRgn ) +sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColorTable, tools::Rectangle* pSrcRect, + tools::Rectangle* pDestRect, bool bMode, bool bMaskRgn ) { Bitmap aBitmap; sal_uInt16 nPackType(0), nPixelSize(0), nCmpCount(0), nCmpSize(0); @@ -805,7 +805,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo { sal_uInt16 nTop, nLeft, nBottom, nRight; pPict->ReadUInt16( nTop ).ReadUInt16( nLeft ).ReadUInt16( nBottom ).ReadUInt16( nRight ); - *pSrcRect = Rectangle( (sal_uLong)nLeft, (sal_uLong)nTop, (sal_uLong)nRight, (sal_uLong)nBottom ); + *pSrcRect = tools::Rectangle( (sal_uLong)nLeft, (sal_uLong)nTop, (sal_uLong)nRight, (sal_uLong)nBottom ); nDataSize += 8; } @@ -815,7 +815,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo Point aTL, aBR; aTL = ReadPoint(); aBR = ReadPoint(); - *pDestRect = Rectangle( aTL, aBR ); + *pDestRect = tools::Rectangle( aTL, aBR ); nDataSize += 8; } @@ -1220,7 +1220,7 @@ void PictReader::ReadHeader() else if (x2 < x1+8 || y2 < y1+8) // a little dubious actualConfid-=1; if (st >= 3 && actualConfid != 20) continue; - aBoundingRect=Rectangle( x1,y1, x2, y2 ); + aBoundingRect=tools::Rectangle( x1,y1, x2, y2 ); if (pPict->IsEof() || pPict->GetError()) continue; // read version @@ -1272,7 +1272,7 @@ void PictReader::ReadHeader() fVRes /= 65536; aHRes /= fHRes; aVRes /= fVRes; - aBoundingRect=Rectangle( x1,y1, x2, y2 ); + aBoundingRect=tools::Rectangle( x1,y1, x2, y2 ); pPict->SeekRel( 4 ); // 4 bytes reserved return; } @@ -1344,7 +1344,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) break; case 0x0001: { // Clip - Rectangle aRect; + tools::Rectangle aRect; pPict->ReadUInt16( nUSHORT ); nDataSize=nUSHORT; ReadRectangle(aRect); @@ -1806,7 +1806,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) case 0x0090: { // BitsRect Bitmap aBmp; - Rectangle aSrcRect, aDestRect; + tools::Rectangle aSrcRect, aDestRect; nDataSize=ReadPixMapEtc(aBmp, false, true, &aSrcRect, &aDestRect, true, false); DrawingMethod( PictDrawingMethod::PAINT ); pVirDev->DrawBitmap(aDestRect.TopLeft(),aDestRect.GetSize(),aBmp); @@ -1814,7 +1814,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) } case 0x0091: { // BitsRgn Bitmap aBmp; - Rectangle aSrcRect, aDestRect; + tools::Rectangle aSrcRect, aDestRect; nDataSize=ReadPixMapEtc(aBmp, false, true, &aSrcRect, &aDestRect, true, true); DrawingMethod( PictDrawingMethod::PAINT ); pVirDev->DrawBitmap(aDestRect.TopLeft(),aDestRect.GetSize(),aBmp); @@ -1831,7 +1831,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) case 0x0098: { // PackBitsRect Bitmap aBmp; - Rectangle aSrcRect, aDestRect; + tools::Rectangle aSrcRect, aDestRect; nDataSize=ReadPixMapEtc(aBmp, false, true, &aSrcRect, &aDestRect, true, false); DrawingMethod( PictDrawingMethod::PAINT ); pVirDev->DrawBitmap(aDestRect.TopLeft(),aDestRect.GetSize(),aBmp); @@ -1839,7 +1839,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) } case 0x0099: { // PackBitsRgn Bitmap aBmp; - Rectangle aSrcRect, aDestRect; + tools::Rectangle aSrcRect, aDestRect; nDataSize=ReadPixMapEtc(aBmp, false, true, &aSrcRect, &aDestRect, true, true); DrawingMethod( PictDrawingMethod::PAINT ); pVirDev->DrawBitmap(aDestRect.TopLeft(),aDestRect.GetSize(),aBmp); @@ -1847,7 +1847,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) } case 0x009a: { // DirectBitsRect Bitmap aBmp; - Rectangle aSrcRect, aDestRect; + tools::Rectangle aSrcRect, aDestRect; nDataSize=ReadPixMapEtc(aBmp, true, false, &aSrcRect, &aDestRect, true, false); DrawingMethod( PictDrawingMethod::PAINT ); pVirDev->DrawBitmap(aDestRect.TopLeft(),aDestRect.GetSize(),aBmp); @@ -1855,7 +1855,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) } case 0x009b: { // DirectBitsRgn Bitmap aBmp; - Rectangle aSrcRect, aDestRect; + tools::Rectangle aSrcRect, aDestRect; nDataSize=ReadPixMapEtc(aBmp, true, false, &aSrcRect, &aDestRect, true, true); DrawingMethod( PictDrawingMethod::PAINT ); pVirDev->DrawBitmap(aDestRect.TopLeft(),aDestRect.GetSize(),aBmp); diff --git a/filter/source/graphicfilter/ipict/shape.cxx b/filter/source/graphicfilter/ipict/shape.cxx index 5aba327f869d..c7ab3ba2f8a0 100644 --- a/filter/source/graphicfilter/ipict/shape.cxx +++ b/filter/source/graphicfilter/ipict/shape.cxx @@ -38,14 +38,14 @@ Here, we choose: namespace PictReaderShapePrivate { /** returns an inside rectangle knowing the penSize in order to obtain the ``correct'' position when we draw a frame in wide length*/ - Rectangle contractRectangle(bool drawFrame, Rectangle const &rect, Size const &pSize) { + tools::Rectangle contractRectangle(bool drawFrame, tools::Rectangle const &rect, Size const &pSize) { if (!drawFrame) return rect; long penSize=(pSize.Width()+pSize.Height())/2; if (2*penSize > rect.Right()-rect.Left()) penSize = (rect.Right()-rect.Left()+1)/2; if (2*penSize > rect.Bottom()-rect.Top()) penSize = (rect.Bottom()-rect.Top()+1)/2; long const X[2] = { rect.Left()+penSize/2, rect.Right()-(penSize+1)/2 }; long const Y[2] = { rect.Top()+penSize/2, rect.Bottom()-(penSize+1)/2 }; - return Rectangle(Point(X[0],Y[0]), Point(X[1], Y[1])); + return tools::Rectangle(Point(X[0],Y[0]), Point(X[1], Y[1])); } } @@ -125,9 +125,9 @@ namespace PictReaderShape { /* Note(checkme): contradictally with the QuickDraw's reference 3-23, it seems better to consider that the frame/content of a rectangle appears inside the given rectangle. Does a conversion appear between the pascal functions and the data stored in the file ? */ - void drawRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &pSize) { + void drawRectangle(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &orig, Size const &pSize) { int penSize=(pSize.Width()+pSize.Height())/2; - Rectangle rect = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); + tools::Rectangle rect = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); long const X[2] = { rect.Left(), rect.Right() }; long const Y[2] = { rect.Top(), rect.Bottom() }; @@ -144,9 +144,9 @@ namespace PictReaderShape { } //-------------------- draws an ellipse -------------------- - void drawEllipse(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &pSize) { + void drawEllipse(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &orig, Size const &pSize) { int penSize=(pSize.Width()+pSize.Height())/2; - Rectangle oval = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); + tools::Rectangle oval = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); using namespace basegfx; long const X[2] = { oval.Left(), oval.Right() }; long const Y[2] = { oval.Top(), oval.Bottom() }; @@ -159,9 +159,9 @@ namespace PictReaderShape { } //-------------------- draws an arc/pie -------------------- - void drawArc(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, const double& angle1, const double& angle2, Size const &pSize) { + void drawArc(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &orig, const double& angle1, const double& angle2, Size const &pSize) { int penSize=(pSize.Width()+pSize.Height())/2; - Rectangle arc = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); + tools::Rectangle arc = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); using namespace basegfx; double const PI2 = M_PI/2.0; @@ -194,9 +194,9 @@ namespace PictReaderShape { } } //-------------------- draws a rectangle with round corner -------------------- - void drawRoundRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &ovalSize, Size const &pSize) { + void drawRoundRectangle(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &orig, Size const &ovalSize, Size const &pSize) { int penSize=(pSize.Width()+pSize.Height())/2; - Rectangle oval = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); + tools::Rectangle oval = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); int ovalW=ovalSize.Width(), ovalH=ovalSize.Height(); using namespace basegfx; long const X[2] = { oval.Left(), oval.Right() }; diff --git a/filter/source/graphicfilter/ipict/shape.hxx b/filter/source/graphicfilter/ipict/shape.hxx index 1264df4f4b01..bccd39e63c26 100644 --- a/filter/source/graphicfilter/ipict/shape.hxx +++ b/filter/source/graphicfilter/ipict/shape.hxx @@ -33,23 +33,23 @@ namespace PictReaderShape { void drawLine(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize); /** draws a rectangle knowing penSize */ - void drawRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &rect, Size const &pSize); + void drawRectangle(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &rect, Size const &pSize); /** draws a polygon knowing penSize */ void drawPolygon(VirtualDevice *dev, bool drawFrame, tools::Polygon const &rect, Size const &pSize); /** draws an ellipse knowing penSize */ - void drawEllipse(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &pSize); + void drawEllipse(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &orig, Size const &pSize); /** draws a rounded rectangle knowing penSize \note ovalSize is two time the size of the corner */ - void drawRoundRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &ovalS, Size const &pSize); + void drawRoundRectangle(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &orig, Size const &ovalS, Size const &pSize); /** draws an arc in a b2dpolygon knowing penSize \note - it supposes that angl1 < angl2 */ - void drawArc(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, const double& angle1, const double& angle2, Size const &pSize); + void drawArc(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &orig, const double& angle1, const double& angle2, Size const &pSize); } #endif // INCLUDED_FILTER_SOURCE_GRAPHICFILTER_IPICT_SHAPE_HXX -- cgit