summaryrefslogtreecommitdiff
path: root/core/fxcrt/include/fx_ucd.h
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-05-20 17:09:48 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-20 17:09:48 -0700
commita2c06e4a667a45a267f9382d0d90ab689c89d0cf (patch)
tree8b9290f82e906a665446b6a606da9139aba2fb85 /core/fxcrt/include/fx_ucd.h
parentf0a128283aeaeb75ee2f62d0f25ba42ac5b07073 (diff)
downloadpdfium-a2c06e4a667a45a267f9382d0d90ab689c89d0cf.tar.xz
Use enum type for char type variables
The mixed use of enum and uint32_t causes warnings. And it is more meaningful to use enum for char type variables. BUG=pdfium:29 Review-Url: https://codereview.chromium.org/2001733002
Diffstat (limited to 'core/fxcrt/include/fx_ucd.h')
-rw-r--r--core/fxcrt/include/fx_ucd.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/fxcrt/include/fx_ucd.h b/core/fxcrt/include/fx_ucd.h
index 90f89486f1..0eb159d703 100644
--- a/core/fxcrt/include/fx_ucd.h
+++ b/core/fxcrt/include/fx_ucd.h
@@ -107,6 +107,9 @@ enum FX_CHARTYPE {
FX_CHARTYPE_ArabicForm = (11 << FX_CHARTYPEBITS),
FX_CHARTYPE_Arabic = (12 << FX_CHARTYPEBITS),
};
+inline FX_CHARTYPE GetCharTypeFromProp(uint32_t prop) {
+ return static_cast<FX_CHARTYPE>(prop & FX_CHARTYPEBITSMASK);
+}
FX_BOOL FX_IsCtrlCode(FX_WCHAR ch);
FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch,
@@ -133,7 +136,9 @@ class CFX_Char {
m_iCharWidth(0),
m_iHorizontalScale(100),
m_iVertialScale(100) {}
- uint32_t GetCharType() const { return m_dwCharProps & FX_CHARTYPEBITSMASK; }
+
+ FX_CHARTYPE GetCharType() const { return GetCharTypeFromProp(m_dwCharProps); }
+
uint16_t m_wCharCode;
uint8_t m_nBreakType;
int8_t m_nRotation;