summaryrefslogtreecommitdiff
path: root/core/src/reflow
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-09 11:30:25 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-09 11:30:25 -0700
commitbb17868d736f698d5217c30d52c5bbfed62c5936 (patch)
tree9d4d3e2538a81e6241d4992570bc3f3c1af71d28 /core/src/reflow
parentbf6c2a4873f8cc12ad910fb904218a78087a3735 (diff)
downloadpdfium-bb17868d736f698d5217c30d52c5bbfed62c5936.tar.xz
Use stdint.h types throughout PDFium.
It's redundant nowadays to provide our own equivalents, now that this is done for us by the system header. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1177483002
Diffstat (limited to 'core/src/reflow')
-rw-r--r--core/src/reflow/autoreflow.cpp2
-rw-r--r--core/src/reflow/autoreflow.h2
-rw-r--r--core/src/reflow/layoutprocessor_reflow.cpp22
-rw-r--r--core/src/reflow/reflowedpage.cpp16
-rw-r--r--core/src/reflow/reflowedpage.h10
-rw-r--r--core/src/reflow/reflowedtextpage.h2
6 files changed, 27 insertions, 27 deletions
diff --git a/core/src/reflow/autoreflow.cpp b/core/src/reflow/autoreflow.cpp
index a10175525c..a5285f375c 100644
--- a/core/src/reflow/autoreflow.cpp
+++ b/core/src/reflow/autoreflow.cpp
@@ -415,7 +415,7 @@ void CPDF_AutoReflowLayoutProvider::GenerateParagraph(CFX_PtrArray& cellArray)
void CPDF_AutoReflowLayoutProvider::ProcessObj(CFX_PtrArray& cellArray, CPDF_PageObject* pObj, CFX_AffineMatrix matrix)
{
}
-FX_INT32 CPDF_AutoReflowLayoutProvider::LogicPreObj(CPDF_PageObject* pObj)
+int32_t CPDF_AutoReflowLayoutProvider::LogicPreObj(CPDF_PageObject* pObj)
{
CPDF_PageObject* pPreObj = m_pPreObj;
m_pPreObj = pObj;
diff --git a/core/src/reflow/autoreflow.h b/core/src/reflow/autoreflow.h
index 95aebcfcdc..20babd72da 100644
--- a/core/src/reflow/autoreflow.h
+++ b/core/src/reflow/autoreflow.h
@@ -105,7 +105,7 @@ public:
int GetRectHeight(FX_RECT rect);
int GetRectWidth(FX_RECT rect);
void ProcessObj(CFX_PtrArray& cellArray, CPDF_PageObject* pObj, CFX_AffineMatrix matrix);
- FX_INT32 LogicPreObj(CPDF_PageObject* pObj);
+ int32_t LogicPreObj(CPDF_PageObject* pObj);
CPDF_AutoReflowElement* m_pRoot;
CPDF_AutoReflowElement* m_pCurrElm;
diff --git a/core/src/reflow/layoutprocessor_reflow.cpp b/core/src/reflow/layoutprocessor_reflow.cpp
index 218d301f0f..7e9ff42137 100644
--- a/core/src/reflow/layoutprocessor_reflow.cpp
+++ b/core/src/reflow/layoutprocessor_reflow.cpp
@@ -404,10 +404,10 @@ FX_BOOL IsSameLine(FX_BOOL bHorizontal, CFX_FloatRect Rect1, CFX_FloatRect Rect2
}
return TRUE;
}
-FX_INT32 IsCanMergeParagraph(IPDF_LayoutElement* pPrevElement, IPDF_LayoutElement* pNextElement)
+int32_t IsCanMergeParagraph(IPDF_LayoutElement* pPrevElement, IPDF_LayoutElement* pNextElement)
{
- FX_INT32 analogial = 100;
- FX_INT32 nPrevObj = pPrevElement->CountObjects(), i;
+ int32_t analogial = 100;
+ int32_t nPrevObj = pPrevElement->CountObjects(), i;
CPDF_PageObject* pPrevObj = NULL;
CFX_FloatRect prevRect, rect;
CFX_PtrArray prevLine, line;
@@ -446,7 +446,7 @@ FX_INT32 IsCanMergeParagraph(IPDF_LayoutElement* pPrevElement, IPDF_LayoutElemen
CPDF_PageObject* pObj = pPrevElement->GetObject(nPrevObj - 1);
if(pObj->m_Type == PDFPAGE_TEXT) {
CPDF_TextObject* pText = (CPDF_TextObject*)pObj;
- FX_INT32 nItem = pText->CountItems();
+ int32_t nItem = pText->CountItems();
CPDF_TextObjectItem item;
pText->GetItemInfo(nItem - 1, &item);
CFX_WideString wStr = pText->GetFont()->UnicodeFromCharCode(item.m_CharCode);
@@ -468,7 +468,7 @@ FX_INT32 IsCanMergeParagraph(IPDF_LayoutElement* pPrevElement, IPDF_LayoutElemen
prevLine.RemoveAll();
prevLine.Append(line);
line.RemoveAll();
- FX_INT32 nNextObj = pNextElement->CountObjects();
+ int32_t nNextObj = pNextElement->CountObjects();
pPrevObj = NULL;
FX_BOOL bFirst = TRUE;
for(i = 0; i < nNextObj; i++) {
@@ -519,7 +519,7 @@ void CPDF_LayoutProcessor_Reflow::ProcessElement(IPDF_LayoutElement* pElement, F
}
if(m_Status == LayoutReady) {
LayoutType layoutType = pElement->GetType();
- FX_INT32 ElementType = GetElementTypes(layoutType);
+ int32_t ElementType = GetElementTypes(layoutType);
switch(ElementType) {
case SST_IE:
m_bIllustration = TRUE;
@@ -639,7 +639,7 @@ void CPDF_LayoutProcessor_Reflow::ProcessElement(IPDF_LayoutElement* pElement, F
if(m_Status == LayoutReady) {
FX_FLOAT dx = 0;
LayoutType layoutType = pElement->GetType();
- FX_INT32 ElementType = GetElementTypes(layoutType);
+ int32_t ElementType = GetElementTypes(layoutType);
switch(ElementType) {
case SST_IE:
m_bIllustration = FALSE;
@@ -705,7 +705,7 @@ void CPDF_LayoutProcessor_Reflow::ProcessElement(IPDF_LayoutElement* pElement, F
m_PausePosition = 100;
}
}
-FX_INT32 CPDF_LayoutProcessor_Reflow::GetElementTypes(LayoutType layoutType)
+int32_t CPDF_LayoutProcessor_Reflow::GetElementTypes(LayoutType layoutType)
{
switch(layoutType) {
case LayoutParagraph:
@@ -1201,7 +1201,7 @@ int CPDF_LayoutProcessor_Reflow::ProcessInsertObject(CPDF_TextObject* pObj, CFX_
}
return 0;
}
-FX_INT32 CPDF_LayoutProcessor_Reflow::LogicPreObj(CPDF_TextObject* pObj)
+int32_t CPDF_LayoutProcessor_Reflow::LogicPreObj(CPDF_TextObject* pObj)
{
CPDF_TextObject* pPreObj = m_pPreObj;
m_pPreObj = pObj;
@@ -1338,7 +1338,7 @@ void CPDF_LayoutProcessor_Reflow::ProcessTextObject(CPDF_TextObject *pTextObj, F
return;
}
CPDF_PageObject* pPreObj = m_pPreObj;
- FX_INT32 logic = ProcessInsertObject(pTextObj, objMatrix);
+ int32_t logic = ProcessInsertObject(pTextObj, objMatrix);
m_pPreObj = pTextObj;
m_perMatrix.Copy(objMatrix);
int size = m_pTempLine->GetSize();
@@ -1533,7 +1533,7 @@ void CPDF_LayoutProcessor_Reflow::ProcessUnitaryObjs(CPDF_PageObjects *pObjs, FX
while(pos) {
CPDF_PageObject* pObj = pObjs->GetNextObject(pos);
if(pObj->m_Type == PDFPAGE_TEXT) {
- FX_INT32 ret = LogicPreObj((CPDF_TextObject*)pObj);
+ int32_t ret = LogicPreObj((CPDF_TextObject*)pObj);
if(ret == 1 || ret == 2) {
continue;
}
diff --git a/core/src/reflow/reflowedpage.cpp b/core/src/reflow/reflowedpage.cpp
index ba2667f074..1c78e75cbc 100644
--- a/core/src/reflow/reflowedpage.cpp
+++ b/core/src/reflow/reflowedpage.cpp
@@ -148,14 +148,14 @@ CPDF_Dictionary* CPDF_ReflowedPage::GetFormResDict(CPDF_PageObject* pObj)
}
return pPageInfo->GetFormDict();
}
-void CPDF_ReflowedPage::GetDisplayMatrix(CFX_AffineMatrix& matrix, FX_INT32 xPos, FX_INT32 yPos, FX_INT32 xSize, FX_INT32 ySize, FX_INT32 iRotate, const CFX_AffineMatrix* pPageMatrix)
+void CPDF_ReflowedPage::GetDisplayMatrix(CFX_AffineMatrix& matrix, int32_t xPos, int32_t yPos, int32_t xSize, int32_t ySize, int32_t iRotate, const CFX_AffineMatrix* pPageMatrix)
{
CFX_AffineMatrix display_matrix;
if(m_PageHeight == 0) {
matrix.Set(1, 0, 0, -1, 0, 0);
return;
}
- FX_INT32 x0, y0, x1, y1, x2, y2;
+ int32_t x0, y0, x1, y1, x2, y2;
iRotate %= 4;
switch (iRotate) {
case 0:
@@ -204,7 +204,7 @@ FX_FLOAT CPDF_ReflowedPage::GetPageHeight()
{
return m_PageHeight;
}
-void CPDF_ReflowedPage::FocusGetData(const CFX_AffineMatrix matrix, FX_INT32 x, FX_INT32 y, CFX_ByteString& str)
+void CPDF_ReflowedPage::FocusGetData(const CFX_AffineMatrix matrix, int32_t x, int32_t y, CFX_ByteString& str)
{
if (NULL == m_pReflowed) {
return;
@@ -215,8 +215,8 @@ void CPDF_ReflowedPage::FocusGetData(const CFX_AffineMatrix matrix, FX_INT32 x,
revMatrix.Transform((float)x, (float)y, x1, y1);
int count = m_pReflowed->GetSize();
FX_FLOAT dx = 1000, dy = 1000;
- FX_INT32 pos = 0;
- FX_INT32 i;
+ int32_t pos = 0;
+ int32_t i;
for(i = 0; i < count; i++) {
CRF_Data* pData = (*m_pReflowed)[i];
FX_FLOAT tempdy = FXSYS_fabs(pData->m_PosY - y1);
@@ -263,12 +263,12 @@ void CPDF_ReflowedPage::FocusGetData(const CFX_AffineMatrix matrix, FX_INT32 x,
}
str.Format("%d", pos);
}
-FX_BOOL CPDF_ReflowedPage::FocusGetPosition(const CFX_AffineMatrix matrix, CFX_ByteString str, FX_INT32& x, FX_INT32& y)
+FX_BOOL CPDF_ReflowedPage::FocusGetPosition(const CFX_AffineMatrix matrix, CFX_ByteString str, int32_t& x, int32_t& y)
{
if (NULL == m_pReflowed) {
return FALSE;
}
- FX_INT32 pos = FXSYS_atoi(str);
+ int32_t pos = FXSYS_atoi(str);
if(pos < 0 || pos >= m_pReflowed->GetSize()) {
return FALSE;
}
@@ -423,7 +423,7 @@ CPDF_ProgressiveReflowPageRender::CPDF_ProgressiveReflowPageRender()
m_pFontEncoding = NULL;
m_DisplayColor = -1;
}
-static FX_FLOAT _CIDTransformToFloat(FX_BYTE ch)
+static FX_FLOAT _CIDTransformToFloat(uint8_t ch)
{
if (ch < 128) {
return ch * 1.0f / 127;
diff --git a/core/src/reflow/reflowedpage.h b/core/src/reflow/reflowedpage.h
index 3fef553d7a..79b4937bdb 100644
--- a/core/src/reflow/reflowedpage.h
+++ b/core/src/reflow/reflowedpage.h
@@ -48,14 +48,14 @@ protected:
void ProcessTextObject(CPDF_TextObject *pObj, FX_FLOAT reflowWidth, CFX_AffineMatrix objMatrix);
void ProcessPathObject(CPDF_PathObject *pObj, FX_FLOAT reflowWidth);
void ProcessUnitaryObjs(CPDF_PageObjects *pObjs, FX_FLOAT reflowWidth, CFX_AffineMatrix objMatrix);
- FX_INT32 LogicPreObj(CPDF_TextObject* pObj);
+ int32_t LogicPreObj(CPDF_TextObject* pObj);
int ProcessInsertObject(CPDF_TextObject* pObj, CFX_AffineMatrix formMatrix);
FX_WCHAR GetPreChar();
FX_BOOL IsSameTextObject(CPDF_TextObject* pTextObj1, CPDF_TextObject* pTextObj2);
int GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const;
FX_BOOL IsCanBreakAfter(FX_DWORD unicode);
FX_BOOL IsCanBreakBefore(FX_DWORD unicode);
- FX_INT32 GetElementTypes(LayoutType layoutType);
+ int32_t GetElementTypes(LayoutType layoutType);
void CreateRFData(CPDF_PageObject* pObj, CFX_AffineMatrix* pMatrix = NULL);
CRF_CharState* GetCharState(CPDF_TextObject* pObj, CPDF_Font* pFont, FX_FLOAT fHeight, FX_ARGB color);
FX_FLOAT ConverWidth(FX_FLOAT width);
@@ -169,15 +169,15 @@ public:
{
return this;
};
- void GetDisplayMatrix(CFX_AffineMatrix& matrix, FX_INT32 xPos, FX_INT32 yPos, FX_INT32 xSize, FX_INT32 ySize, FX_INT32 iRotate, const CFX_AffineMatrix* pPageMatrix);
+ void GetDisplayMatrix(CFX_AffineMatrix& matrix, int32_t xPos, int32_t yPos, int32_t xSize, int32_t ySize, int32_t iRotate, const CFX_AffineMatrix* pPageMatrix);
FX_FLOAT GetPageHeight() ;
FX_FLOAT GetPageWidth()
{
return m_PageWidth;
};
- void FocusGetData(const CFX_AffineMatrix matrix, FX_INT32 x, FX_INT32 y, CFX_ByteString& str);
- FX_BOOL FocusGetPosition(const CFX_AffineMatrix matrix, CFX_ByteString str, FX_INT32& x, FX_INT32& y);
+ void FocusGetData(const CFX_AffineMatrix matrix, int32_t x, int32_t y, CFX_ByteString& str);
+ FX_BOOL FocusGetPosition(const CFX_AffineMatrix matrix, CFX_ByteString str, int32_t& x, int32_t& y);
CRF_DataPtrArray* m_pReflowed;
FX_FLOAT m_PageWidth;
FX_FLOAT m_PageHeight;
diff --git a/core/src/reflow/reflowedtextpage.h b/core/src/reflow/reflowedtextpage.h
index 288ceed48b..bb6e24a9cd 100644
--- a/core/src/reflow/reflowedtextpage.h
+++ b/core/src/reflow/reflowedtextpage.h
@@ -11,7 +11,7 @@
#include "../../src/reflow/reflowedpage.h"
typedef CFX_SegmentedArray<CRF_CharData*> CRF_CharDataPtrArray;
-typedef CFX_SegmentedArray<FX_INT32> CFX_CountBSINT32Array;
+typedef CFX_SegmentedArray<int32_t> CFX_CountBSINT32Array;
class CRF_TextPage : public IPDF_TextPage
{
public: