summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_parser
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-10 17:38:11 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-10 17:38:11 -0700
commitca3ac5e9ffc936066267fbb1c329e5297d8e23e6 (patch)
tree986e666023ae0eec649051613d83c6c60ef3dac0 /core/src/fpdfapi/fpdf_parser
parent0aa0e7331b3512066df3e33d6642456a0de63de7 (diff)
downloadpdfium-ca3ac5e9ffc936066267fbb1c329e5297d8e23e6.tar.xz
Merge to XFA: Remove FX_BSTR and FX_WSTR typedefs.
Nearly automatic merge + re-run script on new files. Original Review URL: https://codereview.chromium.org/1180593004. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1174303002.
Diffstat (limited to 'core/src/fpdfapi/fpdf_parser')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp64
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp10
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp12
5 files changed, 45 insertions, 45 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp
index 973a14e33b..b4366ba277 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp
@@ -103,7 +103,7 @@ FX_DWORD CPDF_StandardSecurityHandler::GetPermissions()
{
return m_Permissions;
}
-static FX_BOOL _LoadCryptInfo(CPDF_Dictionary* pEncryptDict, FX_BSTR name, int& cipher, int& keylen)
+static FX_BOOL _LoadCryptInfo(CPDF_Dictionary* pEncryptDict, const CFX_ByteStringC& name, int& cipher, int& keylen)
{
int Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
cipher = FXCIPHER_RC4;
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp
index 97e68b5c0c..f0cabe5412 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp
@@ -66,7 +66,7 @@ void CFX_DataFilter::ReportEOF(FX_DWORD left_input)
m_bEOF = TRUE;
m_SrcPos -= left_input;
}
-CFX_DataFilter* FPDF_CreateFilter(FX_BSTR name, const CPDF_Dictionary* pParam, int width, int height)
+CFX_DataFilter* FPDF_CreateFilter(const CFX_ByteStringC& name, const CPDF_Dictionary* pParam, int width, int height)
{
FX_DWORD id = name.GetID();
switch (id) {
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
index 5cc06e7929..8533859bef 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
@@ -353,11 +353,11 @@ CPDF_Number::CPDF_Number(FX_BOOL bInteger, void* pData)
: CPDF_Object(PDFOBJ_NUMBER), m_bInteger(bInteger), m_Integer(*(int*)pData) {
}
-CPDF_Number::CPDF_Number(FX_BSTR str) : CPDF_Object(PDFOBJ_NUMBER) {
+CPDF_Number::CPDF_Number(const CFX_ByteStringC& str) : CPDF_Object(PDFOBJ_NUMBER) {
FX_atonum(str, m_bInteger, &m_Integer);
}
-void CPDF_Number::SetString(FX_BSTR str)
+void CPDF_Number::SetString(const CFX_ByteStringC& str)
{
FX_atonum(str, m_bInteger, &m_Integer);
}
@@ -588,19 +588,19 @@ CPDF_Object* CPDF_Dictionary::GetNextElement(FX_POSITION& pos, CFX_ByteString& k
m_Map.GetNextAssoc(pos, key, (void*&)p);
return p;
}
-CPDF_Object* CPDF_Dictionary::GetElement(FX_BSTR key) const
+CPDF_Object* CPDF_Dictionary::GetElement(const CFX_ByteStringC& key) const
{
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
return p;
}
-CPDF_Object* CPDF_Dictionary::GetElementValue(FX_BSTR key) const
+CPDF_Object* CPDF_Dictionary::GetElementValue(const CFX_ByteStringC& key) const
{
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
return p ? p->GetDirect() : NULL;
}
-CFX_ByteString CPDF_Dictionary::GetString(FX_BSTR key) const
+CFX_ByteString CPDF_Dictionary::GetString(const CFX_ByteStringC& key) const
{
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
@@ -609,7 +609,7 @@ CFX_ByteString CPDF_Dictionary::GetString(FX_BSTR key) const
else
return CFX_ByteString();
}
-CFX_ByteStringC CPDF_Dictionary::GetConstString(FX_BSTR key) const
+CFX_ByteStringC CPDF_Dictionary::GetConstString(const CFX_ByteStringC& key) const
{
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
@@ -618,7 +618,7 @@ CFX_ByteStringC CPDF_Dictionary::GetConstString(FX_BSTR key) const
else
return CFX_ByteStringC();
}
-CFX_WideString CPDF_Dictionary::GetUnicodeText(FX_BSTR key, CFX_CharMap* pCharMap) const
+CFX_WideString CPDF_Dictionary::GetUnicodeText(const CFX_ByteStringC& key, CFX_CharMap* pCharMap) const
{
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
@@ -634,7 +634,7 @@ CFX_WideString CPDF_Dictionary::GetUnicodeText(FX_BSTR key, CFX_CharMap* pCharMa
}
return CFX_WideString();
}
-CFX_ByteString CPDF_Dictionary::GetString(FX_BSTR key, FX_BSTR def) const
+CFX_ByteString CPDF_Dictionary::GetString(const CFX_ByteStringC& key, const CFX_ByteStringC& def) const
{
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
@@ -643,7 +643,7 @@ CFX_ByteString CPDF_Dictionary::GetString(FX_BSTR key, FX_BSTR def) const
}
return CFX_ByteString(def);
}
-CFX_ByteStringC CPDF_Dictionary::GetConstString(FX_BSTR key, FX_BSTR def) const
+CFX_ByteStringC CPDF_Dictionary::GetConstString(const CFX_ByteStringC& key, const CFX_ByteStringC& def) const
{
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
@@ -652,7 +652,7 @@ CFX_ByteStringC CPDF_Dictionary::GetConstString(FX_BSTR key, FX_BSTR def) const
else
return CFX_ByteStringC(def);
}
-int CPDF_Dictionary::GetInteger(FX_BSTR key) const
+int CPDF_Dictionary::GetInteger(const CFX_ByteStringC& key) const
{
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
@@ -661,7 +661,7 @@ int CPDF_Dictionary::GetInteger(FX_BSTR key) const
}
return 0;
}
-int CPDF_Dictionary::GetInteger(FX_BSTR key, int def) const
+int CPDF_Dictionary::GetInteger(const CFX_ByteStringC& key, int def) const
{
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
@@ -670,7 +670,7 @@ int CPDF_Dictionary::GetInteger(FX_BSTR key, int def) const
}
return def;
}
-FX_FLOAT CPDF_Dictionary::GetNumber(FX_BSTR key) const
+FX_FLOAT CPDF_Dictionary::GetNumber(const CFX_ByteStringC& key) const
{
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
@@ -679,7 +679,7 @@ FX_FLOAT CPDF_Dictionary::GetNumber(FX_BSTR key) const
}
return 0;
}
-FX_BOOL CPDF_Dictionary::GetBoolean(FX_BSTR key, FX_BOOL bDefault) const
+FX_BOOL CPDF_Dictionary::GetBoolean(const CFX_ByteStringC& key, FX_BOOL bDefault) const
{
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
@@ -688,7 +688,7 @@ FX_BOOL CPDF_Dictionary::GetBoolean(FX_BSTR key, FX_BOOL bDefault) const
}
return bDefault;
}
-CPDF_Dictionary* CPDF_Dictionary::GetDict(FX_BSTR key) const
+CPDF_Dictionary* CPDF_Dictionary::GetDict(const CFX_ByteStringC& key) const
{
CPDF_Object* p = GetElementValue(key);
if (p == NULL) {
@@ -700,7 +700,7 @@ CPDF_Dictionary* CPDF_Dictionary::GetDict(FX_BSTR key) const
}
return NULL;
}
-CPDF_Array* CPDF_Dictionary::GetArray(FX_BSTR key) const
+CPDF_Array* CPDF_Dictionary::GetArray(const CFX_ByteStringC& key) const
{
CPDF_Object* p = GetElementValue(key);
if (p == NULL || p->GetType() != PDFOBJ_ARRAY) {
@@ -708,7 +708,7 @@ CPDF_Array* CPDF_Dictionary::GetArray(FX_BSTR key) const
}
return (CPDF_Array*)p;
}
-CPDF_Stream* CPDF_Dictionary::GetStream(FX_BSTR key) const
+CPDF_Stream* CPDF_Dictionary::GetStream(const CFX_ByteStringC& key) const
{
CPDF_Object* p = GetElementValue(key);
if (p == NULL || p->GetType() != PDFOBJ_STREAM) {
@@ -716,7 +716,7 @@ CPDF_Stream* CPDF_Dictionary::GetStream(FX_BSTR key) const
}
return (CPDF_Stream*)p;
}
-CFX_FloatRect CPDF_Dictionary::GetRect(FX_BSTR key) const
+CFX_FloatRect CPDF_Dictionary::GetRect(const CFX_ByteStringC& key) const
{
CFX_FloatRect rect;
CPDF_Array* pArray = GetArray(key);
@@ -725,7 +725,7 @@ CFX_FloatRect CPDF_Dictionary::GetRect(FX_BSTR key) const
}
return rect;
}
-CFX_AffineMatrix CPDF_Dictionary::GetMatrix(FX_BSTR key) const
+CFX_AffineMatrix CPDF_Dictionary::GetMatrix(const CFX_ByteStringC& key) const
{
CFX_AffineMatrix matrix;
CPDF_Array* pArray = GetArray(key);
@@ -734,12 +734,12 @@ CFX_AffineMatrix CPDF_Dictionary::GetMatrix(FX_BSTR key) const
}
return matrix;
}
-FX_BOOL CPDF_Dictionary::KeyExist(FX_BSTR key) const
+FX_BOOL CPDF_Dictionary::KeyExist(const CFX_ByteStringC& key) const
{
void* value;
return m_Map.Lookup(key, value);
}
-void CPDF_Dictionary::SetAt(FX_BSTR key, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs)
+void CPDF_Dictionary::SetAt(const CFX_ByteStringC& key, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs)
{
ASSERT(m_Type == PDFOBJ_DICTIONARY);
CPDF_Object* p = NULL;
@@ -759,12 +759,12 @@ void CPDF_Dictionary::SetAt(FX_BSTR key, CPDF_Object* pObj, CPDF_IndirectObjects
m_Map.RemoveKey(key);
}
}
-void CPDF_Dictionary::AddValue(FX_BSTR key, CPDF_Object* pObj)
+void CPDF_Dictionary::AddValue(const CFX_ByteStringC& key, CPDF_Object* pObj)
{
ASSERT(m_Type == PDFOBJ_DICTIONARY);
m_Map.AddValue(key, pObj);
}
-void CPDF_Dictionary::RemoveAt(FX_BSTR key)
+void CPDF_Dictionary::RemoveAt(const CFX_ByteStringC& key)
{
ASSERT(m_Type == PDFOBJ_DICTIONARY);
CPDF_Object* p = NULL;
@@ -775,7 +775,7 @@ void CPDF_Dictionary::RemoveAt(FX_BSTR key)
p->Release();
m_Map.RemoveKey(key);
}
-void CPDF_Dictionary::ReplaceKey(FX_BSTR oldkey, FX_BSTR newkey)
+void CPDF_Dictionary::ReplaceKey(const CFX_ByteStringC& oldkey, const CFX_ByteStringC& newkey)
{
ASSERT(m_Type == PDFOBJ_DICTIONARY);
CPDF_Object* p = NULL;
@@ -807,37 +807,37 @@ FX_BOOL CPDF_Dictionary::Identical(CPDF_Dictionary* pOther) const
}
return TRUE;
}
-void CPDF_Dictionary::SetAtInteger(FX_BSTR key, int i)
+void CPDF_Dictionary::SetAtInteger(const CFX_ByteStringC& key, int i)
{
SetAt(key, new CPDF_Number(i));
}
-void CPDF_Dictionary::SetAtName(FX_BSTR key, const CFX_ByteString& name)
+void CPDF_Dictionary::SetAtName(const CFX_ByteStringC& key, const CFX_ByteString& name)
{
SetAt(key, new CPDF_Name(name));
}
-void CPDF_Dictionary::SetAtString(FX_BSTR key, const CFX_ByteString& str)
+void CPDF_Dictionary::SetAtString(const CFX_ByteStringC& key, const CFX_ByteString& str)
{
SetAt(key, new CPDF_String(str));
}
-void CPDF_Dictionary::SetAtReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
+void CPDF_Dictionary::SetAtReference(const CFX_ByteStringC& key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
{
SetAt(key, new CPDF_Reference(pDoc, objnum));
}
-void CPDF_Dictionary::AddReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
+void CPDF_Dictionary::AddReference(const CFX_ByteStringC& key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
{
AddValue(key, new CPDF_Reference(pDoc, objnum));
}
-void CPDF_Dictionary::SetAtNumber(FX_BSTR key, FX_FLOAT f)
+void CPDF_Dictionary::SetAtNumber(const CFX_ByteStringC& key, FX_FLOAT f)
{
CPDF_Number* pNumber = new CPDF_Number;
pNumber->SetNumber(f);
SetAt(key, pNumber);
}
-void CPDF_Dictionary::SetAtBoolean(FX_BSTR key, FX_BOOL bValue)
+void CPDF_Dictionary::SetAtBoolean(const CFX_ByteStringC& key, FX_BOOL bValue)
{
SetAt(key, new CPDF_Boolean(bValue));
}
-void CPDF_Dictionary::SetAtRect(FX_BSTR key, const CFX_FloatRect& rect)
+void CPDF_Dictionary::SetAtRect(const CFX_ByteStringC& key, const CFX_FloatRect& rect)
{
CPDF_Array* pArray = new CPDF_Array;
pArray->AddNumber(rect.left);
@@ -846,7 +846,7 @@ void CPDF_Dictionary::SetAtRect(FX_BSTR key, const CFX_FloatRect& rect)
pArray->AddNumber(rect.top);
SetAt(key, pArray);
}
-void CPDF_Dictionary::SetAtMatrix(FX_BSTR key, const CFX_AffineMatrix& matrix)
+void CPDF_Dictionary::SetAtMatrix(const CFX_ByteStringC& key, const CFX_AffineMatrix& matrix)
{
CPDF_Array* pArray = new CPDF_Array;
pArray->AddNumber16(matrix.a);
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index 09c5c39e4f..f4fa8ff499 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -335,7 +335,7 @@ FX_FILESIZE CPDF_Parser::GetObjectOffset(FX_DWORD objnum)
}
return 0;
}
-static int32_t GetDirectInteger(CPDF_Dictionary* pDict, FX_BSTR key)
+static int32_t GetDirectInteger(CPDF_Dictionary* pDict, const CFX_ByteStringC& key)
{
CPDF_Object* pObj = pDict->GetElement(key);
if (pObj == NULL) {
@@ -346,7 +346,7 @@ static int32_t GetDirectInteger(CPDF_Dictionary* pDict, FX_BSTR key)
}
return 0;
}
-static FX_BOOL CheckDirectType(CPDF_Dictionary* pDict, FX_BSTR key, int32_t iType)
+static FX_BOOL CheckDirectType(CPDF_Dictionary* pDict, const CFX_ByteStringC& key, int32_t iType)
{
CPDF_Object* pObj = pDict->GetElement(key);
if (!pObj) {
@@ -2549,7 +2549,7 @@ FX_BOOL CPDF_SyntaxParser::IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit,
}
return TRUE;
}
-FX_BOOL CPDF_SyntaxParser::SearchWord(FX_BSTR tag, FX_BOOL bWholeWord, FX_BOOL bForward, FX_FILESIZE limit)
+FX_BOOL CPDF_SyntaxParser::SearchWord(const CFX_ByteStringC& tag, FX_BOOL bWholeWord, FX_BOOL bForward, FX_FILESIZE limit)
{
int32_t taglen = tag.GetLength();
if (taglen == 0) {
@@ -2620,7 +2620,7 @@ struct _SearchTagRecord {
FX_DWORD m_Len;
FX_DWORD m_Offset;
};
-int32_t CPDF_SyntaxParser::SearchMultiWord(FX_BSTR tags, FX_BOOL bWholeWord, FX_FILESIZE limit)
+int32_t CPDF_SyntaxParser::SearchMultiWord(const CFX_ByteStringC& tags, FX_BOOL bWholeWord, FX_FILESIZE limit)
{
int32_t ntags = 1, i;
for (i = 0; i < tags.GetLength(); i ++)
@@ -2682,7 +2682,7 @@ end:
FX_Free(pPatterns);
return found;
}
-FX_FILESIZE CPDF_SyntaxParser::FindTag(FX_BSTR tag, FX_FILESIZE limit)
+FX_FILESIZE CPDF_SyntaxParser::FindTag(const CFX_ByteStringC& tag, FX_FILESIZE limit)
{
int32_t taglen = tag.GetLength();
int32_t match = 0;
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
index e6474550a2..61134f5df4 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
@@ -49,7 +49,7 @@ CPDF_SimpleParser::CPDF_SimpleParser(const uint8_t* pData, FX_DWORD dwSize)
m_dwSize = dwSize;
m_dwCurPos = 0;
}
-CPDF_SimpleParser::CPDF_SimpleParser(FX_BSTR str)
+CPDF_SimpleParser::CPDF_SimpleParser(const CFX_ByteStringC& str)
{
m_pData = str.GetPtr();
m_dwSize = str.GetLength();
@@ -194,7 +194,7 @@ CFX_ByteStringC CPDF_SimpleParser::GetWord()
}
return CFX_ByteStringC(pStart, dwSize);
}
-FX_BOOL CPDF_SimpleParser::SearchToken(FX_BSTR token)
+FX_BOOL CPDF_SimpleParser::SearchToken(const CFX_ByteStringC& token)
{
int token_len = token.GetLength();
while (m_dwCurPos < m_dwSize - token_len) {
@@ -209,7 +209,7 @@ FX_BOOL CPDF_SimpleParser::SearchToken(FX_BSTR token)
m_dwCurPos += token_len;
return TRUE;
}
-FX_BOOL CPDF_SimpleParser::SkipWord(FX_BSTR token)
+FX_BOOL CPDF_SimpleParser::SkipWord(const CFX_ByteStringC& token)
{
while (1) {
CFX_ByteStringC word = GetWord();
@@ -222,7 +222,7 @@ FX_BOOL CPDF_SimpleParser::SkipWord(FX_BSTR token)
}
return FALSE;
}
-FX_BOOL CPDF_SimpleParser::FindTagPair(FX_BSTR start_token, FX_BSTR end_token,
+FX_BOOL CPDF_SimpleParser::FindTagPair(const CFX_ByteStringC& start_token, const CFX_ByteStringC& end_token,
FX_DWORD& start_pos, FX_DWORD& end_pos)
{
if (!start_token.IsEmpty()) {
@@ -243,7 +243,7 @@ FX_BOOL CPDF_SimpleParser::FindTagPair(FX_BSTR start_token, FX_BSTR end_token,
}
return FALSE;
}
-FX_BOOL CPDF_SimpleParser::FindTagParam(FX_BSTR token, int nParams)
+FX_BOOL CPDF_SimpleParser::FindTagParam(const CFX_ByteStringC& token, int nParams)
{
nParams ++;
FX_DWORD* pBuf = FX_Alloc(FX_DWORD, nParams);
@@ -287,7 +287,7 @@ static int _hex2dec(char ch)
}
return 0;
}
-CFX_ByteString PDF_NameDecode(FX_BSTR bstr)
+CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& bstr)
{
int size = bstr.GetLength();
const FX_CHAR* pSrc = bstr.GetCStr();