| 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 #ifndef XFA_FDE_CFDE_TXTEDTBUF_H_ | 7 #ifndef XFA_FDE_CFDE_TXTEDTBUF_H_ |
| 8 #define XFA_FDE_CFDE_TXTEDTBUF_H_ | 8 #define XFA_FDE_CFDE_TXTEDTBUF_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 int32_t GetTextLength() const; | 24 int32_t GetTextLength() const; |
| 25 void SetText(const CFX_WideString& wsText); | 25 void SetText(const CFX_WideString& wsText); |
| 26 void GetText(CFX_WideString& wsText) const; | 26 void GetText(CFX_WideString& wsText) const; |
| 27 FX_WCHAR GetCharByIndex(int32_t nIndex) const; | 27 FX_WCHAR GetCharByIndex(int32_t nIndex) const; |
| 28 void GetRange(CFX_WideString& wsText, | 28 void GetRange(CFX_WideString& wsText, |
| 29 int32_t nBegin, | 29 int32_t nBegin, |
| 30 int32_t nCount = -1) const; | 30 int32_t nCount = -1) const; |
| 31 | 31 |
| 32 void Insert(int32_t nPos, const FX_WCHAR* lpText, int32_t nLength = 1); | 32 void Insert(int32_t nPos, const FX_WCHAR* lpText, int32_t nLength = 1); |
| 33 void Delete(int32_t nIndex, int32_t nLength = 1); | 33 void Delete(int32_t nIndex, int32_t nLength = 1); |
| 34 void Clear(FX_BOOL bRelease = TRUE); | 34 void Clear(bool bRelease = true); |
| 35 | 35 |
| 36 FX_BOOL Optimize(IFX_Pause* pPause = nullptr); | 36 bool Optimize(IFX_Pause* pPause = nullptr); |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 friend class CFDE_TxtEdtBufIter; | 39 friend class CFDE_TxtEdtBufIter; |
| 40 | 40 |
| 41 struct FDE_CHUNKHEADER { | 41 struct FDE_CHUNKHEADER { |
| 42 int32_t nUsed; | 42 int32_t nUsed; |
| 43 FX_WCHAR wChars[1]; | 43 FX_WCHAR wChars[1]; |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 struct FDE_CHUNKPLACE { | 46 struct FDE_CHUNKPLACE { |
| 47 int32_t nChunkIndex; | 47 int32_t nChunkIndex; |
| 48 int32_t nCharIndex; | 48 int32_t nCharIndex; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 void ResetChunkBuffer(int32_t nDefChunkCount, int32_t nChunkSize); | 51 void ResetChunkBuffer(int32_t nDefChunkCount, int32_t nChunkSize); |
| 52 int32_t CP2Index(const FDE_CHUNKPLACE& cp) const; | 52 int32_t CP2Index(const FDE_CHUNKPLACE& cp) const; |
| 53 void Index2CP(int32_t nIndex, FDE_CHUNKPLACE& cp) const; | 53 void Index2CP(int32_t nIndex, FDE_CHUNKPLACE& cp) const; |
| 54 | 54 |
| 55 int32_t m_nChunkSize; | 55 int32_t m_nChunkSize; |
| 56 | 56 |
| 57 int32_t m_nTotal; | 57 int32_t m_nTotal; |
| 58 FX_BOOL m_bChanged; | 58 bool m_bChanged; |
| 59 CFX_ArrayTemplate<FDE_CHUNKHEADER*> m_Chunks; | 59 CFX_ArrayTemplate<FDE_CHUNKHEADER*> m_Chunks; |
| 60 std::unique_ptr<IFX_MemoryAllocator> m_pAllocator; | 60 std::unique_ptr<IFX_MemoryAllocator> m_pAllocator; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 #endif // XFA_FDE_CFDE_TXTEDTBUF_H_ | 63 #endif // XFA_FDE_CFDE_TXTEDTBUF_H_ |
| OLD | NEW |