summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedtbuf.cpp
diff options
context:
space:
mode:
authorJane Liu <janeliulwq@google.com>2017-08-21 10:26:25 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-21 15:18:36 +0000
commit3fa212abba3b6977a4e47981116bb0a3f4017221 (patch)
treebcf288f01955521b52d9806f510ea9a4d14bd6b2 /xfa/fde/cfde_txtedtbuf.cpp
parent69ad278881f83a1f8cf45d5a42a88752c0871c7e (diff)
downloadpdfium-3fa212abba3b6977a4e47981116bb0a3f4017221.tar.xz
Converted CFDE_TxtEdt{Buf|Engine}::Insert() to take CFX_WideString
Converted CFDE_TxtEdtBuf::Insert(), CFDE_TxtEdtEngine::Insert(), and CFDE_TxtEdtEngine::Inner_Insert() to take in CFX_WideString instead of a wchar_t* and length. Bug=pdfium:757 Change-Id: I6097e9b0d4e584b920b2117b4c5489eedef37767 Reviewed-on: https://pdfium-review.googlesource.com/11411 Commit-Queue: Jane Liu <janeliulwq@google.com> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_txtedtbuf.cpp')
-rw-r--r--xfa/fde/cfde_txtedtbuf.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/xfa/fde/cfde_txtedtbuf.cpp b/xfa/fde/cfde_txtedtbuf.cpp
index 6e712f2b04..3f558ca386 100644
--- a/xfa/fde/cfde_txtedtbuf.cpp
+++ b/xfa/fde/cfde_txtedtbuf.cpp
@@ -110,10 +110,10 @@ CFX_WideString CFDE_TxtEdtBuf::GetRange(int32_t nBegin, int32_t nLength) const {
return wsText;
}
-void CFDE_TxtEdtBuf::Insert(int32_t nPos,
- const wchar_t* lpText,
- int32_t nLength) {
+void CFDE_TxtEdtBuf::Insert(int32_t nPos, const CFX_WideString& wsText) {
ASSERT(nPos >= 0 && nPos <= m_nTotal);
+
+ int32_t nLength = wsText.GetLength();
ASSERT(nLength > 0);
int32_t chunkIndex = 0;
@@ -137,6 +137,7 @@ void CFDE_TxtEdtBuf::Insert(int32_t nPos,
charIndex = 0;
}
+ const wchar_t* lpText = wsText.c_str();
if (chunkIndex != 0) {
ChunkHeader* chunk = m_chunks[chunkIndex - 1].get();
if (chunk->nUsed != m_chunkSize) {