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/fde_txtedtparag.h" | 7 #include "xfa/fee/fde_txtedtparag.h" |
8 | 8 |
9 #include "xfa/fee/fde_txtedtbuf.h" | 9 #include "xfa/fee/fde_txtedtbuf.h" |
10 #include "xfa/fee/fde_txtedtengine.h" | 10 #include "xfa/fee/fde_txtedtengine.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 FX_WCHAR wcAlias = 0; | 37 FX_WCHAR wcAlias = 0; |
38 if (pParam->dwMode & FDE_TEXTEDITMODE_Password) { | 38 if (pParam->dwMode & FDE_TEXTEDITMODE_Password) { |
39 wcAlias = m_pEngine->GetAliasChar(); | 39 wcAlias = m_pEngine->GetAliasChar(); |
40 } | 40 } |
41 IFX_CharIter* pIter = | 41 IFX_CharIter* pIter = |
42 new CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)pTxtBuf, wcAlias); | 42 new CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)pTxtBuf, wcAlias); |
43 pIter->SetAt(m_nCharStart); | 43 pIter->SetAt(m_nCharStart); |
44 int32_t nEndIndex = m_nCharStart + m_nCharCount; | 44 int32_t nEndIndex = m_nCharStart + m_nCharCount; |
45 CFX_ArrayTemplate<int32_t> LineBaseArr; | 45 CFX_ArrayTemplate<int32_t> LineBaseArr; |
46 FX_BOOL bReload = FALSE; | 46 FX_BOOL bReload = FALSE; |
47 FX_DWORD dwBreakStatus = FX_TXTBREAK_None; | 47 uint32_t dwBreakStatus = FX_TXTBREAK_None; |
48 do { | 48 do { |
49 if (bReload) { | 49 if (bReload) { |
50 dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); | 50 dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); |
51 } else { | 51 } else { |
52 FX_WCHAR wAppend = pIter->GetChar(); | 52 FX_WCHAR wAppend = pIter->GetChar(); |
53 dwBreakStatus = pTxtBreak->AppendChar(wAppend); | 53 dwBreakStatus = pTxtBreak->AppendChar(wAppend); |
54 } | 54 } |
55 if (pIter->GetAt() + 1 == nEndIndex && | 55 if (pIter->GetAt() + 1 == nEndIndex && |
56 dwBreakStatus < FX_TXTBREAK_LineBreak) { | 56 dwBreakStatus < FX_TXTBREAK_LineBreak) { |
57 dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); | 57 dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (((int32_t*)m_lpData)[0] == 0) { | 98 if (((int32_t*)m_lpData)[0] == 0) { |
99 FX_Free(m_lpData); | 99 FX_Free(m_lpData); |
100 m_lpData = NULL; | 100 m_lpData = NULL; |
101 } | 101 } |
102 } | 102 } |
103 void CFDE_TxtEdtParag::CalcLines() { | 103 void CFDE_TxtEdtParag::CalcLines() { |
104 IFX_TxtBreak* pTxtBreak = m_pEngine->GetTextBreak(); | 104 IFX_TxtBreak* pTxtBreak = m_pEngine->GetTextBreak(); |
105 IFDE_TxtEdtBuf* pTxtBuf = m_pEngine->GetTextBuf(); | 105 IFDE_TxtEdtBuf* pTxtBuf = m_pEngine->GetTextBuf(); |
106 IFX_CharIter* pIter = new CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)pTxtBuf); | 106 IFX_CharIter* pIter = new CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)pTxtBuf); |
107 int32_t nCount = 0; | 107 int32_t nCount = 0; |
108 FX_DWORD dwBreakStatus = FX_TXTBREAK_None; | 108 uint32_t dwBreakStatus = FX_TXTBREAK_None; |
109 int32_t nEndIndex = m_nCharStart + m_nCharCount; | 109 int32_t nEndIndex = m_nCharStart + m_nCharCount; |
110 pIter->SetAt(m_nCharStart); | 110 pIter->SetAt(m_nCharStart); |
111 FX_BOOL bReload = FALSE; | 111 FX_BOOL bReload = FALSE; |
112 do { | 112 do { |
113 if (bReload) { | 113 if (bReload) { |
114 dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); | 114 dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); |
115 } else { | 115 } else { |
116 FX_WCHAR wAppend = pIter->GetChar(); | 116 FX_WCHAR wAppend = pIter->GetChar(); |
117 dwBreakStatus = pTxtBreak->AppendChar(wAppend); | 117 dwBreakStatus = pTxtBreak->AppendChar(wAppend); |
118 } | 118 } |
(...skipping 22 matching lines...) Expand all Loading... |
141 int32_t* pLineBaseArr = (int32_t*)m_lpData; | 141 int32_t* pLineBaseArr = (int32_t*)m_lpData; |
142 FXSYS_assert(nLineIndex < m_nLineCount); | 142 FXSYS_assert(nLineIndex < m_nLineCount); |
143 nStart = m_nCharStart; | 143 nStart = m_nCharStart; |
144 pLineBaseArr++; | 144 pLineBaseArr++; |
145 for (int32_t i = 0; i < nLineIndex; i++) { | 145 for (int32_t i = 0; i < nLineIndex; i++) { |
146 nStart += *pLineBaseArr; | 146 nStart += *pLineBaseArr; |
147 pLineBaseArr++; | 147 pLineBaseArr++; |
148 } | 148 } |
149 nCount = *pLineBaseArr; | 149 nCount = *pLineBaseArr; |
150 } | 150 } |
OLD | NEW |