| 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/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 = |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 ePreType = FX_GetWordBreakProperty(wcTemp); | 151 ePreType = FX_GetWordBreakProperty(wcTemp); |
| 152 pIter->Next(bPrev); | 152 pIter->Next(bPrev); |
| 153 } | 153 } |
| 154 FX_WCHAR wcTemp = pIter->GetChar(); | 154 FX_WCHAR wcTemp = pIter->GetChar(); |
| 155 eCurType = FX_GetWordBreakProperty(wcTemp); | 155 eCurType = FX_GetWordBreakProperty(wcTemp); |
| 156 FX_BOOL bFirst = TRUE; | 156 FX_BOOL bFirst = TRUE; |
| 157 do { | 157 do { |
| 158 pIter->Next(bPrev); | 158 pIter->Next(bPrev); |
| 159 FX_WCHAR wcTemp = pIter->GetChar(); | 159 FX_WCHAR wcTemp = pIter->GetChar(); |
| 160 eNextType = FX_GetWordBreakProperty(wcTemp); | 160 eNextType = FX_GetWordBreakProperty(wcTemp); |
| 161 FX_WORD wBreak = | 161 uint16_t wBreak = |
| 162 gs_FX_WordBreak_Table[eCurType] & ((FX_WORD)(1 << eNextType)); | 162 gs_FX_WordBreak_Table[eCurType] & ((uint16_t)(1 << eNextType)); |
| 163 if (wBreak) { | 163 if (wBreak) { |
| 164 if (pIter->IsEOF(!bPrev)) { | 164 if (pIter->IsEOF(!bPrev)) { |
| 165 pIter->Next(!bPrev); | 165 pIter->Next(!bPrev); |
| 166 return TRUE; | 166 return TRUE; |
| 167 } | 167 } |
| 168 if (bFirst) { | 168 if (bFirst) { |
| 169 int32_t nFlags = 0; | 169 int32_t nFlags = 0; |
| 170 if (eCurType == FX_WordBreakProp_MidLetter) { | 170 if (eCurType == FX_WordBreakProp_MidLetter) { |
| 171 if (eNextType == FX_WordBreakProp_ALetter) { | 171 if (eNextType == FX_WordBreakProp_ALetter) { |
| 172 nFlags = 1; | 172 nFlags = 1; |
| (...skipping 56 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 |