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 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 int cur_size = curChars.GetSize(); | 1088 int cur_size = curChars.GetSize(); |
1089 nextChars.SetSize(cur_size - iCharPos); | 1089 nextChars.SetSize(cur_size - iCharPos); |
1090 FXSYS_memcpy(nextChars.GetData(), curChars.GetDataPtr(iCharPos), | 1090 FXSYS_memcpy(nextChars.GetData(), curChars.GetDataPtr(iCharPos), |
1091 (cur_size - iCharPos) * sizeof(CFX_RTFChar)); | 1091 (cur_size - iCharPos) * sizeof(CFX_RTFChar)); |
1092 iCount -= iCharPos; | 1092 iCount -= iCharPos; |
1093 cur_size = curChars.GetSize(); | 1093 cur_size = curChars.GetSize(); |
1094 curChars.RemoveAt(cur_size - iCount, iCount); | 1094 curChars.RemoveAt(cur_size - iCount, iCount); |
1095 pNextLine->m_iStart = pCurLine->m_iStart; | 1095 pNextLine->m_iStart = pCurLine->m_iStart; |
1096 pNextLine->m_iWidth = pCurLine->GetLineEnd() - iEndPos; | 1096 pNextLine->m_iWidth = pCurLine->GetLineEnd() - iEndPos; |
1097 pCurLine->m_iWidth = iEndPos; | 1097 pCurLine->m_iWidth = iEndPos; |
1098 CFX_RTFChar* tc = curChars.GetDataPtr(iCharPos - 1); | 1098 curChars.GetDataPtr(iCharPos - 1)->m_nBreakType = FX_LBT_UNKNOWN; |
1099 tc->m_nBreakType = FX_LBT_UNKNOWN; | |
1100 iCount = nextChars.GetSize(); | 1099 iCount = nextChars.GetSize(); |
1101 CFX_RTFChar* pNextChars = nextChars.GetData(); | 1100 CFX_RTFChar* pNextChars = nextChars.GetData(); |
1102 for (int32_t i = 0; i < iCount; i++) { | 1101 for (int32_t i = 0; i < iCount; i++) { |
1103 CFX_RTFChar* tc = pNextChars + i; | 1102 CFX_RTFChar* tc = pNextChars + i; |
1104 if (tc->GetCharType() >= FX_CHARTYPE_ArabicAlef) { | 1103 if (tc->GetCharType() >= FX_CHARTYPE_ArabicAlef) { |
1105 pCurLine->m_iArabicChars--; | 1104 pCurLine->m_iArabicChars--; |
1106 pNextLine->m_iArabicChars++; | 1105 pNextLine->m_iArabicChars++; |
1107 } | 1106 } |
1108 if (tc->m_dwLayoutStyles & FX_RTFLAYOUTSTYLE_MBCSCode) { | 1107 if (tc->m_dwLayoutStyles & FX_RTFLAYOUTSTYLE_MBCSCode) { |
1109 pCurLine->m_iMBCSChars--; | 1108 pCurLine->m_iMBCSChars--; |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1513 rtBBoxF.height = fHeight; | 1512 rtBBoxF.height = fHeight; |
1514 rtBBoxF.top = std::max(rtBBoxF.top, 0.0f); | 1513 rtBBoxF.top = std::max(rtBBoxF.top, 0.0f); |
1515 } | 1514 } |
1516 rtArray.SetAt(i, rtBBoxF); | 1515 rtArray.SetAt(i, rtBBoxF); |
1517 continue; | 1516 continue; |
1518 } | 1517 } |
1519 rtArray.SetAt(i, rect); | 1518 rtArray.SetAt(i, rect); |
1520 } | 1519 } |
1521 return iLength; | 1520 return iLength; |
1522 } | 1521 } |
OLD | NEW |