| 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/fde/cfde_txtedtengine.h" | 7 #include "xfa/fde/cfde_txtedtengine.h" |
| 8 | 8 |
| 9 #include "xfa/fde/cfde_txtedtbuf.h" | 9 #include "xfa/fde/cfde_txtedtbuf.h" |
| 10 #include "xfa/fde/cfde_txtedtbufiter.h" | 10 #include "xfa/fde/cfde_txtedtbufiter.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return ((m_nLineCount - 1) / m_nPageLineCount) + 1; | 76 return ((m_nLineCount - 1) / m_nPageLineCount) + 1; |
| 77 } | 77 } |
| 78 | 78 |
| 79 IFDE_TxtEdtPage* CFDE_TxtEdtEngine::GetPage(int32_t nIndex) { | 79 IFDE_TxtEdtPage* CFDE_TxtEdtEngine::GetPage(int32_t nIndex) { |
| 80 if (m_PagePtrArray.GetSize() <= nIndex) { | 80 if (m_PagePtrArray.GetSize() <= nIndex) { |
| 81 return NULL; | 81 return NULL; |
| 82 } | 82 } |
| 83 return (IFDE_TxtEdtPage*)m_PagePtrArray[nIndex]; | 83 return (IFDE_TxtEdtPage*)m_PagePtrArray[nIndex]; |
| 84 } | 84 } |
| 85 | 85 |
| 86 FX_BOOL CFDE_TxtEdtEngine::SetBufChunkSize(int32_t nChunkSize) { | |
| 87 return m_pTxtBuf->SetChunkSize(nChunkSize); | |
| 88 } | |
| 89 | |
| 90 void CFDE_TxtEdtEngine::SetTextByStream(IFX_Stream* pStream) { | 86 void CFDE_TxtEdtEngine::SetTextByStream(IFX_Stream* pStream) { |
| 91 ResetEngine(); | 87 ResetEngine(); |
| 92 int32_t nIndex = 0; | 88 int32_t nIndex = 0; |
| 93 if (pStream != NULL && pStream->GetLength()) { | 89 if (pStream != NULL && pStream->GetLength()) { |
| 94 int32_t nStreamLength = pStream->GetLength(); | 90 int32_t nStreamLength = pStream->GetLength(); |
| 95 FX_BOOL bValid = TRUE; | 91 FX_BOOL bValid = TRUE; |
| 96 if (m_nLimit > 0 && nStreamLength > m_nLimit) { | 92 if (m_nLimit > 0 && nStreamLength > m_nLimit) { |
| 97 bValid = FALSE; | 93 bValid = FALSE; |
| 98 } | 94 } |
| 99 FX_BOOL bPreIsCR = FALSE; | 95 FX_BOOL bPreIsCR = FALSE; |
| (...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 m_SelRangePtrArr.RemoveAt(nCountRange); | 1603 m_SelRangePtrArr.RemoveAt(nCountRange); |
| 1608 DeleteRange_DoRecord(nSelStart, nSelCount, TRUE); | 1604 DeleteRange_DoRecord(nSelStart, nSelCount, TRUE); |
| 1609 } | 1605 } |
| 1610 ClearSelection(); | 1606 ClearSelection(); |
| 1611 m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo); | 1607 m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo); |
| 1612 m_Param.pEventSink->On_SelChanged(this); | 1608 m_Param.pEventSink->On_SelChanged(this); |
| 1613 SetCaretPos(nSelStart, TRUE); | 1609 SetCaretPos(nSelStart, TRUE); |
| 1614 return; | 1610 return; |
| 1615 } | 1611 } |
| 1616 } | 1612 } |
| OLD | NEW |