From 11a52df2216bf96a3869ac894513959098dc14da Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Wed, 1 Apr 2015 19:35:19 +0900 Subject: Replace FNTSIZ_* with a scoped enumeration FontSizeType Change-Id: Ia6bcaaac60c18abda803f6a40db8a5c5076b9427 Reviewed-on: https://gerrit.libreoffice.org/15101 Tested-by: Jenkins Reviewed-by: Noel Grandin --- starmath/inc/node.hxx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'starmath/inc') diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index a6aae542d0aa..27b539a08ae8 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -36,11 +36,13 @@ #define ATTR_ITALIC 0x0002 -#define FNTSIZ_ABSOLUT 1 -#define FNTSIZ_PLUS 2 -#define FNTSIZ_MINUS 3 -#define FNTSIZ_MULTIPLY 4 -#define FNTSIZ_DIVIDE 5 +enum class FontSizeType { + ABSOLUT = 1, + PLUS = 2, + MINUS = 3, + MULTIPLY = 4, + DIVIDE = 5 +}; // flags to interdict respective status changes #define FLG_FONT 0x0001 @@ -143,7 +145,7 @@ public: SmFace & GetFont() { return aFace; }; void SetFont(const SmFace &rFace); - void SetFontSize(const Fraction &rRelSize, sal_uInt16 nType); + void SetFontSize(const Fraction &rRelSize, FontSizeType nType); void SetSize(const Fraction &rScale); virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); @@ -1247,20 +1249,20 @@ public: */ class SmFontNode : public SmStructureNode { - sal_uInt16 nSizeType; + FontSizeType nSizeType; Fraction aFontSize; public: SmFontNode(const SmToken &rNodeToken) : SmStructureNode(NFONT, rNodeToken) { - nSizeType = FNTSIZ_MULTIPLY; + nSizeType = FontSizeType::MULTIPLY; aFontSize = Fraction(1L); } - void SetSizeParameter(const Fraction &rValue, sal_uInt16 nType); + void SetSizeParameter(const Fraction &rValue, FontSizeType nType); const Fraction & GetSizeParameter() const {return aFontSize;} - const sal_uInt16& GetSizeType() const {return nSizeType;} + const FontSizeType& GetSizeType() const {return nSizeType;} virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell) SAL_OVERRIDE; virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat) SAL_OVERRIDE; -- cgit