summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/fpdf_page')
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_allstates.cpp4
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_colorspace.cpp6
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_colorstate.cpp8
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_colorstate.h2
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_colorstatedata.h4
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_generalstate.cpp2
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_image.cpp16
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_meshstream.cpp14
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_meshstream.h18
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_textobject.cpp34
-rw-r--r--core/fpdfapi/fpdf_page/fpdf_page_colors.cpp4
-rw-r--r--core/fpdfapi/fpdf_page/fpdf_page_doc.cpp2
-rw-r--r--core/fpdfapi/fpdf_page/fpdf_page_func.cpp20
-rw-r--r--core/fpdfapi/fpdf_page/fpdf_page_parser.cpp28
-rw-r--r--core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp48
-rw-r--r--core/fpdfapi/fpdf_page/fpdf_page_pattern.cpp2
-rw-r--r--core/fpdfapi/fpdf_page/include/cpdf_clippath.h4
-rw-r--r--core/fpdfapi/fpdf_page/include/cpdf_colorspace.h8
-rw-r--r--core/fpdfapi/fpdf_page/include/cpdf_image.h12
-rw-r--r--core/fpdfapi/fpdf_page/include/cpdf_textobject.h8
-rw-r--r--core/fpdfapi/fpdf_page/pageint.h48
21 files changed, 146 insertions, 146 deletions
diff --git a/core/fpdfapi/fpdf_page/cpdf_allstates.cpp b/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
index 5d02381d2e..159de584ee 100644
--- a/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
@@ -47,7 +47,7 @@ void CPDF_AllStates::SetLineDash(CPDF_Array* pArray,
CFX_GraphStateData* pData = m_GraphState.GetModify();
pData->m_DashPhase = phase * scale;
pData->SetDashCount(pArray->GetCount());
- for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
+ for (uint32_t i = 0; i < pArray->GetCount(); i++) {
pData->m_DashArray[i] = pArray->GetNumberAt(i) * scale;
}
}
@@ -62,7 +62,7 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
if (!pObject)
continue;
- FX_DWORD key = key_str.GetID();
+ uint32_t key = key_str.GetID();
switch (key) {
case FXBSTR_ID('L', 'W', 0, 0):
m_GraphState.GetModify()->m_LineWidth = pObject->GetNumber();
diff --git a/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp b/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp
index b1b464471d..3add21cfed 100644
--- a/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp
@@ -364,7 +364,7 @@ CPDF_ColorSpace* CPDF_ColorSpace::Load(CPDF_Document* pDoc, CPDF_Object* pObj) {
return ColorspaceFromName(familyname);
CPDF_ColorSpace* pCS = NULL;
- FX_DWORD id = familyname.GetID();
+ uint32_t id = familyname.GetID();
if (id == FXBSTR_ID('C', 'a', 'l', 'G')) {
pCS = new CPDF_CalGray(pDoc);
} else if (id == FXBSTR_ID('C', 'a', 'l', 'R')) {
@@ -930,8 +930,8 @@ void CPDF_ICCBasedCS::TranslateImageLine(uint8_t* pDestBuf,
uint8_t* temp_src = FX_Alloc2D(uint8_t, nMaxColors, m_nComponents);
uint8_t* pSrc = temp_src;
for (int i = 0; i < nMaxColors; i++) {
- FX_DWORD color = i;
- FX_DWORD order = nMaxColors / 52;
+ uint32_t color = i;
+ uint32_t order = nMaxColors / 52;
for (int c = 0; c < m_nComponents; c++) {
*pSrc++ = (uint8_t)(color / order * 5);
color %= order;
diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp b/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp
index 81e5e41d60..7f80c82a03 100644
--- a/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp
@@ -25,7 +25,7 @@ void CPDF_ColorState::SetStrokeColor(CPDF_ColorSpace* pCS,
}
void CPDF_ColorState::SetColor(CPDF_Color& color,
- FX_DWORD& rgb,
+ uint32_t& rgb,
CPDF_ColorSpace* pCS,
FX_FLOAT* pValue,
int nValues) {
@@ -39,7 +39,7 @@ void CPDF_ColorState::SetColor(CPDF_Color& color,
}
color.SetValue(pValue);
int R, G, B;
- rgb = color.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (FX_DWORD)-1;
+ rgb = color.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (uint32_t)-1;
}
void CPDF_ColorState::SetFillPattern(CPDF_Pattern* pPattern,
@@ -54,7 +54,7 @@ void CPDF_ColorState::SetFillPattern(CPDF_Pattern* pPattern,
pData->m_FillRGB = 0x00BFBFBF;
return;
}
- pData->m_FillRGB = ret ? FXSYS_RGB(R, G, B) : (FX_DWORD)-1;
+ pData->m_FillRGB = ret ? FXSYS_RGB(R, G, B) : (uint32_t)-1;
}
void CPDF_ColorState::SetStrokePattern(CPDF_Pattern* pPattern,
@@ -70,5 +70,5 @@ void CPDF_ColorState::SetStrokePattern(CPDF_Pattern* pPattern,
return;
}
pData->m_StrokeRGB =
- pData->m_StrokeColor.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (FX_DWORD)-1;
+ pData->m_StrokeColor.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (uint32_t)-1;
}
diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstate.h b/core/fpdfapi/fpdf_page/cpdf_colorstate.h
index e7f3e37d35..2b27d07702 100644
--- a/core/fpdfapi/fpdf_page/cpdf_colorstate.h
+++ b/core/fpdfapi/fpdf_page/cpdf_colorstate.h
@@ -32,7 +32,7 @@ class CPDF_ColorState : public CFX_CountRef<CPDF_ColorStateData> {
private:
void SetColor(CPDF_Color& color,
- FX_DWORD& rgb,
+ uint32_t& rgb,
CPDF_ColorSpace* pCS,
FX_FLOAT* pValue,
int nValues);
diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h b/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h
index 96e43bd9f3..6a992ad0b1 100644
--- a/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h
+++ b/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h
@@ -18,9 +18,9 @@ class CPDF_ColorStateData {
void Default();
CPDF_Color m_FillColor;
- FX_DWORD m_FillRGB;
+ uint32_t m_FillRGB;
CPDF_Color m_StrokeColor;
- FX_DWORD m_StrokeRGB;
+ uint32_t m_StrokeRGB;
};
#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATEDATA_H_
diff --git a/core/fpdfapi/fpdf_page/cpdf_generalstate.cpp b/core/fpdfapi/fpdf_page/cpdf_generalstate.cpp
index 11c4dc7701..45a40cc85c 100644
--- a/core/fpdfapi/fpdf_page/cpdf_generalstate.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_generalstate.cpp
@@ -9,7 +9,7 @@
namespace {
int RI_StringToId(const CFX_ByteString& ri) {
- FX_DWORD id = ri.GetID();
+ uint32_t id = ri.GetID();
if (id == FXBSTR_ID('A', 'b', 's', 'o'))
return 1;
diff --git a/core/fpdfapi/fpdf_page/cpdf_image.cpp b/core/fpdfapi/fpdf_page/cpdf_image.cpp
index 7b114841be..d5c97807e9 100644
--- a/core/fpdfapi/fpdf_page/cpdf_image.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_image.cpp
@@ -74,7 +74,7 @@ FX_BOOL CPDF_Image::LoadImageF(CPDF_Stream* pStream, FX_BOOL bInline) {
return TRUE;
}
-CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, FX_DWORD size) {
+CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, uint32_t size) {
int32_t width;
int32_t height;
int32_t num_comps;
@@ -120,7 +120,7 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, FX_DWORD size) {
return pDict;
}
-void CPDF_Image::SetJpegImage(uint8_t* pData, FX_DWORD size) {
+void CPDF_Image::SetJpegImage(uint8_t* pData, uint32_t size) {
CPDF_Dictionary* pDict = InitJPEG(pData, size);
if (!pDict) {
return;
@@ -129,11 +129,11 @@ void CPDF_Image::SetJpegImage(uint8_t* pData, FX_DWORD size) {
}
void CPDF_Image::SetJpegImage(IFX_FileRead* pFile) {
- FX_DWORD size = (FX_DWORD)pFile->GetSize();
+ uint32_t size = (uint32_t)pFile->GetSize();
if (!size) {
return;
}
- FX_DWORD dwEstimateSize = size;
+ uint32_t dwEstimateSize = size;
if (dwEstimateSize > 8192) {
dwEstimateSize = 8192;
}
@@ -221,7 +221,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
uint8_t* pColorTable = FX_Alloc2D(uint8_t, iPalette, 3);
uint8_t* ptr = pColorTable;
for (int32_t i = 0; i < iPalette; i++) {
- FX_DWORD argb = pBitmap->GetPaletteArgb(i);
+ uint32_t argb = pBitmap->GetPaletteArgb(i);
ptr[0] = (uint8_t)(argb >> 16);
ptr[1] = (uint8_t)(argb >> 8);
ptr[2] = (uint8_t)argb;
@@ -357,9 +357,9 @@ void CPDF_Image::ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pBitmap) {
}
CFX_DIBSource* CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask,
- FX_DWORD* pMatteColor,
+ uint32_t* pMatteColor,
FX_BOOL bStdCS,
- FX_DWORD GroupFamily,
+ uint32_t GroupFamily,
FX_BOOL bLoadMask) const {
std::unique_ptr<CPDF_DIBSource> source(new CPDF_DIBSource);
if (source->Load(m_pDocument, m_pStream,
@@ -385,7 +385,7 @@ CFX_DIBSource* CPDF_Image::DetachMask() {
FX_BOOL CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource,
CPDF_Dictionary* pPageResource,
FX_BOOL bStdCS,
- FX_DWORD GroupFamily,
+ uint32_t GroupFamily,
FX_BOOL bLoadMask) {
std::unique_ptr<CPDF_DIBSource> source(new CPDF_DIBSource);
int ret =
diff --git a/core/fpdfapi/fpdf_page/cpdf_meshstream.cpp b/core/fpdfapi/fpdf_page/cpdf_meshstream.cpp
index 1d983d2b25..f4a1c16754 100644
--- a/core/fpdfapi/fpdf_page/cpdf_meshstream.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_meshstream.cpp
@@ -26,7 +26,7 @@ FX_BOOL CPDF_MeshStream::Load(CPDF_Stream* pShadingStream,
if (!m_nCoordBits || !m_nCompBits)
return FALSE;
- FX_DWORD nComps = pCS->CountComponents();
+ uint32_t nComps = pCS->CountComponents();
if (nComps > 8)
return FALSE;
@@ -44,14 +44,14 @@ FX_BOOL CPDF_MeshStream::Load(CPDF_Stream* pShadingStream,
m_xmax = pDecode->GetNumberAt(1);
m_ymin = pDecode->GetNumberAt(2);
m_ymax = pDecode->GetNumberAt(3);
- for (FX_DWORD i = 0; i < m_nComps; i++) {
+ for (uint32_t i = 0; i < m_nComps; i++) {
m_ColorMin[i] = pDecode->GetNumberAt(i * 2 + 4);
m_ColorMax[i] = pDecode->GetNumberAt(i * 2 + 5);
}
return TRUE;
}
-FX_DWORD CPDF_MeshStream::GetFlag() {
+uint32_t CPDF_MeshStream::GetFlag() {
return m_BitStream.GetBits(m_nFlagBits) & 0x03;
}
@@ -70,7 +70,7 @@ void CPDF_MeshStream::GetCoords(FX_FLOAT& x, FX_FLOAT& y) {
}
void CPDF_MeshStream::GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b) {
- FX_DWORD i;
+ uint32_t i;
FX_FLOAT color_value[8];
for (i = 0; i < m_nComps; i++) {
color_value[i] = m_ColorMin[i] +
@@ -82,7 +82,7 @@ void CPDF_MeshStream::GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b) {
FX_FLOAT result[kMaxResults];
int nResults;
FXSYS_memset(result, 0, sizeof(result));
- for (FX_DWORD i = 0; i < m_nFuncs; i++) {
+ for (uint32_t i = 0; i < m_nFuncs; i++) {
if (m_pFuncs[i] && m_pFuncs[i]->CountOutputs() <= kMaxResults) {
m_pFuncs[i]->Call(color_value, 1, result, nResults);
}
@@ -93,9 +93,9 @@ void CPDF_MeshStream::GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b) {
}
}
-FX_DWORD CPDF_MeshStream::GetVertex(CPDF_MeshVertex& vertex,
+uint32_t CPDF_MeshStream::GetVertex(CPDF_MeshVertex& vertex,
CFX_Matrix* pObject2Bitmap) {
- FX_DWORD flag = GetFlag();
+ uint32_t flag = GetFlag();
GetCoords(vertex.x, vertex.y);
pObject2Bitmap->Transform(vertex.x, vertex.y);
GetColor(vertex.r, vertex.g, vertex.b);
diff --git a/core/fpdfapi/fpdf_page/cpdf_meshstream.h b/core/fpdfapi/fpdf_page/cpdf_meshstream.h
index 4934c0b133..462dcf09c7 100644
--- a/core/fpdfapi/fpdf_page/cpdf_meshstream.h
+++ b/core/fpdfapi/fpdf_page/cpdf_meshstream.h
@@ -31,25 +31,25 @@ class CPDF_MeshStream {
int nFuncs,
CPDF_ColorSpace* pCS);
- FX_DWORD GetFlag();
+ uint32_t GetFlag();
void GetCoords(FX_FLOAT& x, FX_FLOAT& y);
void GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b);
- FX_DWORD GetVertex(CPDF_MeshVertex& vertex, CFX_Matrix* pObject2Bitmap);
+ uint32_t GetVertex(CPDF_MeshVertex& vertex, CFX_Matrix* pObject2Bitmap);
FX_BOOL GetVertexRow(CPDF_MeshVertex* vertex,
int count,
CFX_Matrix* pObject2Bitmap);
CPDF_Function** m_pFuncs;
CPDF_ColorSpace* m_pCS;
- FX_DWORD m_nFuncs;
- FX_DWORD m_nCoordBits;
- FX_DWORD m_nCompBits;
- FX_DWORD m_nFlagBits;
- FX_DWORD m_nComps;
- FX_DWORD m_CoordMax;
- FX_DWORD m_CompMax;
+ uint32_t m_nFuncs;
+ uint32_t m_nCoordBits;
+ uint32_t m_nCompBits;
+ uint32_t m_nFlagBits;
+ uint32_t m_nComps;
+ uint32_t m_CoordMax;
+ uint32_t m_CompMax;
FX_FLOAT m_xmin;
FX_FLOAT m_xmax;
FX_FLOAT m_ymin;
diff --git a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
index cf588dcf3d..7ca03b4f05 100644
--- a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
@@ -25,7 +25,7 @@ CPDF_TextObject::~CPDF_TextObject() {
void CPDF_TextObject::GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const {
pInfo->m_CharCode =
- m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[index];
+ m_nChars == 1 ? (uint32_t)(uintptr_t)m_pCharCodes : m_pCharCodes[index];
pInfo->m_OriginX = index ? m_pCharPos[index - 1] : 0;
pInfo->m_OriginY = 0;
if (pInfo->m_CharCode == -1) {
@@ -54,26 +54,26 @@ int CPDF_TextObject::CountChars() const {
}
int count = 0;
for (int i = 0; i < m_nChars; ++i)
- if (m_pCharCodes[i] != (FX_DWORD)-1) {
+ if (m_pCharCodes[i] != (uint32_t)-1) {
++count;
}
return count;
}
void CPDF_TextObject::GetCharInfo(int index,
- FX_DWORD& charcode,
+ uint32_t& charcode,
FX_FLOAT& kerning) const {
if (m_nChars == 1) {
- charcode = (FX_DWORD)(uintptr_t)m_pCharCodes;
+ charcode = (uint32_t)(uintptr_t)m_pCharCodes;
kerning = 0;
return;
}
int count = 0;
for (int i = 0; i < m_nChars; ++i) {
- if (m_pCharCodes[i] != (FX_DWORD)-1) {
+ if (m_pCharCodes[i] != (uint32_t)-1) {
if (count == index) {
charcode = m_pCharCodes[i];
- if (i == m_nChars - 1 || m_pCharCodes[i + 1] != (FX_DWORD)-1) {
+ if (i == m_nChars - 1 || m_pCharCodes[i + 1] != (uint32_t)-1) {
kerning = 0;
} else {
kerning = m_pCharPos[i];
@@ -92,8 +92,8 @@ void CPDF_TextObject::GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const {
}
int count = 0;
for (int i = 0; i < m_nChars; ++i) {
- FX_DWORD charcode = m_pCharCodes[i];
- if (charcode == (FX_DWORD)-1) {
+ uint32_t charcode = m_pCharCodes[i];
+ if (charcode == (uint32_t)-1) {
continue;
}
if (count == index) {
@@ -110,8 +110,8 @@ CPDF_TextObject* CPDF_TextObject::Clone() const {
obj->m_nChars = m_nChars;
if (m_nChars > 1) {
- obj->m_pCharCodes = FX_Alloc(FX_DWORD, m_nChars);
- FXSYS_memcpy(obj->m_pCharCodes, m_pCharCodes, m_nChars * sizeof(FX_DWORD));
+ obj->m_pCharCodes = FX_Alloc(uint32_t, m_nChars);
+ FXSYS_memcpy(obj->m_pCharCodes, m_pCharCodes, m_nChars * sizeof(uint32_t));
obj->m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
FXSYS_memcpy(obj->m_pCharPos, m_pCharPos,
(m_nChars - 1) * sizeof(FX_FLOAT));
@@ -145,7 +145,7 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs,
}
m_nChars += nsegs - 1;
if (m_nChars > 1) {
- m_pCharCodes = FX_Alloc(FX_DWORD, m_nChars);
+ m_pCharCodes = FX_Alloc(uint32_t, m_nChars);
m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
int index = 0;
for (int i = 0; i < nsegs; ++i) {
@@ -156,12 +156,12 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs,
}
if (i != nsegs - 1) {
m_pCharPos[index - 1] = pKerning[i];
- m_pCharCodes[index++] = (FX_DWORD)-1;
+ m_pCharCodes[index++] = (uint32_t)-1;
}
}
} else {
int offset = 0;
- m_pCharCodes = (FX_DWORD*)(uintptr_t)pFont->GetNextChar(
+ m_pCharCodes = (uint32_t*)(uintptr_t)pFont->GetNextChar(
pStrs[0], pStrs[0].GetLength(), offset);
}
}
@@ -171,7 +171,7 @@ void CPDF_TextObject::SetText(const CFX_ByteString& str) {
RecalcPositionData();
}
-FX_FLOAT CPDF_TextObject::GetCharWidth(FX_DWORD charcode) const {
+FX_FLOAT CPDF_TextObject::GetCharWidth(uint32_t charcode) const {
FX_FLOAT fontsize = m_TextState.GetFontSize() / 1000;
CPDF_Font* pFont = m_TextState.GetFont();
FX_BOOL bVertWriting = FALSE;
@@ -203,10 +203,10 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
}
FX_FLOAT fontsize = m_TextState.GetFontSize();
for (int i = 0; i < m_nChars; ++i) {
- FX_DWORD charcode =
- m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i];
+ uint32_t charcode =
+ m_nChars == 1 ? (uint32_t)(uintptr_t)m_pCharCodes : m_pCharCodes[i];
if (i > 0) {
- if (charcode == (FX_DWORD)-1) {
+ if (charcode == (uint32_t)-1) {
curpos -= (m_pCharPos[i - 1] * fontsize) / 1000;
continue;
}
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index cc40976f29..224602ebc7 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -21,7 +21,7 @@
namespace {
-FX_DWORD ComponentsForFamily(int family) {
+uint32_t ComponentsForFamily(int family) {
if (family == PDFCS_DEVICERGB)
return 3;
if (family == PDFCS_DEVICEGRAY)
@@ -216,7 +216,7 @@ void CPDF_DeviceCS::TranslateImageLine(uint8_t* pDestBuf,
}
}
-CPDF_IccProfile::CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize)
+CPDF_IccProfile::CPDF_IccProfile(const uint8_t* pData, uint32_t dwSize)
: m_bsRGB(FALSE), m_pTransform(NULL), m_nSrcComponents(0) {
if (dwSize == 3144 &&
FXSYS_memcmp(pData + 0x190, "sRGB IEC61966-2.1", 17) == 0) {
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 2e68702127..d762e1aa53 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -477,7 +477,7 @@ CPDF_Image* CPDF_DocPageData::GetImage(CPDF_Object* pImageStream) {
if (!pImageStream)
return nullptr;
- const FX_DWORD dwImageObjNum = pImageStream->GetObjNum();
+ const uint32_t dwImageObjNum = pImageStream->GetObjNum();
auto it = m_ImageMap.find(dwImageObjNum);
if (it != m_ImageMap.end()) {
return it->second->AddRef();
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/fpdfapi/fpdf_page/fpdf_page_func.cpp
index 08eafad6ac..0fa2dd7712 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_func.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_func.cpp
@@ -490,7 +490,7 @@ static FX_FLOAT PDF_Interpolate(FX_FLOAT x,
FX_FLOAT ymax) {
return ((x - xmin) * (ymax - ymin) / (xmax - xmin)) + ymin;
}
-static FX_DWORD _GetBits32(const uint8_t* pData, int bitpos, int nbits) {
+static uint32_t _GetBits32(const uint8_t* pData, int bitpos, int nbits) {
int result = 0;
for (int i = 0; i < nbits; i++)
if (pData[(bitpos + i) / 8] & (1 << (7 - (bitpos + i) % 8))) {
@@ -515,8 +515,8 @@ class CPDF_SampledFunc : public CPDF_Function {
SampleEncodeInfo* m_pEncodeInfo;
SampleDecodeInfo* m_pDecodeInfo;
- FX_DWORD m_nBitsPerSample;
- FX_DWORD m_SampleMax;
+ uint32_t m_nBitsPerSample;
+ uint32_t m_SampleMax;
CPDF_StreamAcc* m_pSampleStream;
};
@@ -632,7 +632,7 @@ FX_BOOL CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const {
return FALSE;
}
for (int j = 0; j < m_nOutputs; j++) {
- FX_DWORD sample =
+ uint32_t sample =
_GetBits32(pSampleData, bitpos.ValueOrDie() + j * m_nBitsPerSample,
m_nBitsPerSample);
FX_FLOAT encoded = (FX_FLOAT)sample;
@@ -650,7 +650,7 @@ FX_BOOL CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const {
if (!bitpos2.IsValid()) {
return FALSE;
}
- FX_DWORD sample1 =
+ uint32_t sample1 =
_GetBits32(pSampleData, bitpos2.ValueOrDie(), m_nBitsPerSample);
encoded += (encoded_input[i] - index[i]) *
((FX_FLOAT)sample1 - (FX_FLOAT)sample);
@@ -770,12 +770,12 @@ FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj) {
if (!pArray) {
return FALSE;
}
- FX_DWORD nSubs = pArray->GetCount();
+ uint32_t nSubs = pArray->GetCount();
if (nSubs == 0) {
return FALSE;
}
m_nOutputs = 0;
- for (FX_DWORD i = 0; i < nSubs; i++) {
+ for (uint32_t i = 0; i < nSubs; i++) {
CPDF_Object* pSub = pArray->GetElementValue(i);
if (pSub == pObj) {
return FALSE;
@@ -804,7 +804,7 @@ FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj) {
if (!pArray) {
return FALSE;
}
- for (FX_DWORD i = 0; i < nSubs - 1; i++) {
+ for (uint32_t i = 0; i < nSubs - 1; i++) {
m_pBounds[i + 1] = pArray->GetFloatAt(i);
}
m_pBounds[nSubs] = m_pDomains[1];
@@ -813,7 +813,7 @@ FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj) {
if (!pArray) {
return FALSE;
}
- for (FX_DWORD i = 0; i < nSubs * 2; i++) {
+ for (uint32_t i = 0; i < nSubs * 2; i++) {
m_pEncode[i] = pArray->GetFloatAt(i);
}
return TRUE;
@@ -900,7 +900,7 @@ FX_BOOL CPDF_Function::Init(CPDF_Object* pObj) {
m_pRanges[i] = pRanges->GetFloatAt(i);
}
}
- FX_DWORD old_outputs = m_nOutputs;
+ uint32_t old_outputs = m_nOutputs;
if (!v_Init(pObj)) {
return FALSE;
}
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index 63c84bbd22..75b745222f 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -255,8 +255,8 @@ void CPDF_StreamContentParser::AddObjectParam(CPDF_Object* pObj) {
m_ParamBuf[index].m_pObject = pObj;
}
void CPDF_StreamContentParser::ClearAllParams() {
- FX_DWORD index = m_ParamStartPos;
- for (FX_DWORD i = 0; i < m_ParamCount; i++) {
+ uint32_t index = m_ParamStartPos;
+ for (uint32_t i = 0; i < m_ParamCount; i++) {
if (m_ParamBuf[index].m_Type == 0) {
if (CPDF_Object* pObject = m_ParamBuf[index].m_pObject)
pObject->Release();
@@ -270,7 +270,7 @@ void CPDF_StreamContentParser::ClearAllParams() {
m_ParamCount = 0;
}
-CPDF_Object* CPDF_StreamContentParser::GetObject(FX_DWORD index) {
+CPDF_Object* CPDF_StreamContentParser::GetObject(uint32_t index) {
if (index >= m_ParamCount) {
return NULL;
}
@@ -302,7 +302,7 @@ CPDF_Object* CPDF_StreamContentParser::GetObject(FX_DWORD index) {
return NULL;
}
-CFX_ByteString CPDF_StreamContentParser::GetString(FX_DWORD index) {
+CFX_ByteString CPDF_StreamContentParser::GetString(uint32_t index) {
if (index >= m_ParamCount) {
return CFX_ByteString();
}
@@ -320,7 +320,7 @@ CFX_ByteString CPDF_StreamContentParser::GetString(FX_DWORD index) {
return CFX_ByteString();
}
-FX_FLOAT CPDF_StreamContentParser::GetNumber(FX_DWORD index) {
+FX_FLOAT CPDF_StreamContentParser::GetNumber(uint32_t index) {
if (index >= m_ParamCount) {
return 0;
}
@@ -339,7 +339,7 @@ FX_FLOAT CPDF_StreamContentParser::GetNumber(FX_DWORD index) {
return 0;
}
-FX_FLOAT CPDF_StreamContentParser::GetNumber16(FX_DWORD index) {
+FX_FLOAT CPDF_StreamContentParser::GetNumber16(uint32_t index) {
return GetNumber(index);
}
@@ -484,7 +484,7 @@ CPDF_StreamContentParser::InitializeOpCodes() {
void CPDF_StreamContentParser::OnOperator(const FX_CHAR* op) {
int i = 0;
- FX_DWORD opid = 0;
+ uint32_t opid = 0;
while (i < 4 && op[i]) {
opid = (opid << 8) + op[i];
i++;
@@ -574,7 +574,7 @@ void CPDF_StreamContentParser::Handle_BeginImage() {
std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pObj(
m_pSyntax->ReadNextObject());
if (!key.IsEmpty()) {
- FX_DWORD dwObjNum = pObj ? pObj->GetObjNum() : 0;
+ uint32_t dwObjNum = pObj ? pObj->GetObjNum() : 0;
if (dwObjNum)
pDict->SetAtReference(key, m_pDocument, dwObjNum);
else
@@ -1645,17 +1645,17 @@ void CPDF_StreamContentParser::AddPathObject(int FillType, FX_BOOL bStroke) {
}
}
-FX_DWORD CPDF_StreamContentParser::Parse(const uint8_t* pData,
- FX_DWORD dwSize,
- FX_DWORD max_cost) {
+uint32_t CPDF_StreamContentParser::Parse(const uint8_t* pData,
+ uint32_t dwSize,
+ uint32_t max_cost) {
if (m_Level > _FPDF_MAX_FORM_LEVEL_) {
return dwSize;
}
- FX_DWORD InitObjCount = m_pObjectHolder->GetPageObjectList()->size();
+ uint32_t InitObjCount = m_pObjectHolder->GetPageObjectList()->size();
CPDF_StreamParser syntax(pData, dwSize);
CPDF_StreamParserAutoClearer auto_clearer(&m_pSyntax, &syntax);
while (1) {
- FX_DWORD cost = m_pObjectHolder->GetPageObjectList()->size() - InitObjCount;
+ uint32_t cost = m_pObjectHolder->GetPageObjectList()->size() - InitObjCount;
if (max_cost && cost >= max_cost) {
break;
}
@@ -1810,7 +1810,7 @@ void PDF_ReplaceAbbr(CPDF_Object* pObj) {
}
case CPDF_Object::ARRAY: {
CPDF_Array* pArray = pObj->AsArray();
- for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
+ for (uint32_t i = 0; i < pArray->GetCount(); i++) {
CPDF_Object* pElement = pArray->GetElement(i);
if (pElement->IsName()) {
CFX_ByteString name = pElement->GetString();
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index 9995038def..f2b7582a01 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -31,7 +31,7 @@
#include "core/fxcrt/include/fx_safe_types.h"
#include "core/include/fxcodec/fx_codec.h"
-CPDF_StreamParser::CPDF_StreamParser(const uint8_t* pData, FX_DWORD dwSize) {
+CPDF_StreamParser::CPDF_StreamParser(const uint8_t* pData, uint32_t dwSize) {
m_pBuf = pData;
m_Size = dwSize;
m_Pos = 0;
@@ -44,11 +44,11 @@ CPDF_StreamParser::~CPDF_StreamParser() {
}
}
-FX_DWORD DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder,
+uint32_t DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder,
uint8_t*& dest_buf,
- FX_DWORD& dest_size) {
+ uint32_t& dest_size) {
if (!pDecoder) {
- return static_cast<FX_DWORD>(-1);
+ return static_cast<uint32_t>(-1);
}
int ncomps = pDecoder->CountComps();
int bpc = pDecoder->GetBPC();
@@ -57,7 +57,7 @@ FX_DWORD DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder,
int pitch = (width * ncomps * bpc + 7) / 8;
if (height == 0 || pitch > (1 << 30) / height) {
delete pDecoder;
- return static_cast<FX_DWORD>(-1);
+ return static_cast<uint32_t>(-1);
}
dest_buf = FX_Alloc2D(uint8_t, pitch, height);
dest_size = pitch * height; // Safe since checked alloc returned.
@@ -68,26 +68,26 @@ FX_DWORD DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder,
FXSYS_memcpy(dest_buf + row * pitch, pLine, pitch);
}
- FX_DWORD srcoff = pDecoder->GetSrcOffset();
+ uint32_t srcoff = pDecoder->GetSrcOffset();
delete pDecoder;
return srcoff;
}
ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(
const uint8_t* src_buf,
- FX_DWORD src_size,
+ uint32_t src_size,
int width,
int height,
const CPDF_Dictionary* pParams);
-FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf,
- FX_DWORD limit,
+uint32_t PDF_DecodeInlineStream(const uint8_t* src_buf,
+ uint32_t limit,
int width,
int height,
CFX_ByteString& decoder,
CPDF_Dictionary* pParam,
uint8_t*& dest_buf,
- FX_DWORD& dest_size) {
+ uint32_t& dest_size) {
if (decoder == "CCITTFaxDecode" || decoder == "CCF") {
ICodec_ScanlineDecoder* pDecoder =
FPDFAPI_CreateFaxDecoder(src_buf, limit, width, height, pParam);
@@ -119,7 +119,7 @@ FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf,
}
dest_size = 0;
dest_buf = 0;
- return (FX_DWORD)-1;
+ return (uint32_t)-1;
}
CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
@@ -146,12 +146,12 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
pParam = pDict->GetDictBy("DecodeParms");
}
}
- FX_DWORD width = pDict->GetIntegerBy("Width");
- FX_DWORD height = pDict->GetIntegerBy("Height");
- FX_DWORD OrigSize = 0;
+ uint32_t width = pDict->GetIntegerBy("Width");
+ uint32_t height = pDict->GetIntegerBy("Height");
+ uint32_t OrigSize = 0;
if (pCSObj) {
- FX_DWORD bpc = pDict->GetIntegerBy("BitsPerComponent");
- FX_DWORD nComponents = 1;
+ uint32_t bpc = pDict->GetIntegerBy("BitsPerComponent");
+ uint32_t nComponents = 1;
CPDF_ColorSpace* pCS = pDoc->LoadColorSpace(pCSObj);
if (!pCS) {
nComponents = 3;
@@ -159,7 +159,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
nComponents = pCS->CountComponents();
pDoc->GetPageData()->ReleaseColorSpace(pCSObj);
}
- FX_DWORD pitch = width;
+ uint32_t pitch = width;
if (bpc && pitch > INT_MAX / bpc) {
return NULL;
}
@@ -185,7 +185,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
}
OrigSize *= height;
uint8_t* pData = NULL;
- FX_DWORD dwStreamSize;
+ uint32_t dwStreamSize;
if (Decoder.IsEmpty()) {
if (OrigSize > m_Size - m_Pos) {
OrigSize = m_Size - m_Pos;
@@ -195,7 +195,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
dwStreamSize = OrigSize;
m_Pos += OrigSize;
} else {
- FX_DWORD dwDestSize = OrigSize;
+ uint32_t dwDestSize = OrigSize;
dwStreamSize =
PDF_DecodeInlineStream(m_pBuf + m_Pos, m_Size - m_Pos, width, height,
Decoder, pParam, pData, dwDestSize);
@@ -217,10 +217,10 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
}
} else {
FX_Free(pData);
- FX_DWORD dwSavePos = m_Pos;
+ uint32_t dwSavePos = m_Pos;
m_Pos += dwStreamSize;
while (1) {
- FX_DWORD dwPrevPos = m_Pos;
+ uint32_t dwPrevPos = m_Pos;
CPDF_StreamParser::SyntaxType type = ParseNextElement();
if (type == CPDF_StreamParser::EndOfData) {
break;
@@ -332,7 +332,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement() {
}
void CPDF_StreamParser::SkipPathObject() {
- FX_DWORD command_startpos = m_Pos;
+ uint32_t command_startpos = m_Pos;
if (!PositionIsInBounds())
return;
@@ -365,7 +365,7 @@ void CPDF_StreamParser::SkipPathObject() {
if (PDFCharIsNumeric(ch))
continue;
- FX_DWORD op_startpos = m_Pos - 1;
+ uint32_t op_startpos = m_Pos - 1;
while (!PDFCharIsWhitespace(ch) && !PDFCharIsDelimiter(ch)) {
if (!PositionIsInBounds())
return;
@@ -808,7 +808,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause) {
}
m_Size = safeSize.ValueOrDie();
m_pData = FX_Alloc(uint8_t, m_Size);
- FX_DWORD pos = 0;
+ uint32_t pos = 0;
for (const auto& stream : m_StreamArray) {
FXSYS_memcpy(m_pData + pos, stream->GetData(), stream->GetSize());
pos += stream->GetSize();
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
index 822d06d84c..68ac8c849d 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
@@ -58,7 +58,7 @@ CFX_FloatRect GetShadingBBox(CPDF_Stream* pStream,
color_count = kQuadColorsPerPatch;
while (!stream.m_BitStream.IsEOF()) {
- FX_DWORD flag = 0;
+ uint32_t flag = 0;
if (type != kLatticeFormGouraudTriangleMeshShading)
flag = stream.GetFlag();
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_clippath.h b/core/fpdfapi/fpdf_page/include/cpdf_clippath.h
index e265cd4ce0..6f239e661f 100644
--- a/core/fpdfapi/fpdf_page/include/cpdf_clippath.h
+++ b/core/fpdfapi/fpdf_page/include/cpdf_clippath.h
@@ -17,10 +17,10 @@ class CPDF_TextObject;
class CPDF_ClipPath : public CFX_CountRef<CPDF_ClipPathData> {
public:
- FX_DWORD GetPathCount() const { return m_pObject->m_PathCount; }
+ uint32_t GetPathCount() const { return m_pObject->m_PathCount; }
CPDF_Path GetPath(int i) const { return m_pObject->m_pPathList[i]; }
int GetClipType(int i) const { return m_pObject->m_pTypeList[i]; }
- FX_DWORD GetTextCount() const { return m_pObject->m_TextCount; }
+ uint32_t GetTextCount() const { return m_pObject->m_TextCount; }
CPDF_TextObject* GetText(int i) const { return m_pObject->m_pTextList[i]; }
CFX_FloatRect GetClipBox() const;
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_colorspace.h b/core/fpdfapi/fpdf_page/include/cpdf_colorspace.h
index afdd71dc4d..6be55f47b9 100644
--- a/core/fpdfapi/fpdf_page/include/cpdf_colorspace.h
+++ b/core/fpdfapi/fpdf_page/include/cpdf_colorspace.h
@@ -37,7 +37,7 @@ class CPDF_ColorSpace {
int GetBufSize() const;
FX_FLOAT* CreateBuf();
void GetDefaultColor(FX_FLOAT* buf) const;
- FX_DWORD CountComponents() const { return m_nComponents; }
+ uint32_t CountComponents() const { return m_nComponents; }
int GetFamily() const { return m_Family; }
virtual void GetDefaultValue(int iComponent,
FX_FLOAT& value,
@@ -87,7 +87,7 @@ class CPDF_ColorSpace {
CPDF_Document* const m_pDocument;
protected:
- CPDF_ColorSpace(CPDF_Document* pDoc, int family, FX_DWORD nComponents)
+ CPDF_ColorSpace(CPDF_Document* pDoc, int family, uint32_t nComponents)
: m_pDocument(pDoc),
m_Family(family),
m_nComponents(nComponents),
@@ -114,9 +114,9 @@ class CPDF_ColorSpace {
}
int m_Family;
- FX_DWORD m_nComponents;
+ uint32_t m_nComponents;
CPDF_Array* m_pArray;
- FX_DWORD m_dwStdConversion;
+ uint32_t m_dwStdConversion;
};
#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_image.h b/core/fpdfapi/fpdf_page/include/cpdf_image.h
index 9153e9a660..48349deb3b 100644
--- a/core/fpdfapi/fpdf_page/include/cpdf_image.h
+++ b/core/fpdfapi/fpdf_page/include/cpdf_image.h
@@ -52,14 +52,14 @@ class CPDF_Image {
FX_BOOL IsInterpol() const { return m_bInterpolate; }
CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = NULL,
- FX_DWORD* pMatteColor = NULL,
+ uint32_t* pMatteColor = NULL,
FX_BOOL bStdCS = FALSE,
- FX_DWORD GroupFamily = 0,
+ uint32_t GroupFamily = 0,
FX_BOOL bLoadMask = FALSE) const;
void SetInlineDict(CPDF_Dictionary* pDict) { m_pInlineDict = pDict; }
void SetImage(const CFX_DIBitmap* pDIBitmap, int32_t iCompress);
- void SetJpegImage(uint8_t* pImageData, FX_DWORD size);
+ void SetJpegImage(uint8_t* pImageData, uint32_t size);
void SetJpegImage(IFX_FileRead* pFile);
void ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pDIBitmap);
@@ -67,7 +67,7 @@ class CPDF_Image {
FX_BOOL StartLoadDIBSource(CPDF_Dictionary* pFormResource,
CPDF_Dictionary* pPageResource,
FX_BOOL bStdCS = FALSE,
- FX_DWORD GroupFamily = 0,
+ uint32_t GroupFamily = 0,
FX_BOOL bLoadMask = FALSE);
FX_BOOL Continue(IFX_Pause* pPause);
CFX_DIBSource* DetachBitmap();
@@ -75,10 +75,10 @@ class CPDF_Image {
CFX_DIBSource* m_pDIBSource;
CFX_DIBSource* m_pMask;
- FX_DWORD m_MatteColor;
+ uint32_t m_MatteColor;
private:
- CPDF_Dictionary* InitJPEG(uint8_t* pData, FX_DWORD size);
+ CPDF_Dictionary* InitJPEG(uint8_t* pData, uint32_t size);
CPDF_Stream* m_pStream;
FX_BOOL m_bInline;
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_textobject.h b/core/fpdfapi/fpdf_page/include/cpdf_textobject.h
index bb268c1446..c47180ef6b 100644
--- a/core/fpdfapi/fpdf_page/include/cpdf_textobject.h
+++ b/core/fpdfapi/fpdf_page/include/cpdf_textobject.h
@@ -12,7 +12,7 @@
#include "core/fxcrt/include/fx_system.h"
struct CPDF_TextObjectItem {
- FX_DWORD m_CharCode;
+ uint32_t m_CharCode;
FX_FLOAT m_OriginX;
FX_FLOAT m_OriginY;
};
@@ -33,9 +33,9 @@ class CPDF_TextObject : public CPDF_PageObject {
int CountItems() const { return m_nChars; }
void GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const;
int CountChars() const;
- void GetCharInfo(int index, FX_DWORD& charcode, FX_FLOAT& kerning) const;
+ void GetCharInfo(int index, uint32_t& charcode, FX_FLOAT& kerning) const;
void GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const;
- FX_FLOAT GetCharWidth(FX_DWORD charcode) const;
+ FX_FLOAT GetCharWidth(uint32_t charcode) const;
FX_FLOAT GetPosX() const { return m_PosX; }
FX_FLOAT GetPosY() const { return m_PosY; }
void GetTextMatrix(CFX_Matrix* pMatrix) const;
@@ -62,7 +62,7 @@ class CPDF_TextObject : public CPDF_PageObject {
FX_FLOAT m_PosX;
FX_FLOAT m_PosY;
int m_nChars;
- FX_DWORD* m_pCharCodes;
+ uint32_t* m_pCharCodes;
FX_FLOAT* m_pCharPos;
};
diff --git a/core/fpdfapi/fpdf_page/pageint.h b/core/fpdfapi/fpdf_page/pageint.h
index 297b1e2e77..d76eea49d2 100644
--- a/core/fpdfapi/fpdf_page/pageint.h
+++ b/core/fpdfapi/fpdf_page/pageint.h
@@ -39,7 +39,7 @@ class CPDF_StreamParser {
public:
enum SyntaxType { EndOfData, Number, Keyword, Name, Others };
- CPDF_StreamParser(const uint8_t* pData, FX_DWORD dwSize);
+ CPDF_StreamParser(const uint8_t* pData, uint32_t dwSize);
~CPDF_StreamParser();
CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc,
@@ -48,14 +48,14 @@ class CPDF_StreamParser {
FX_BOOL bDecode);
SyntaxType ParseNextElement();
uint8_t* GetWordBuf() { return m_WordBuffer; }
- FX_DWORD GetWordSize() const { return m_WordSize; }
+ uint32_t GetWordSize() const { return m_WordSize; }
CPDF_Object* GetObject() {
CPDF_Object* pObj = m_pLastObj;
m_pLastObj = NULL;
return pObj;
}
- FX_DWORD GetPos() const { return m_Pos; }
- void SetPos(FX_DWORD pos) { m_Pos = pos; }
+ uint32_t GetPos() const { return m_Pos; }
+ void SetPos(uint32_t pos) { m_Pos = pos; }
CPDF_Object* ReadNextObject(FX_BOOL bAllowNestedArray = FALSE,
FX_BOOL bInArray = FALSE);
void SkipPathObject();
@@ -69,13 +69,13 @@ class CPDF_StreamParser {
const uint8_t* m_pBuf;
// Length in bytes of m_pBuf.
- FX_DWORD m_Size;
+ uint32_t m_Size;
// Current byte position within m_pBuf.
- FX_DWORD m_Pos;
+ uint32_t m_Pos;
uint8_t m_WordBuffer[256];
- FX_DWORD m_WordSize;
+ uint32_t m_WordSize;
CPDF_Object* m_pLastObj;
private:
@@ -128,14 +128,14 @@ class CPDF_StreamContentParser {
void AddNameParam(const FX_CHAR* name, int size);
int GetNextParamPos();
void ClearAllParams();
- CPDF_Object* GetObject(FX_DWORD index);
- CFX_ByteString GetString(FX_DWORD index);
- FX_FLOAT GetNumber(FX_DWORD index);
- FX_FLOAT GetNumber16(FX_DWORD index);
- int GetInteger(FX_DWORD index) { return (int32_t)(GetNumber(index)); }
+ CPDF_Object* GetObject(uint32_t index);
+ CFX_ByteString GetString(uint32_t index);
+ FX_FLOAT GetNumber(uint32_t index);
+ FX_FLOAT GetNumber16(uint32_t index);
+ int GetInteger(uint32_t index) { return (int32_t)(GetNumber(index)); }
void OnOperator(const FX_CHAR* op);
void BigCaseCaller(int index);
- FX_DWORD GetParsePos() { return m_pSyntax->GetPos(); }
+ uint32_t GetParsePos() { return m_pSyntax->GetPos(); }
void AddTextObject(CFX_ByteString* pText,
FX_FLOAT fInitKerning,
FX_FLOAT* pKerning,
@@ -144,7 +144,7 @@ class CPDF_StreamContentParser {
void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y);
void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y);
void OnChangeTextMatrix();
- FX_DWORD Parse(const uint8_t* pData, FX_DWORD dwSize, FX_DWORD max_cost);
+ uint32_t Parse(const uint8_t* pData, uint32_t dwSize, uint32_t max_cost);
void ParsePathObject();
void AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag);
void AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_FLOAT w, FX_FLOAT h);
@@ -168,7 +168,7 @@ class CPDF_StreamContentParser {
protected:
using OpCodes =
- std::unordered_map<FX_DWORD, void (CPDF_StreamContentParser::*)()>;
+ std::unordered_map<uint32_t, void (CPDF_StreamContentParser::*)()>;
static OpCodes InitializeOpCodes();
void Handle_CloseFillStrokePath();
@@ -254,8 +254,8 @@ class CPDF_StreamContentParser {
CFX_FloatRect m_BBox;
CPDF_ParseOptions m_Options;
ContentParam m_ParamBuf[PARAM_BUF_SIZE];
- FX_DWORD m_ParamStartPos;
- FX_DWORD m_ParamCount;
+ uint32_t m_ParamStartPos;
+ uint32_t m_ParamCount;
CPDF_StreamParser* m_pSyntax;
std::unique_ptr<CPDF_AllStates> m_pCurStates;
CPDF_ContentMark m_CurContentMark;
@@ -313,12 +313,12 @@ class CPDF_ContentParser {
FX_BOOL m_bForm;
CPDF_ParseOptions m_Options;
CPDF_Type3Char* m_pType3Char;
- FX_DWORD m_nStreams;
+ uint32_t m_nStreams;
std::unique_ptr<CPDF_StreamAcc> m_pSingleStream;
std::vector<std::unique_ptr<CPDF_StreamAcc>> m_StreamArray;
uint8_t* m_pData;
- FX_DWORD m_Size;
- FX_DWORD m_CurrentOffset;
+ uint32_t m_Size;
+ uint32_t m_CurrentOffset;
std::unique_ptr<CPDF_StreamContentParser> m_pParser;
};
@@ -361,7 +361,7 @@ class CPDF_DocPageData {
using CPDF_FontFileMap = std::map<CPDF_Stream*, CPDF_CountedStreamAcc*>;
using CPDF_FontMap = std::map<CPDF_Dictionary*, CPDF_CountedFont*>;
using CPDF_IccProfileMap = std::map<CPDF_Stream*, CPDF_CountedIccProfile*>;
- using CPDF_ImageMap = std::map<FX_DWORD, CPDF_CountedImage*>;
+ using CPDF_ImageMap = std::map<uint32_t, CPDF_CountedImage*>;
using CPDF_PatternMap = std::map<CPDF_Object*, CPDF_CountedPattern*>;
CPDF_Document* const m_pPDFDoc;
@@ -441,14 +441,14 @@ class CPDF_StitchFunc : public CPDF_Function {
class CPDF_IccProfile {
public:
- CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize);
+ CPDF_IccProfile(const uint8_t* pData, uint32_t dwSize);
~CPDF_IccProfile();
- FX_DWORD GetComponents() const { return m_nSrcComponents; }
+ uint32_t GetComponents() const { return m_nSrcComponents; }
FX_BOOL m_bsRGB;
void* m_pTransform;
private:
- FX_DWORD m_nSrcComponents;
+ uint32_t m_nSrcComponents;
};
class CPDF_DeviceCS : public CPDF_ColorSpace {