diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-04-22 12:04:14 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-04-22 12:04:14 -0700 |
commit | 1ddf056da74de0a34631b8a719f4f02b4ec82144 (patch) | |
tree | 45217449a89d4286a903c76774971c1c2c6c38e4 /core/src/fpdfapi/fpdf_parser | |
parent | ea6a069e6e593d97513e86fc761cf789a9714c22 (diff) | |
download | pdfium-1ddf056da74de0a34631b8a719f4f02b4ec82144.tar.xz |
Add missing operators for CFX_ByteStringC.
Removing the implicit cast operator forces a build breakage should we
use ByteStringC in STL containers. Adding an operator< restores correct
behaviour. Adding an operator[] avoids re-writing some code to call
GetPtr() prior to array indexing.
Part 1 of 4.
R=thestig@chromium.org
TBR=brucedawson@chromium.org
BUG=pdfium:142.
Review URL: https://codereview.chromium.org/1090303003
Diffstat (limited to 'core/src/fpdfapi/fpdf_parser')
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp | 4 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index 1a49ffd6b7..2772d9825e 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -2558,7 +2558,7 @@ FX_BOOL CPDF_SyntaxParser::SearchWord(FX_BSTR tag, FX_BOOL bWholeWord, FX_BOOL b if (!bForward) { offset = taglen - 1; } - FX_LPCBYTE tag_data = tag; + FX_LPCBYTE tag_data = tag.GetPtr(); FX_BYTE byte; while (1) { if (bForward) { @@ -2595,7 +2595,7 @@ FX_BOOL CPDF_SyntaxParser::SearchWord(FX_BSTR tag, FX_BOOL bWholeWord, FX_BOOL b } } FX_FILESIZE startpos = bForward ? pos - taglen + 1 : pos; - if (!bWholeWord || IsWholeWord(startpos, limit, tag, taglen)) { + if (!bWholeWord || IsWholeWord(startpos, limit, tag.GetPtr(), taglen)) { m_Pos = startpos; return TRUE; } diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp index bbfd4cc680..df154eae90 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp @@ -51,7 +51,7 @@ CPDF_SimpleParser::CPDF_SimpleParser(FX_LPCBYTE pData, FX_DWORD dwSize) } CPDF_SimpleParser::CPDF_SimpleParser(FX_BSTR str) { - m_pData = str; + m_pData = str.GetPtr(); m_dwSize = str.GetLength(); m_dwCurPos = 0; } @@ -198,7 +198,7 @@ FX_BOOL CPDF_SimpleParser::SearchToken(FX_BSTR token) { int token_len = token.GetLength(); while (m_dwCurPos < m_dwSize - token_len) { - if (FXSYS_memcmp32(m_pData + m_dwCurPos, token, token_len) == 0) { + if (FXSYS_memcmp32(m_pData + m_dwCurPos, token.GetPtr(), token_len) == 0) { break; } m_dwCurPos ++; |