summaryrefslogtreecommitdiff
path: root/include/editeng
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/editeng
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/editeng')
-rw-r--r--include/editeng/charrotateitem.hxx16
-rw-r--r--include/editeng/editeng.hxx5
-rw-r--r--include/editeng/outliner.hxx2
3 files changed, 14 insertions, 9 deletions
diff --git a/include/editeng/charrotateitem.hxx b/include/editeng/charrotateitem.hxx
index 0ce60bb1a05b..093c84224fe5 100644
--- a/include/editeng/charrotateitem.hxx
+++ b/include/editeng/charrotateitem.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_EDITENG_CHARROTATEITEM_HXX
#include <svl/intitem.hxx>
+#include <tools/degree.hxx>
#include <editeng/editengdllapi.h>
// class SvxTextRotateItem ----------------------------------------------
@@ -34,7 +35,7 @@
class EDITENG_DLLPUBLIC SvxTextRotateItem : public SfxUInt16Item
{
public:
- SvxTextRotateItem(sal_uInt16 nValue, const sal_uInt16 nId);
+ SvxTextRotateItem(Degree10 nValue, const sal_uInt16 nId);
virtual SvxTextRotateItem* Clone(SfxItemPool *pPool = nullptr) const override;
@@ -47,11 +48,14 @@ public:
virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;
+ Degree10 GetValue() const { return Degree10(SfxUInt16Item::GetValue()); }
+ void SetValue(Degree10 val) { SfxUInt16Item::SetValue(val.get()); }
+
// our currently only degree values
- void SetTopToBottom() { SetValue(2700); }
- void SetBottomToTop() { SetValue(900); }
- bool IsTopToBottom() const { return 2700 == GetValue(); }
- bool IsBottomToTop() const { return 900 == GetValue(); }
+ void SetTopToBottom() { SetValue(Degree10(2700)); }
+ void SetBottomToTop() { SetValue(Degree10(900)); }
+ bool IsTopToBottom() const { return Degree10(2700) == GetValue(); }
+ bool IsBottomToTop() const { return Degree10(900) == GetValue(); }
bool IsVertical() const { return IsTopToBottom() || IsBottomToTop(); }
void dumpAsXml(xmlTextWriterPtr pWriter) const override;
@@ -75,7 +79,7 @@ class EDITENG_DLLPUBLIC SvxCharRotateItem final : public SvxTextRotateItem
public:
static SfxPoolItem* CreateDefault();
- SvxCharRotateItem( sal_uInt16 nValue /*= 0*/,
+ SvxCharRotateItem( Degree10 nValue /*= 0*/,
bool bFitIntoLine /*= false*/,
const sal_uInt16 nId );
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index 3f896f09a23c..871acf2f43b5 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -37,6 +37,7 @@
#include <i18nlangtag/lang.h>
#include <tools/lineend.hxx>
+#include <tools/degree.hxx>
#include <editeng/eedata.hxx>
#include <o3tl/typed_flags_set.hxx>
@@ -373,7 +374,7 @@ public:
void Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect );
void Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos );
void Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos, bool bClip );
- void Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOrientation = 0 );
+ void Draw( OutputDevice* pOutDev, const Point& rStartPos, Degree10 nOrientation = Degree10(0) );
ErrCode Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr );
void Write( SvStream& rOutput, EETextFormat );
@@ -480,7 +481,7 @@ public:
void SetBeginPasteOrDropHdl( const Link<PasteOrDropInfos&,void>& rLink );
void SetEndPasteOrDropHdl( const Link<PasteOrDropInfos&,void>& rLink );
- virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev );
+ virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long nBaseLineY, const Point& rOrigin, Degree10 nOrientation, OutputDevice* pOutDev );
virtual void ParagraphInserted( sal_Int32 nNewParagraph );
virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph );
virtual void ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph );
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 083cee135e99..3ea2fd9b2631 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -635,7 +635,7 @@ protected:
void InvalidateBullet(sal_Int32 nPara);
void PaintBullet( sal_Int32 nPara, const Point& rStartPos,
- const Point& rOrigin, short nOrientation,
+ const Point& rOrigin, Degree10 nOrientation,
OutputDevice* pOutDev );
// used by OutlinerEditEng. Allows Outliner objects to provide