summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fxcrt/fx_arabic.cpp2
-rw-r--r--core/fxcrt/include/fx_ucd.h7
2 files changed, 7 insertions, 2 deletions
diff --git a/core/fxcrt/fx_arabic.cpp b/core/fxcrt/fx_arabic.cpp
index 01a1a2a15e..cf0056ede2 100644
--- a/core/fxcrt/fx_arabic.cpp
+++ b/core/fxcrt/fx_arabic.cpp
@@ -122,7 +122,7 @@ const FX_ARBFORMTABLE* ParseChar(const CFX_Char* pTC,
wChar = 0xFEFF;
return nullptr;
}
- eType = (FX_CHARTYPE)pTC->GetCharType();
+ eType = pTC->GetCharType();
wChar = (FX_WCHAR)pTC->m_wCharCode;
const FX_ARBFORMTABLE* pFT = FX_GetArabicFormTable(wChar);
if (!pFT || eType >= FX_CHARTYPE_ArabicNormal)
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;