summaryrefslogtreecommitdiff
path: root/vcl/backendtest
diff options
context:
space:
mode:
authorPhilipp Hofer <philipp.hofer@protonmail.com>2020-11-12 13:26:56 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-11-22 01:55:18 +0100
commit58d98a08aee7bf027c109eeb94183d24351827fa (patch)
tree4cdfd20f56d097e77f79286dfcc379eca25aa12a /vcl/backendtest
parenta65141b2b46ad8150bafca4629b0ef924978a201 (diff)
tdf#123936 Formatting files in module vcl with clang-format
Change-Id: Ia162ad5b7499c0ddfdbfca59ae76b81335ce2d45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105728 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
Diffstat (limited to 'vcl/backendtest')
-rw-r--r--vcl/backendtest/outputdevice/gradient.cxx36
-rw-r--r--vcl/backendtest/outputdevice/pixel.cxx7
-rw-r--r--vcl/backendtest/outputdevice/polypolygon.cxx16
-rw-r--r--vcl/backendtest/outputdevice/rectangle.cxx30
4 files changed, 43 insertions, 46 deletions
diff --git a/vcl/backendtest/outputdevice/gradient.cxx b/vcl/backendtest/outputdevice/gradient.cxx
index e9b454660cbc..ec5e9079e028 100644
--- a/vcl/backendtest/outputdevice/gradient.cxx
+++ b/vcl/backendtest/outputdevice/gradient.cxx
@@ -11,16 +11,16 @@
#include <test/outputdevice.hxx>
#include <vcl/gradient.hxx>
-namespace vcl::test {
-
+namespace vcl::test
+{
Bitmap OutputDeviceTestGradient::setupLinearGradient()
{
initialSetup(12, 12, constBackgroundColor);
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetAngle(Degree10(900));
- tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
- maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
+ tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
+ maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -32,8 +32,8 @@ Bitmap OutputDeviceTestGradient::setupLinearGradientAngled()
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetAngle(Degree10(450));
- tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
- maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
+ tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
+ maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -45,8 +45,8 @@ Bitmap OutputDeviceTestGradient::setupLinearGradientBorder()
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetBorder(50);
- tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
- maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
+ tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
+ maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -58,8 +58,8 @@ Bitmap OutputDeviceTestGradient::setupLinearGradientIntensity()
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetStartIntensity(50);
- tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
- maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
+ tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
+ maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -72,8 +72,8 @@ Bitmap OutputDeviceTestGradient::setupLinearGradientSteps()
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetAngle(Degree10(900));
aGradient.SetSteps(4);
- tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
- maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
+ tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
+ maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -85,8 +85,8 @@ Bitmap OutputDeviceTestGradient::setupAxialGradient()
Gradient aGradient(GradientStyle::Axial, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetAngle(Degree10(900));
- tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
- maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
+ tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
+ maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -97,8 +97,8 @@ Bitmap OutputDeviceTestGradient::setupRadialGradient()
initialSetup(12, 12, constBackgroundColor);
Gradient aGradient(GradientStyle::Radial, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
- tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
- maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
+ tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
+ maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -111,8 +111,8 @@ Bitmap OutputDeviceTestGradient::setupRadialGradientOfs()
Gradient aGradient(GradientStyle::Radial, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetOfsX(100); // Move center to the bottom-right corner.
aGradient.SetOfsY(100);
- tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
- maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
+ tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
+ maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
diff --git a/vcl/backendtest/outputdevice/pixel.cxx b/vcl/backendtest/outputdevice/pixel.cxx
index 520cf50fe92f..c0fcc47705f5 100644
--- a/vcl/backendtest/outputdevice/pixel.cxx
+++ b/vcl/backendtest/outputdevice/pixel.cxx
@@ -10,12 +10,11 @@
#include <test/outputdevice.hxx>
-namespace vcl::test {
-
+namespace vcl::test
+{
namespace
{
-
-void drawPixelOffset(OutputDevice& rDevice, tools::Rectangle const & rRect, int nOffset)
+void drawPixelOffset(OutputDevice& rDevice, tools::Rectangle const& rRect, int nOffset)
{
for (tools::Long x = 0 + nOffset; x < (rRect.GetWidth() - nOffset); ++x)
{
diff --git a/vcl/backendtest/outputdevice/polypolygon.cxx b/vcl/backendtest/outputdevice/polypolygon.cxx
index a53acbaf72be..9151bd28ff3f 100644
--- a/vcl/backendtest/outputdevice/polypolygon.cxx
+++ b/vcl/backendtest/outputdevice/polypolygon.cxx
@@ -10,23 +10,21 @@
#include <test/outputdevice.hxx>
-
-namespace vcl::test {
-
+namespace vcl::test
+{
namespace
{
-
-tools::Polygon createPolygonOffset(tools::Rectangle const & rRect, int nOffset, int nFix = 0)
+tools::Polygon createPolygonOffset(tools::Rectangle const& rRect, int nOffset, int nFix = 0)
{
// Note: According to https://lists.freedesktop.org/archives/libreoffice/2019-November/083709.html
// filling polygons always skips the right-most and bottom-most pixels, in order to avoid
// overlaps when drawing adjacent polygons. Specifying nFix = 1 allows to visually compensate
// for this by making the polygon explicitly larger.
tools::Polygon aPolygon(4);
- aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Top() + nOffset), 0);
- aPolygon.SetPoint(Point(rRect.Right() - nOffset + nFix, rRect.Top() + nOffset), 1);
+ aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Top() + nOffset), 0);
+ aPolygon.SetPoint(Point(rRect.Right() - nOffset + nFix, rRect.Top() + nOffset), 1);
aPolygon.SetPoint(Point(rRect.Right() - nOffset + nFix, rRect.Bottom() - nOffset + nFix), 2);
- aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Bottom() - nOffset + nFix), 3);
+ aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Bottom() - nOffset + nFix), 3);
aPolygon.Optimize(PolyOptimizeFlags::CLOSE);
return aPolygon;
}
@@ -53,7 +51,7 @@ Bitmap OutputDeviceTestPolyPolygon::setupFilledRectangle(bool useLineColor)
{
initialSetup(13, 13, constBackgroundColor);
- if(useLineColor)
+ if (useLineColor)
mpVirtualDevice->SetLineColor(constLineColor);
else
mpVirtualDevice->SetLineColor();
diff --git a/vcl/backendtest/outputdevice/rectangle.cxx b/vcl/backendtest/outputdevice/rectangle.cxx
index 8e7c0ba861aa..1401a39e1695 100644
--- a/vcl/backendtest/outputdevice/rectangle.cxx
+++ b/vcl/backendtest/outputdevice/rectangle.cxx
@@ -10,23 +10,23 @@
#include <test/outputdevice.hxx>
-namespace vcl::test {
-
+namespace vcl::test
+{
namespace
{
- void drawRectOffset(OutputDevice& rDevice, tools::Rectangle const & rRect, int nOffset)
- {
- rDevice.DrawRect(tools::Rectangle(rRect.Left() + nOffset, rRect.Top() + nOffset,
- rRect.Right() - nOffset, rRect.Bottom() - nOffset));
-
- }
+void drawRectOffset(OutputDevice& rDevice, tools::Rectangle const& rRect, int nOffset)
+{
+ rDevice.DrawRect(tools::Rectangle(rRect.Left() + nOffset, rRect.Top() + nOffset,
+ rRect.Right() - nOffset, rRect.Bottom() - nOffset));
+}
- void drawInvertOffset(OutputDevice& rDevice, tools::Rectangle const & rRect, int nOffset, InvertFlags eFlags)
- {
- tools::Rectangle aRectangle(rRect.Left() + nOffset, rRect.Top() + nOffset,
- rRect.Right() - nOffset, rRect.Bottom() - nOffset);
- rDevice.Invert(aRectangle, eFlags);
- }
+void drawInvertOffset(OutputDevice& rDevice, tools::Rectangle const& rRect, int nOffset,
+ InvertFlags eFlags)
+{
+ tools::Rectangle aRectangle(rRect.Left() + nOffset, rRect.Top() + nOffset,
+ rRect.Right() - nOffset, rRect.Bottom() - nOffset);
+ rDevice.Invert(aRectangle, eFlags);
+}
} // end anonymous namespace
@@ -34,7 +34,7 @@ Bitmap OutputDeviceTestRect::setupFilledRectangle(bool useLineColor)
{
initialSetup(13, 13, constBackgroundColor);
- if(useLineColor)
+ if (useLineColor)
mpVirtualDevice->SetLineColor(constLineColor);
else
mpVirtualDevice->SetLineColor();