diff options
Diffstat (limited to 'core/src/fpdfapi')
-rw-r--r-- | core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp | 6 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp | 4 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_font/font_int.h | 2 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_font/fpdf_font.cpp | 6 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp | 8 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page.cpp | 4 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp | 2 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp | 8 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp | 6 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_page/pageint.h | 4 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp | 2 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp | 2 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp | 64 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp | 10 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp | 12 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 5 |
16 files changed, 73 insertions, 72 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp index 717386041d..8cfbd1b40e 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp @@ -106,11 +106,11 @@ void CPDF_PageContentGenerate::ProcessForm(CFX_ByteTextBuf& buf, const uint8_t* } CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL); CPDF_Dictionary* pFormDict = CPDF_Dictionary::Create(); - pFormDict->SetAtName(FX_BSTR("Type"), FX_BSTR("XObject")); - pFormDict->SetAtName(FX_BSTR("Subtype"), FX_BSTR("Form")); + pFormDict->SetAtName("Type", "XObject"); + pFormDict->SetAtName("Subtype", "Form"); CFX_FloatRect bbox = m_pPage->GetPageBBox(); matrix.TransformRect(bbox); - pFormDict->SetAtRect(FX_BSTR("BBox"), bbox); + pFormDict->SetAtRect("BBox", bbox); pStream->InitStream((uint8_t*)data, size, pFormDict); buf << "q " << matrix << " cm "; CFX_ByteString name = RealizeResource(pStream, "XObject"); diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp index 7176a62435..18913a0020 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp @@ -1170,8 +1170,8 @@ void CPDF_Document::DeletePage(int iPage) } m_PageList.RemoveAt(iPage); } -CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name); -void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name) +CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, const CFX_ByteStringC& name); +void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, const CFX_ByteStringC& name) { if (pPageDict->KeyExist(name)) { return; diff --git a/core/src/fpdfapi/fpdf_font/font_int.h b/core/src/fpdfapi/fpdf_font/font_int.h index 6f32f4fa98..aa46f16f75 100644 --- a/core/src/fpdfapi/fpdf_font/font_int.h +++ b/core/src/fpdfapi/fpdf_font/font_int.h @@ -57,7 +57,7 @@ public: CPDF_CMapParser(); ~CPDF_CMapParser() {} FX_BOOL Initialize(CPDF_CMap*); - void ParseWord(FX_BSTR str); + void ParseWord(const CFX_ByteStringC& str); CFX_BinaryBuf m_AddMaps; private: CPDF_CMap* m_pCMap; diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp index c6922d11f8..48a96dc554 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp @@ -391,7 +391,7 @@ int CPDF_Font::GetCharTypeWidth(FX_DWORD charcode) return m_Font.GetGlyphWidth(glyph_index); } int _PDF_GetStandardFontName(CFX_ByteString& name); -CPDF_Font* CPDF_Font::GetStockFont(CPDF_Document* pDoc, FX_BSTR name) +CPDF_Font* CPDF_Font::GetStockFont(CPDF_Document* pDoc, const CFX_ByteStringC& name) { CFX_ByteString fontname(name); int font_id = _PDF_GetStandardFontName(fontname); @@ -532,7 +532,7 @@ FX_DWORD CPDF_ToUnicodeMap::ReverseLookup(FX_WCHAR unicode) } return 0; } -static FX_DWORD _StringToCode(FX_BSTR str) +static FX_DWORD _StringToCode(const CFX_ByteStringC& str) { const FX_CHAR* buf = str.GetCStr(); int len = str.GetLength(); @@ -584,7 +584,7 @@ static CFX_WideString _StringDataAdd(CFX_WideString str) } return ret; } -static CFX_WideString _StringToWideString(FX_BSTR str) +static CFX_WideString _StringToWideString(const CFX_ByteStringC& str) { const FX_CHAR* buf = str.GetCStr(); int len = str.GetLength(); diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp index bec2c90144..ed5ef5c5fe 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp @@ -119,7 +119,7 @@ FX_BOOL CPDF_CMapParser::Initialize(CPDF_CMap* pCMap) m_AddMaps.EstimateSize(0, 10240); return TRUE; } -static FX_DWORD CMap_GetCode(FX_BSTR word) +static FX_DWORD CMap_GetCode(const CFX_ByteStringC& word) { int num = 0; if (word.GetAt(0) == '<') { @@ -146,7 +146,7 @@ static FX_DWORD CMap_GetCode(FX_BSTR word) } return num; } -static FX_BOOL _CMap_GetCodeRange(_CMap_CodeRange& range, FX_BSTR first, FX_BSTR second) +static FX_BOOL _CMap_GetCodeRange(_CMap_CodeRange& range, const CFX_ByteStringC& first, const CFX_ByteStringC& second) { if (first.GetLength() == 0 || first.GetAt(0) != '<') { return FALSE; @@ -177,11 +177,11 @@ static FX_BOOL _CMap_GetCodeRange(_CMap_CodeRange& range, FX_BSTR first, FX_BSTR } return TRUE; } -static CFX_ByteString CMap_GetString(FX_BSTR word) +static CFX_ByteString CMap_GetString(const CFX_ByteStringC& word) { return word.Mid(1, word.GetLength() - 2); } -void CPDF_CMapParser::ParseWord(FX_BSTR word) +void CPDF_CMapParser::ParseWord(const CFX_ByteStringC& word) { if (word.IsEmpty()) { return; diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp index 046cebeb98..688066e3a3 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp @@ -902,7 +902,7 @@ CPDF_Page::~CPDF_Page() pModule->DestroyPageCache(m_pPageRender); } } -CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name) +CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, const CFX_ByteStringC& name) { int level = 0; while (1) { @@ -921,7 +921,7 @@ CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name) } } } -CPDF_Object* CPDF_Page::GetPageAttr(FX_BSTR name) const +CPDF_Object* CPDF_Page::GetPageAttr(const CFX_ByteStringC& name) const { return FPDFAPI_GetPageAttr(m_pFormDict, name); } diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp index 00ea4c5fce..305c1a9183 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp @@ -310,7 +310,7 @@ CPDF_Font* CPDF_DocPageData::GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnl m_FontMap.SetAt(pFontDict, fontData); return pFont; } -CPDF_Font* CPDF_DocPageData::GetStandardFont(FX_BSTR fontName, CPDF_FontEncoding* pEncoding) +CPDF_Font* CPDF_DocPageData::GetStandardFont(const CFX_ByteStringC& fontName, CPDF_FontEncoding* pEncoding) { if (fontName.IsEmpty()) { return NULL; diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp index 3ce4baf20c..8752acf536 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp @@ -376,7 +376,7 @@ CPDF_GeneralStateData::~CPDF_GeneralStateData() pDocCache->ReleaseTransferFunc(m_pTR); } } -static int GetBlendType(FX_BSTR mode) +static int GetBlendType(const CFX_ByteStringC& mode) { switch (mode.GetID()) { case FXBSTR_ID('N', 'o', 'r', 'm'): @@ -417,7 +417,7 @@ static int GetBlendType(FX_BSTR mode) } return FXDIB_BLEND_NORMAL; } -void CPDF_GeneralStateData::SetBlendMode(FX_BSTR blend_mode) +void CPDF_GeneralStateData::SetBlendMode(const CFX_ByteStringC& blend_mode) { if (blend_mode.GetLength() > 15) { return; @@ -677,7 +677,7 @@ void CPDF_ContentMarkData::DeleteLastMark() } m_Marks.RemoveAt(size - 1); } -FX_BOOL CPDF_ContentMark::HasMark(FX_BSTR mark) const +FX_BOOL CPDF_ContentMark::HasMark(const CFX_ByteStringC& mark) const { if (m_pObject == NULL) { return FALSE; @@ -690,7 +690,7 @@ FX_BOOL CPDF_ContentMark::HasMark(FX_BSTR mark) const } return FALSE; } -FX_BOOL CPDF_ContentMark::LookupMark(FX_BSTR mark, CPDF_Dictionary*& pDict) const +FX_BOOL CPDF_ContentMark::LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const { if (m_pObject == NULL) { return FALSE; diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp index d898feecf4..ebe75484e0 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp @@ -438,7 +438,7 @@ const _FX_BSTR _PDF_InlineValueAbbr[] = { _FX_BSTRC("CCITTFaxDecode"), _FX_BSTRC("CCF"), _FX_BSTRC("DCTDecode"), _FX_BSTRC("DCT"), }; -static CFX_ByteStringC _PDF_FindFullName(const _FX_BSTR* table, int count, FX_BSTR abbr) +static CFX_ByteStringC _PDF_FindFullName(const _FX_BSTR* table, int count, const CFX_ByteStringC& abbr) { int i = 0; while (i < count) { @@ -496,7 +496,7 @@ void _PDF_ReplaceAbbr(CPDF_Object* pObj) } } } -static CFX_ByteStringC _PDF_FindAbbrName(const _FX_BSTR* table, int count, FX_BSTR fullName) +static CFX_ByteStringC _PDF_FindAbbrName(const _FX_BSTR* table, int count, const CFX_ByteStringC& fullName) { int i = 0; while (i < count) { @@ -1178,7 +1178,7 @@ void CPDF_StreamContentParser::Handle_SetFont() m_pCurStates->m_TextState.SetFont(pFont); } } -CPDF_Object* CPDF_StreamContentParser::FindResourceObj(FX_BSTR type, const CFX_ByteString& name) +CPDF_Object* CPDF_StreamContentParser::FindResourceObj(const CFX_ByteStringC& type, const CFX_ByteString& name) { if (m_pResources == NULL) { return NULL; diff --git a/core/src/fpdfapi/fpdf_page/pageint.h b/core/src/fpdfapi/fpdf_page/pageint.h index 9ff1c4cb11..5bf854948a 100644 --- a/core/src/fpdfapi/fpdf_page/pageint.h +++ b/core/src/fpdfapi/fpdf_page/pageint.h @@ -205,7 +205,7 @@ public: CPDF_Font* FindFont(const CFX_ByteString& name); CPDF_ColorSpace* FindColorSpace(const CFX_ByteString& name); CPDF_Pattern* FindPattern(const CFX_ByteString& name, FX_BOOL bShading); - CPDF_Object* FindResourceObj(FX_BSTR type, const CFX_ByteString& name); + CPDF_Object* FindResourceObj(const CFX_ByteStringC& type, const CFX_ByteString& name); void Handle_CloseFillStrokePath(); void Handle_FillStrokePath(); void Handle_CloseEOFillStrokePath(); @@ -367,7 +367,7 @@ public: ~CPDF_DocPageData(); void Clear(FX_BOOL bRelease = FALSE); CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly); - CPDF_Font* GetStandardFont(FX_BSTR fontName, CPDF_FontEncoding* pEncoding); + CPDF_Font* GetStandardFont(const CFX_ByteStringC& fontName, CPDF_FontEncoding* pEncoding); void ReleaseFont(CPDF_Dictionary* pFontDict); CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources); CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj); 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(); diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index 2cbe2e8eb6..5851aabbe0 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -603,8 +603,9 @@ int CPDF_DIBSource::CreateDecoder() if (decoder == FX_BSTRC("CCITTFaxDecode")) { m_pDecoder = FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width, m_Height, pParams); } else if (decoder == FX_BSTRC("DCTDecode")) { - m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(src_data, src_size, m_Width, m_Height, - m_nComponents, pParams ? pParams->GetInteger(FX_BSTR("ColorTransform"), 1) : 1); + m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder( + src_data, src_size, m_Width, m_Height, m_nComponents, + pParams ? pParams->GetInteger("ColorTransform", 1) : 1); if (!m_pDecoder) { FX_BOOL bTransform = FALSE; int comps, bpc; |