summaryrefslogtreecommitdiff
path: root/xfa/fde/css/cfde_csstextbuf.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-06-26 13:33:47 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-26 20:49:42 +0000
commitf76e9d33b6246358d34cb476dbf197788fe49425 (patch)
tree5207216d0850b602816b0bb0f196ecb29117ff0f /xfa/fde/css/cfde_csstextbuf.h
parentbdb330ee4d4d9d6fafc6bc84d4fa28c045eda936 (diff)
downloadpdfium-f76e9d33b6246358d34cb476dbf197788fe49425.tar.xz
Clean up CFDE_CSSTextBuf.
Change-Id: I8230c2d5e5450ea36ff6d2a4fefc1619a13e9c44 Reviewed-on: https://pdfium-review.googlesource.com/6930 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fde/css/cfde_csstextbuf.h')
-rw-r--r--xfa/fde/css/cfde_csstextbuf.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/xfa/fde/css/cfde_csstextbuf.h b/xfa/fde/css/cfde_csstextbuf.h
index 71c76f3361..eaeb085971 100644
--- a/xfa/fde/css/cfde_csstextbuf.h
+++ b/xfa/fde/css/cfde_csstextbuf.h
@@ -17,24 +17,14 @@ class CFDE_CSSTextBuf {
CFDE_CSSTextBuf();
~CFDE_CSSTextBuf();
- bool AttachBuffer(const wchar_t* pBuffer, int32_t iBufLen);
+ void AttachBuffer(const wchar_t* pBuffer, int32_t iBufLen);
bool EstimateSize(int32_t iAllocSize);
- bool AppendChar(wchar_t wch) {
- if (m_iDatLen >= m_iBufLen && !ExpandBuf(m_iBufLen * 2))
- return false;
- m_pBuffer[m_iDatLen++] = wch;
- return true;
- }
+ bool AppendChar(wchar_t wch);
void Clear() { m_iDatPos = m_iDatLen = 0; }
void Reset();
- int32_t TrimEnd() {
- while (m_iDatLen > 0 && m_pBuffer[m_iDatLen - 1] <= ' ')
- --m_iDatLen;
- AppendChar(0);
- return --m_iDatLen;
- }
+ int32_t TrimEnd();
void Subtract(int32_t iStart, int32_t iLength);
bool IsEOF() const { return m_iDatPos >= m_iDatLen; }