diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-30 20:27:55 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-31 06:27:11 +0000 |
commit | a5a571307fb3306b74ab46b085cde6388270a770 (patch) | |
tree | 66d4ce12bb5236c50ab6a5d253bc8c6d8b5d292d /vcl/backendtest | |
parent | 17d821af6bb9df93569836a92f6bed975587fc6c (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 'vcl/backendtest')
-rw-r--r-- | vcl/backendtest/VisualBackendTest.cxx | 38 | ||||
-rw-r--r-- | vcl/backendtest/outputdevice/bitmap.cxx | 22 | ||||
-rw-r--r-- | vcl/backendtest/outputdevice/common.cxx | 10 | ||||
-rw-r--r-- | vcl/backendtest/outputdevice/gradient.cxx | 4 | ||||
-rw-r--r-- | vcl/backendtest/outputdevice/line.cxx | 2 | ||||
-rw-r--r-- | vcl/backendtest/outputdevice/outputdevice.cxx | 4 | ||||
-rw-r--r-- | vcl/backendtest/outputdevice/pixel.cxx | 2 | ||||
-rw-r--r-- | vcl/backendtest/outputdevice/polygon.cxx | 2 | ||||
-rw-r--r-- | vcl/backendtest/outputdevice/polyline.cxx | 2 | ||||
-rw-r--r-- | vcl/backendtest/outputdevice/polypolygon.cxx | 2 | ||||
-rw-r--r-- | vcl/backendtest/outputdevice/rectangle.cxx | 4 |
11 files changed, 46 insertions, 46 deletions
diff --git a/vcl/backendtest/VisualBackendTest.cxx b/vcl/backendtest/VisualBackendTest.cxx index d419f249eb8c..1d9af127eb24 100644 --- a/vcl/backendtest/VisualBackendTest.cxx +++ b/vcl/backendtest/VisualBackendTest.cxx @@ -51,7 +51,7 @@ using namespace css; -void drawBitmapCentered(Rectangle& rRect, Bitmap aBitmap, vcl::RenderContext& rRenderContext) +void drawBitmapCentered(tools::Rectangle& rRect, Bitmap aBitmap, vcl::RenderContext& rRenderContext) { long nWidth = rRect.GetWidth(); long nHeight = rRect.GetHeight(); @@ -66,7 +66,7 @@ void drawBitmapCentered(Rectangle& rRect, Bitmap aBitmap, vcl::RenderContext& rR rRenderContext.DrawBitmap(aPoint, aBitmap); } -void drawBitmapScaledAndCentered(Rectangle& rRect, Bitmap aBitmap, vcl::RenderContext& rRenderContext, BmpScaleFlag aFlag = BmpScaleFlag::Fast) +void drawBitmapScaledAndCentered(tools::Rectangle& rRect, Bitmap aBitmap, vcl::RenderContext& rRenderContext, BmpScaleFlag aFlag = BmpScaleFlag::Fast) { long nWidth = rRect.GetWidth(); long nHeight = rRect.GetHeight(); @@ -80,7 +80,7 @@ void drawBitmapScaledAndCentered(Rectangle& rRect, Bitmap aBitmap, vcl::RenderCo drawBitmapCentered(rRect, aBitmap, rRenderContext); } -void drawBackgroundRect(Rectangle& rRect, Color aColor, vcl::RenderContext& rRenderContext) +void drawBackgroundRect(tools::Rectangle& rRect, Color aColor, vcl::RenderContext& rRenderContext) { rRenderContext.Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR); rRenderContext.SetFillColor(aColor); @@ -89,7 +89,7 @@ void drawBackgroundRect(Rectangle& rRect, Color aColor, vcl::RenderContext& rRen rRenderContext.Pop(); } -void assertAndSetBackground(vcl::test::TestResult eResult, Rectangle& rRect, vcl::RenderContext& rRenderContext) +void assertAndSetBackground(vcl::test::TestResult eResult, tools::Rectangle& rRect, vcl::RenderContext& rRenderContext) { if (eResult == vcl::test::TestResult::Passed) drawBackgroundRect(rRect, COL_GREEN, rRenderContext); @@ -157,9 +157,9 @@ public: } } - static std::vector<Rectangle> setupRegions(int nPartitionsX, int nPartitionsY, int nWidth, int nHeight) + static std::vector<tools::Rectangle> setupRegions(int nPartitionsX, int nPartitionsY, int nWidth, int nHeight) { - std::vector<Rectangle> aRegions; + std::vector<tools::Rectangle> aRegions; for (int y = 0; y < nPartitionsY; y++) { @@ -170,7 +170,7 @@ public: long x2 = (x+1) * (nWidth / nPartitionsX); long y2 = (y+1) * (nHeight / nPartitionsY); - aRegions.push_back(Rectangle(x1 + 1, y1 + 1, x2 - 2, y2 - 2)); + aRegions.push_back(tools::Rectangle(x1 + 1, y1 + 1, x2 - 2, y2 - 2)); } } return aRegions; @@ -178,10 +178,10 @@ public: static void testRectangles(vcl::RenderContext& rRenderContext, int nWidth, int nHeight) { - Rectangle aRectangle; + tools::Rectangle aRectangle; size_t index = 0; - std::vector<Rectangle> aRegions = setupRegions(3, 2, nWidth, nHeight); + std::vector<tools::Rectangle> aRegions = setupRegions(3, 2, nWidth, nHeight); aRectangle = aRegions[index++]; { @@ -234,10 +234,10 @@ public: static void testFilledRectangles(vcl::RenderContext& rRenderContext, int nWidth, int nHeight) { - Rectangle aRectangle; + tools::Rectangle aRectangle; size_t index = 0; - std::vector<Rectangle> aRegions = setupRegions(3, 2, nWidth, nHeight); + std::vector<tools::Rectangle> aRegions = setupRegions(3, 2, nWidth, nHeight); aRectangle = aRegions[index++]; { @@ -288,10 +288,10 @@ public: static void testLines(vcl::RenderContext& rRenderContext, int nWidth, int nHeight) { - Rectangle aRectangle; + tools::Rectangle aRectangle; size_t index = 0; - std::vector<Rectangle> aRegions = setupRegions(3, 2, nWidth, nHeight); + std::vector<tools::Rectangle> aRegions = setupRegions(3, 2, nWidth, nHeight); aRectangle = aRegions[index++]; { @@ -339,10 +339,10 @@ public: static void testBitmaps(vcl::RenderContext& rRenderContext, int nWidth, int nHeight) { - Rectangle aRectangle; + tools::Rectangle aRectangle; size_t index = 0; - std::vector<Rectangle> aRegions = setupRegions(2, 2, nWidth, nHeight); + std::vector<tools::Rectangle> aRegions = setupRegions(2, 2, nWidth, nHeight); aRectangle = aRegions[index++]; { @@ -374,7 +374,7 @@ public: } } - virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rRect*/) override + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/) override { if (mnTest % mnNumberOfTests == mnNumberOfTests - 1) { @@ -427,7 +427,7 @@ public: mpVDev->DrawPolyPolygon(polyPolygon); - Rectangle aGradientRect(Point(200, 200), Size(200 + fTime * 300, 200 + fTime * 300)); + tools::Rectangle aGradientRect(Point(200, 200), Size(200 + fTime * 300, 200 + fTime * 300)); mpVDev->DrawGradient(aGradientRect, Gradient(GradientStyle::Linear, COL_YELLOW, COL_BLUE)); rRenderContext.DrawOutDev(Point(), mpVDev->GetOutputSizePixel(), @@ -445,7 +445,7 @@ public: long nWidth = aSize.Width(); long nHeight = aSize.Height(); - Rectangle aRectangle; + tools::Rectangle aRectangle; size_t index = 0; if (mnTest % mnNumberOfTests == 0) @@ -466,7 +466,7 @@ public: } else if (mnTest % mnNumberOfTests == 4) { - std::vector<Rectangle> aRegions = setupRegions(3, 2, nWidth, nHeight); + std::vector<tools::Rectangle> aRegions = setupRegions(3, 2, nWidth, nHeight); aRectangle = aRegions[index++]; { diff --git a/vcl/backendtest/outputdevice/bitmap.cxx b/vcl/backendtest/outputdevice/bitmap.cxx index c86589ae9171..eaddff1a18a9 100644 --- a/vcl/backendtest/outputdevice/bitmap.cxx +++ b/vcl/backendtest/outputdevice/bitmap.cxx @@ -23,8 +23,8 @@ Bitmap OutputDeviceTestBitmap::setupDrawTransformedBitmap() Bitmap::ScopedWriteAccess aWriteAccess(aBitmap); aWriteAccess->Erase(constFillColor); aWriteAccess->SetLineColor(COL_YELLOW); - aWriteAccess->DrawRect(Rectangle(0, 0, 8, 8)); - aWriteAccess->DrawRect(Rectangle(2, 2, 6, 6)); + aWriteAccess->DrawRect(tools::Rectangle(0, 0, 8, 8)); + aWriteAccess->DrawRect(tools::Rectangle(2, 2, 6, 6)); } initialSetup(13, 13, constBackgroundColor); @@ -48,8 +48,8 @@ Bitmap OutputDeviceTestBitmap::setupDrawBitmap() Bitmap::ScopedWriteAccess aWriteAccess(aBitmap); aWriteAccess->Erase(constFillColor); aWriteAccess->SetLineColor(COL_YELLOW); - aWriteAccess->DrawRect(Rectangle(0, 0, 8, 8)); - aWriteAccess->DrawRect(Rectangle(2, 2, 6, 6)); + aWriteAccess->DrawRect(tools::Rectangle(0, 0, 8, 8)); + aWriteAccess->DrawRect(tools::Rectangle(2, 2, 6, 6)); } initialSetup(13, 13, constBackgroundColor); @@ -70,8 +70,8 @@ Bitmap OutputDeviceTestBitmap::setupDrawBitmapExWithAlpha() Bitmap::ScopedWriteAccess aWriteAccess(aBitmap); aWriteAccess->Erase(COL_WHITE); aWriteAccess->SetLineColor(Color(0xFF, 0xFF, 0x00)); - aWriteAccess->DrawRect(Rectangle(0, 0, 8, 8)); - aWriteAccess->DrawRect(Rectangle(3, 3, 5, 5)); + aWriteAccess->DrawRect(tools::Rectangle(0, 0, 8, 8)); + aWriteAccess->DrawRect(tools::Rectangle(3, 3, 5, 5)); } AlphaMask aAlpha(aBitmapSize); @@ -79,13 +79,13 @@ Bitmap OutputDeviceTestBitmap::setupDrawBitmapExWithAlpha() AlphaMask::ScopedWriteAccess aWriteAccess(aAlpha); aWriteAccess->Erase(COL_WHITE); aWriteAccess->SetLineColor(Color(0x44, 0x44, 0x44)); - aWriteAccess->DrawRect(Rectangle(0, 0, 8, 8)); - aWriteAccess->DrawRect(Rectangle(3, 3, 5, 5)); + aWriteAccess->DrawRect(tools::Rectangle(0, 0, 8, 8)); + aWriteAccess->DrawRect(tools::Rectangle(3, 3, 5, 5)); } initialSetup(13, 13, constBackgroundColor); - Point aPoint(alignToCenter(maVDRectangle, Rectangle(Point(), aBitmapSize)).TopLeft()); + Point aPoint(alignToCenter(maVDRectangle, tools::Rectangle(Point(), aBitmapSize)).TopLeft()); mpVirtualDevice->DrawBitmapEx(aPoint, BitmapEx(aBitmap, aAlpha)); @@ -100,8 +100,8 @@ Bitmap OutputDeviceTestBitmap::setupDrawMask() Bitmap::ScopedWriteAccess aWriteAccess(aBitmap); aWriteAccess->Erase(COL_WHITE); aWriteAccess->SetLineColor(COL_BLACK); - aWriteAccess->DrawRect(Rectangle(0, 0, 8, 8)); - aWriteAccess->DrawRect(Rectangle(3, 3, 5, 5)); + aWriteAccess->DrawRect(tools::Rectangle(0, 0, 8, 8)); + aWriteAccess->DrawRect(tools::Rectangle(3, 3, 5, 5)); } initialSetup(13, 13, constBackgroundColor); diff --git a/vcl/backendtest/outputdevice/common.cxx b/vcl/backendtest/outputdevice/common.cxx index 727fbcc8c767..1252baf3b1b1 100644 --- a/vcl/backendtest/outputdevice/common.cxx +++ b/vcl/backendtest/outputdevice/common.cxx @@ -226,7 +226,7 @@ OutputDeviceTestCommon::OutputDeviceTestCommon() void OutputDeviceTestCommon::initialSetup(long nWidth, long nHeight, Color aColor) { - maVDRectangle = Rectangle(Point(), Size (nWidth, nHeight)); + maVDRectangle = tools::Rectangle(Point(), Size (nWidth, nHeight)); mpVirtualDevice->SetOutputSizePixel(maVDRectangle.GetSize()); mpVirtualDevice->SetBackground(Wallpaper(aColor)); mpVirtualDevice->Erase(); @@ -282,12 +282,12 @@ TestResult OutputDeviceTestCommon::checkRectangles(Bitmap& aBitmap, std::vector< return aReturnValue; } -Rectangle OutputDeviceTestCommon::alignToCenter(Rectangle aRect1, Rectangle aRect2) +tools::Rectangle OutputDeviceTestCommon::alignToCenter(tools::Rectangle aRect1, tools::Rectangle aRect2) { Point aPoint((aRect1.GetWidth() / 2.0) - (aRect2.GetWidth() / 2.0), (aRect1.GetHeight() / 2.0) - (aRect2.GetHeight() / 2.0)); - return Rectangle(aPoint, aRect2.GetSize()); + return tools::Rectangle(aPoint, aRect2.GetSize()); } TestResult OutputDeviceTestCommon::checkDiamond(Bitmap& rBitmap) @@ -295,7 +295,7 @@ TestResult OutputDeviceTestCommon::checkDiamond(Bitmap& rBitmap) return checkDiamondLine(rBitmap, 1, constLineColor); } -void OutputDeviceTestCommon::createDiamondPoints(Rectangle rRect, int nOffset, +void OutputDeviceTestCommon::createDiamondPoints(tools::Rectangle rRect, int nOffset, Point& rPoint1, Point& rPoint2, Point& rPoint3, Point& rPoint4) { @@ -308,7 +308,7 @@ void OutputDeviceTestCommon::createDiamondPoints(Rectangle rRect, int nOffset, rPoint4 = Point(midPointX - nOffset, midPointY ); } -void OutputDeviceTestCommon::createHorizontalVerticalDiagonalLinePoints(Rectangle rRect, +void OutputDeviceTestCommon::createHorizontalVerticalDiagonalLinePoints(tools::Rectangle rRect, Point& rHorizontalLinePoint1, Point& rHorizontalLinePoint2, Point& rVerticalLinePoint1, Point& rVerticalLinePoint2, Point& rDiagonalLinePoint1, Point& rDiagonalLinePoint2) diff --git a/vcl/backendtest/outputdevice/gradient.cxx b/vcl/backendtest/outputdevice/gradient.cxx index 83d45bf8cf4d..b1fdd0a24445 100644 --- a/vcl/backendtest/outputdevice/gradient.cxx +++ b/vcl/backendtest/outputdevice/gradient.cxx @@ -19,7 +19,7 @@ Bitmap OutputDeviceTestGradient::setupLinearGradient() Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00)); aGradient.SetAngle(900); - Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1, + tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1, maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1); mpVirtualDevice->DrawGradient(aDrawRect, aGradient); @@ -31,7 +31,7 @@ Bitmap OutputDeviceTestGradient::setupRadialGradient() initialSetup(12, 12, constBackgroundColor); Gradient aGradient(GradientStyle::Radial, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00)); - Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1, + tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1, maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1); mpVirtualDevice->DrawGradient(aDrawRect, aGradient); diff --git a/vcl/backendtest/outputdevice/line.cxx b/vcl/backendtest/outputdevice/line.cxx index 4cd39dbfcfe9..1c384c14de3c 100644 --- a/vcl/backendtest/outputdevice/line.cxx +++ b/vcl/backendtest/outputdevice/line.cxx @@ -16,7 +16,7 @@ namespace test { namespace { -void drawLineOffset(OutputDevice& rDevice, Rectangle& rRect, int nOffset) +void drawLineOffset(OutputDevice& rDevice, tools::Rectangle& rRect, int nOffset) { Point aLeftTop (rRect.Left() + nOffset, rRect.Top() + nOffset); Point aRightTop (rRect.Right() - nOffset, rRect.Top() + nOffset); diff --git a/vcl/backendtest/outputdevice/outputdevice.cxx b/vcl/backendtest/outputdevice/outputdevice.cxx index 6f7ed16df824..5ada6edcefec 100644 --- a/vcl/backendtest/outputdevice/outputdevice.cxx +++ b/vcl/backendtest/outputdevice/outputdevice.cxx @@ -32,10 +32,10 @@ Bitmap OutputDeviceTestAnotherOutDev::setupXOR() { initialSetup(13, 13, constBackgroundColor); - Rectangle aDrawRectangle(maVDRectangle); + tools::Rectangle aDrawRectangle(maVDRectangle); aDrawRectangle.shrink(2); - Rectangle aScissorRectangle(maVDRectangle); + tools::Rectangle aScissorRectangle(maVDRectangle); aScissorRectangle.shrink(4); mpVirtualDevice->SetRasterOp(RasterOp::Xor); diff --git a/vcl/backendtest/outputdevice/pixel.cxx b/vcl/backendtest/outputdevice/pixel.cxx index f13690e72209..2ad49e0f2fe8 100644 --- a/vcl/backendtest/outputdevice/pixel.cxx +++ b/vcl/backendtest/outputdevice/pixel.cxx @@ -16,7 +16,7 @@ namespace test { namespace { -void drawPixelOffset(OutputDevice& rDevice, Rectangle& rRect, int nOffset) +void drawPixelOffset(OutputDevice& rDevice, tools::Rectangle& rRect, int nOffset) { for (long x = 0 + nOffset; x < (rRect.GetWidth() - nOffset); ++x) { diff --git a/vcl/backendtest/outputdevice/polygon.cxx b/vcl/backendtest/outputdevice/polygon.cxx index de722c54abe9..a6b3c75a9a13 100644 --- a/vcl/backendtest/outputdevice/polygon.cxx +++ b/vcl/backendtest/outputdevice/polygon.cxx @@ -16,7 +16,7 @@ namespace test { namespace { -void drawPolygonOffset(OutputDevice& rDevice, Rectangle& rRect, int nOffset) +void drawPolygonOffset(OutputDevice& rDevice, tools::Rectangle& rRect, int nOffset) { tools::Polygon aPolygon(4); aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Top() + nOffset), 0); diff --git a/vcl/backendtest/outputdevice/polyline.cxx b/vcl/backendtest/outputdevice/polyline.cxx index 808d7274965b..c449cfb31100 100644 --- a/vcl/backendtest/outputdevice/polyline.cxx +++ b/vcl/backendtest/outputdevice/polyline.cxx @@ -16,7 +16,7 @@ namespace test { namespace { -void drawPolyLineOffset(OutputDevice& rDevice, Rectangle& rRect, int nOffset) +void drawPolyLineOffset(OutputDevice& rDevice, tools::Rectangle& rRect, int nOffset) { tools::Polygon aPolygon(4); aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Top() + nOffset), 0); diff --git a/vcl/backendtest/outputdevice/polypolygon.cxx b/vcl/backendtest/outputdevice/polypolygon.cxx index a6d3a018fbfc..f7f3a53749f5 100644 --- a/vcl/backendtest/outputdevice/polypolygon.cxx +++ b/vcl/backendtest/outputdevice/polypolygon.cxx @@ -17,7 +17,7 @@ namespace test { namespace { -tools::Polygon createPolygonOffset(Rectangle& rRect, int nOffset) +tools::Polygon createPolygonOffset(tools::Rectangle& rRect, int nOffset) { tools::Polygon aPolygon(4); aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Top() + nOffset), 0); diff --git a/vcl/backendtest/outputdevice/rectangle.cxx b/vcl/backendtest/outputdevice/rectangle.cxx index 80ab3cf6f7ee..911d3dccf51d 100644 --- a/vcl/backendtest/outputdevice/rectangle.cxx +++ b/vcl/backendtest/outputdevice/rectangle.cxx @@ -15,9 +15,9 @@ namespace test { namespace { - void drawRectOffset(OutputDevice& rDevice, Rectangle& rRect, int nOffset) + void drawRectOffset(OutputDevice& rDevice, tools::Rectangle& rRect, int nOffset) { - rDevice.DrawRect(Rectangle(rRect.Left() + nOffset, rRect.Top() + nOffset, + rDevice.DrawRect(tools::Rectangle(rRect.Left() + nOffset, rRect.Top() + nOffset, rRect.Right() - nOffset, rRect.Bottom() - nOffset)); } |