diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-12 15:55:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-13 06:54:23 +0000 |
commit | 8fce16fb573506c24aa06e86b476fa6f42ea60b9 (patch) | |
tree | 2817c8c6ff49b141dcb2dfd38582b7272ecff0f1 /include/svx | |
parent | b39feae4f12b07a0fdb2c8c2a48d5aae613cd7c9 (diff) |
convert SvxPageUsage to scoped enum
and expand out the bit-tricks some of the code was playing to make it
more obvious what is going on
Change-Id: I9c98334393b939b1d900425f6133556ce88247ae
Reviewed-on: https://gerrit.libreoffice.org/29734
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svx')
-rw-r--r-- | include/svx/pagectrl.hxx | 7 | ||||
-rw-r--r-- | include/svx/pageitem.hxx | 19 |
2 files changed, 14 insertions, 12 deletions
diff --git a/include/svx/pagectrl.hxx b/include/svx/pagectrl.hxx index 82225f457de1..50095f66a2d5 100644 --- a/include/svx/pagectrl.hxx +++ b/include/svx/pagectrl.hxx @@ -24,6 +24,7 @@ #include <svx/sdr/attribute/sdrallfillattributeshelper.hxx> class SvxBoxItem; +enum class SvxPageUsage; class SVX_DLLPUBLIC SvxPageWindow : public vcl::Window { @@ -66,7 +67,7 @@ private: bool bHorz : 1; bool bVert : 1; - sal_uInt16 eUsage; + SvxPageUsage eUsage; protected: virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) override; @@ -143,8 +144,8 @@ public: long GetFtDist() const { return nFtDist; } long GetFtHeight() const { return nFtHeight; } - void SetUsage(sal_uInt16 eU) { eUsage = eU; } - sal_uInt16 GetUsage() const { return eUsage; } + void SetUsage(SvxPageUsage eU) { eUsage = eU; } + SvxPageUsage GetUsage() const { return eUsage; } void SetHeader( bool bNew ) { bHeader = bNew; } void SetFooter( bool bNew ) { bFooter = bNew; } diff --git a/include/svx/pageitem.hxx b/include/svx/pageitem.hxx index 227cc398dbef..5849473a932e 100644 --- a/include/svx/pageitem.hxx +++ b/include/svx/pageitem.hxx @@ -28,12 +28,13 @@ using SvxNumType = sal_Int16; // css::style::NumberingType constants usage of the page --------------------------------------------------------------------*/ -enum SvxPageUsage +enum class SvxPageUsage { - SVX_PAGE_LEFT = 0x0001, - SVX_PAGE_RIGHT = 0x0002, - SVX_PAGE_ALL = 0x0003, - SVX_PAGE_MIRROR = 0x0007 + NONE = 0, + Left = 1, + Right = 2, + All = 3, + Mirror = 7 }; /*-------------------------------------------------------------------- @@ -51,7 +52,7 @@ private: OUString aDescName; // name of the template SvxNumType eNumType; // enumeration bool bLandscape; // Portrait / Landscape - sal_uInt16 eUse; // Layout + SvxPageUsage eUse; // Layout public: @@ -75,8 +76,8 @@ public: virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const override; // orientation - sal_uInt16 GetPageUsage() const { return eUse; } - void SetPageUsage(sal_uInt16 eU) { eUse= eU; } + SvxPageUsage GetPageUsage() const { return eUse; } + void SetPageUsage(SvxPageUsage eU) { eUse= eU; } bool IsLandscape() const { return bLandscape; } void SetLandscape(bool bL) { bLandscape = bL; } @@ -86,7 +87,7 @@ public: void SetNumType(SvxNumType eNum) { eNumType = eNum; } // name of the descriptor - void SetDescName(const OUString& rStr) { aDescName = rStr; } + void SetDescName(const OUString& rStr) { aDescName = rStr; } }; |