summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-12-23 14:09:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-12-24 12:00:07 +0100
commit88c0e46e139fe44f7f2a6f9fbaa6b3fd7a827a8d (patch)
treef41e0a3e856a8dd9dba6bbac7d08e62518b53420 /vcl
parent17aea7c41c95186c03c173a8c6f26cd2ebce4c54 (diff)
custom literal for Degree10
Change-Id: Id13869138a622e62d9ffebf2c89bddccda6aff01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/backendtest/outputdevice/gradient.cxx8
-rw-r--r--vcl/headless/svpgdi.cxx4
-rw-r--r--vcl/qa/cppunit/TypeSerializerTest.cxx2
-rw-r--r--vcl/qa/cppunit/svm/svmtest.cxx2
-rw-r--r--vcl/qt5/Qt5Graphics_Text.cxx2
-rw-r--r--vcl/skia/gdiimpl.cxx8
-rw-r--r--vcl/source/bitmap/bitmappaint.cxx12
-rw-r--r--vcl/source/control/fixed.cxx2
-rw-r--r--vcl/source/filter/GraphicNativeTransform.cxx7
-rw-r--r--vcl/source/filter/jpeg/Exif.cxx10
-rw-r--r--vcl/source/font/PhysicalFontFace.cxx2
-rw-r--r--vcl/source/font/fontselect.cxx8
-rw-r--r--vcl/source/gdi/gdimtf.cxx4
-rw-r--r--vcl/source/gdi/gradient.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx10
-rw-r--r--vcl/source/gdi/sallayout.cxx2
-rw-r--r--vcl/source/gdi/wall.cxx2
-rw-r--r--vcl/source/graphic/GraphicObject.cxx4
-rw-r--r--vcl/source/graphic/GraphicObject2.cxx2
-rw-r--r--vcl/source/outdev/gradient.cxx8
-rw-r--r--vcl/source/outdev/hatch.cxx20
-rw-r--r--vcl/source/outdev/text.cxx12
-rw-r--r--vcl/source/window/cursor.cxx2
-rw-r--r--vcl/source/window/printdlg.cxx2
-rw-r--r--vcl/source/window/toolbox.cxx4
-rw-r--r--vcl/source/window/toolbox2.cxx8
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx2
-rw-r--r--vcl/unx/generic/print/common_gfx.cxx2
-rw-r--r--vcl/unx/generic/print/text_gfx.cxx4
-rw-r--r--vcl/workben/svptest.cxx2
-rw-r--r--vcl/workben/vcldemo.cxx8
31 files changed, 83 insertions, 84 deletions
diff --git a/vcl/backendtest/outputdevice/gradient.cxx b/vcl/backendtest/outputdevice/gradient.cxx
index ec5e9079e028..ebb94fbaaf9b 100644
--- a/vcl/backendtest/outputdevice/gradient.cxx
+++ b/vcl/backendtest/outputdevice/gradient.cxx
@@ -18,7 +18,7 @@ Bitmap OutputDeviceTestGradient::setupLinearGradient()
initialSetup(12, 12, constBackgroundColor);
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
- aGradient.SetAngle(Degree10(900));
+ aGradient.SetAngle(900_deg10);
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::setupLinearGradientAngled()
initialSetup(12, 12, constBackgroundColor);
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
- aGradient.SetAngle(Degree10(450));
+ aGradient.SetAngle(450_deg10);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
@@ -70,7 +70,7 @@ Bitmap OutputDeviceTestGradient::setupLinearGradientSteps()
initialSetup(12, 12, constBackgroundColor);
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
- aGradient.SetAngle(Degree10(900));
+ aGradient.SetAngle(900_deg10);
aGradient.SetSteps(4);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
@@ -84,7 +84,7 @@ Bitmap OutputDeviceTestGradient::setupAxialGradient()
initialSetup(13, 13, constBackgroundColor);
Gradient aGradient(GradientStyle::Axial, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
- aGradient.SetAngle(Degree10(900));
+ aGradient.SetAngle(900_deg10);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 40e2ad1542b1..825da3e5f415 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1947,7 +1947,7 @@ bool SvpSalGraphics::drawGradient(const tools::PolyPolygon& rPolyPolygon, const
tools::Rectangle aBoundRect;
Point aCenter;
- aGradient.SetAngle(aGradient.GetAngle() + Degree10(2700));
+ aGradient.SetAngle(aGradient.GetAngle() + 2700_deg10);
aGradient.GetBoundRect(aInputRect, aBoundRect, aCenter);
Color aStartColor = aGradient.GetStartColor();
Color aEndColor = aGradient.GetEndColor();
@@ -1956,7 +1956,7 @@ bool SvpSalGraphics::drawGradient(const tools::PolyPolygon& rPolyPolygon, const
if (rGradient.GetStyle() == GradientStyle::Linear)
{
tools::Polygon aPoly(aBoundRect);
- aPoly.Rotate(aCenter, aGradient.GetAngle() % Degree10(3600));
+ aPoly.Rotate(aCenter, aGradient.GetAngle() % 3600_deg10);
pattern = cairo_pattern_create_linear(aPoly[0].X(), aPoly[0].Y(), aPoly[1].X(), aPoly[1].Y());
}
else
diff --git a/vcl/qa/cppunit/TypeSerializerTest.cxx b/vcl/qa/cppunit/TypeSerializerTest.cxx
index fd45662bdf20..6b3445032309 100644
--- a/vcl/qa/cppunit/TypeSerializerTest.cxx
+++ b/vcl/qa/cppunit/TypeSerializerTest.cxx
@@ -87,7 +87,7 @@ TypeSerializerTest::~TypeSerializerTest()
void TypeSerializerTest::testGradient()
{
Gradient aGradient(GradientStyle::Radial, Color(0xFF, 0x00, 0x00), Color(0x00, 0xFF, 0x00));
- aGradient.SetAngle(Degree10(900));
+ aGradient.SetAngle(900_deg10);
aGradient.SetBorder(5);
aGradient.SetOfsX(11);
aGradient.SetOfsY(12);
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index 454a58b75d0c..6a435c708807 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -1287,7 +1287,7 @@ void SvmTest::testHatch()
tools::PolyPolygon aPolyPolygon(1);
aPolyPolygon.Insert(aPolygon);
- Hatch aHatch(HatchStyle::Single, COL_YELLOW, 15, Degree10(900));
+ Hatch aHatch(HatchStyle::Single, COL_YELLOW, 15, 900_deg10);
pVirtualDev->DrawHatch(aPolyPolygon, aHatch);
diff --git a/vcl/qt5/Qt5Graphics_Text.cxx b/vcl/qt5/Qt5Graphics_Text.cxx
index 50bae31399ef..cfd148e8415e 100644
--- a/vcl/qt5/Qt5Graphics_Text.cxx
+++ b/vcl/qt5/Qt5Graphics_Text.cxx
@@ -305,7 +305,7 @@ void Qt5Graphics::DrawTextLayout(const GenericSalLayout& rLayout)
= static_cast<Qt5CommonSalLayout*>(const_cast<GenericSalLayout*>(&rLayout));
Degree10 nOrientation = rLayout.GetOrientation();
if (nOrientation)
- pQt5Layout->SetOrientation(Degree10(0));
+ pQt5Layout->SetOrientation(0_deg10);
Point aPos;
const GlyphItem* pGlyph;
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 773bdd2be1bf..9e7a441d3b86 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1880,7 +1880,7 @@ bool SkiaSalGraphicsImpl::drawGradient(const tools::PolyPolygon& rPolyPolygon,
Gradient aGradient(rGradient);
tools::Rectangle aBoundRect;
Point aCenter;
- aGradient.SetAngle(aGradient.GetAngle() + Degree10(2700));
+ aGradient.SetAngle(aGradient.GetAngle() + 2700_deg10);
aGradient.GetBoundRect(boundRect, aBoundRect, aCenter);
SkColor startColor
@@ -1891,7 +1891,7 @@ bool SkiaSalGraphicsImpl::drawGradient(const tools::PolyPolygon& rPolyPolygon,
if (rGradient.GetStyle() == GradientStyle::Linear)
{
tools::Polygon aPoly(aBoundRect);
- aPoly.Rotate(aCenter, aGradient.GetAngle() % Degree10(3600));
+ aPoly.Rotate(aCenter, aGradient.GetAngle() % 3600_deg10);
SkPoint points[2] = { SkPoint::Make(toSkX(aPoly[0].X()), toSkY(aPoly[0].Y())),
SkPoint::Make(toSkX(aPoly[1].X()), toSkY(aPoly[1].Y())) };
SkColor colors[2] = { startColor, endColor };
@@ -1901,7 +1901,7 @@ bool SkiaSalGraphicsImpl::drawGradient(const tools::PolyPolygon& rPolyPolygon,
else if (rGradient.GetStyle() == GradientStyle::Axial)
{
tools::Polygon aPoly(aBoundRect);
- aPoly.Rotate(aCenter, aGradient.GetAngle() % Degree10(3600));
+ aPoly.Rotate(aCenter, aGradient.GetAngle() % 3600_deg10);
SkPoint points[2] = { SkPoint::Make(toSkX(aPoly[0].X()), toSkY(aPoly[0].Y())),
SkPoint::Make(toSkX(aPoly[1].X()), toSkY(aPoly[1].Y())) };
SkColor colors[3] = { endColor, startColor, endColor };
@@ -1985,7 +1985,7 @@ void SkiaSalGraphicsImpl::drawGenericLayout(const GenericSalLayout& layout, Colo
{
angle = layout.GetOrientation();
if (pGlyph->IsVertical())
- angle += Degree10(900); // 90 degree
+ angle += 900_deg10; // 90 degree
}
SkRSXform form = SkRSXform::Make(toCos(angle), toSin(angle), aPos.X(), aPos.Y());
glyphForms.emplace_back(std::move(form));
diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx
index 98c4a37a435a..98d50d5f87bc 100644
--- a/vcl/source/bitmap/bitmappaint.cxx
+++ b/vcl/source/bitmap/bitmappaint.cxx
@@ -212,12 +212,12 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& rFillColor)
{
bool bRet = false;
- nAngle10 %= Degree10(3600);
- nAngle10 = (nAngle10 < Degree10(0)) ? (Degree10(3599) + nAngle10) : nAngle10;
+ nAngle10 %= 3600_deg10;
+ nAngle10 = (nAngle10 < 0_deg10) ? (Degree10(3599) + nAngle10) : nAngle10;
if (!nAngle10)
bRet = true;
- else if (nAngle10 == Degree10(1800))
+ else if (nAngle10 == 1800_deg10)
bRet = Mirror(BmpMirrorFlags::Horizontal | BmpMirrorFlags::Vertical);
else
{
@@ -228,7 +228,7 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& rFillColor)
{
const Size aSizePix(GetSizePixel());
- if (nAngle10 == Degree10(900) || nAngle10 == Degree10(2700))
+ if (nAngle10 == 900_deg10 || nAngle10 == 2700_deg10)
{
const Size aNewSizePix(aSizePix.Height(), aSizePix.Width());
Bitmap aNewBmp(aNewSizePix, GetBitCount(), &pReadAcc->GetPalette());
@@ -243,7 +243,7 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& rFillColor)
const tools::Long nNewWidth = aNewSizePix.Width();
const tools::Long nNewHeight = aNewSizePix.Height();
- if (nAngle10 == Degree10(900))
+ if (nAngle10 == 900_deg10)
{
for (tools::Long nY = 0, nOtherX = nWidth1; nY < nNewHeight;
nY++, nOtherX--)
@@ -256,7 +256,7 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& rFillColor)
}
}
}
- else if (nAngle10 == Degree10(2700))
+ else if (nAngle10 == 2700_deg10)
{
for (tools::Long nY = 0, nOtherX = 0; nY < nNewHeight; nY++, nOtherX++)
{
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index bb9831dcf425..9b8e6242e296 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -507,7 +507,7 @@ void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext)
tools::Long nWidth = rRenderContext.GetTextWidth(aText);
rRenderContext.Push(PushFlags::FONT);
vcl::Font aFont(rRenderContext.GetFont());
- aFont.SetOrientation(Degree10(900));
+ aFont.SetOrientation(900_deg10);
SetFont(aFont);
Point aStartPt(aOutSize.Width() / 2, aOutSize.Height() - 1);
if (nWinStyle & WB_VCENTER)
diff --git a/vcl/source/filter/GraphicNativeTransform.cxx b/vcl/source/filter/GraphicNativeTransform.cxx
index d1bb5abb547b..b591217edd91 100644
--- a/vcl/source/filter/GraphicNativeTransform.cxx
+++ b/vcl/source/filter/GraphicNativeTransform.cxx
@@ -38,14 +38,13 @@ GraphicNativeTransform::~GraphicNativeTransform() {}
void GraphicNativeTransform::rotate(Degree10 aInputRotation)
{
// Rotation can be between 0 and 3600
- Degree10 aRotation = aInputRotation % Degree10(3600);
+ Degree10 aRotation = aInputRotation % 3600_deg10;
- if (aRotation == Degree10(0))
+ if (aRotation == 0_deg10)
{
return; // No rotation is needed
}
- else if (aRotation != Degree10(900) && aRotation != Degree10(1800)
- && aRotation != Degree10(2700))
+ else if (aRotation != 900_deg10 && aRotation != 1800_deg10 && aRotation != 2700_deg10)
{
return;
}
diff --git a/vcl/source/filter/jpeg/Exif.cxx b/vcl/source/filter/jpeg/Exif.cxx
index b8760b63aef7..d23c6025185c 100644
--- a/vcl/source/filter/jpeg/Exif.cxx
+++ b/vcl/source/filter/jpeg/Exif.cxx
@@ -53,17 +53,17 @@ Degree10 Exif::getRotation() const
{
switch(maOrientation) {
case exif::TOP_LEFT:
- return Degree10(0);
+ return 0_deg10;
case exif::BOTTOM_RIGHT:
- return Degree10(1800);
+ return 1800_deg10;
case exif::RIGHT_TOP:
- return Degree10(2700);
+ return 2700_deg10;
case exif::LEFT_BOTTOM:
- return Degree10(900);
+ return 900_deg10;
default:
break;
}
- return Degree10(0);
+ return 0_deg10;
}
bool Exif::read(SvStream& rStream)
diff --git a/vcl/source/font/PhysicalFontFace.cxx b/vcl/source/font/PhysicalFontFace.cxx
index 9610c1268057..876d6dfbb924 100644
--- a/vcl/source/font/PhysicalFontFace.cxx
+++ b/vcl/source/font/PhysicalFontFace.cxx
@@ -161,7 +161,7 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchSt
int nHeightMatch = 0;
int nWidthMatch = 0;
- if( rFSD.mnOrientation != Degree10(0) )
+ if( rFSD.mnOrientation != 0_deg10 )
nMatch += 80;
else if( rFSD.mnWidth != 0 )
nMatch += 25;
diff --git a/vcl/source/font/fontselect.cxx b/vcl/source/font/fontselect.cxx
index 09fb90e8b15f..b592c71670a2 100644
--- a/vcl/source/font/fontselect.cxx
+++ b/vcl/source/font/fontselect.cxx
@@ -46,12 +46,12 @@ FontSelectPattern::FontSelectPattern( const vcl::Font& rFont,
rFont.GetFontAttributes( *this );
// normalize orientation between 0 and 3600
- if( mnOrientation < Degree10(0) || mnOrientation >= Degree10(3600) )
+ if( mnOrientation < 0_deg10 || mnOrientation >= 3600_deg10 )
{
- if( mnOrientation >= Degree10(0) )
- mnOrientation %= Degree10(3600);
+ if( mnOrientation >= 0_deg10 )
+ mnOrientation %= 3600_deg10;
else
- mnOrientation = Degree10(3600) - (-mnOrientation % Degree10(3600));
+ mnOrientation = 3600_deg10 - (-mnOrientation % 3600_deg10);
}
// normalize width and height
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 89390752d185..43cfa3070c1e 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -819,8 +819,8 @@ void GDIMetaFile::ImplAddGradientEx( GDIMetaFile& rMtf,
void GDIMetaFile::Rotate( Degree10 nAngle10 )
{
- nAngle10 %= Degree10(3600);
- nAngle10 = ( nAngle10 < Degree10(0) ) ? ( Degree10(3599) + nAngle10 ) : nAngle10;
+ nAngle10 %= 3600_deg10;
+ nAngle10 = ( nAngle10 < 0_deg10 ) ? ( Degree10(3599) + nAngle10 ) : nAngle10;
if( !nAngle10 )
return;
diff --git a/vcl/source/gdi/gradient.cxx b/vcl/source/gdi/gradient.cxx
index b5c331e6953c..a3014abda46d 100644
--- a/vcl/source/gdi/gradient.cxx
+++ b/vcl/source/gdi/gradient.cxx
@@ -198,7 +198,7 @@ void Gradient::SetSteps( sal_uInt16 nSteps )
void Gradient::GetBoundRect( const tools::Rectangle& rRect, tools::Rectangle& rBoundRect, Point& rCenter ) const
{
tools::Rectangle aRect( rRect );
- Degree10 nAngle = GetAngle() % Degree10(3600);
+ Degree10 nAngle = GetAngle() % 3600_deg10;
if( GetStyle() == GradientStyle::Linear || GetStyle() == GradientStyle::Axial )
{
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 87b33685cc51..9b70300e5cc7 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6062,9 +6062,9 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
Degree10 nAngle = m_aCurrentPDFState.m_aFont.GetOrientation();
// normalize angles
- while( nAngle < Degree10(0) )
- nAngle += Degree10(3600);
- nAngle = nAngle % Degree10(3600);
+ while( nAngle < 0_deg10 )
+ nAngle += 3600_deg10;
+ nAngle = nAngle % 3600_deg10;
double fAngle = static_cast<double>(nAngle.get()) * M_PI / 1800.0;
Matrix3 aRotScale;
@@ -8300,7 +8300,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit const & rObject )
tools::Rectangle aBoundRect;
Point aCenter;
- Degree10 nAngle = rObject.m_aGradient.GetAngle() % Degree10(3600);
+ Degree10 nAngle = rObject.m_aGradient.GetAngle() % 3600_deg10;
rObject.m_aGradient.GetBoundRect( aRect, aBoundRect, aCenter );
const bool bLinear = (rObject.m_aGradient.GetStyle() == GradientStyle::Linear);
@@ -8326,7 +8326,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit const & rObject )
tools::Polygon aPoly( 2 );
aPoly[0] = aBoundRect.BottomCenter();
aPoly[1] = aBoundRect.TopCenter();
- aPoly.Rotate( aCenter, Degree10(3600) - nAngle );
+ aPoly.Rotate( aCenter, 3600_deg10 - nAngle );
aLine.append( static_cast<sal_Int32>(aPoly[0].X()) );
aLine.append( " " );
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index eaa03d22e5f0..fc3338929ec5 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -562,7 +562,7 @@ Point SalLayout::GetDrawPosition( const Point& rRelative ) const
Point aPos = maDrawBase;
Point aOfs = rRelative + maDrawOffset;
- if( mnOrientation == Degree10(0) )
+ if( mnOrientation == 0_deg10 )
aPos += aOfs;
else
{
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index 6b332e5c74fe..444b5441b202 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -282,7 +282,7 @@ bool Wallpaper::IsGradient() const
Gradient Wallpaper::ImplGetApplicationGradient()
{
Gradient g;
- g.SetAngle( Degree10(900) );
+ g.SetAngle( 900_deg10 );
g.SetStyle( GradientStyle::Linear );
g.SetStartColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
// no 'extreme' gradient when high contrast
diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx
index aa5435d3ad50..ffb2cc776bc5 100644
--- a/vcl/source/graphic/GraphicObject.cxx
+++ b/vcl/source/graphic/GraphicObject.cxx
@@ -110,7 +110,7 @@ bool lclDrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
if( aGraphic.IsSupportedGraphic() )
{
- const Degree10 nRot10 = rAttr.GetRotation() % Degree10(3600);
+ const Degree10 nRot10 = rAttr.GetRotation() % 3600_deg10;
if( nRot10 )
{
@@ -353,7 +353,7 @@ bool GraphicObject::ImplGetCropParams( OutputDevice const * pOut, Point& rPt, Si
if( GetType() != GraphicType::NONE )
{
tools::Polygon aClipPoly( tools::Rectangle( rPt, rSz ) );
- const Degree10 nRot10 = pAttr->GetRotation() % Degree10(3600);
+ const Degree10 nRot10 = pAttr->GetRotation() % 3600_deg10;
const Point aOldOrigin( rPt );
const MapMode aMap100( MapUnit::Map100thMM );
Size aSize100;
diff --git a/vcl/source/graphic/GraphicObject2.cxx b/vcl/source/graphic/GraphicObject2.cxx
index 4153ff47a6ea..82ce4dd07fcf 100644
--- a/vcl/source/graphic/GraphicObject2.cxx
+++ b/vcl/source/graphic/GraphicObject2.cxx
@@ -484,7 +484,7 @@ void GraphicObject::ImplTransformBitmap( BitmapEx& rBmpEx,
const Size aSizePixel( rBmpEx.GetSizePixel() );
- if( rAttr.GetRotation() == Degree10(0) || IsAnimated() )
+ if( rAttr.GetRotation() == 0_deg10 || IsAnimated() )
return;
if( !(aSizePixel.Width() && aSizePixel.Height() && rDstSize.Width() && rDstSize.Height()) )
diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx
index ea8e8b1ca703..5e562c259d96 100644
--- a/vcl/source/outdev/gradient.cxx
+++ b/vcl/source/outdev/gradient.cxx
@@ -265,7 +265,7 @@ void OutputDevice::DrawLinearGradient( const tools::Rectangle& rRect,
// get BoundRect of rotated rectangle
tools::Rectangle aRect;
Point aCenter;
- Degree10 nAngle = rGradient.GetAngle() % Degree10(3600);
+ Degree10 nAngle = rGradient.GetAngle() % 3600_deg10;
rGradient.GetBoundRect( rRect, aRect, aCenter );
@@ -470,7 +470,7 @@ void OutputDevice::DrawComplexGradient( const tools::Rectangle& rRect,
tools::Long nRedSteps = nEndRed - nStartRed;
tools::Long nGreenSteps = nEndGreen - nStartGreen;
tools::Long nBlueSteps = nEndBlue - nStartBlue;
- Degree10 nAngle = rGradient.GetAngle() % Degree10(3600);
+ Degree10 nAngle = rGradient.GetAngle() % 3600_deg10;
rGradient.GetBoundRect( rRect, aRect, aCenter );
@@ -623,7 +623,7 @@ void OutputDevice::DrawLinearGradientToMetafile( const tools::Rectangle& rRect,
// get BoundRect of rotated rectangle
tools::Rectangle aRect;
Point aCenter;
- Degree10 nAngle = rGradient.GetAngle() % Degree10(3600);
+ Degree10 nAngle = rGradient.GetAngle() % 3600_deg10;
rGradient.GetBoundRect( rRect, aRect, aCenter );
@@ -820,7 +820,7 @@ void OutputDevice::DrawComplexGradientToMetafile( const tools::Rectangle& rRect,
tools::Long nRedSteps = nEndRed - nStartRed;
tools::Long nGreenSteps = nEndGreen - nStartGreen;
tools::Long nBlueSteps = nEndBlue - nStartBlue;
- Degree10 nAngle = rGradient.GetAngle() % Degree10(3600);
+ Degree10 nAngle = rGradient.GetAngle() % 3600_deg10;
rGradient.GetBoundRect( rRect, aRect, aCenter );
diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx
index f2d234677331..775253bbba9a 100644
--- a/vcl/source/outdev/hatch.cxx
+++ b/vcl/source/outdev/hatch.cxx
@@ -187,7 +187,7 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch&
if( ( rHatch.GetStyle() == HatchStyle::Double ) || ( rHatch.GetStyle() == HatchStyle::Triple ) )
{
// Double hatch
- CalcHatchValues( aRect, nWidth, rHatch.GetAngle() + Degree10(900), aPt1, aPt2, aInc, aEndPt1 );
+ CalcHatchValues( aRect, nWidth, rHatch.GetAngle() + 900_deg10, aPt1, aPt2, aInc, aEndPt1 );
do
{
DrawHatchLine( tools::Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer.get(), bMtf );
@@ -199,7 +199,7 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch&
if( rHatch.GetStyle() == HatchStyle::Triple )
{
// Triple hatch
- CalcHatchValues( aRect, nWidth, rHatch.GetAngle() + Degree10(450), aPt1, aPt2, aInc, aEndPt1 );
+ CalcHatchValues( aRect, nWidth, rHatch.GetAngle() + 450_deg10, aPt1, aPt2, aInc, aEndPt1 );
do
{
DrawHatchLine( tools::Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer.get(), bMtf );
@@ -216,15 +216,15 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, tools::Long n
Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 )
{
Point aRef;
- Degree10 nAngle = nAngle10 % Degree10(1800);
+ Degree10 nAngle = nAngle10 % 1800_deg10;
tools::Long nOffset = 0;
- if( nAngle > Degree10(900) )
- nAngle -= Degree10(1800);
+ if( nAngle > 900_deg10 )
+ nAngle -= 1800_deg10;
aRef = ( !IsRefPoint() ? rRect.TopLeft() : GetRefPoint() );
- if( Degree10(0) == nAngle )
+ if( 0_deg10 == nAngle )
{
rInc = Size( 0, nDist );
rPt1 = rRect.TopLeft();
@@ -239,7 +239,7 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, tools::Long n
rPt1.AdjustY( -nOffset );
rPt2.AdjustY( -nOffset );
}
- else if( Degree10(900) == nAngle )
+ else if( 900_deg10 == nAngle )
{
rInc = Size( nDist, 0 );
rPt1 = rRect.TopLeft();
@@ -254,7 +254,7 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, tools::Long n
rPt1.AdjustX( -nOffset );
rPt2.AdjustX( -nOffset );
}
- else if( nAngle >= Degree10(-450) && nAngle <= Degree10(450) )
+ else if( nAngle >= Degree10(-450) && nAngle <= 450_deg10 )
{
const double fAngle = F_PI1800 * std::abs( nAngle.get() );
const double fTan = tan( fAngle );
@@ -264,7 +264,7 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, tools::Long n
nDist = FRound( nDist / cos( fAngle ) );
rInc = Size( 0, nDist );
- if( nAngle > Degree10(0) )
+ if( nAngle > 0_deg10 )
{
rPt1 = rRect.TopLeft();
rPt2 = Point( rRect.Right(), rRect.Top() - nYOff );
@@ -297,7 +297,7 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, tools::Long n
nDist = FRound( nDist / sin( fAngle ) );
rInc = Size( nDist, 0 );
- if( nAngle > Degree10(0) )
+ if( nAngle > 0_deg10 )
{
rPt1 = rRect.TopLeft();
rPt2 = Point( rRect.Left() - nXOff, rRect.Bottom() );
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 42a753f29e3f..c23f93b5ddfb 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -90,9 +90,9 @@ void OutputDevice::ImplDrawTextRect( tools::Long nBaseX, tools::Long nBaseY,
if ( nOrientation )
{
// Rotate rect without rounding problems for 90 degree rotations
- if ( !(nOrientation % Degree10(900)) )
+ if ( !(nOrientation % 900_deg10) )
{
- if ( nOrientation == Degree10(900) )
+ if ( nOrientation == 900_deg10 )
{
tools::Long nTemp = nX;
nX = nY;
@@ -102,7 +102,7 @@ void OutputDevice::ImplDrawTextRect( tools::Long nBaseX, tools::Long nBaseY,
nHeight = nTemp;
nY -= nHeight;
}
- else if ( nOrientation == Degree10(1800) )
+ else if ( nOrientation == 1800_deg10 )
{
nX = -nX;
nY = -nY;
@@ -173,7 +173,7 @@ tools::Rectangle OutputDevice::ImplGetTextBoundRect( const SalLayout& rSalLayout
if ( mpFontInstance->mnOrientation )
{
tools::Long nBaseX = nX, nBaseY = nY;
- if ( !(mpFontInstance->mnOrientation % Degree10(900)) )
+ if ( !(mpFontInstance->mnOrientation % 900_deg10) )
{
tools::Long nX2 = nX+nWidth;
tools::Long nY2 = nY+nHeight;
@@ -225,7 +225,7 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout )
const FontSelectPattern& rPattern = mpFontInstance->GetFontSelectPattern();
vcl::Font aFont( GetFont() );
- aFont.SetOrientation( Degree10(0) );
+ aFont.SetOrientation( 0_deg10 );
aFont.SetFontSize( Size( rPattern.mnWidth, rPattern.mnHeight ) );
pVDev->SetFont( aFont );
pVDev->SetTextColor( COL_BLACK );
@@ -1230,7 +1230,7 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr,
// set layout options
ImplLayoutArgs aLayoutArgs(rStr, nMinIndex, nEndIndex, nLayoutFlags, maFont.GetLanguageTag(), pLayoutCache);
- Degree10 nOrientation = mpFontInstance ? mpFontInstance->mnOrientation : Degree10(0);
+ Degree10 nOrientation = mpFontInstance ? mpFontInstance->mnOrientation : 0_deg10;
aLayoutArgs.SetOrientation( nOrientation );
aLayoutArgs.SetLayoutWidth( nPixelWidth );
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 18773be22698..c8e9b5ab14ed 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -332,7 +332,7 @@ vcl::Cursor::Cursor()
{
mpData = nullptr;
mpWindow = nullptr;
- mnOrientation = Degree10(0);
+ mnOrientation = 0_deg10;
mnDirection = CursorDirection::NONE;
mnStyle = 0;
mbVisible = false;
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 6ea1182f2b7e..45ac01862829 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -158,7 +158,7 @@ void PrintDialog::PrintPreviewWindow::Paint(vcl::RenderContext& rRenderContext,
{
rRenderContext.Push(PushFlags::FONT);
vcl::Font aFont(rRenderContext.GetFont());
- aFont.SetOrientation(Degree10(900));
+ aFont.SetOrientation(900_deg10);
rRenderContext.SetFont(aFont);
auto nLeft = aOffset.X() - nTextHeight;
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 289f9e522954..5f8df0453a20 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1146,7 +1146,7 @@ void ToolBox::ImplInitToolBoxData()
meTextPosition = ToolBoxTextPosition::Right;
mnLastFocusItemId = 0;
mnActivateCount = 0;
- mnImagesRotationAngle = Degree10(0);
+ mnImagesRotationAngle = 0_deg10;
mpStatusListener = new VclStatusListener<ToolBox>(this, ".uno:ImageOrientation");
mpStatusListener->startListening();
@@ -2700,7 +2700,7 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplToolItems::si
bRotate = true;
vcl::Font aRotateFont = aOldFont;
- aRotateFont.SetOrientation( Degree10(2700) );
+ aRotateFont.SetOrientation( 2700_deg10 );
// center horizontally
nTextOffX += aTxtSize.Height();
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 360fa312640d..18cd1481d014 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -94,7 +94,7 @@ void ImplToolItem::init(sal_uInt16 nItemId, ToolBoxItemBits nItemBits,
mbBreak = false;
mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
- mnImageAngle = Degree10(0);
+ mnImageAngle = 0_deg10;
mbMirrorMode = false;
mbVisibleText = false;
mbExpand = false;
@@ -978,9 +978,9 @@ void ToolBox::SetItemImageAngle( sal_uInt16 nItemId, Degree10 nAngle10 )
ImplToolItem* pItem = &mpData->m_aItems[nPos];
Size aOldSize = pItem->maImage.GetSizePixel();
- Degree10 nDeltaAngle = (nAngle10 - pItem->mnImageAngle) % Degree10(3600);
- while( nDeltaAngle < Degree10(0) )
- nDeltaAngle += Degree10(3600);
+ Degree10 nDeltaAngle = (nAngle10 - pItem->mnImageAngle) % 3600_deg10;
+ while( nDeltaAngle < 0_deg10 )
+ nDeltaAngle += 3600_deg10;
pItem->mnImageAngle = nAngle10;
if( nDeltaAngle && !!pItem->maImage )
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index d3fd5f753983..9cd6afaf7e53 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -91,7 +91,7 @@ namespace
double toRadian(Degree10 nDegree10th)
{
- return (Degree10(3600) - nDegree10th).get() * M_PI / 1800.0;
+ return (3600_deg10 - nDegree10th).get() * M_PI / 1800.0;
}
cairo_t* syncCairoContext(cairo_t* cr)
diff --git a/vcl/unx/generic/print/common_gfx.cxx b/vcl/unx/generic/print/common_gfx.cxx
index e39e4e331c76..b2ea22adb927 100644
--- a/vcl/unx/generic/print/common_gfx.cxx
+++ b/vcl/unx/generic/print/common_gfx.cxx
@@ -125,7 +125,7 @@ PrinterGfx::Clear()
mnDepth = 24;
mnPSLevel = 2;
mbColor = true;
- mnTextAngle = Degree10(0);
+ mnTextAngle = 0_deg10;
maClipRegion.clear();
maGraphicsStack.clear();
diff --git a/vcl/unx/generic/print/text_gfx.cxx b/vcl/unx/generic/print/text_gfx.cxx
index f87fe2176f20..d847004ed5ad 100644
--- a/vcl/unx/generic/print/text_gfx.cxx
+++ b/vcl/unx/generic/print/text_gfx.cxx
@@ -90,7 +90,7 @@ void PrinterGfx::DrawGlyph(const Point& rPoint,
PSGSave ();
PSTranslate (rPoint);
PSRotate (nCurrentTextAngle);
- mnTextAngle = Degree10(0);
+ mnTextAngle = 0_deg10;
aPoint = Point( 0, 0 );
}
@@ -114,7 +114,7 @@ void PrinterGfx::DrawGlyph(const Point& rPoint,
maVirtualStatus.mnTextHeight = nTextWidth;
if( aPoint.X() || aPoint.Y() )
PSTranslate( aPoint );
- PSRotate (Degree10(900));
+ PSRotate (900_deg10);
// draw the rotated glyph
drawGlyph(aRotPoint, rGlyph.glyphId());
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx
index 18192be64ed8..cc936cc44f58 100644
--- a/vcl/workben/svptest.cxx
+++ b/vcl/workben/svptest.cxx
@@ -264,7 +264,7 @@ void MyWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rR
Color const aDarkGreen(0, 0x40, 0);
Gradient aGradient(GradientStyle::Linear, aBlack, aWhite);
- aGradient.SetAngle(Degree10(900));
+ aGradient.SetAngle(900_deg10);
rRenderContext.DrawGradient(tools::Rectangle(Point(1000, 4500),
Size(aPaperSize.Width() - 2000, 500)),
aGradient);
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index d0a0aafdf7ea..9b6b719192a6 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -463,7 +463,7 @@ public:
aFontRect.AdjustTop(nHeight/2 );
aFontRect.AdjustBottom(nHeight );
- aFont.SetOrientation(Degree10(450)); // 45 degrees
+ aFont.SetOrientation(450_deg10); // 45 degrees
rDev.SetFont(aFont);
rDev.DrawText(aFontRect, aText);
@@ -679,7 +679,7 @@ public:
case 2:
{
tools::Polygon aPoly(aSub);
- aPoly.Rotate(aSub.Center(), Degree10(450));
+ aPoly.Rotate(aSub.Center(), 450_deg10);
aPoly.Clip(aSmaller);
aRegion = vcl::Region(aPoly);
break;
@@ -1035,7 +1035,7 @@ public:
case 3:
case 0: // 45degree rectangle.
aPoly = tools::Polygon(aPieces[i]);
- aPoly.Rotate(aPieces[i].Center(), Degree10(450));
+ aPoly.Rotate(aPieces[i].Center(), 450_deg10);
break;
case 1: // arc
aPoly = tools::Polygon(aPieces[i],
@@ -1046,7 +1046,7 @@ public:
aPoly = tools::Polygon(aPieces[i],
aPieces[i].GetWidth()/5,
aPieces[i].GetHeight()/5);
- aPoly.Rotate(aPieces[i].Center(), Degree10(450));
+ aPoly.Rotate(aPieces[i].Center(), 450_deg10);
break;
}
aClipRegion = vcl::Region(aPoly);