diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-03-07 09:18:18 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-07 14:41:34 +0000 |
commit | fc9b9880c79bd9e7864c009aad48c9b27bb352a0 (patch) | |
tree | 604a3f76f67d4528b7668e0de94509813e01422c /xfa/fgas/layout/fgas_textbreak.cpp | |
parent | 1704350a92234b1e38f0a84010ddf9ecdfce48f8 (diff) | |
download | pdfium-fc9b9880c79bd9e7864c009aad48c9b27bb352a0.tar.xz |
Cleanup text code
This Cl removes unused defines and methods. It also merges fx_arb into fx_arabic
as the arb methods are only used in the arabic file and they are always included
together.
Change-Id: I1e6f75d5cb5f5bcc8db3b54cb2a14d284da5b7b1
Reviewed-on: https://pdfium-review.googlesource.com/2899
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fgas/layout/fgas_textbreak.cpp')
-rw-r--r-- | xfa/fgas/layout/fgas_textbreak.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp index 8be72f2c7b..153d575139 100644 --- a/xfa/fgas/layout/fgas_textbreak.cpp +++ b/xfa/fgas/layout/fgas_textbreak.cpp @@ -9,7 +9,6 @@ #include <algorithm> #include "core/fxcrt/fx_arabic.h" -#include "core/fxcrt/fx_arb.h" #include "core/fxcrt/fx_memory.h" #include "third_party/base/ptr_util.h" #include "xfa/fgas/font/cfgas_gefont.h" @@ -31,6 +30,11 @@ const FX_TxtBreak_LPFAppendChar g_FX_TxtBreak_lpfAppendChar[16] = { &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Others, }; +bool IsCtrlCode(FX_WCHAR ch) { + uint32_t dwRet = (FX_GetUnicodeProperties(ch) & FX_CHARTYPEBITSMASK); + return dwRet == FX_CHARTYPE_Tab || dwRet == FX_CHARTYPE_Control; +} + } // namespace CFX_TxtBreak::CFX_TxtBreak(uint32_t dwPolicies) @@ -1561,7 +1565,7 @@ std::vector<CFX_RectF> CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun, iCharSize = *pWidths++; } fCharSize = static_cast<FX_FLOAT>(iCharSize) / 20000.0f; - bool bRet = (!bSingleLine && FX_IsCtrlCode(wch)); + bool bRet = (!bSingleLine && IsCtrlCode(wch)); if (!(wch == L'\v' || wch == L'\f' || wch == 0x2028 || wch == 0x2029 || (wLineBreakChar != 0xFEFF && wch == wLineBreakChar))) { bRet = false; |