diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qa/cppunit/test_rectangle.cxx | 4 | ||||
-rw-r--r-- | tools/source/generic/b3dtrans.cxx | 4 | ||||
-rw-r--r-- | tools/source/generic/gen.cxx | 29 | ||||
-rw-r--r-- | tools/source/generic/poly.cxx | 22 | ||||
-rw-r--r-- | tools/source/generic/poly2.cxx | 10 | ||||
-rw-r--r-- | tools/source/generic/svborder.cxx | 2 |
6 files changed, 37 insertions, 34 deletions
diff --git a/tools/qa/cppunit/test_rectangle.cxx b/tools/qa/cppunit/test_rectangle.cxx index 4f3fff8afa34..e9a1c719b10f 100644 --- a/tools/qa/cppunit/test_rectangle.cxx +++ b/tools/qa/cppunit/test_rectangle.cxx @@ -30,7 +30,7 @@ public: void Test::test_rectangle() { { - Rectangle aRect(1,1,1,1); + tools::Rectangle aRect(1,1,1,1); CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetWidth()); CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetHeight()); @@ -40,7 +40,7 @@ void Test::test_rectangle() } { - Rectangle aRect(Point(), Size(1,1)); + tools::Rectangle aRect(Point(), Size(1,1)); CPPUNIT_ASSERT_EQUAL(long(0), aRect.Left()); CPPUNIT_ASSERT_EQUAL(long(0), aRect.Top()); diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx index d12330145fdf..bc830767c280 100644 --- a/tools/source/generic/b3dtrans.cxx +++ b/tools/source/generic/b3dtrans.cxx @@ -147,7 +147,7 @@ void B3dTransformationSet::Reset() mfRatio = 0.0; - maViewportRectangle = Rectangle(-1, -1, 2, 2); + maViewportRectangle = tools::Rectangle(-1, -1, 2, 2); maVisibleRectangle = maViewportRectangle; mbPerspective = true; @@ -318,7 +318,7 @@ void B3dTransformationSet::SetPerspective(bool bNew) } } -void B3dTransformationSet::SetViewportRectangle(Rectangle const & rRect, Rectangle const & rVisible) +void B3dTransformationSet::SetViewportRectangle(tools::Rectangle const & rRect, tools::Rectangle const & rVisible) { if(rRect != maViewportRectangle || rVisible != maVisibleRectangle) { diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 96bbd91a2e4f..834fc6869864 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -42,7 +42,7 @@ SvStream& WritePair( SvStream& rOStream, const Pair& rPair ) return rOStream; } -void Rectangle::SetSize( const Size& rSize ) +void tools::Rectangle::SetSize( const Size& rSize ) { if ( rSize.Width() < 0 ) nRight = nLeft + rSize.Width() +1; @@ -59,7 +59,7 @@ void Rectangle::SetSize( const Size& rSize ) nBottom = RECT_EMPTY; } -Rectangle& Rectangle::Union( const Rectangle& rRect ) +tools::Rectangle& tools::Rectangle::Union( const tools::Rectangle& rRect ) { if ( rRect.IsEmpty() ) return *this; @@ -77,18 +77,18 @@ Rectangle& Rectangle::Union( const Rectangle& rRect ) return *this; } -Rectangle& Rectangle::Intersection( const Rectangle& rRect ) +tools::Rectangle& tools::Rectangle::Intersection( const tools::Rectangle& rRect ) { if ( IsEmpty() ) return *this; if ( rRect.IsEmpty() ) { - *this = Rectangle(); + *this = tools::Rectangle(); return *this; } // Justify rectangle - Rectangle aTmpRect( rRect ); + tools::Rectangle aTmpRect( rRect ); Justify(); aTmpRect.Justify(); @@ -100,12 +100,12 @@ Rectangle& Rectangle::Intersection( const Rectangle& rRect ) // Determine if intersection is empty if ( nRight < nLeft || nBottom < nTop ) - *this = Rectangle(); + *this = tools::Rectangle(); return *this; } -void Rectangle::Justify() +void tools::Rectangle::Justify() { long nHelp; @@ -124,7 +124,7 @@ void Rectangle::Justify() } } -bool Rectangle::IsInside( const Point& rPoint ) const +bool tools::Rectangle::IsInside( const Point& rPoint ) const { if ( IsEmpty() ) return false; @@ -152,7 +152,7 @@ bool Rectangle::IsInside( const Point& rPoint ) const return true; } -bool Rectangle::IsInside( const Rectangle& rRect ) const +bool tools::Rectangle::IsInside( const tools::Rectangle& rRect ) const { if ( IsInside( rRect.TopLeft() ) && IsInside( rRect.BottomRight() ) ) return true; @@ -160,13 +160,15 @@ bool Rectangle::IsInside( const Rectangle& rRect ) const return false; } -bool Rectangle::IsOver( const Rectangle& rRect ) const +bool tools::Rectangle::IsOver( const tools::Rectangle& rRect ) const { // If there's no intersection, they don't overlap return !GetIntersection( rRect ).IsEmpty(); } -SvStream& ReadRectangle( SvStream& rIStream, Rectangle& rRect ) +namespace tools +{ +SvStream& ReadRectangle( SvStream& rIStream, tools::Rectangle& rRect ) { sal_Int32 nTmpL(0), nTmpT(0), nTmpR(0), nTmpB(0); @@ -180,7 +182,7 @@ SvStream& ReadRectangle( SvStream& rIStream, Rectangle& rRect ) return rIStream; } -SvStream& WriteRectangle( SvStream& rOStream, const Rectangle& rRect ) +SvStream& WriteRectangle( SvStream& rOStream, const tools::Rectangle& rRect ) { rOStream.WriteInt32( rRect.nLeft ) .WriteInt32( rRect.nTop ) @@ -189,8 +191,9 @@ SvStream& WriteRectangle( SvStream& rOStream, const Rectangle& rRect ) return rOStream; } +} -OString Rectangle::toString() const +OString tools::Rectangle::toString() const { std::stringstream ss; // Note that this is not just used for debugging output but the diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 0faae1a39b27..353638ea984d 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -556,7 +556,7 @@ Polygon::Polygon( const tools::Polygon& rPoly ) mpImplPolygon->mnRefCount++; } -Polygon::Polygon( const Rectangle& rRect ) +Polygon::Polygon( const tools::Rectangle& rRect ) { if ( rRect.IsEmpty() ) @@ -572,13 +572,13 @@ Polygon::Polygon( const Rectangle& rRect ) } } -Polygon::Polygon( const Rectangle& rRect, sal_uInt32 nHorzRound, sal_uInt32 nVertRound ) +Polygon::Polygon( const tools::Rectangle& rRect, sal_uInt32 nHorzRound, sal_uInt32 nVertRound ) { if ( rRect.IsEmpty() ) mpImplPolygon = static_cast<ImplPolygon*>(&aStaticImplPolygon); else { - Rectangle aRect( rRect ); + tools::Rectangle aRect( rRect ); aRect.Justify(); // SJ: i9140 nHorzRound = std::min( nHorzRound, static_cast<sal_uInt32>(labs( aRect.GetWidth() >> 1 )) ); @@ -670,7 +670,7 @@ Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY ) mpImplPolygon = static_cast<ImplPolygon*>(&aStaticImplPolygon); } -Polygon::Polygon( const Rectangle& rBound, const Point& rStart, const Point& rEnd, +Polygon::Polygon( const tools::Rectangle& rBound, const Point& rStart, const Point& rEnd, PolyStyle eStyle, bool bFullCircle ) { const long nWidth = rBound.GetWidth(); @@ -922,7 +922,7 @@ void Polygon::Optimize( PolyOptimizeFlags nOptimizeFlags ) { if( nOptimizeFlags & PolyOptimizeFlags::EDGES ) { - const Rectangle aBound( GetBoundRect() ); + const tools::Rectangle aBound( GetBoundRect() ); const double fArea = ( aBound.GetWidth() + aBound.GetHeight() ) * 0.5; const sal_uInt16 nPercent = 50; @@ -1320,10 +1320,10 @@ void Polygon::Rotate( const Point& rCenter, double fSin, double fCos ) } } -void Polygon::Clip( const Rectangle& rRect ) +void Polygon::Clip( const tools::Rectangle& rRect ) { // #105251# Justify rect before edge filtering - Rectangle aJustifiedRect( rRect ); + tools::Rectangle aJustifiedRect( rRect ); aJustifiedRect.Justify(); sal_uInt16 nSourceSize = mpImplPolygon->mnPoints; @@ -1351,7 +1351,7 @@ void Polygon::Clip( const Rectangle& rRect ) mpImplPolygon = aPolygon.release(); } -Rectangle Polygon::GetBoundRect() const +tools::Rectangle Polygon::GetBoundRect() const { // Removing the assert. Bezier curves have the attribute that each single // curve segment defined by four points can not exit the four-point polygon @@ -1366,7 +1366,7 @@ Rectangle Polygon::GetBoundRect() const sal_uInt16 nCount = mpImplPolygon->mnPoints; if( ! nCount ) - return Rectangle(); + return tools::Rectangle(); long nXMin, nXMax, nYMin, nYMax; @@ -1388,14 +1388,14 @@ Rectangle Polygon::GetBoundRect() const nYMax = pPt->Y(); } - return Rectangle( nXMin, nYMin, nXMax, nYMax ); + return tools::Rectangle( nXMin, nYMin, nXMax, nYMax ); } bool Polygon::IsInside( const Point& rPoint ) const { DBG_ASSERT( !mpImplPolygon->mpFlagAry, "IsInside could fail with beziers!" ); - const Rectangle aBound( GetBoundRect() ); + const tools::Rectangle aBound( GetBoundRect() ); const Line aLine( rPoint, Point( aBound.Right() + 100L, rPoint.Y() ) ); sal_uInt16 nCount = mpImplPolygon->mnPoints; sal_uInt16 nPCounter = 0; diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx index 144fe9a4e00e..0c4f7ed9d665 100644 --- a/tools/source/generic/poly2.cxx +++ b/tools/source/generic/poly2.cxx @@ -251,7 +251,7 @@ void PolyPolygon::Optimize( PolyOptimizeFlags nOptimizeFlags ) if( bEdges ) { - const Rectangle aBound( GetBoundRect() ); + const tools::Rectangle aBound( GetBoundRect() ); fArea = ( aBound.GetWidth() + aBound.GetHeight() ) * 0.5; nPercent = 50; @@ -424,7 +424,7 @@ void PolyPolygon::Rotate( const Point& rCenter, double fSin, double fCos ) mpImplPolyPolygon->mpPolyAry[ i ]->Rotate( rCenter, fSin, fCos ); } -void PolyPolygon::Clip( const Rectangle& rRect ) +void PolyPolygon::Clip( const tools::Rectangle& rRect ) { sal_uInt16 nPolyCount = mpImplPolyPolygon->mnCount; sal_uInt16 i; @@ -449,7 +449,7 @@ void PolyPolygon::Clip( const Rectangle& rRect ) } } -Rectangle PolyPolygon::GetBoundRect() const +tools::Rectangle PolyPolygon::GetBoundRect() const { long nXMin=0, nXMax=0, nYMin=0, nYMax=0; bool bFirst = true; @@ -486,9 +486,9 @@ Rectangle PolyPolygon::GetBoundRect() const } if ( !bFirst ) - return Rectangle( nXMin, nYMin, nXMax, nYMax ); + return tools::Rectangle( nXMin, nYMin, nXMax, nYMax ); else - return Rectangle(); + return tools::Rectangle(); } Polygon& PolyPolygon::operator[]( sal_uInt16 nPos ) diff --git a/tools/source/generic/svborder.cxx b/tools/source/generic/svborder.cxx index 8f2bec386c5e..9e4f15133f9c 100644 --- a/tools/source/generic/svborder.cxx +++ b/tools/source/generic/svborder.cxx @@ -19,7 +19,7 @@ #include <tools/svborder.hxx> #include <osl/diagnose.h> -Rectangle & operator += ( Rectangle & rRect, const SvBorder & rBorder ) +tools::Rectangle & operator += ( tools::Rectangle & rRect, const SvBorder & rBorder ) { // call GetSize first due to Empty-Rect Size aS( rRect.GetSize() ); |