Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: xfa/fgas/layout/fgas_linebreak.cpp

Issue 1830323006: Remove FX_DWORD from XFA. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fgas/font/fgas_stdfontmgr.cpp ('k') | xfa/fgas/layout/fgas_rtfbreak.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/fgas/layout/fgas_linebreak.h" 7 #include "xfa/fgas/layout/fgas_linebreak.h"
8 8
9 #include "core/fxcrt/include/fx_ucd.h" 9 #include "core/fxcrt/include/fx_ucd.h"
10 10
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, 266 FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN,
267 FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN}, 267 FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN},
268 }; 268 };
269 269
270 void FX_GetLineBreakPositions(const FX_WCHAR* pwsText, 270 void FX_GetLineBreakPositions(const FX_WCHAR* pwsText,
271 FX_LINEBREAKTYPE* pBrkType, 271 FX_LINEBREAKTYPE* pBrkType,
272 int32_t iLength) { 272 int32_t iLength) {
273 if (iLength < 2) { 273 if (iLength < 2) {
274 return; 274 return;
275 } 275 }
276 FX_DWORD dwCur, dwNext; 276 uint32_t dwCur, dwNext;
277 FX_WCHAR wch; 277 FX_WCHAR wch;
278 wch = *pwsText++; 278 wch = *pwsText++;
279 dwCur = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; 279 dwCur = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F;
280 iLength--; 280 iLength--;
281 for (int32_t i = 0; i < iLength; i++) { 281 for (int32_t i = 0; i < iLength; i++) {
282 wch = *pwsText++; 282 wch = *pwsText++;
283 dwNext = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; 283 dwNext = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F;
284 if (dwNext == FX_CBP_SP) { 284 if (dwNext == FX_CBP_SP) {
285 pBrkType[i] = FX_LBT_PROHIBITED_BRK; 285 pBrkType[i] = FX_LBT_PROHIBITED_BRK;
286 } else { 286 } else {
287 pBrkType[i] = *((const FX_LINEBREAKTYPE*)gs_FX_LineBreak_PairTable + 287 pBrkType[i] = *((const FX_LINEBREAKTYPE*)gs_FX_LineBreak_PairTable +
288 (dwCur << 5) + dwNext); 288 (dwCur << 5) + dwNext);
289 } 289 }
290 dwCur = dwNext; 290 dwCur = dwNext;
291 } 291 }
292 pBrkType[iLength] = FX_LBT_INDIRECT_BRK; 292 pBrkType[iLength] = FX_LBT_INDIRECT_BRK;
293 } 293 }
294 void FX_GetLineBreakPositions(const FX_WCHAR* pwsText, 294 void FX_GetLineBreakPositions(const FX_WCHAR* pwsText,
295 int32_t iLength, 295 int32_t iLength,
296 CFX_Int32MassArray& bp) { 296 CFX_Int32MassArray& bp) {
297 if (iLength < 2) { 297 if (iLength < 2) {
298 return; 298 return;
299 } 299 }
300 FX_LINEBREAKTYPE eType; 300 FX_LINEBREAKTYPE eType;
301 FX_DWORD dwCur, dwNext; 301 uint32_t dwCur, dwNext;
302 FX_WCHAR wch; 302 FX_WCHAR wch;
303 wch = *pwsText++; 303 wch = *pwsText++;
304 dwCur = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; 304 dwCur = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F;
305 iLength--; 305 iLength--;
306 for (int32_t i = 0; i < iLength; i++) { 306 for (int32_t i = 0; i < iLength; i++) {
307 wch = *pwsText++; 307 wch = *pwsText++;
308 dwNext = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; 308 dwNext = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F;
309 if (dwNext == FX_CBP_SP) { 309 if (dwNext == FX_CBP_SP) {
310 eType = FX_LBT_PROHIBITED_BRK; 310 eType = FX_LBT_PROHIBITED_BRK;
311 } else { 311 } else {
312 eType = *((const FX_LINEBREAKTYPE*)gs_FX_LineBreak_PairTable + 312 eType = *((const FX_LINEBREAKTYPE*)gs_FX_LineBreak_PairTable +
313 (dwCur << 5) + dwNext); 313 (dwCur << 5) + dwNext);
314 } 314 }
315 if (eType == FX_LBT_DIRECT_BRK) { 315 if (eType == FX_LBT_DIRECT_BRK) {
316 bp.Add(i); 316 bp.Add(i);
317 } 317 }
318 dwCur = dwNext; 318 dwCur = dwNext;
319 } 319 }
320 } 320 }
OLDNEW
« no previous file with comments | « xfa/fgas/font/fgas_stdfontmgr.cpp ('k') | xfa/fgas/layout/fgas_rtfbreak.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698