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

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

Issue 2053963002: Avoid casts via correct types in fgas_textbreak (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 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/layout/fgas_textbreak.h ('k') | xfa/fwl/basewidget/fwl_monthcalendarimp.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_textbreak.h" 7 #include "xfa/fgas/layout/fgas_textbreak.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
11 #include "core/fxcrt/include/fx_arabic.h" 11 #include "core/fxcrt/include/fx_arabic.h"
12 #include "core/fxcrt/include/fx_arb.h" 12 #include "core/fxcrt/include/fx_arb.h"
13 #include "core/fxcrt/include/fx_memory.h" 13 #include "core/fxcrt/include/fx_memory.h"
14 #include "xfa/fgas/font/fgas_gefont.h" 14 #include "xfa/fgas/font/fgas_gefont.h"
15 #include "xfa/fgas/layout/fgas_linebreak.h" 15 #include "xfa/fgas/layout/fgas_linebreak.h"
16 #include "xfa/fgas/layout/fgas_unicode.h" 16 #include "xfa/fgas/layout/fgas_unicode.h"
17 17
18 namespace {
19
20 typedef uint32_t (CFX_TxtBreak::*FX_TxtBreak_LPFAppendChar)(
21 CFX_TxtChar* pCurChar,
22 int32_t iRotation);
23 const FX_TxtBreak_LPFAppendChar g_FX_TxtBreak_lpfAppendChar[16] = {
24 &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Tab,
25 &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Control,
26 &CFX_TxtBreak::AppendChar_Combination, &CFX_TxtBreak::AppendChar_Others,
27 &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Arabic,
28 &CFX_TxtBreak::AppendChar_Arabic, &CFX_TxtBreak::AppendChar_Arabic,
29 &CFX_TxtBreak::AppendChar_Arabic, &CFX_TxtBreak::AppendChar_Arabic,
30 &CFX_TxtBreak::AppendChar_Arabic, &CFX_TxtBreak::AppendChar_Others,
31 &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Others,
32 };
33
34 } // namespace
35
18 CFX_TxtBreak::CFX_TxtBreak(uint32_t dwPolicies) 36 CFX_TxtBreak::CFX_TxtBreak(uint32_t dwPolicies)
19 : m_dwPolicies(dwPolicies), 37 : m_dwPolicies(dwPolicies),
20 m_iLineWidth(2000000), 38 m_iLineWidth(2000000),
21 m_dwLayoutStyles(0), 39 m_dwLayoutStyles(0),
22 m_bVertical(FALSE), 40 m_bVertical(FALSE),
23 m_bArabicContext(FALSE), 41 m_bArabicContext(FALSE),
24 m_bArabicShapes(FALSE), 42 m_bArabicShapes(FALSE),
25 m_bRTL(FALSE), 43 m_bRTL(FALSE),
26 m_bSingleLine(FALSE), 44 m_bSingleLine(FALSE),
27 m_bCombText(FALSE), 45 m_bCombText(FALSE),
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 m_pUserData = pUserData; 223 m_pUserData = pUserData;
206 } 224 }
207 void CFX_TxtBreak::SetBreakStatus() { 225 void CFX_TxtBreak::SetBreakStatus() {
208 if (m_bPagination) { 226 if (m_bPagination) {
209 return; 227 return;
210 } 228 }
211 int32_t iCount = m_pCurLine->CountChars(); 229 int32_t iCount = m_pCurLine->CountChars();
212 if (iCount < 1) { 230 if (iCount < 1) {
213 return; 231 return;
214 } 232 }
215 CFX_TxtChar* pTC = (CFX_TxtChar*)m_pCurLine->GetCharPtr(iCount - 1); 233 CFX_TxtChar* pTC = m_pCurLine->GetCharPtr(iCount - 1);
216 if (pTC->m_dwStatus == 0) { 234 if (pTC->m_dwStatus == 0) {
217 pTC->m_dwStatus = FX_TXTBREAK_PieceBreak; 235 pTC->m_dwStatus = FX_TXTBREAK_PieceBreak;
218 } 236 }
219 } 237 }
220 void CFX_TxtBreak::SetHorizontalScale(int32_t iScale) { 238 void CFX_TxtBreak::SetHorizontalScale(int32_t iScale) {
221 if (iScale < 0) { 239 if (iScale < 0) {
222 iScale = 0; 240 iScale = 0;
223 } 241 }
224 if (iScale == m_iHorScale) { 242 if (iScale == m_iHorScale) {
225 return; 243 return;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 if (m_bRTL) { 322 if (m_bRTL) {
305 m_bArabicNumber = m_iArabicContext >= 1; 323 m_bArabicNumber = m_iArabicContext >= 1;
306 } else { 324 } else {
307 m_bArabicNumber = m_iArabicContext > 1; 325 m_bArabicNumber = m_iArabicContext > 1;
308 } 326 }
309 m_bArabicNumber = m_bArabicNumber && m_bArabicShapes; 327 m_bArabicNumber = m_bArabicNumber && m_bArabicShapes;
310 } 328 }
311 m_bArabicComma = m_bArabicNumber; 329 m_bArabicComma = m_bArabicNumber;
312 ResetContextCharStyles(); 330 ResetContextCharStyles();
313 } 331 }
314 void CFX_TxtBreak::AppendChar_PageLoad(CFX_Char* pCurChar, uint32_t dwProps) { 332 void CFX_TxtBreak::AppendChar_PageLoad(CFX_TxtChar* pCurChar,
333 uint32_t dwProps) {
315 if (!m_bPagination) { 334 if (!m_bPagination) {
316 ((CFX_TxtChar*)pCurChar)->m_dwStatus = 0; 335 pCurChar->m_dwStatus = 0;
317 ((CFX_TxtChar*)pCurChar)->m_pUserData = m_pUserData; 336 pCurChar->m_pUserData = m_pUserData;
318 } 337 }
319 if (m_bArabicContext || m_bArabicShapes) { 338 if (m_bArabicContext || m_bArabicShapes) {
320 int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS; 339 int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
321 int32_t iArabicContext = 340 int32_t iArabicContext =
322 (iBidiCls == FX_BIDICLASS_R || iBidiCls == FX_BIDICLASS_AL) 341 (iBidiCls == FX_BIDICLASS_R || iBidiCls == FX_BIDICLASS_AL)
323 ? 2 342 ? 2
324 : ((iBidiCls == FX_BIDICLASS_L || iBidiCls == FX_BIDICLASS_S) ? 0 343 : ((iBidiCls == FX_BIDICLASS_L || iBidiCls == FX_BIDICLASS_S) ? 0
325 : 1); 344 : 1);
326 if (iArabicContext != m_iArabicContext && iArabicContext != 1) { 345 if (iArabicContext != m_iArabicContext && iArabicContext != 1) {
327 m_iArabicContext = iArabicContext; 346 m_iArabicContext = iArabicContext;
328 if (m_iCurArabicContext == 1) { 347 if (m_iCurArabicContext == 1) {
329 m_iCurArabicContext = iArabicContext; 348 m_iCurArabicContext = iArabicContext;
330 } 349 }
331 ResetArabicContext(); 350 ResetArabicContext();
332 if (!m_bPagination) { 351 if (!m_bPagination) {
333 CFX_TxtChar* pLastChar = (CFX_TxtChar*)GetLastChar(1, FALSE); 352 CFX_TxtChar* pLastChar = GetLastChar(1, FALSE);
334 if (pLastChar != NULL && pLastChar->m_dwStatus < 1) { 353 if (pLastChar != NULL && pLastChar->m_dwStatus < 1) {
335 pLastChar->m_dwStatus = FX_TXTBREAK_PieceBreak; 354 pLastChar->m_dwStatus = FX_TXTBREAK_PieceBreak;
336 } 355 }
337 } 356 }
338 } 357 }
339 } 358 }
340 pCurChar->m_dwCharStyles = m_dwContextCharStyles; 359 pCurChar->m_dwCharStyles = m_dwContextCharStyles;
341 } 360 }
342 uint32_t CFX_TxtBreak::AppendChar_Combination(CFX_Char* pCurChar, 361 uint32_t CFX_TxtBreak::AppendChar_Combination(CFX_TxtChar* pCurChar,
343 int32_t iRotation) { 362 int32_t iRotation) {
344 ASSERT(pCurChar != NULL);
345 FX_WCHAR wch = pCurChar->m_wCharCode; 363 FX_WCHAR wch = pCurChar->m_wCharCode;
346 FX_WCHAR wForm; 364 FX_WCHAR wForm;
347 int32_t iCharWidth = 0; 365 int32_t iCharWidth = 0;
348 CFX_Char* pLastChar;
349 pCurChar->m_iCharWidth = -1; 366 pCurChar->m_iCharWidth = -1;
350 if (m_bCombText) { 367 if (m_bCombText) {
351 iCharWidth = m_iCombWidth; 368 iCharWidth = m_iCombWidth;
352 } else { 369 } else {
353 if (m_bVertical != FX_IsOdd(iRotation)) { 370 if (m_bVertical != FX_IsOdd(iRotation)) {
354 iCharWidth = 1000; 371 iCharWidth = 1000;
355 } else { 372 } else {
356 wForm = wch; 373 wForm = wch;
357 if (!m_bPagination) { 374 if (!m_bPagination) {
358 pLastChar = GetLastChar(0, FALSE); 375 CFX_TxtChar* pLastChar = GetLastChar(0, FALSE);
359 if (pLastChar != NULL && 376 if (pLastChar &&
360 (((CFX_TxtChar*)pLastChar)->m_dwCharStyles & 377 (pLastChar->m_dwCharStyles & FX_TXTCHARSTYLE_ArabicShadda) == 0) {
361 FX_TXTCHARSTYLE_ArabicShadda) == 0) {
362 FX_BOOL bShadda = FALSE; 378 FX_BOOL bShadda = FALSE;
363 if (wch == 0x0651) { 379 if (wch == 0x0651) {
364 FX_WCHAR wLast = pLastChar->m_wCharCode; 380 FX_WCHAR wLast = pLastChar->m_wCharCode;
365 if (wLast >= 0x064C && wLast <= 0x0650) { 381 if (wLast >= 0x064C && wLast <= 0x0650) {
366 wForm = FX_GetArabicFromShaddaTable(wLast); 382 wForm = FX_GetArabicFromShaddaTable(wLast);
367 bShadda = TRUE; 383 bShadda = TRUE;
368 } 384 }
369 } else if (wch >= 0x064C && wch <= 0x0650) { 385 } else if (wch >= 0x064C && wch <= 0x0650) {
370 if (pLastChar->m_wCharCode == 0x0651) { 386 if (pLastChar->m_wCharCode == 0x0651) {
371 wForm = FX_GetArabicFromShaddaTable(wch); 387 wForm = FX_GetArabicFromShaddaTable(wch);
372 bShadda = TRUE; 388 bShadda = TRUE;
373 } 389 }
374 } 390 }
375 if (bShadda) { 391 if (bShadda) {
376 ((CFX_TxtChar*)pLastChar)->m_dwCharStyles |= 392 pLastChar->m_dwCharStyles |= FX_TXTCHARSTYLE_ArabicShadda;
377 FX_TXTCHARSTYLE_ArabicShadda; 393 pLastChar->m_iCharWidth = 0;
378 ((CFX_TxtChar*)pLastChar)->m_iCharWidth = 0; 394 pCurChar->m_dwCharStyles |= FX_TXTCHARSTYLE_ArabicShadda;
379 ((CFX_TxtChar*)pCurChar)->m_dwCharStyles |=
380 FX_TXTCHARSTYLE_ArabicShadda;
381 } 395 }
382 } 396 }
383 } 397 }
384 if (!m_pFont->GetCharWidth(wForm, iCharWidth, FALSE)) { 398 if (!m_pFont->GetCharWidth(wForm, iCharWidth, FALSE)) {
385 iCharWidth = 0; 399 iCharWidth = 0;
386 } 400 }
387 } 401 }
388 iCharWidth *= m_iFontSize; 402 iCharWidth *= m_iFontSize;
389 iCharWidth = iCharWidth * m_iHorScale / 100; 403 iCharWidth = iCharWidth * m_iHorScale / 100;
390 } 404 }
391 pCurChar->m_iCharWidth = -iCharWidth; 405 pCurChar->m_iCharWidth = -iCharWidth;
392 return FX_TXTBREAK_None; 406 return FX_TXTBREAK_None;
393 } 407 }
394 uint32_t CFX_TxtBreak::AppendChar_Tab(CFX_Char* pCurChar, int32_t iRotation) { 408 uint32_t CFX_TxtBreak::AppendChar_Tab(CFX_TxtChar* pCurChar,
409 int32_t iRotation) {
395 m_eCharType = FX_CHARTYPE_Tab; 410 m_eCharType = FX_CHARTYPE_Tab;
396 if ((m_dwLayoutStyles & FX_TXTLAYOUTSTYLE_ExpandTab) == 0) { 411 if ((m_dwLayoutStyles & FX_TXTLAYOUTSTYLE_ExpandTab) == 0) {
397 return FX_TXTBREAK_None; 412 return FX_TXTBREAK_None;
398 } 413 }
399 int32_t& iLineWidth = m_pCurLine->m_iWidth; 414 int32_t& iLineWidth = m_pCurLine->m_iWidth;
400 int32_t iCharWidth; 415 int32_t iCharWidth;
401 if (m_bCombText) { 416 if (m_bCombText) {
402 iCharWidth = m_iCombWidth; 417 iCharWidth = m_iCombWidth;
403 } else { 418 } else {
404 if (m_bEquidistant) { 419 if (m_bEquidistant) {
405 iCharWidth = iLineWidth; 420 iCharWidth = iLineWidth;
406 iCharWidth = m_iTabWidth * (iCharWidth / m_iTabWidth + 1) - iCharWidth; 421 iCharWidth = m_iTabWidth * (iCharWidth / m_iTabWidth + 1) - iCharWidth;
407 if (iCharWidth < FX_TXTBREAK_MinimumTabWidth) { 422 if (iCharWidth < FX_TXTBREAK_MinimumTabWidth) {
408 iCharWidth += m_iTabWidth; 423 iCharWidth += m_iTabWidth;
409 } 424 }
410 } else { 425 } else {
411 iCharWidth = m_iTabWidth; 426 iCharWidth = m_iTabWidth;
412 } 427 }
413 } 428 }
414 pCurChar->m_iCharWidth = iCharWidth; 429 pCurChar->m_iCharWidth = iCharWidth;
415 iLineWidth += iCharWidth; 430 iLineWidth += iCharWidth;
416 if (!m_bSingleLine && iLineWidth >= m_iLineWidth + m_iTolerance) { 431 if (!m_bSingleLine && iLineWidth >= m_iLineWidth + m_iTolerance) {
417 return EndBreak(FX_TXTBREAK_LineBreak); 432 return EndBreak(FX_TXTBREAK_LineBreak);
418 } 433 }
419 return FX_TXTBREAK_None; 434 return FX_TXTBREAK_None;
420 } 435 }
421 uint32_t CFX_TxtBreak::AppendChar_Control(CFX_Char* pCurChar, 436 uint32_t CFX_TxtBreak::AppendChar_Control(CFX_TxtChar* pCurChar,
422 int32_t iRotation) { 437 int32_t iRotation) {
423 m_eCharType = FX_CHARTYPE_Control; 438 m_eCharType = FX_CHARTYPE_Control;
424 uint32_t dwRet = FX_TXTBREAK_None; 439 uint32_t dwRet = FX_TXTBREAK_None;
425 if (!m_bSingleLine) { 440 if (!m_bSingleLine) {
426 FX_WCHAR wch = pCurChar->m_wCharCode; 441 FX_WCHAR wch = pCurChar->m_wCharCode;
427 switch (wch) { 442 switch (wch) {
428 case L'\v': 443 case L'\v':
429 case 0x2028: 444 case 0x2028:
430 dwRet = FX_TXTBREAK_LineBreak; 445 dwRet = FX_TXTBREAK_LineBreak;
431 break; 446 break;
432 case L'\f': 447 case L'\f':
433 dwRet = FX_TXTBREAK_PageBreak; 448 dwRet = FX_TXTBREAK_PageBreak;
434 break; 449 break;
435 case 0x2029: 450 case 0x2029:
436 dwRet = FX_TXTBREAK_ParagraphBreak; 451 dwRet = FX_TXTBREAK_ParagraphBreak;
437 break; 452 break;
438 default: 453 default:
439 if (wch == m_wParagBreakChar) { 454 if (wch == m_wParagBreakChar) {
440 dwRet = FX_TXTBREAK_ParagraphBreak; 455 dwRet = FX_TXTBREAK_ParagraphBreak;
441 } 456 }
442 break; 457 break;
443 } 458 }
444 if (dwRet != FX_TXTBREAK_None) { 459 if (dwRet != FX_TXTBREAK_None) {
445 dwRet = EndBreak(dwRet); 460 dwRet = EndBreak(dwRet);
446 } 461 }
447 } 462 }
448 return dwRet; 463 return dwRet;
449 } 464 }
450 uint32_t CFX_TxtBreak::AppendChar_Arabic(CFX_Char* pCurChar, 465 uint32_t CFX_TxtBreak::AppendChar_Arabic(CFX_TxtChar* pCurChar,
451 int32_t iRotation) { 466 int32_t iRotation) {
452 FX_CHARTYPE chartype = pCurChar->GetCharType(); 467 FX_CHARTYPE chartype = pCurChar->GetCharType();
453 int32_t& iLineWidth = m_pCurLine->m_iWidth; 468 int32_t& iLineWidth = m_pCurLine->m_iWidth;
454 FX_WCHAR wForm; 469 FX_WCHAR wForm;
455 int32_t iCharWidth = 0; 470 int32_t iCharWidth = 0;
456 CFX_Char* pLastChar = NULL; 471 CFX_Char* pLastChar = NULL;
457 FX_BOOL bAlef = FALSE; 472 FX_BOOL bAlef = FALSE;
458 if (!m_bCombText && m_eCharType >= FX_CHARTYPE_ArabicAlef && 473 if (!m_bCombText && m_eCharType >= FX_CHARTYPE_ArabicAlef &&
459 m_eCharType <= FX_CHARTYPE_ArabicDistortion) { 474 m_eCharType <= FX_CHARTYPE_ArabicDistortion) {
460 pLastChar = GetLastChar(1); 475 pLastChar = GetLastChar(1);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 iCharWidth = iCharWidth * m_iHorScale / 100; 518 iCharWidth = iCharWidth * m_iHorScale / 100;
504 } 519 }
505 pCurChar->m_iCharWidth = iCharWidth; 520 pCurChar->m_iCharWidth = iCharWidth;
506 iLineWidth += iCharWidth; 521 iLineWidth += iCharWidth;
507 m_pCurLine->m_iArabicChars++; 522 m_pCurLine->m_iArabicChars++;
508 if (!m_bSingleLine && iLineWidth > m_iLineWidth + m_iTolerance) { 523 if (!m_bSingleLine && iLineWidth > m_iLineWidth + m_iTolerance) {
509 return EndBreak(FX_TXTBREAK_LineBreak); 524 return EndBreak(FX_TXTBREAK_LineBreak);
510 } 525 }
511 return FX_TXTBREAK_None; 526 return FX_TXTBREAK_None;
512 } 527 }
513 uint32_t CFX_TxtBreak::AppendChar_Others(CFX_Char* pCurChar, 528 uint32_t CFX_TxtBreak::AppendChar_Others(CFX_TxtChar* pCurChar,
514 int32_t iRotation) { 529 int32_t iRotation) {
515 uint32_t dwProps = pCurChar->m_dwCharProps; 530 uint32_t dwProps = pCurChar->m_dwCharProps;
516 FX_CHARTYPE chartype = pCurChar->GetCharType(); 531 FX_CHARTYPE chartype = pCurChar->GetCharType();
517 int32_t& iLineWidth = m_pCurLine->m_iWidth; 532 int32_t& iLineWidth = m_pCurLine->m_iWidth;
518 int32_t iCharWidth = 0; 533 int32_t iCharWidth = 0;
519 m_eCharType = chartype; 534 m_eCharType = chartype;
520 FX_WCHAR wch = pCurChar->m_wCharCode; 535 FX_WCHAR wch = pCurChar->m_wCharCode;
521 FX_WCHAR wForm = wch; 536 FX_WCHAR wForm = wch;
522 if (chartype == FX_CHARTYPE_Numeric) { 537 if (chartype == FX_CHARTYPE_Numeric) {
523 if (m_bArabicNumber) { 538 if (m_bArabicNumber) {
(...skipping 22 matching lines...) Expand all
546 iCharWidth += m_iCharSpace; 561 iCharWidth += m_iCharSpace;
547 pCurChar->m_iCharWidth = iCharWidth; 562 pCurChar->m_iCharWidth = iCharWidth;
548 iLineWidth += iCharWidth; 563 iLineWidth += iCharWidth;
549 FX_BOOL bBreak = (chartype != FX_CHARTYPE_Space || 564 FX_BOOL bBreak = (chartype != FX_CHARTYPE_Space ||
550 (m_dwPolicies & FX_TXTBREAKPOLICY_SpaceBreak) != 0); 565 (m_dwPolicies & FX_TXTBREAKPOLICY_SpaceBreak) != 0);
551 if (!m_bSingleLine && bBreak && iLineWidth > m_iLineWidth + m_iTolerance) { 566 if (!m_bSingleLine && bBreak && iLineWidth > m_iLineWidth + m_iTolerance) {
552 return EndBreak(FX_TXTBREAK_LineBreak); 567 return EndBreak(FX_TXTBREAK_LineBreak);
553 } 568 }
554 return FX_TXTBREAK_None; 569 return FX_TXTBREAK_None;
555 } 570 }
556 typedef uint32_t (CFX_TxtBreak::*FX_TxtBreak_LPFAppendChar)(CFX_Char* pCurChar, 571
557 int32_t iRotation);
558 static const FX_TxtBreak_LPFAppendChar g_FX_TxtBreak_lpfAppendChar[16] = {
559 &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Tab,
560 &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Control,
561 &CFX_TxtBreak::AppendChar_Combination, &CFX_TxtBreak::AppendChar_Others,
562 &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Arabic,
563 &CFX_TxtBreak::AppendChar_Arabic, &CFX_TxtBreak::AppendChar_Arabic,
564 &CFX_TxtBreak::AppendChar_Arabic, &CFX_TxtBreak::AppendChar_Arabic,
565 &CFX_TxtBreak::AppendChar_Arabic, &CFX_TxtBreak::AppendChar_Others,
566 &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Others,
567 };
568 uint32_t CFX_TxtBreak::AppendChar(FX_WCHAR wch) { 572 uint32_t CFX_TxtBreak::AppendChar(FX_WCHAR wch) {
569 uint32_t dwProps = kTextLayoutCodeProperties[(uint16_t)wch]; 573 uint32_t dwProps = kTextLayoutCodeProperties[(uint16_t)wch];
570 FX_CHARTYPE chartype = GetCharTypeFromProp(dwProps); 574 FX_CHARTYPE chartype = GetCharTypeFromProp(dwProps);
571 CFX_TxtChar* pCurChar = m_pCurLine->m_pLineChars->AddSpace(); 575 CFX_TxtChar* pCurChar = m_pCurLine->m_pLineChars->AddSpace();
572 pCurChar->m_wCharCode = (uint16_t)wch; 576 pCurChar->m_wCharCode = (uint16_t)wch;
573 pCurChar->m_nRotation = m_iCharRotation; 577 pCurChar->m_nRotation = m_iCharRotation;
574 pCurChar->m_dwCharProps = dwProps; 578 pCurChar->m_dwCharProps = dwProps;
575 pCurChar->m_dwCharStyles = 0; 579 pCurChar->m_dwCharStyles = 0;
576 pCurChar->m_iCharWidth = 0; 580 pCurChar->m_iCharWidth = 0;
577 pCurChar->m_iHorizontalScale = m_iHorScale; 581 pCurChar->m_iHorizontalScale = m_iHorScale;
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
1653 rtBBoxF.height = fHeight; 1657 rtBBoxF.height = fHeight;
1654 rtBBoxF.top = std::max(rtBBoxF.top, 0.0f); 1658 rtBBoxF.top = std::max(rtBBoxF.top, 0.0f);
1655 } 1659 }
1656 rtArray.SetAt(i, rtBBoxF); 1660 rtArray.SetAt(i, rtBBoxF);
1657 continue; 1661 continue;
1658 } 1662 }
1659 rtArray.SetAt(i, rect); 1663 rtArray.SetAt(i, rect);
1660 } 1664 }
1661 return iLength; 1665 return iLength;
1662 } 1666 }
OLDNEW
« no previous file with comments | « xfa/fgas/layout/fgas_textbreak.h ('k') | xfa/fwl/basewidget/fwl_monthcalendarimp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698