summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-03-25 13:42:34 -0700
committerTom Sepez <tsepez@chromium.org>2016-03-25 13:42:34 -0700
commit46c8b1e3202ab5ae3663141dc25bec3b4360322e (patch)
treec12b4979cf1bd8f2930175a986e6d7918e6b9c45 /core/fpdfapi
parent86a61dc374e8abe351df03a1aa6665013cc39345 (diff)
downloadpdfium-46c8b1e3202ab5ae3663141dc25bec3b4360322e.tar.xz
Replace CFX_DWordArray with CFX_ArrayTemplate<FX_DWORD>.
First step to getting rid of FX_DWORD. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1832113003 .
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/fpdf_edit/editint.h4
-rw-r--r--core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp7
-rw-r--r--core/fpdfapi/fpdf_edit/include/cpdf_creator.h2
-rw-r--r--core/fpdfapi/fpdf_font/cpdf_cidfont.cpp2
-rw-r--r--core/fpdfapi/fpdf_font/cpdf_cidfont.h6
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp2
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_data_avail.h4
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp2
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_hint_tables.h8
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_parser.cpp2
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_document.h2
11 files changed, 21 insertions, 20 deletions
diff --git a/core/fpdfapi/fpdf_edit/editint.h b/core/fpdfapi/fpdf_edit/editint.h
index 8a73f123a3..eaf93d12da 100644
--- a/core/fpdfapi/fpdf_edit/editint.h
+++ b/core/fpdfapi/fpdf_edit/editint.h
@@ -29,14 +29,14 @@ class CPDF_ObjectStream {
FX_FILESIZE End(CPDF_Creator* pCreator);
- CFX_DWordArray m_ObjNumArray;
+ CFX_ArrayTemplate<FX_DWORD> m_ObjNumArray;
CFX_ByteTextBuf m_Buffer;
FX_DWORD m_dwObjNum;
int32_t m_index;
protected:
- CFX_DWordArray m_OffsetArray;
+ CFX_ArrayTemplate<FX_DWORD> m_OffsetArray;
};
class CPDF_XRefStream {
public:
diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
index cf79fdc47d..8e1072aa00 100644
--- a/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
+++ b/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
@@ -500,7 +500,8 @@ static void _CFString2CFXByteString(CFStringRef src, CFX_ByteString& dest) {
dest = (FX_CHAR*)pBuffer;
free(pBuffer);
}
-FX_BOOL IsHasCharSet(CFArrayRef languages, const CFX_DWordArray& charSets) {
+FX_BOOL IsHasCharSet(CFArrayRef languages,
+ const CFX_ArrayTemplate<FX_DWORD>& charSets) {
int iCount = charSets.GetSize();
for (int i = 0; i < CFArrayGetCount(languages); ++i) {
CFStringRef language = (CFStringRef)CFArrayGetValueAtIndex(languages, i);
@@ -571,7 +572,7 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont,
CFRelease(descriptor);
return NULL;
}
- CFX_DWordArray charSets;
+ CFX_ArrayTemplate<FX_DWORD> charSets;
charSets.Add(FXFONT_CHINESEBIG5_CHARSET);
charSets.Add(FXFONT_GB2312_CHARSET);
charSets.Add(FXFONT_HANGEUL_CHARSET);
@@ -1075,7 +1076,7 @@ static int InsertDeletePDFPage(CPDF_Document* pDoc,
static int InsertNewPage(CPDF_Document* pDoc,
int iPage,
CPDF_Dictionary* pPageDict,
- CFX_DWordArray& pageList) {
+ CFX_ArrayTemplate<FX_DWORD>& pageList) {
CPDF_Dictionary* pRoot = pDoc->GetRoot();
if (!pRoot) {
return -1;
diff --git a/core/fpdfapi/fpdf_edit/include/cpdf_creator.h b/core/fpdfapi/fpdf_edit/include/cpdf_creator.h
index 0488266564..ad776a2866 100644
--- a/core/fpdfapi/fpdf_edit/include/cpdf_creator.h
+++ b/core/fpdfapi/fpdf_edit/include/cpdf_creator.h
@@ -93,7 +93,7 @@ class CPDF_Creator {
FX_POSITION m_Pos;
FX_FILESIZE m_XrefStart;
CFX_FileSizeListArray m_ObjectOffset;
- CFX_DWordArray m_NewObjNumArray;
+ CFX_ArrayTemplate<FX_DWORD> m_NewObjNumArray;
CPDF_Array* m_pIDArray;
int32_t m_FileVersion;
};
diff --git a/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp b/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
index d528017779..956046c3be 100644
--- a/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
@@ -812,7 +812,7 @@ void CPDF_CIDFont::LoadSubstFont() {
g_CharsetCPs[m_Charset], IsVertWriting());
}
void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray,
- CFX_DWordArray& result,
+ CFX_ArrayTemplate<FX_DWORD>& result,
int nElements) {
int width_status = 0;
int iCurElement = 0;
diff --git a/core/fpdfapi/fpdf_font/cpdf_cidfont.h b/core/fpdfapi/fpdf_font/cpdf_cidfont.h
index 6ff7c825d2..6405d2c342 100644
--- a/core/fpdfapi/fpdf_font/cpdf_cidfont.h
+++ b/core/fpdfapi/fpdf_font/cpdf_cidfont.h
@@ -63,7 +63,7 @@ class CPDF_CIDFont : public CPDF_Font {
protected:
int GetGlyphIndex(FX_DWORD unicodeb, FX_BOOL* pVertGlyph);
void LoadMetricsArray(CPDF_Array* pArray,
- CFX_DWordArray& result,
+ CFX_ArrayTemplate<FX_DWORD>& result,
int nElements);
void LoadSubstFont();
FX_WCHAR GetUnicodeFromCharCode(FX_DWORD charcode) const;
@@ -78,10 +78,10 @@ class CPDF_CIDFont : public CPDF_Font {
uint16_t m_DefaultWidth;
uint16_t* m_pAnsiWidths;
FX_SMALL_RECT m_CharBBox[256];
- CFX_DWordArray m_WidthList;
+ CFX_ArrayTemplate<FX_DWORD> m_WidthList;
short m_DefaultVY;
short m_DefaultW1;
- CFX_DWordArray m_VertMetrics;
+ CFX_ArrayTemplate<FX_DWORD> m_VertMetrics;
FX_BOOL m_bAdobeCourierStd;
CFX_CTTGSUBTable* m_pTTGSUBTable;
};
diff --git a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
index c5576ae8e2..2c41c13a5a 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
@@ -499,7 +499,7 @@ void CPDF_DataAvail::ResetFirstCheck(int iPage) {
FX_BOOL CPDF_DataAvail::CheckPage(IPDF_DataAvail::DownloadHints* pHints) {
FX_DWORD iPageObjs = m_PageObjList.GetSize();
- CFX_DWordArray UnavailObjList;
+ CFX_ArrayTemplate<FX_DWORD> UnavailObjList;
for (FX_DWORD i = 0; i < iPageObjs; ++i) {
FX_DWORD dwPageObjNum = m_PageObjList.GetAt(i);
FX_BOOL bExist = FALSE;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_data_avail.h b/core/fpdfapi/fpdf_parser/cpdf_data_avail.h
index 4c8d3719ff..036de72968 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_data_avail.h
+++ b/core/fpdfapi/fpdf_parser/cpdf_data_avail.h
@@ -179,8 +179,8 @@ class CPDF_DataAvail final : public IPDF_DataAvail {
FX_DWORD m_bufferSize;
CFX_ByteString m_WordBuf;
uint8_t m_bufferData[512];
- CFX_DWordArray m_XRefStreamList;
- CFX_DWordArray m_PageObjList;
+ CFX_ArrayTemplate<FX_DWORD> m_XRefStreamList;
+ CFX_ArrayTemplate<FX_DWORD> m_PageObjList;
FX_DWORD m_PagesObjNum;
FX_BOOL m_bLinearized;
FX_DWORD m_dwFirstPageNo;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
index 0dd869210e..eafda43965 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
@@ -126,7 +126,7 @@ FX_BOOL CPDF_HintTables::ReadPageHintTable(CFX_BitStream* hStream) {
if (!CanReadFromBitStream(hStream, required_bits))
return FALSE;
- CFX_DWordArray dwPageLenArray;
+ CFX_ArrayTemplate<FX_DWORD> dwPageLenArray;
for (int i = 0; i < nPages; ++i) {
FX_SAFE_DWORD safePageLen = hStream->GetBits(dwDeltaPageLenBits);
safePageLen += dwPageLeastLen;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
index 3271f5e1ec..f6f862fab6 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
+++ b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
@@ -51,10 +51,10 @@ class CPDF_HintTables {
CPDF_DataAvail* m_pDataAvail;
FX_DWORD m_nFirstPageSharedObjs;
FX_FILESIZE m_szFirstPageObjOffset;
- CFX_DWordArray m_dwDeltaNObjsArray;
- CFX_DWordArray m_dwNSharedObjsArray;
- CFX_DWordArray m_dwSharedObjNumArray;
- CFX_DWordArray m_dwIdentifierArray;
+ CFX_ArrayTemplate<FX_DWORD> m_dwDeltaNObjsArray;
+ CFX_ArrayTemplate<FX_DWORD> m_dwNSharedObjsArray;
+ CFX_ArrayTemplate<FX_DWORD> m_dwSharedObjNumArray;
+ CFX_ArrayTemplate<FX_DWORD> m_dwIdentifierArray;
std::vector<FX_FILESIZE> m_szPageOffsetArray;
std::vector<FX_FILESIZE> m_szSharedObjOffsetArray;
};
diff --git a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
index e9896d8099..5312e62d43 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
@@ -1010,7 +1010,7 @@ FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE* pos, FX_BOOL bMainXRef) {
return FALSE;
}
- CFX_DWordArray WidthArray;
+ CFX_ArrayTemplate<FX_DWORD> WidthArray;
FX_SAFE_DWORD dwAccWidth = 0;
for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
WidthArray.Add(pArray->GetIntegerAt(i));
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_document.h b/core/fpdfapi/fpdf_parser/include/cpdf_document.h
index 02a55dd455..21b9d250fd 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_document.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_document.h
@@ -129,7 +129,7 @@ class CPDF_Document : public CFX_PrivateData, public CPDF_IndirectObjectHolder {
FX_BOOL m_bLinearized;
FX_DWORD m_dwFirstPageNo;
FX_DWORD m_dwFirstPageObjNum;
- CFX_DWordArray m_PageList;
+ CFX_ArrayTemplate<FX_DWORD> m_PageList;
CPDF_DocPageData* m_pDocPage;
CPDF_DocRenderData* m_pDocRender;
};