OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/src/fee/fx_wordbreak/fx_wordbreak_impl.h" | 7 #include "xfa/fee/fx_wordbreak/fx_wordbreak_impl.h" |
8 | 8 |
9 FX_WordBreakProp FX_GetWordBreakProperty(FX_WCHAR wcCodePoint) { | 9 FX_WordBreakProp FX_GetWordBreakProperty(FX_WCHAR wcCodePoint) { |
10 FX_DWORD dwProperty = | 10 FX_DWORD dwProperty = |
11 (FX_DWORD)gs_FX_WordBreak_CodePointProperties[wcCodePoint >> 1]; | 11 (FX_DWORD)gs_FX_WordBreak_CodePointProperties[wcCodePoint >> 1]; |
12 return (FX_WordBreakProp)(((wcCodePoint) & 1) ? (dwProperty & 0x0F) | 12 return (FX_WordBreakProp)(((wcCodePoint)&1) ? (dwProperty & 0x0F) |
13 : (dwProperty >> 4)); | 13 : (dwProperty >> 4)); |
14 } | 14 } |
15 CFX_CharIter::CFX_CharIter(const CFX_WideString& wsText) | 15 CFX_CharIter::CFX_CharIter(const CFX_WideString& wsText) |
16 : m_wsText(wsText), m_nIndex(0) { | 16 : m_wsText(wsText), m_nIndex(0) { |
17 FXSYS_assert(!wsText.IsEmpty()); | 17 FXSYS_assert(!wsText.IsEmpty()); |
18 } | 18 } |
19 CFX_CharIter::~CFX_CharIter() {} | 19 CFX_CharIter::~CFX_CharIter() {} |
20 void CFX_CharIter::Release() { | 20 void CFX_CharIter::Release() { |
21 delete this; | 21 delete this; |
22 } | 22 } |
23 FX_BOOL CFX_CharIter::Next(FX_BOOL bPrev) { | 23 FX_BOOL CFX_CharIter::Next(FX_BOOL bPrev) { |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } | 229 } |
230 ePreType = eCurType; | 230 ePreType = eCurType; |
231 eCurType = eNextType; | 231 eCurType = eNextType; |
232 bFirst = FALSE; | 232 bFirst = FALSE; |
233 } while (!pIter->IsEOF(!bPrev)); | 233 } while (!pIter->IsEOF(!bPrev)); |
234 return TRUE; | 234 return TRUE; |
235 } | 235 } |
236 IFX_WordBreak* FX_WordBreak_Create() { | 236 IFX_WordBreak* FX_WordBreak_Create() { |
237 return new CFX_WordBreak; | 237 return new CFX_WordBreak; |
238 } | 238 } |
OLD | NEW |