summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedtbuf.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-08-21 12:27:45 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-21 17:49:27 +0000
commita798e2f487e388aafc0beeda46aca3fb0358c189 (patch)
tree4b2c4d68081b2fb90e42af70d106a2bd10e743af /xfa/fde/cfde_txtedtbuf.h
parent3b20ec77c760ef11dacf00a3e654d06cadf20c27 (diff)
downloadpdfium-a798e2f487e388aafc0beeda46aca3fb0358c189.tar.xz
Cleanup CFDE_TxtEdtBuf and simplify some logic.
This CL cleans up nits in CFDE_TxtEdtBuf and simplifies some of the methods. Change-Id: I2092da8e27281a577752fc331fec0612a349dfd6 Reviewed-on: https://pdfium-review.googlesource.com/11335 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_txtedtbuf.h')
-rw-r--r--xfa/fde/cfde_txtedtbuf.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/xfa/fde/cfde_txtedtbuf.h b/xfa/fde/cfde_txtedtbuf.h
index b28e4a434e..e8293d0240 100644
--- a/xfa/fde/cfde_txtedtbuf.h
+++ b/xfa/fde/cfde_txtedtbuf.h
@@ -8,7 +8,7 @@
#define XFA_FDE_CFDE_TXTEDTBUF_H_
#include <memory>
-#include <tuple>
+#include <utility>
#include <vector>
#include "core/fxcrt/fx_basic.h"
@@ -51,7 +51,7 @@ class CFDE_TxtEdtBuf {
void Insert(int32_t nPos, const CFX_WideString& wsText);
void Delete(int32_t nIndex, int32_t nLength);
- void Clear(bool bRelease);
+ void Clear();
void SetChunkSizeForTesting(size_t size);
size_t GetChunkCountForTesting() const { return m_chunks.size(); }
@@ -59,15 +59,14 @@ class CFDE_TxtEdtBuf {
private:
class ChunkHeader {
public:
- ChunkHeader();
+ explicit ChunkHeader(int32_t chunkSize);
~ChunkHeader();
int32_t nUsed;
- std::unique_ptr<wchar_t, FxFreeDeleter> wChars;
+ std::vector<wchar_t> wChars;
};
- std::tuple<int32_t, int32_t> Index2CP(int32_t nIndex) const;
- std::unique_ptr<ChunkHeader> NewChunk();
+ std::pair<int32_t, int32_t> Index2CP(int32_t nIndex) const;
int32_t m_chunkSize;
int32_t m_nTotal;