diff options
author | Nico Weber <thakis@chromium.org> | 2015-08-04 12:19:10 -0700 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2015-08-04 12:19:10 -0700 |
commit | b048f791a15f2da781a01eba5b09eb9d389f9c11 (patch) | |
tree | 6850a73c18bbc41eaf4b1fdc6b3c96646d45587b /core/src/fxcrt/fx_arabic.cpp | |
parent | c8eeed31f217d99a706b0cbf5e4ce0bcc12beb64 (diff) | |
download | pdfium-b048f791a15f2da781a01eba5b09eb9d389f9c11.tar.xz |
clang-format all pdfium code.
No behavior change.
Generated by:
find . -name '*.cpp' -o -name '*.h' | \
grep -E -v 'third_party|thirdparties|lpng_v163' | \
xargs ../../buildtools/mac/clang-format -i
See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion.
BUG=none
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1265503005 .
Diffstat (limited to 'core/src/fxcrt/fx_arabic.cpp')
-rw-r--r-- | core/src/fxcrt/fx_arabic.cpp | 136 |
1 files changed, 64 insertions, 72 deletions
diff --git a/core/src/fxcrt/fx_arabic.cpp b/core/src/fxcrt/fx_arabic.cpp index 3cb2fd067a..3b7d0c1c71 100644 --- a/core/src/fxcrt/fx_arabic.cpp +++ b/core/src/fxcrt/fx_arabic.cpp @@ -8,85 +8,77 @@ #include "fx_arabic.h" extern const FX_DWORD gs_FX_TextLayout_CodeProperties[65536]; -IFX_BidiChar* IFX_BidiChar::Create() -{ - return new CFX_BidiChar; +IFX_BidiChar* IFX_BidiChar::Create() { + return new CFX_BidiChar; } CFX_BidiChar::CFX_BidiChar() - : m_bSeparateNeutral(TRUE) - , m_iCurStart(0) - , m_iCurCount(0) - , m_iCurBidi(0) - , m_iLastBidi(0) - , m_iLastStart(0) - , m_iLastCount(0) -{ -} -void CFX_BidiChar::SetPolicy(FX_BOOL bSeparateNeutral) -{ - m_bSeparateNeutral = bSeparateNeutral; + : m_bSeparateNeutral(TRUE), + m_iCurStart(0), + m_iCurCount(0), + m_iCurBidi(0), + m_iLastBidi(0), + m_iLastStart(0), + m_iLastCount(0) {} +void CFX_BidiChar::SetPolicy(FX_BOOL bSeparateNeutral) { + m_bSeparateNeutral = bSeparateNeutral; } -FX_BOOL CFX_BidiChar::AppendChar(FX_WCHAR wch) -{ - FX_DWORD dwProps = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch]; - int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS; - int32_t iContext = 0; - switch (iBidiCls) { - case FX_BIDICLASS_L: - case FX_BIDICLASS_AN: - case FX_BIDICLASS_EN: - iContext = 1; - break; - case FX_BIDICLASS_R: - case FX_BIDICLASS_AL: - iContext = 2; - break; +FX_BOOL CFX_BidiChar::AppendChar(FX_WCHAR wch) { + FX_DWORD dwProps = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch]; + int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS; + int32_t iContext = 0; + switch (iBidiCls) { + case FX_BIDICLASS_L: + case FX_BIDICLASS_AN: + case FX_BIDICLASS_EN: + iContext = 1; + break; + case FX_BIDICLASS_R: + case FX_BIDICLASS_AL: + iContext = 2; + break; + } + FX_BOOL bRet = FALSE; + if (iContext != m_iCurBidi) { + if (m_bSeparateNeutral) { + bRet = TRUE; + } else { + if (m_iCurBidi == 0) { + bRet = (m_iCurCount > 0); + } else { + bRet = (iContext != 0); + } + } + if (bRet) { + m_iLastBidi = m_iCurBidi; + m_iLastStart = m_iCurStart; + m_iCurStart = m_iCurCount; + m_iLastCount = m_iCurCount - m_iLastStart; } - FX_BOOL bRet = FALSE; - if (iContext != m_iCurBidi) { - if (m_bSeparateNeutral) { - bRet = TRUE; - } else { - if (m_iCurBidi == 0) { - bRet = (m_iCurCount > 0); - } else { - bRet = (iContext != 0); - } - } - if (bRet) { - m_iLastBidi = m_iCurBidi; - m_iLastStart = m_iCurStart; - m_iCurStart = m_iCurCount; - m_iLastCount = m_iCurCount - m_iLastStart; - } - if (m_bSeparateNeutral || iContext != 0) { - m_iCurBidi = iContext; - } + if (m_bSeparateNeutral || iContext != 0) { + m_iCurBidi = iContext; } - m_iCurCount ++; - return bRet; + } + m_iCurCount++; + return bRet; } -FX_BOOL CFX_BidiChar::EndChar() -{ - m_iLastBidi = m_iCurBidi; - m_iLastStart = m_iCurStart; - m_iCurStart = m_iCurCount; - m_iLastCount = m_iCurCount - m_iLastStart; - return m_iLastCount > 0; +FX_BOOL CFX_BidiChar::EndChar() { + m_iLastBidi = m_iCurBidi; + m_iLastStart = m_iCurStart; + m_iCurStart = m_iCurCount; + m_iLastCount = m_iCurCount - m_iLastStart; + return m_iLastCount > 0; } -int32_t CFX_BidiChar::GetBidiInfo(int32_t &iStart, int32_t &iCount) -{ - iStart = m_iLastStart; - iCount = m_iLastCount; - return m_iLastBidi; +int32_t CFX_BidiChar::GetBidiInfo(int32_t& iStart, int32_t& iCount) { + iStart = m_iLastStart; + iCount = m_iLastCount; + return m_iLastBidi; } -void CFX_BidiChar::Reset() -{ - m_iCurStart = 0; - m_iCurCount = 0; - m_iCurBidi = 0; - m_iLastBidi = 0; - m_iLastStart = 0; - m_iLastCount = 0; +void CFX_BidiChar::Reset() { + m_iCurStart = 0; + m_iCurCount = 0; + m_iCurBidi = 0; + m_iLastBidi = 0; + m_iLastStart = 0; + m_iLastCount = 0; } |