summaryrefslogtreecommitdiff
path: root/include/svx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-10-20 07:27:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-21 08:13:05 +0200
commit0fb58a1ff168ae122e9c8993a3136658e3b0e3f0 (patch)
tree908983b02f466e0a49599edc70aaa1baaa240371 /include/svx
parentb84afd2188d6993c91081885dc24664bd3f1cc73 (diff)
new tools::Degree10 strong typedef
partly to flush some use of "long" out the codebase, but also to make it obvious which units are being used for angle values. Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svx')
-rw-r--r--include/svx/xgrad.hxx9
-rw-r--r--include/svx/xhatch.hxx9
2 files changed, 10 insertions, 8 deletions
diff --git a/include/svx/xgrad.hxx b/include/svx/xgrad.hxx
index f8ef9dbe9f98..6e372ec2dbfb 100644
--- a/include/svx/xgrad.hxx
+++ b/include/svx/xgrad.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SVX_XGRAD_HXX
#include <tools/color.hxx>
+#include <tools/degree.hxx>
#include <svx/svxdllapi.h>
#include <com/sun/star/awt/GradientStyle.hpp>
#include <boost/property_tree/ptree_fwd.hpp>
@@ -32,7 +33,7 @@ class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC XGradient final
css::awt::GradientStyle eStyle;
Color aStartColor;
Color aEndColor;
- long nAngle;
+ Degree10 nAngle;
sal_uInt16 nBorder;
sal_uInt16 nOfsX;
sal_uInt16 nOfsY;
@@ -45,7 +46,7 @@ class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC XGradient final
public:
XGradient();
XGradient( const Color& rStart, const Color& rEnd,
- css::awt::GradientStyle eStyle = css::awt::GradientStyle_LINEAR, long nAngle = 0,
+ css::awt::GradientStyle eStyle = css::awt::GradientStyle_LINEAR, Degree10 nAngle = Degree10(0),
sal_uInt16 nXOfs = 50, sal_uInt16 nYOfs = 50, sal_uInt16 nBorder = 0,
sal_uInt16 nStartIntens = 100, sal_uInt16 nEndIntens = 100,
sal_uInt16 nSteps = 0 );
@@ -55,7 +56,7 @@ public:
void SetGradientStyle(css::awt::GradientStyle eNewStyle) { eStyle = eNewStyle; }
void SetStartColor(const Color& rColor) { aStartColor = rColor; }
void SetEndColor(const Color& rColor) { aEndColor = rColor; }
- void SetAngle(long nNewAngle) { nAngle = nNewAngle; }
+ void SetAngle(Degree10 nNewAngle) { nAngle = nNewAngle; }
void SetBorder(sal_uInt16 nNewBorder) { nBorder = nNewBorder; }
void SetXOffset(sal_uInt16 nNewOffset) { nOfsX = nNewOffset; }
void SetYOffset(sal_uInt16 nNewOffset) { nOfsY = nNewOffset; }
@@ -66,7 +67,7 @@ public:
css::awt::GradientStyle GetGradientStyle() const { return eStyle; }
const Color& GetStartColor() const { return aStartColor; }
const Color& GetEndColor() const { return aEndColor; }
- long GetAngle() const { return nAngle; }
+ Degree10 GetAngle() const { return nAngle; }
sal_uInt16 GetBorder() const { return nBorder; }
sal_uInt16 GetXOffset() const { return nOfsX; }
sal_uInt16 GetYOffset() const { return nOfsY; }
diff --git a/include/svx/xhatch.hxx b/include/svx/xhatch.hxx
index 79b5f624e338..0ef791c64caf 100644
--- a/include/svx/xhatch.hxx
+++ b/include/svx/xhatch.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SVX_XHATCH_HXX
#include <tools/color.hxx>
+#include <tools/degree.hxx>
#include <svx/svxdllapi.h>
#include <com/sun/star/drawing/HatchStyle.hpp>
@@ -32,24 +33,24 @@ class SVXCORE_DLLPUBLIC XHatch final
css::drawing::HatchStyle eStyle;
Color aColor;
long nDistance;
- long nAngle;
+ Degree10 nAngle;
public:
XHatch() : eStyle(css::drawing::HatchStyle_SINGLE), nDistance(0), nAngle(0) {}
XHatch(const Color& rCol, css::drawing::HatchStyle eStyle = css::drawing::HatchStyle_SINGLE,
- long nDistance = 20, long nAngle = 0);
+ long nDistance = 20, Degree10 nAngle = Degree10(0));
bool operator==(const XHatch& rHatch) const;
void SetHatchStyle(css::drawing::HatchStyle eNewStyle) { eStyle = eNewStyle; }
void SetColor(const Color& rColor) { aColor = rColor; }
void SetDistance(long nNewDistance) { nDistance = nNewDistance; }
- void SetAngle(long nNewAngle) { nAngle = nNewAngle; }
+ void SetAngle(Degree10 nNewAngle) { nAngle = nNewAngle; }
css::drawing::HatchStyle GetHatchStyle() const { return eStyle; }
const Color& GetColor() const { return aColor; }
long GetDistance() const { return nDistance; }
- long GetAngle() const { return nAngle; }
+ Degree10 GetAngle() const { return nAngle; }
};
#endif