| 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/fgas/layout/fgas_rtfbreak.h" | 7 #include "xfa/fgas/layout/fgas_rtfbreak.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 &CFX_RTFBreak::AppendChar_Arabic, &CFX_RTFBreak::AppendChar_Arabic, | 508 &CFX_RTFBreak::AppendChar_Arabic, &CFX_RTFBreak::AppendChar_Arabic, |
| 509 &CFX_RTFBreak::AppendChar_Arabic, &CFX_RTFBreak::AppendChar_Arabic, | 509 &CFX_RTFBreak::AppendChar_Arabic, &CFX_RTFBreak::AppendChar_Arabic, |
| 510 &CFX_RTFBreak::AppendChar_Arabic, &CFX_RTFBreak::AppendChar_Others, | 510 &CFX_RTFBreak::AppendChar_Arabic, &CFX_RTFBreak::AppendChar_Others, |
| 511 &CFX_RTFBreak::AppendChar_Others, &CFX_RTFBreak::AppendChar_Others, | 511 &CFX_RTFBreak::AppendChar_Others, &CFX_RTFBreak::AppendChar_Others, |
| 512 }; | 512 }; |
| 513 FX_DWORD CFX_RTFBreak::AppendChar(FX_WCHAR wch) { | 513 FX_DWORD CFX_RTFBreak::AppendChar(FX_WCHAR wch) { |
| 514 FXSYS_assert(m_pFont != NULL && m_pCurLine != NULL && m_pArabicChar != NULL); | 514 FXSYS_assert(m_pFont != NULL && m_pCurLine != NULL && m_pArabicChar != NULL); |
| 515 if (m_bCharCode) { | 515 if (m_bCharCode) { |
| 516 return AppendChar_CharCode(wch); | 516 return AppendChar_CharCode(wch); |
| 517 } | 517 } |
| 518 FX_DWORD dwProps = kTextLayoutCodeProperties[(FX_WORD)wch]; | 518 FX_DWORD dwProps = kTextLayoutCodeProperties[(uint16_t)wch]; |
| 519 FX_DWORD dwType = (dwProps & FX_CHARTYPEBITSMASK); | 519 FX_DWORD dwType = (dwProps & FX_CHARTYPEBITSMASK); |
| 520 CFX_RTFCharArray& tca = m_pCurLine->m_LineChars; | 520 CFX_RTFCharArray& tca = m_pCurLine->m_LineChars; |
| 521 CFX_RTFChar* pCurChar = tca.AddSpace(); | 521 CFX_RTFChar* pCurChar = tca.AddSpace(); |
| 522 pCurChar->m_dwStatus = 0; | 522 pCurChar->m_dwStatus = 0; |
| 523 pCurChar->m_wCharCode = wch; | 523 pCurChar->m_wCharCode = wch; |
| 524 pCurChar->m_dwCharProps = dwProps; | 524 pCurChar->m_dwCharProps = dwProps; |
| 525 pCurChar->m_dwCharStyles = 0; | 525 pCurChar->m_dwCharStyles = 0; |
| 526 pCurChar->m_dwLayoutStyles = 0; | 526 pCurChar->m_dwLayoutStyles = 0; |
| 527 pCurChar->m_iFontSize = m_iFontSize; | 527 pCurChar->m_iFontSize = m_iFontSize; |
| 528 pCurChar->m_iFontHeight = m_iFontHeight; | 528 pCurChar->m_iFontHeight = m_iFontHeight; |
| (...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1682 rtBBoxF.height = fHeight; | 1682 rtBBoxF.height = fHeight; |
| 1683 rtBBoxF.top = std::max(rtBBoxF.top, 0.0f); | 1683 rtBBoxF.top = std::max(rtBBoxF.top, 0.0f); |
| 1684 } | 1684 } |
| 1685 rtArray.SetAt(i, rtBBoxF); | 1685 rtArray.SetAt(i, rtBBoxF); |
| 1686 continue; | 1686 continue; |
| 1687 } | 1687 } |
| 1688 rtArray.SetAt(i, rect); | 1688 rtArray.SetAt(i, rect); |
| 1689 } | 1689 } |
| 1690 return iLength; | 1690 return iLength; |
| 1691 } | 1691 } |
| OLD | NEW |