summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedtbuf.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2017-01-09 13:43:07 -0800
committerCommit bot <commit-bot@chromium.org>2017-01-09 13:43:07 -0800
commit5e9066cbfa252b84d49f8b4adba445ba7761e81f (patch)
tree0c9a396c4740a8e1398e8caef28b1a44372e6fed /xfa/fde/cfde_txtedtbuf.h
parentf04b7f1c438bf9f9e41a1925c6bcaa378c082ee1 (diff)
downloadpdfium-5e9066cbfa252b84d49f8b4adba445ba7761e81f.tar.xz
Add CFDE_TxtEdtBuf testschromium/2977
This CL adds a set of unit tests for the text edit buffer. It fixes up a few bugs found adding the tests and removes the unused ::Optimize method. Review-Url: https://codereview.chromium.org/2614383003
Diffstat (limited to 'xfa/fde/cfde_txtedtbuf.h')
-rw-r--r--xfa/fde/cfde_txtedtbuf.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/xfa/fde/cfde_txtedtbuf.h b/xfa/fde/cfde_txtedtbuf.h
index ac25a080e5..63edbf6167 100644
--- a/xfa/fde/cfde_txtedtbuf.h
+++ b/xfa/fde/cfde_txtedtbuf.h
@@ -25,16 +25,15 @@ class CFDE_TxtEdtBuf {
void SetText(const CFX_WideString& wsText);
CFX_WideString GetText() const;
FX_WCHAR GetCharByIndex(int32_t nIndex) const;
- CFX_WideString GetRange(int32_t nBegin, int32_t nCount = -1) const;
+ CFX_WideString GetRange(int32_t nBegin, int32_t nCount) const;
- void Insert(int32_t nPos, const FX_WCHAR* lpText, int32_t nLength = 1);
- void Delete(int32_t nIndex, int32_t nLength = 1);
- void Clear(bool bRelease = true);
-
- bool Optimize(IFX_Pause* pPause = nullptr);
+ void Insert(int32_t nPos, const FX_WCHAR* lpText, int32_t nLength);
+ void Delete(int32_t nIndex, int32_t nLength);
+ void Clear(bool bRelease);
private:
friend class CFDE_TxtEdtBufIter;
+ friend class CFDE_TxtEdtBufTest;
struct FDE_CHUNKHEADER {
int32_t nUsed;
@@ -50,6 +49,8 @@ class CFDE_TxtEdtBuf {
int32_t CP2Index(const FDE_CHUNKPLACE& cp) const;
void Index2CP(int32_t nIndex, FDE_CHUNKPLACE& cp) const;
+ void SetChunkSizeForTesting(size_t size);
+
int32_t m_nChunkSize;
int32_t m_nTotal;