summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/fgas_rtfbreak.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-28 10:37:00 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-28 19:35:04 +0000
commitd7de8e15eaae5a37abfcb8d1cf7028fbcebbaccd (patch)
tree05017ae10ab82f998aa684c13a6ba11a9d5c69b9 /xfa/fgas/layout/fgas_rtfbreak.h
parentfb906e34cb8e0d1030f743939cb1100ebfbcdbf0 (diff)
downloadpdfium-d7de8e15eaae5a37abfcb8d1cf7028fbcebbaccd.tar.xz
Convert FX_RTFLINEALIGNMENT to an enum class
This Cl removes unused items and converts the remaining members to an enum class. Change-Id: I86e95231275ab20f274a5913715c1579a6fbc5dc Reviewed-on: https://pdfium-review.googlesource.com/2875 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fgas/layout/fgas_rtfbreak.h')
-rw-r--r--xfa/fgas/layout/fgas_rtfbreak.h38
1 files changed, 9 insertions, 29 deletions
diff --git a/xfa/fgas/layout/fgas_rtfbreak.h b/xfa/fgas/layout/fgas_rtfbreak.h
index cbc36ad09f..9119f9df3d 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.h
+++ b/xfa/fgas/layout/fgas_rtfbreak.h
@@ -27,33 +27,13 @@ class CFGAS_GEFont;
#define FX_RTFLAYOUTSTYLE_Pagination 0x01
#define FX_RTFLAYOUTSTYLE_ExpandTab 0x10
-#define FX_RTFCHARSTYLE_Alignment 0x000F
-#define FX_RTFCHARSTYLE_ArabicNumber 0x0010
-#define FX_RTFCHARSTYLE_ArabicShadda 0x0020
-#define FX_RTFCHARSTYLE_OddBidiLevel 0x0040
-#define FX_RTFCHARSTYLE_RTLReadingOrder 0x0080
-#define FX_RTFCHARSTYLE_ArabicContext 0x0300
-#define FX_RTFCHARSTYLE_ArabicIndic 0x0400
-#define FX_RTFCHARSTYLE_ArabicComma 0x0800
-#define FX_RTFLINEALIGNMENT_Left 0
-#define FX_RTFLINEALIGNMENT_Center 1
-#define FX_RTFLINEALIGNMENT_Right 2
-#define FX_RTFLINEALIGNMENT_Justified (1 << 2)
-#define FX_RTFLINEALIGNMENT_Distributed (2 << 2)
-#define FX_RTFLINEALIGNMENT_JustifiedLeft \
- (FX_RTFLINEALIGNMENT_Left | FX_RTFLINEALIGNMENT_Justified)
-#define FX_RTFLINEALIGNMENT_JustifiedCenter \
- (FX_RTFLINEALIGNMENT_Center | FX_RTFLINEALIGNMENT_Justified)
-#define FX_RTFLINEALIGNMENT_JustifiedRight \
- (FX_RTFLINEALIGNMENT_Right | FX_RTFLINEALIGNMENT_Justified)
-#define FX_RTFLINEALIGNMENT_DistributedLeft \
- (FX_RTFLINEALIGNMENT_Left | FX_RTFLINEALIGNMENT_Distributed)
-#define FX_RTFLINEALIGNMENT_DistributedCenter \
- (FX_RTFLINEALIGNMENT_Center | FX_RTFLINEALIGNMENT_Distributed)
-#define FX_RTFLINEALIGNMENT_DistributedRight \
- (FX_RTFLINEALIGNMENT_Right | FX_RTFLINEALIGNMENT_Distributed)
-#define FX_RTFLINEALIGNMENT_LowerMask 0x03
-#define FX_RTFLINEALIGNMENT_HigherMask 0x0C
+enum class CFX_RTFLineAlignment {
+ Left = 0,
+ Center,
+ Right,
+ Justified,
+ Distributed
+};
struct FX_RTFTEXTOBJ {
FX_RTFTEXTOBJ();
@@ -219,7 +199,7 @@ class CFX_RTFBreak {
void SetCharSpace(FX_FLOAT fCharSpace);
void SetWordSpace(bool bDefault, FX_FLOAT fWordSpace);
void SetReadingOrder(bool bRTL = false);
- void SetAlignment(int32_t iAlignment = FX_RTFLINEALIGNMENT_Left);
+ void SetAlignment(CFX_RTFLineAlignment align) { m_iAlignment = align; }
void SetUserData(const CFX_RetainPtr<CFX_Retainable>& pUserData);
uint32_t AppendChar(FX_WCHAR wch);
uint32_t EndBreak(uint32_t dwStatus = FX_RTFBREAK_PieceBreak);
@@ -281,7 +261,7 @@ class CFX_RTFBreak {
bool m_bWordSpace;
int32_t m_iWordSpace;
bool m_bRTL;
- int32_t m_iAlignment;
+ CFX_RTFLineAlignment m_iAlignment;
CFX_RetainPtr<CFX_Retainable> m_pUserData;
FX_CHARTYPE m_eCharType;
uint32_t m_dwIdentity;