summaryrefslogtreecommitdiff
path: root/tools/source/generic
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-03-30 20:27:55 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-03-31 06:27:11 +0000
commita5a571307fb3306b74ab46b085cde6388270a770 (patch)
tree66d4ce12bb5236c50ab6a5d253bc8c6d8b5d292d /tools/source/generic
parent17d821af6bb9df93569836a92f6bed975587fc6c (diff)
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 <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'tools/source/generic')
-rw-r--r--tools/source/generic/b3dtrans.cxx4
-rw-r--r--tools/source/generic/gen.cxx29
-rw-r--r--tools/source/generic/poly.cxx22
-rw-r--r--tools/source/generic/poly2.cxx10
-rw-r--r--tools/source/generic/svborder.cxx2
5 files changed, 35 insertions, 32 deletions
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() );