summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-02 15:17:29 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-02 15:17:30 -0700
commit12f3e4a58f05850b93af35619cb04f0231d86acc (patch)
tree9851d8e46e5c168f5d148864caa2eebf814529dd /core/fpdfapi/page
parent3b3ce1a242f8445848d3f23d6c35ba01d7c645f4 (diff)
downloadpdfium-12f3e4a58f05850b93af35619cb04f0231d86acc.tar.xz
Remove FX_BOOL from core
Review-Url: https://codereview.chromium.org/2477443002
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r--core/fpdfapi/page/cpdf_allstates.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_clippath.cpp12
-rw-r--r--core/fpdfapi/page/cpdf_color.cpp8
-rw-r--r--core/fpdfapi/page/cpdf_color.h2
-rw-r--r--core/fpdfapi/page/cpdf_colorspace.cpp466
-rw-r--r--core/fpdfapi/page/cpdf_colorspace.h63
-rw-r--r--core/fpdfapi/page/cpdf_colorstate.cpp4
-rw-r--r--core/fpdfapi/page/cpdf_contentmark.cpp4
-rw-r--r--core/fpdfapi/page/cpdf_contentmark.h4
-rw-r--r--core/fpdfapi/page/cpdf_contentmarkitem.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_contentmarkitem.h2
-rw-r--r--core/fpdfapi/page/cpdf_docpagedata.cpp4
-rw-r--r--core/fpdfapi/page/cpdf_docpagedata.h2
-rw-r--r--core/fpdfapi/page/cpdf_image.cpp40
-rw-r--r--core/fpdfapi/page/cpdf_image.h16
-rw-r--r--core/fpdfapi/page/cpdf_meshstream.cpp10
-rw-r--r--core/fpdfapi/page/cpdf_meshstream.h6
-rw-r--r--core/fpdfapi/page/cpdf_pageobjectholder.cpp4
-rw-r--r--core/fpdfapi/page/cpdf_pageobjectholder.h12
-rw-r--r--core/fpdfapi/page/cpdf_path.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_path.h2
-rw-r--r--core/fpdfapi/page/cpdf_pathobject.h2
-rw-r--r--core/fpdfapi/page/cpdf_psengine.h10
-rw-r--r--core/fpdfapi/page/cpdf_shadingpattern.cpp10
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp20
-rw-r--r--core/fpdfapi/page/cpdf_textobject.cpp4
-rw-r--r--core/fpdfapi/page/cpdf_tilingpattern.cpp10
-rw-r--r--core/fpdfapi/page/cpdf_tilingpattern.h2
-rw-r--r--core/fpdfapi/page/fpdf_page_colors.cpp66
-rw-r--r--core/fpdfapi/page/fpdf_page_func.cpp128
-rw-r--r--core/fpdfapi/page/fpdf_page_parser_old.cpp24
-rw-r--r--core/fpdfapi/page/pageint.h74
32 files changed, 507 insertions, 510 deletions
diff --git a/core/fpdfapi/page/cpdf_allstates.cpp b/core/fpdfapi/page/cpdf_allstates.cpp
index 70de98e3f0..012c1349c0 100644
--- a/core/fpdfapi/page/cpdf_allstates.cpp
+++ b/core/fpdfapi/page/cpdf_allstates.cpp
@@ -109,7 +109,7 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
m_GeneralState.SetBlendMode(pArray ? pArray->GetStringAt(0)
: pObject->GetString());
if (m_GeneralState.GetBlendType() > FXDIB_BLEND_MULTIPLY)
- pParser->GetPageObjectHolder()->SetBackgroundAlphaNeeded(TRUE);
+ pParser->GetPageObjectHolder()->SetBackgroundAlphaNeeded(true);
break;
}
case FXBSTR_ID('S', 'M', 'a', 's'):
diff --git a/core/fpdfapi/page/cpdf_clippath.cpp b/core/fpdfapi/page/cpdf_clippath.cpp
index 9d4b737d33..465a1c7997 100644
--- a/core/fpdfapi/page/cpdf_clippath.cpp
+++ b/core/fpdfapi/page/cpdf_clippath.cpp
@@ -42,7 +42,7 @@ CPDF_TextObject* CPDF_ClipPath::GetText(size_t i) const {
CFX_FloatRect CPDF_ClipPath::GetClipBox() const {
CFX_FloatRect rect;
- FX_BOOL bStarted = FALSE;
+ bool bStarted = false;
int count = GetPathCount();
if (count) {
rect = GetPath(0).GetBoundingBox();
@@ -50,26 +50,26 @@ CFX_FloatRect CPDF_ClipPath::GetClipBox() const {
CFX_FloatRect path_rect = GetPath(i).GetBoundingBox();
rect.Intersect(path_rect);
}
- bStarted = TRUE;
+ bStarted = true;
}
count = GetTextCount();
if (count) {
CFX_FloatRect layer_rect;
- FX_BOOL bLayerStarted = FALSE;
+ bool bLayerStarted = false;
for (int i = 0; i < count; i++) {
CPDF_TextObject* pTextObj = GetText(i);
if (!pTextObj) {
if (!bStarted) {
rect = layer_rect;
- bStarted = TRUE;
+ bStarted = true;
} else {
rect.Intersect(layer_rect);
}
- bLayerStarted = FALSE;
+ bLayerStarted = false;
} else {
if (!bLayerStarted) {
layer_rect = CFX_FloatRect(pTextObj->GetBBox(nullptr));
- bLayerStarted = TRUE;
+ bLayerStarted = true;
} else {
layer_rect.Union(CFX_FloatRect(pTextObj->GetBBox(nullptr)));
}
diff --git a/core/fpdfapi/page/cpdf_color.cpp b/core/fpdfapi/page/cpdf_color.cpp
index 68fa0edacf..4ba28ce314 100644
--- a/core/fpdfapi/page/cpdf_color.cpp
+++ b/core/fpdfapi/page/cpdf_color.cpp
@@ -132,18 +132,18 @@ void CPDF_Color::Copy(const CPDF_Color* pSrc) {
}
}
-FX_BOOL CPDF_Color::GetRGB(int& R, int& G, int& B) const {
+bool CPDF_Color::GetRGB(int& R, int& G, int& B) const {
if (!m_pCS || !m_pBuffer)
- return FALSE;
+ return false;
FX_FLOAT r = 0.0f, g = 0.0f, b = 0.0f;
if (!m_pCS->GetRGB(m_pBuffer, r, g, b))
- return FALSE;
+ return false;
R = (int32_t)(r * 255 + 0.5f);
G = (int32_t)(g * 255 + 0.5f);
B = (int32_t)(b * 255 + 0.5f);
- return TRUE;
+ return true;
}
CPDF_Pattern* CPDF_Color::GetPattern() const {
diff --git a/core/fpdfapi/page/cpdf_color.h b/core/fpdfapi/page/cpdf_color.h
index 3eb839a684..e81b531055 100644
--- a/core/fpdfapi/page/cpdf_color.h
+++ b/core/fpdfapi/page/cpdf_color.h
@@ -26,7 +26,7 @@ class CPDF_Color {
void SetValue(FX_FLOAT* comp);
void SetValue(CPDF_Pattern* pPattern, FX_FLOAT* comp, int ncomps);
- FX_BOOL GetRGB(int& R, int& G, int& B) const;
+ bool GetRGB(int& R, int& G, int& B) const;
CPDF_Pattern* GetPattern() const;
const CPDF_ColorSpace* GetColorSpace() const { return m_pCS; }
diff --git a/core/fpdfapi/page/cpdf_colorspace.cpp b/core/fpdfapi/page/cpdf_colorspace.cpp
index e43bacc079..2740169d04 100644
--- a/core/fpdfapi/page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/page/cpdf_colorspace.cpp
@@ -60,23 +60,23 @@ class CPDF_CalGray : public CPDF_ColorSpace {
public:
explicit CPDF_CalGray(CPDF_Document* pDoc);
- FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- FX_BOOL GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const override;
- FX_BOOL SetRGB(FX_FLOAT* pBuf,
- FX_FLOAT R,
- FX_FLOAT G,
- FX_FLOAT B) const override;
+ bool GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const override;
+ bool SetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT R,
+ FX_FLOAT G,
+ FX_FLOAT B) const override;
void TranslateImageLine(uint8_t* pDestBuf,
const uint8_t* pSrcBuf,
int pixels,
int image_width,
int image_height,
- FX_BOOL bTransMask = FALSE) const override;
+ bool bTransMask = false) const override;
private:
FX_FLOAT m_WhitePoint[3];
@@ -88,57 +88,57 @@ class CPDF_CalRGB : public CPDF_ColorSpace {
public:
explicit CPDF_CalRGB(CPDF_Document* pDoc);
- FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- FX_BOOL GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const override;
- FX_BOOL SetRGB(FX_FLOAT* pBuf,
- FX_FLOAT R,
- FX_FLOAT G,
- FX_FLOAT B) const override;
+ bool GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const override;
+ bool SetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT R,
+ FX_FLOAT G,
+ FX_FLOAT B) const override;
void TranslateImageLine(uint8_t* pDestBuf,
const uint8_t* pSrcBuf,
int pixels,
int image_width,
int image_height,
- FX_BOOL bTransMask = FALSE) const override;
+ bool bTransMask = false) const override;
FX_FLOAT m_WhitePoint[3];
FX_FLOAT m_BlackPoint[3];
FX_FLOAT m_Gamma[3];
FX_FLOAT m_Matrix[9];
- FX_BOOL m_bGamma;
- FX_BOOL m_bMatrix;
+ bool m_bGamma;
+ bool m_bMatrix;
};
class CPDF_LabCS : public CPDF_ColorSpace {
public:
explicit CPDF_LabCS(CPDF_Document* pDoc);
- FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
void GetDefaultValue(int iComponent,
FX_FLOAT& value,
FX_FLOAT& min,
FX_FLOAT& max) const override;
- FX_BOOL GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const override;
- FX_BOOL SetRGB(FX_FLOAT* pBuf,
- FX_FLOAT R,
- FX_FLOAT G,
- FX_FLOAT B) const override;
+ bool GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const override;
+ bool SetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT R,
+ FX_FLOAT G,
+ FX_FLOAT B) const override;
void TranslateImageLine(uint8_t* pDestBuf,
const uint8_t* pSrcBuf,
int pixels,
int image_width,
int image_height,
- FX_BOOL bTransMask = FALSE) const override;
+ bool bTransMask = false) const override;
FX_FLOAT m_WhitePoint[3];
FX_FLOAT m_BlackPoint[3];
@@ -150,36 +150,36 @@ class CPDF_ICCBasedCS : public CPDF_ColorSpace {
explicit CPDF_ICCBasedCS(CPDF_Document* pDoc);
~CPDF_ICCBasedCS() override;
- FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- FX_BOOL GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const override;
- FX_BOOL SetRGB(FX_FLOAT* pBuf,
- FX_FLOAT R,
- FX_FLOAT G,
- FX_FLOAT B) const override;
-
- FX_BOOL v_GetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT& c,
- FX_FLOAT& m,
- FX_FLOAT& y,
- FX_FLOAT& k) const override;
-
- void EnableStdConversion(FX_BOOL bEnabled) override;
+ bool GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const override;
+ bool SetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT R,
+ FX_FLOAT G,
+ FX_FLOAT B) const override;
+
+ bool v_GetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT& c,
+ FX_FLOAT& m,
+ FX_FLOAT& y,
+ FX_FLOAT& k) const override;
+
+ void EnableStdConversion(bool bEnabled) override;
void TranslateImageLine(uint8_t* pDestBuf,
const uint8_t* pSrcBuf,
int pixels,
int image_width,
int image_height,
- FX_BOOL bTransMask = FALSE) const override;
+ bool bTransMask = false) const override;
CPDF_ColorSpace* m_pAlterCS;
CPDF_IccProfile* m_pProfile;
uint8_t* m_pCache;
FX_FLOAT* m_pRanges;
- FX_BOOL m_bOwn;
+ bool m_bOwn;
};
class CPDF_IndexedCS : public CPDF_ColorSpace {
@@ -187,15 +187,15 @@ class CPDF_IndexedCS : public CPDF_ColorSpace {
explicit CPDF_IndexedCS(CPDF_Document* pDoc);
~CPDF_IndexedCS() override;
- FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- FX_BOOL GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const override;
+ bool GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const override;
CPDF_ColorSpace* GetBaseCS() const override;
- void EnableStdConversion(FX_BOOL bEnabled) override;
+ void EnableStdConversion(bool bEnabled) override;
CPDF_ColorSpace* m_pBaseCS;
CPDF_CountedColorSpace* m_pCountedBaseCS;
@@ -215,12 +215,12 @@ class CPDF_SeparationCS : public CPDF_ColorSpace {
FX_FLOAT& value,
FX_FLOAT& min,
FX_FLOAT& max) const override;
- FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- FX_BOOL GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const override;
- void EnableStdConversion(FX_BOOL bEnabled) override;
+ bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ bool GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const override;
+ void EnableStdConversion(bool bEnabled) override;
std::unique_ptr<CPDF_ColorSpace> m_pAltCS;
std::unique_ptr<CPDF_Function> m_pFunc;
@@ -237,12 +237,12 @@ class CPDF_DeviceNCS : public CPDF_ColorSpace {
FX_FLOAT& value,
FX_FLOAT& min,
FX_FLOAT& max) const override;
- FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- FX_BOOL GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const override;
- void EnableStdConversion(FX_BOOL bEnabled) override;
+ bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ bool GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const override;
+ void EnableStdConversion(bool bEnabled) override;
std::unique_ptr<CPDF_ColorSpace> m_pAltCS;
std::unique_ptr<CPDF_Function> m_pFunc;
@@ -418,47 +418,47 @@ FX_FLOAT* CPDF_ColorSpace::CreateBuf() {
return (FX_FLOAT*)pBuf;
}
-FX_BOOL CPDF_ColorSpace::sRGB() const {
+bool CPDF_ColorSpace::sRGB() const {
if (m_Family == PDFCS_DEVICERGB) {
- return TRUE;
+ return true;
}
if (m_Family != PDFCS_ICCBASED) {
- return FALSE;
+ return false;
}
CPDF_ICCBasedCS* pCS = (CPDF_ICCBasedCS*)this;
return pCS->m_pProfile->m_bsRGB;
}
-FX_BOOL CPDF_ColorSpace::SetRGB(FX_FLOAT* pBuf,
- FX_FLOAT R,
- FX_FLOAT G,
- FX_FLOAT B) const {
- return FALSE;
+bool CPDF_ColorSpace::SetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT R,
+ FX_FLOAT G,
+ FX_FLOAT B) const {
+ return false;
}
-FX_BOOL CPDF_ColorSpace::GetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT& c,
- FX_FLOAT& m,
- FX_FLOAT& y,
- FX_FLOAT& k) const {
+bool CPDF_ColorSpace::GetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT& c,
+ FX_FLOAT& m,
+ FX_FLOAT& y,
+ FX_FLOAT& k) const {
if (v_GetCMYK(pBuf, c, m, y, k)) {
- return TRUE;
+ return true;
}
FX_FLOAT R, G, B;
if (!GetRGB(pBuf, R, G, B)) {
- return FALSE;
+ return false;
}
sRGB_to_AdobeCMYK(R, G, B, c, m, y, k);
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_ColorSpace::SetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT c,
- FX_FLOAT m,
- FX_FLOAT y,
- FX_FLOAT k) const {
+bool CPDF_ColorSpace::SetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT c,
+ FX_FLOAT m,
+ FX_FLOAT y,
+ FX_FLOAT k) const {
if (v_SetCMYK(pBuf, c, m, y, k)) {
- return TRUE;
+ return true;
}
FX_FLOAT R, G, B;
AdobeCMYK_to_sRGB(c, m, y, k, R, G, B);
@@ -493,7 +493,7 @@ void CPDF_ColorSpace::TranslateImageLine(uint8_t* dest_buf,
int pixels,
int image_width,
int image_height,
- FX_BOOL bTransMask) const {
+ bool bTransMask) const {
CFX_FixedBufGrow<FX_FLOAT, 16> srcbuf(m_nComponents);
FX_FLOAT* src = srcbuf;
FX_FLOAT R, G, B;
@@ -515,7 +515,7 @@ CPDF_ColorSpace* CPDF_ColorSpace::GetBaseCS() const {
return nullptr;
}
-void CPDF_ColorSpace::EnableStdConversion(FX_BOOL bEnabled) {
+void CPDF_ColorSpace::EnableStdConversion(bool bEnabled) {
if (bEnabled)
m_dwStdConversion++;
else if (m_dwStdConversion)
@@ -533,33 +533,33 @@ CPDF_ColorSpace::CPDF_ColorSpace(CPDF_Document* pDoc,
CPDF_ColorSpace::~CPDF_ColorSpace() {}
-FX_BOOL CPDF_ColorSpace::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
- return TRUE;
+bool CPDF_ColorSpace::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
+ return true;
}
-FX_BOOL CPDF_ColorSpace::v_GetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT& c,
- FX_FLOAT& m,
- FX_FLOAT& y,
- FX_FLOAT& k) const {
- return FALSE;
+bool CPDF_ColorSpace::v_GetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT& c,
+ FX_FLOAT& m,
+ FX_FLOAT& y,
+ FX_FLOAT& k) const {
+ return false;
}
-FX_BOOL CPDF_ColorSpace::v_SetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT c,
- FX_FLOAT m,
- FX_FLOAT y,
- FX_FLOAT k) const {
- return FALSE;
+bool CPDF_ColorSpace::v_SetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT c,
+ FX_FLOAT m,
+ FX_FLOAT y,
+ FX_FLOAT k) const {
+ return false;
}
CPDF_CalGray::CPDF_CalGray(CPDF_Document* pDoc)
: CPDF_ColorSpace(pDoc, PDFCS_CALGRAY, 1) {}
-FX_BOOL CPDF_CalGray::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
+bool CPDF_CalGray::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
CPDF_Dictionary* pDict = pArray->GetDictAt(1);
if (!pDict)
- return FALSE;
+ return false;
CPDF_Array* pParam = pDict->GetArrayFor("WhitePoint");
int i;
@@ -573,26 +573,26 @@ FX_BOOL CPDF_CalGray::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
m_Gamma = pDict->GetNumberFor("Gamma");
if (m_Gamma == 0)
m_Gamma = 1.0f;
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_CalGray::GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const {
+bool CPDF_CalGray::GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const {
R = G = B = *pBuf;
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_CalGray::SetRGB(FX_FLOAT* pBuf,
- FX_FLOAT R,
- FX_FLOAT G,
- FX_FLOAT B) const {
+bool CPDF_CalGray::SetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT R,
+ FX_FLOAT G,
+ FX_FLOAT B) const {
if (R == G && R == B) {
*pBuf = R;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CPDF_CalGray::TranslateImageLine(uint8_t* pDestBuf,
@@ -600,7 +600,7 @@ void CPDF_CalGray::TranslateImageLine(uint8_t* pDestBuf,
int pixels,
int image_width,
int image_height,
- FX_BOOL bTransMask) const {
+ bool bTransMask) const {
for (int i = 0; i < pixels; i++) {
*pDestBuf++ = pSrcBuf[i];
*pDestBuf++ = pSrcBuf[i];
@@ -611,10 +611,10 @@ void CPDF_CalGray::TranslateImageLine(uint8_t* pDestBuf,
CPDF_CalRGB::CPDF_CalRGB(CPDF_Document* pDoc)
: CPDF_ColorSpace(pDoc, PDFCS_CALRGB, 3) {}
-FX_BOOL CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
+bool CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
CPDF_Dictionary* pDict = pArray->GetDictAt(1);
if (!pDict)
- return FALSE;
+ return false;
CPDF_Array* pParam = pDict->GetArrayFor("WhitePoint");
int i;
@@ -627,28 +627,28 @@ FX_BOOL CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
pParam = pDict->GetArrayFor("Gamma");
if (pParam) {
- m_bGamma = TRUE;
+ m_bGamma = true;
for (i = 0; i < 3; i++)
m_Gamma[i] = pParam->GetNumberAt(i);
} else {
- m_bGamma = FALSE;
+ m_bGamma = false;
}
pParam = pDict->GetArrayFor("Matrix");
if (pParam) {
- m_bMatrix = TRUE;
+ m_bMatrix = true;
for (i = 0; i < 9; i++)
m_Matrix[i] = pParam->GetNumberAt(i);
} else {
- m_bMatrix = FALSE;
+ m_bMatrix = false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_CalRGB::GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const {
+bool CPDF_CalRGB::GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const {
FX_FLOAT A_ = pBuf[0];
FX_FLOAT B_ = pBuf[1];
FX_FLOAT C_ = pBuf[2];
@@ -672,17 +672,17 @@ FX_BOOL CPDF_CalRGB::GetRGB(FX_FLOAT* pBuf,
}
XYZ_to_sRGB_WhitePoint(X, Y, Z, R, G, B, m_WhitePoint[0], m_WhitePoint[1],
m_WhitePoint[2]);
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_CalRGB::SetRGB(FX_FLOAT* pBuf,
- FX_FLOAT R,
- FX_FLOAT G,
- FX_FLOAT B) const {
+bool CPDF_CalRGB::SetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT R,
+ FX_FLOAT G,
+ FX_FLOAT B) const {
pBuf[0] = R;
pBuf[1] = G;
pBuf[2] = B;
- return TRUE;
+ return true;
}
void CPDF_CalRGB::TranslateImageLine(uint8_t* pDestBuf,
@@ -690,7 +690,7 @@ void CPDF_CalRGB::TranslateImageLine(uint8_t* pDestBuf,
int pixels,
int image_width,
int image_height,
- FX_BOOL bTransMask) const {
+ bool bTransMask) const {
if (bTransMask) {
FX_FLOAT Cal[3];
FX_FLOAT R;
@@ -733,10 +733,10 @@ void CPDF_LabCS::GetDefaultValue(int iComponent,
}
}
-FX_BOOL CPDF_LabCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
+bool CPDF_LabCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
CPDF_Dictionary* pDict = pArray->GetDictAt(1);
if (!pDict)
- return FALSE;
+ return false;
CPDF_Array* pParam = pDict->GetArrayFor("WhitePoint");
int i;
@@ -752,13 +752,13 @@ FX_BOOL CPDF_LabCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
100 * 1.0f};
for (i = 0; i < 4; i++)
m_Ranges[i] = pParam ? pParam->GetNumberAt(i) : def_ranges[i];
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_LabCS::GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const {
+bool CPDF_LabCS::GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const {
FX_FLOAT Lstar = pBuf[0];
FX_FLOAT astar = pBuf[1];
FX_FLOAT bstar = pBuf[2];
@@ -782,14 +782,14 @@ FX_BOOL CPDF_LabCS::GetRGB(FX_FLOAT* pBuf,
Z = 1.0889f * N * N * N;
XYZ_to_sRGB(X, Y, Z, R, G, B);
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_LabCS::SetRGB(FX_FLOAT* pBuf,
- FX_FLOAT R,
- FX_FLOAT G,
- FX_FLOAT B) const {
- return FALSE;
+bool CPDF_LabCS::SetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT R,
+ FX_FLOAT G,
+ FX_FLOAT B) const {
+ return false;
}
void CPDF_LabCS::TranslateImageLine(uint8_t* pDestBuf,
@@ -797,7 +797,7 @@ void CPDF_LabCS::TranslateImageLine(uint8_t* pDestBuf,
int pixels,
int image_width,
int image_height,
- FX_BOOL bTransMask) const {
+ bool bTransMask) const {
for (int i = 0; i < pixels; i++) {
FX_FLOAT lab[3];
FX_FLOAT R, G, B;
@@ -819,7 +819,7 @@ CPDF_ICCBasedCS::CPDF_ICCBasedCS(CPDF_Document* pDoc)
m_pProfile(nullptr),
m_pCache(nullptr),
m_pRanges(nullptr),
- m_bOwn(FALSE) {}
+ m_bOwn(false) {}
CPDF_ICCBasedCS::~CPDF_ICCBasedCS() {
FX_Free(m_pCache);
@@ -830,14 +830,14 @@ CPDF_ICCBasedCS::~CPDF_ICCBasedCS() {
m_pDocument->GetPageData()->ReleaseIccProfile(m_pProfile);
}
-FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
+bool CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
CPDF_Stream* pStream = pArray->GetStreamAt(1);
if (!pStream)
- return FALSE;
+ return false;
m_pProfile = pDoc->LoadIccProfile(pStream);
if (!m_pProfile)
- return FALSE;
+ return false;
m_nComponents =
m_pProfile
@@ -854,19 +854,19 @@ FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
if (pAlterCS->CountComponents() > 0) { // Use Alternative colorspace
m_nComponents = pAlterCS->CountComponents();
m_pAlterCS = pAlterCS.release();
- m_bOwn = TRUE;
+ m_bOwn = true;
} else { // No valid alternative colorspace
int32_t nDictComponents = pDict ? pDict->GetIntegerFor("N") : 0;
if (nDictComponents != 1 && nDictComponents != 3 &&
nDictComponents != 4) {
- return FALSE;
+ return false;
}
m_nComponents = nDictComponents;
}
} else { // Using sRGB
if (pAlterCS->CountComponents() == m_nComponents) {
m_pAlterCS = pAlterCS.release();
- m_bOwn = TRUE;
+ m_bOwn = true;
}
}
}
@@ -890,18 +890,18 @@ FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
else
m_pRanges[i] = 0;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const {
+bool CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const {
if (m_pProfile && m_pProfile->m_bsRGB) {
R = pBuf[0];
G = pBuf[1];
B = pBuf[2];
- return TRUE;
+ return true;
}
CCodec_IccModule* pIccModule = CPDF_ModuleMgr::Get()->GetIccModule();
if (!m_pProfile->m_pTransform || !pIccModule) {
@@ -911,7 +911,7 @@ FX_BOOL CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf,
R = 0.0f;
G = 0.0f;
B = 0.0f;
- return TRUE;
+ return true;
}
FX_FLOAT rgb[3];
pIccModule->SetComponents(m_nComponents);
@@ -919,32 +919,32 @@ FX_BOOL CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf,
R = rgb[0];
G = rgb[1];
B = rgb[2];
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_ICCBasedCS::SetRGB(FX_FLOAT* pBuf,
- FX_FLOAT R,
- FX_FLOAT G,
- FX_FLOAT B) const {
- return FALSE;
+bool CPDF_ICCBasedCS::SetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT R,
+ FX_FLOAT G,
+ FX_FLOAT B) const {
+ return false;
}
-FX_BOOL CPDF_ICCBasedCS::v_GetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT& c,
- FX_FLOAT& m,
- FX_FLOAT& y,
- FX_FLOAT& k) const {
+bool CPDF_ICCBasedCS::v_GetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT& c,
+ FX_FLOAT& m,
+ FX_FLOAT& y,
+ FX_FLOAT& k) const {
if (m_nComponents != 4)
- return FALSE;
+ return false;
c = pBuf[0];
m = pBuf[1];
y = pBuf[2];
k = pBuf[3];
- return TRUE;
+ return true;
}
-void CPDF_ICCBasedCS::EnableStdConversion(FX_BOOL bEnabled) {
+void CPDF_ICCBasedCS::EnableStdConversion(bool bEnabled) {
CPDF_ColorSpace::EnableStdConversion(bEnabled);
if (m_pAlterCS)
m_pAlterCS->EnableStdConversion(bEnabled);
@@ -955,7 +955,7 @@ void CPDF_ICCBasedCS::TranslateImageLine(uint8_t* pDestBuf,
int pixels,
int image_width,
int image_height,
- FX_BOOL bTransMask) const {
+ bool bTransMask) const {
if (m_pProfile->m_bsRGB) {
ReverseRGB(pDestBuf, pSrcBuf, pixels);
} else if (m_pProfile->m_pTransform) {
@@ -1016,18 +1016,18 @@ CPDF_IndexedCS::~CPDF_IndexedCS() {
}
}
-FX_BOOL CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
+bool CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
if (pArray->GetCount() < 4) {
- return FALSE;
+ return false;
}
CPDF_Object* pBaseObj = pArray->GetDirectObjectAt(1);
if (pBaseObj == m_pArray) {
- return FALSE;
+ return false;
}
CPDF_DocPageData* pDocPageData = pDoc->GetPageData();
m_pBaseCS = pDocPageData->GetColorSpace(pBaseObj, nullptr);
if (!m_pBaseCS) {
- return FALSE;
+ return false;
}
m_pCountedBaseCS = pDocPageData->FindColorSpacePtr(m_pBaseCS->GetArray());
m_nBaseComponents = m_pBaseCS->CountComponents();
@@ -1042,31 +1042,31 @@ FX_BOOL CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
CPDF_Object* pTableObj = pArray->GetDirectObjectAt(3);
if (!pTableObj)
- return FALSE;
+ return false;
if (CPDF_String* pString = pTableObj->AsString()) {
m_Table = pString->GetString();
} else if (CPDF_Stream* pStream = pTableObj->AsStream()) {
CPDF_StreamAcc acc;
- acc.LoadAllData(pStream, FALSE);
+ acc.LoadAllData(pStream, false);
m_Table = CFX_ByteStringC(acc.GetData(), acc.GetSize());
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_IndexedCS::GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const {
+bool CPDF_IndexedCS::GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const {
int index = (int32_t)(*pBuf);
if (index < 0 || index > m_MaxIndex) {
- return FALSE;
+ return false;
}
if (m_nBaseComponents) {
if (index == INT_MAX || (index + 1) > INT_MAX / m_nBaseComponents ||
(index + 1) * m_nBaseComponents > (int)m_Table.GetLength()) {
R = G = B = 0;
- return FALSE;
+ return false;
}
}
CFX_FixedBufGrow<FX_FLOAT, 16> Comps(m_nBaseComponents);
@@ -1084,7 +1084,7 @@ CPDF_ColorSpace* CPDF_IndexedCS::GetBaseCS() const {
return m_pBaseCS;
}
-void CPDF_IndexedCS::EnableStdConversion(FX_BOOL bEnabled) {
+void CPDF_IndexedCS::EnableStdConversion(bool bEnabled) {
CPDF_ColorSpace::EnableStdConversion(bEnabled);
if (m_pBaseCS) {
m_pBaseCS->EnableStdConversion(bEnabled);
@@ -1103,41 +1103,41 @@ CPDF_PatternCS::~CPDF_PatternCS() {
}
}
-FX_BOOL CPDF_PatternCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
+bool CPDF_PatternCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
CPDF_Object* pBaseCS = pArray->GetDirectObjectAt(1);
if (pBaseCS == m_pArray) {
- return FALSE;
+ return false;
}
CPDF_DocPageData* pDocPageData = pDoc->GetPageData();
m_pBaseCS = pDocPageData->GetColorSpace(pBaseCS, nullptr);
if (m_pBaseCS) {
if (m_pBaseCS->GetFamily() == PDFCS_PATTERN) {
- return FALSE;
+ return false;
}
m_pCountedBaseCS = pDocPageData->FindColorSpacePtr(m_pBaseCS->GetArray());
m_nComponents = m_pBaseCS->CountComponents() + 1;
if (m_pBaseCS->CountComponents() > MAX_PATTERN_COLORCOMPS) {
- return FALSE;
+ return false;
}
} else {
m_nComponents = 1;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_PatternCS::GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const {
+bool CPDF_PatternCS::GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const {
if (m_pBaseCS) {
ASSERT(m_pBaseCS->GetFamily() != PDFCS_PATTERN);
PatternValue* pvalue = (PatternValue*)pBuf;
if (m_pBaseCS->GetRGB(pvalue->m_Comps, R, G, B)) {
- return TRUE;
+ return true;
}
}
R = G = B = 0.75f;
- return FALSE;
+ return false;
}
CPDF_ColorSpace* CPDF_PatternCS::GetBaseCS() const {
@@ -1158,21 +1158,21 @@ void CPDF_SeparationCS::GetDefaultValue(int iComponent,
max = 1.0f;
}
-FX_BOOL CPDF_SeparationCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
+bool CPDF_SeparationCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
CFX_ByteString name = pArray->GetStringAt(1);
if (name == "None") {
m_Type = None;
- return TRUE;
+ return true;
}
m_Type = Colorant;
CPDF_Object* pAltCS = pArray->GetDirectObjectAt(2);
if (pAltCS == m_pArray)
- return FALSE;
+ return false;
m_pAltCS = Load(pDoc, pAltCS);
if (!m_pAltCS)
- return FALSE;
+ return false;
CPDF_Object* pFuncObj = pArray->GetDirectObjectAt(3);
if (pFuncObj && !pFuncObj->IsName())
@@ -1180,19 +1180,19 @@ FX_BOOL CPDF_SeparationCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
if (m_pFunc && m_pFunc->CountOutputs() < m_pAltCS->CountComponents())
m_pFunc.reset();
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_SeparationCS::GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const {
+bool CPDF_SeparationCS::GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const {
if (m_Type == None)
- return FALSE;
+ return false;
if (!m_pFunc) {
if (!m_pAltCS)
- return FALSE;
+ return false;
int nComps = m_pAltCS->CountComponents();
CFX_FixedBufGrow<FX_FLOAT, 16> results(nComps);
@@ -1205,7 +1205,7 @@ FX_BOOL CPDF_SeparationCS::GetRGB(FX_FLOAT* pBuf,
int nresults = 0;
m_pFunc->Call(pBuf, 1, results, nresults);
if (nresults == 0)
- return FALSE;
+ return false;
if (m_pAltCS)
return m_pAltCS->GetRGB(results, R, G, B);
@@ -1213,10 +1213,10 @@ FX_BOOL CPDF_SeparationCS::GetRGB(FX_FLOAT* pBuf,
R = 0;
G = 0;
B = 0;
- return FALSE;
+ return false;
}
-void CPDF_SeparationCS::EnableStdConversion(FX_BOOL bEnabled) {
+void CPDF_SeparationCS::EnableStdConversion(bool bEnabled) {
CPDF_ColorSpace::EnableStdConversion(bEnabled);
if (m_pAltCS)
m_pAltCS->EnableStdConversion(bEnabled);
@@ -1236,41 +1236,41 @@ void CPDF_DeviceNCS::GetDefaultValue(int iComponent,
max = 1.0f;
}
-FX_BOOL CPDF_DeviceNCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
+bool CPDF_DeviceNCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
CPDF_Array* pObj = ToArray(pArray->GetDirectObjectAt(1));
if (!pObj)
- return FALSE;
+ return false;
m_nComponents = pObj->GetCount();
CPDF_Object* pAltCS = pArray->GetDirectObjectAt(2);
if (!pAltCS || pAltCS == m_pArray)
- return FALSE;
+ return false;
m_pAltCS = Load(pDoc, pAltCS);
m_pFunc = CPDF_Function::Load(pArray->GetDirectObjectAt(3));
if (!m_pAltCS || !m_pFunc)
- return FALSE;
+ return false;
return m_pFunc->CountOutputs() >= m_pAltCS->CountComponents();
}
-FX_BOOL CPDF_DeviceNCS::GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const {
+bool CPDF_DeviceNCS::GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const {
if (!m_pFunc)
- return FALSE;
+ return false;
CFX_FixedBufGrow<FX_FLOAT, 16> results(m_pFunc->CountOutputs());
int nresults = 0;
m_pFunc->Call(pBuf, m_nComponents, results, nresults);
if (nresults == 0)
- return FALSE;
+ return false;
return m_pAltCS->GetRGB(results, R, G, B);
}
-void CPDF_DeviceNCS::EnableStdConversion(FX_BOOL bEnabled) {
+void CPDF_DeviceNCS::EnableStdConversion(bool bEnabled) {
CPDF_ColorSpace::EnableStdConversion(bEnabled);
if (m_pAltCS) {
m_pAltCS->EnableStdConversion(bEnabled);
diff --git a/core/fpdfapi/page/cpdf_colorspace.h b/core/fpdfapi/page/cpdf_colorspace.h
index 78311ce195..c4d62ed849 100644
--- a/core/fpdfapi/page/cpdf_colorspace.h
+++ b/core/fpdfapi/page/cpdf_colorspace.h
@@ -47,38 +47,35 @@ class CPDF_ColorSpace {
FX_FLOAT& min,
FX_FLOAT& max) const;
- FX_BOOL sRGB() const;
- virtual FX_BOOL GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const = 0;
- virtual FX_BOOL SetRGB(FX_FLOAT* pBuf,
- FX_FLOAT R,
- FX_FLOAT G,
- FX_FLOAT B) const;
-
- FX_BOOL GetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT& c,
- FX_FLOAT& m,
- FX_FLOAT& y,
- FX_FLOAT& k) const;
- FX_BOOL SetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT c,
- FX_FLOAT m,
- FX_FLOAT y,
- FX_FLOAT k) const;
+ bool sRGB() const;
+ virtual bool GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const = 0;
+ virtual bool SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
+
+ bool GetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT& c,
+ FX_FLOAT& m,
+ FX_FLOAT& y,
+ FX_FLOAT& k) const;
+ bool SetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT c,
+ FX_FLOAT m,
+ FX_FLOAT y,
+ FX_FLOAT k) const;
virtual void TranslateImageLine(uint8_t* dest_buf,
const uint8_t* src_buf,
int pixels,
int image_width,
int image_height,
- FX_BOOL bTransMask = FALSE) const;
+ bool bTransMask = false) const;
CPDF_Array*& GetArray() { return m_pArray; }
virtual CPDF_ColorSpace* GetBaseCS() const;
- virtual void EnableStdConversion(FX_BOOL bEnabled);
+ virtual void EnableStdConversion(bool bEnabled);
CPDF_Document* const m_pDocument;
@@ -86,17 +83,17 @@ class CPDF_ColorSpace {
CPDF_ColorSpace(CPDF_Document* pDoc, int family, uint32_t nComponents);
virtual ~CPDF_ColorSpace();
- virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
- virtual FX_BOOL v_GetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT& c,
- FX_FLOAT& m,
- FX_FLOAT& y,
- FX_FLOAT& k) const;
- virtual FX_BOOL v_SetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT c,
- FX_FLOAT m,
- FX_FLOAT y,
- FX_FLOAT k) const;
+ virtual bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
+ virtual bool v_GetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT& c,
+ FX_FLOAT& m,
+ FX_FLOAT& y,
+ FX_FLOAT& k) const;
+ virtual bool v_SetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT c,
+ FX_FLOAT m,
+ FX_FLOAT y,
+ FX_FLOAT k) const;
int m_Family;
uint32_t m_nComponents;
diff --git a/core/fpdfapi/page/cpdf_colorstate.cpp b/core/fpdfapi/page/cpdf_colorstate.cpp
index da583122af..c43a331c64 100644
--- a/core/fpdfapi/page/cpdf_colorstate.cpp
+++ b/core/fpdfapi/page/cpdf_colorstate.cpp
@@ -89,7 +89,7 @@ void CPDF_ColorState::SetFillPattern(CPDF_Pattern* pPattern,
ColorData* pData = m_Ref.GetPrivateCopy();
pData->m_FillColor.SetValue(pPattern, pValue, nValues);
int R, G, B;
- FX_BOOL ret = pData->m_FillColor.GetRGB(R, G, B);
+ bool ret = pData->m_FillColor.GetRGB(R, G, B);
if (CPDF_TilingPattern* pTilingPattern = pPattern->AsTilingPattern()) {
if (!ret && pTilingPattern->colored()) {
pData->m_FillRGB = 0x00BFBFBF;
@@ -105,7 +105,7 @@ void CPDF_ColorState::SetStrokePattern(CPDF_Pattern* pPattern,
ColorData* pData = m_Ref.GetPrivateCopy();
pData->m_StrokeColor.SetValue(pPattern, pValue, nValues);
int R, G, B;
- FX_BOOL ret = pData->m_StrokeColor.GetRGB(R, G, B);
+ bool ret = pData->m_StrokeColor.GetRGB(R, G, B);
if (CPDF_TilingPattern* pTilingPattern = pPattern->AsTilingPattern()) {
if (!ret && pTilingPattern->colored()) {
pData->m_StrokeRGB = 0x00BFBFBF;
diff --git a/core/fpdfapi/page/cpdf_contentmark.cpp b/core/fpdfapi/page/cpdf_contentmark.cpp
index 4e8625b940..d60e144d6e 100644
--- a/core/fpdfapi/page/cpdf_contentmark.cpp
+++ b/core/fpdfapi/page/cpdf_contentmark.cpp
@@ -35,7 +35,7 @@ int CPDF_ContentMark::GetMCID() const {
void CPDF_ContentMark::AddMark(const CFX_ByteString& name,
CPDF_Dictionary* pDict,
- FX_BOOL bDirect) {
+ bool bDirect) {
m_Ref.GetPrivateCopy()->AddMark(name, pDict, bDirect);
}
@@ -104,7 +104,7 @@ int CPDF_ContentMark::MarkData::GetMCID() const {
void CPDF_ContentMark::MarkData::AddMark(const CFX_ByteString& name,
CPDF_Dictionary* pDict,
- FX_BOOL bDirect) {
+ bool bDirect) {
CPDF_ContentMarkItem item;
item.SetName(name);
if (pDict) {
diff --git a/core/fpdfapi/page/cpdf_contentmark.h b/core/fpdfapi/page/cpdf_contentmark.h
index 485fe3b4c6..154f19d529 100644
--- a/core/fpdfapi/page/cpdf_contentmark.h
+++ b/core/fpdfapi/page/cpdf_contentmark.h
@@ -32,7 +32,7 @@ class CPDF_ContentMark {
bool LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const;
void AddMark(const CFX_ByteString& name,
CPDF_Dictionary* pDict,
- FX_BOOL bDirect);
+ bool bDirect);
void DeleteLastMark();
explicit operator bool() const { return !!m_Ref; }
@@ -51,7 +51,7 @@ class CPDF_ContentMark {
int GetMCID() const;
void AddMark(const CFX_ByteString& name,
CPDF_Dictionary* pDict,
- FX_BOOL bDictNeedClone);
+ bool bDictNeedClone);
void DeleteLastMark();
private:
diff --git a/core/fpdfapi/page/cpdf_contentmarkitem.cpp b/core/fpdfapi/page/cpdf_contentmarkitem.cpp
index 507dc22d9a..597f8a595c 100644
--- a/core/fpdfapi/page/cpdf_contentmarkitem.cpp
+++ b/core/fpdfapi/page/cpdf_contentmarkitem.cpp
@@ -33,7 +33,7 @@ CPDF_Dictionary* CPDF_ContentMarkItem::GetParam() const {
}
}
-FX_BOOL CPDF_ContentMarkItem::HasMCID() const {
+bool CPDF_ContentMarkItem::HasMCID() const {
CPDF_Dictionary* pDict = GetParam();
return pDict && pDict->KeyExist("MCID");
}
diff --git a/core/fpdfapi/page/cpdf_contentmarkitem.h b/core/fpdfapi/page/cpdf_contentmarkitem.h
index ef691e252c..f1f06c3a38 100644
--- a/core/fpdfapi/page/cpdf_contentmarkitem.h
+++ b/core/fpdfapi/page/cpdf_contentmarkitem.h
@@ -28,7 +28,7 @@ class CPDF_ContentMarkItem {
CFX_ByteString GetName() const { return m_MarkName; }
ParamType GetParamType() const { return m_ParamType; }
CPDF_Dictionary* GetParam() const;
- FX_BOOL HasMCID() const;
+ bool HasMCID() const;
void SetName(const CFX_ByteString& name) { m_MarkName = name; }
void SetDirectDict(
diff --git a/core/fpdfapi/page/cpdf_docpagedata.cpp b/core/fpdfapi/page/cpdf_docpagedata.cpp
index 5f1f561ebb..c4dc050215 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.cpp
+++ b/core/fpdfapi/page/cpdf_docpagedata.cpp
@@ -445,7 +445,7 @@ CPDF_IccProfile* CPDF_DocPageData::GetIccProfile(
return it->second->AddRef();
CPDF_StreamAcc stream;
- stream.LoadAllData(pIccProfileStream, FALSE);
+ stream.LoadAllData(pIccProfileStream, false);
uint8_t digest[20];
CRYPT_SHA1Generate(stream.GetData(), stream.GetSize(), digest);
CFX_ByteString bsDigest(digest, 20);
@@ -497,7 +497,7 @@ CPDF_StreamAcc* CPDF_DocPageData::GetFontFileStreamAcc(
org_size = std::max(org_size, 0);
CPDF_StreamAcc* pFontFile = new CPDF_StreamAcc;
- pFontFile->LoadAllData(pFontStream, FALSE, org_size);
+ pFontFile->LoadAllData(pFontStream, false, org_size);
CPDF_CountedStreamAcc* pCountedFont = new CPDF_CountedStreamAcc(pFontFile);
m_FontFileMap[pFontStream] = pCountedFont;
diff --git a/core/fpdfapi/page/cpdf_docpagedata.h b/core/fpdfapi/page/cpdf_docpagedata.h
index 64c0444a5e..bf2b80498d 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.h
+++ b/core/fpdfapi/page/cpdf_docpagedata.h
@@ -29,7 +29,7 @@ class CPDF_DocPageData {
explicit CPDF_DocPageData(CPDF_Document* pPDFDoc);
~CPDF_DocPageData();
- void Clear(bool bRelease = FALSE);
+ void Clear(bool bRelease = false);
CPDF_Font* GetFont(CPDF_Dictionary* pFontDict);
CPDF_Font* GetStandardFont(const CFX_ByteString& fontName,
CPDF_FontEncoding* pEncoding);
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index b40bc3ca8e..23c6e4f786 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -115,7 +115,7 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, uint32_t size) {
pDict->SetFor("DecodeParms", pParms);
pParms->SetIntegerFor("ColorTransform", 0);
}
- m_bIsMask = FALSE;
+ m_bIsMask = false;
m_Width = width;
m_Height = height;
if (!m_pStream)
@@ -170,7 +170,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
ArgbDecode(pBitmap->GetPaletteArgb(1), set_a, set_r, set_g, set_b);
}
if (set_a == 0 || reset_a == 0) {
- pDict->SetFor("ImageMask", new CPDF_Boolean(TRUE));
+ pDict->SetFor("ImageMask", new CPDF_Boolean(true));
if (reset_a == 0) {
CPDF_Array* pArray = new CPDF_Array;
pArray->AddInteger(1);
@@ -191,7 +191,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
pBuf[4] = (FX_CHAR)set_g;
pBuf[5] = (FX_CHAR)set_b;
ct.ReleaseBuffer(6);
- pCS->Add(new CPDF_String(ct, TRUE));
+ pCS->Add(new CPDF_String(ct, true));
pDict->SetFor("ColorSpace", pCS);
}
pDict->SetIntegerFor("BitsPerComponent", 1);
@@ -244,10 +244,10 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
}
}
const CFX_DIBitmap* pMaskBitmap = nullptr;
- FX_BOOL bDeleteMask = FALSE;
+ bool bDeleteMask = false;
if (pBitmap->HasAlpha()) {
pMaskBitmap = pBitmap->GetAlphaMask();
- bDeleteMask = TRUE;
+ bDeleteMask = true;
}
if (pMaskBitmap) {
int32_t maskWidth = pMaskBitmap->GetWidth();
@@ -348,9 +348,9 @@ void CPDF_Image::ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pBitmap) {
CFX_DIBSource* CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask,
uint32_t* pMatteColor,
- FX_BOOL bStdCS,
+ bool bStdCS,
uint32_t GroupFamily,
- FX_BOOL bLoadMask) const {
+ bool bLoadMask) const {
std::unique_ptr<CPDF_DIBSource> source(new CPDF_DIBSource);
if (source->Load(m_pDocument, m_pStream,
reinterpret_cast<CPDF_DIBSource**>(ppMask), pMatteColor,
@@ -372,41 +372,41 @@ CFX_DIBSource* CPDF_Image::DetachMask() {
return pBitmap;
}
-FX_BOOL CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource,
- CPDF_Dictionary* pPageResource,
- FX_BOOL bStdCS,
- uint32_t GroupFamily,
- FX_BOOL bLoadMask) {
+bool CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource,
+ CPDF_Dictionary* pPageResource,
+ bool bStdCS,
+ uint32_t GroupFamily,
+ bool bLoadMask) {
std::unique_ptr<CPDF_DIBSource> source(new CPDF_DIBSource);
int ret =
- source->StartLoadDIBSource(m_pDocument, m_pStream, TRUE, pFormResource,
+ source->StartLoadDIBSource(m_pDocument, m_pStream, true, pFormResource,
pPageResource, bStdCS, GroupFamily, bLoadMask);
if (ret == 2) {
m_pDIBSource = source.release();
- return TRUE;
+ return true;
}
if (!ret) {
m_pDIBSource = nullptr;
- return FALSE;
+ return false;
}
m_pMask = source->DetachMask();
m_MatteColor = source->GetMatteColor();
m_pDIBSource = source.release();
- return FALSE;
+ return false;
}
-FX_BOOL CPDF_Image::Continue(IFX_Pause* pPause) {
+bool CPDF_Image::Continue(IFX_Pause* pPause) {
CPDF_DIBSource* pSource = static_cast<CPDF_DIBSource*>(m_pDIBSource);
int ret = pSource->ContinueLoadDIBSource(pPause);
if (ret == 2) {
- return TRUE;
+ return true;
}
if (!ret) {
delete m_pDIBSource;
m_pDIBSource = nullptr;
- return FALSE;
+ return false;
}
m_pMask = pSource->DetachMask();
m_MatteColor = pSource->GetMatteColor();
- return FALSE;
+ return false;
}
diff --git a/core/fpdfapi/page/cpdf_image.h b/core/fpdfapi/page/cpdf_image.h
index 1e6f70fa33..f619845597 100644
--- a/core/fpdfapi/page/cpdf_image.h
+++ b/core/fpdfapi/page/cpdf_image.h
@@ -51,21 +51,21 @@ class CPDF_Image {
CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = nullptr,
uint32_t* pMatteColor = nullptr,
- FX_BOOL bStdCS = FALSE,
+ bool bStdCS = false,
uint32_t GroupFamily = 0,
- FX_BOOL bLoadMask = FALSE) const;
+ bool bLoadMask = false) const;
void SetImage(const CFX_DIBitmap* pDIBitmap, int32_t iCompress);
void SetJpegImage(IFX_SeekableReadStream* pFile);
void ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pDIBitmap);
- FX_BOOL StartLoadDIBSource(CPDF_Dictionary* pFormResource,
- CPDF_Dictionary* pPageResource,
- FX_BOOL bStdCS = FALSE,
- uint32_t GroupFamily = 0,
- FX_BOOL bLoadMask = FALSE);
- FX_BOOL Continue(IFX_Pause* pPause);
+ bool StartLoadDIBSource(CPDF_Dictionary* pFormResource,
+ CPDF_Dictionary* pPageResource,
+ bool bStdCS = false,
+ uint32_t GroupFamily = 0,
+ bool bLoadMask = false);
+ bool Continue(IFX_Pause* pPause);
CFX_DIBSource* DetachBitmap();
CFX_DIBSource* DetachMask();
diff --git a/core/fpdfapi/page/cpdf_meshstream.cpp b/core/fpdfapi/page/cpdf_meshstream.cpp
index c3bfcb4ab5..8bc2a851cc 100644
--- a/core/fpdfapi/page/cpdf_meshstream.cpp
+++ b/core/fpdfapi/page/cpdf_meshstream.cpp
@@ -201,17 +201,17 @@ uint32_t CPDF_MeshStream::GetVertex(CPDF_MeshVertex& vertex,
return flag;
}
-FX_BOOL CPDF_MeshStream::GetVertexRow(CPDF_MeshVertex* vertex,
- int count,
- CFX_Matrix* pObject2Bitmap) {
+bool CPDF_MeshStream::GetVertexRow(CPDF_MeshVertex* vertex,
+ int count,
+ CFX_Matrix* pObject2Bitmap) {
for (int i = 0; i < count; i++) {
if (m_BitStream.IsEOF())
- return FALSE;
+ return false;
GetCoords(vertex[i].x, vertex[i].y);
pObject2Bitmap->Transform(vertex[i].x, vertex[i].y);
GetColor(vertex[i].r, vertex[i].g, vertex[i].b);
m_BitStream.ByteAlign();
}
- return TRUE;
+ return true;
}
diff --git a/core/fpdfapi/page/cpdf_meshstream.h b/core/fpdfapi/page/cpdf_meshstream.h
index 4d37f17889..21a6c2fa8c 100644
--- a/core/fpdfapi/page/cpdf_meshstream.h
+++ b/core/fpdfapi/page/cpdf_meshstream.h
@@ -42,9 +42,9 @@ class CPDF_MeshStream {
void GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b);
uint32_t GetVertex(CPDF_MeshVertex& vertex, CFX_Matrix* pObject2Bitmap);
- FX_BOOL GetVertexRow(CPDF_MeshVertex* vertex,
- int count,
- CFX_Matrix* pObject2Bitmap);
+ bool GetVertexRow(CPDF_MeshVertex* vertex,
+ int count,
+ CFX_Matrix* pObject2Bitmap);
CFX_BitStream* BitStream() { return &m_BitStream; }
uint32_t ComponentBits() const { return m_nComponentBits; }
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.cpp b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
index 885d9639bd..a52d97f27e 100644
--- a/core/fpdfapi/page/cpdf_pageobjectholder.cpp
+++ b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
@@ -17,8 +17,8 @@ CPDF_PageObjectHolder::CPDF_PageObjectHolder()
m_pPageResources(nullptr),
m_pResources(nullptr),
m_Transparency(0),
- m_bBackgroundAlphaNeeded(FALSE),
- m_bHasImageMask(FALSE),
+ m_bBackgroundAlphaNeeded(false),
+ m_bHasImageMask(false),
m_ParseState(CONTENT_NOT_PARSED) {}
CPDF_PageObjectHolder::~CPDF_PageObjectHolder() {}
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.h b/core/fpdfapi/page/cpdf_pageobjectholder.h
index 96a0a80838..ce5424e009 100644
--- a/core/fpdfapi/page/cpdf_pageobjectholder.h
+++ b/core/fpdfapi/page/cpdf_pageobjectholder.h
@@ -34,13 +34,13 @@ class CPDF_PageObjectHolder {
return &m_PageObjectList;
}
- FX_BOOL BackgroundAlphaNeeded() const { return m_bBackgroundAlphaNeeded; }
- void SetBackgroundAlphaNeeded(FX_BOOL needed) {
+ bool BackgroundAlphaNeeded() const { return m_bBackgroundAlphaNeeded; }
+ void SetBackgroundAlphaNeeded(bool needed) {
m_bBackgroundAlphaNeeded = needed;
}
- FX_BOOL HasImageMask() const { return m_bHasImageMask; }
- void SetHasImageMask(FX_BOOL value) { m_bHasImageMask = value; }
+ bool HasImageMask() const { return m_bHasImageMask; }
+ void SetHasImageMask(bool value) { m_bHasImageMask = value; }
void Transform(const CFX_Matrix& matrix);
CFX_FloatRect CalcBoundingBox() const;
@@ -58,8 +58,8 @@ class CPDF_PageObjectHolder {
void LoadTransInfo();
- FX_BOOL m_bBackgroundAlphaNeeded;
- FX_BOOL m_bHasImageMask;
+ bool m_bBackgroundAlphaNeeded;
+ bool m_bHasImageMask;
ParseState m_ParseState;
std::unique_ptr<CPDF_ContentParser> m_pParser;
CPDF_PageObjectList m_PageObjectList;
diff --git a/core/fpdfapi/page/cpdf_path.cpp b/core/fpdfapi/page/cpdf_path.cpp
index e80edf798e..2bfda75f56 100644
--- a/core/fpdfapi/page/cpdf_path.cpp
+++ b/core/fpdfapi/page/cpdf_path.cpp
@@ -49,7 +49,7 @@ CFX_FloatRect CPDF_Path::GetBoundingBox(FX_FLOAT line_width,
return m_Ref.GetObject()->GetBoundingBox(line_width, miter_limit);
}
-FX_BOOL CPDF_Path::IsRect() const {
+bool CPDF_Path::IsRect() const {
return m_Ref.GetObject()->IsRect();
}
diff --git a/core/fpdfapi/page/cpdf_path.h b/core/fpdfapi/page/cpdf_path.h
index d69672a4de..407905e429 100644
--- a/core/fpdfapi/page/cpdf_path.h
+++ b/core/fpdfapi/page/cpdf_path.h
@@ -33,7 +33,7 @@ class CPDF_Path {
CFX_FloatRect GetBoundingBox() const;
CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const;
- FX_BOOL IsRect() const;
+ bool IsRect() const;
void Transform(const CFX_Matrix* pMatrix);
void Append(const CPDF_Path& other, const CFX_Matrix* pMatrix);
diff --git a/core/fpdfapi/page/cpdf_pathobject.h b/core/fpdfapi/page/cpdf_pathobject.h
index 65578a1bab..d5ce5c0d02 100644
--- a/core/fpdfapi/page/cpdf_pathobject.h
+++ b/core/fpdfapi/page/cpdf_pathobject.h
@@ -29,7 +29,7 @@ class CPDF_PathObject : public CPDF_PageObject {
CPDF_Path m_Path;
int m_FillType;
- FX_BOOL m_bStroke;
+ bool m_bStroke;
CFX_Matrix m_Matrix;
};
diff --git a/core/fpdfapi/page/cpdf_psengine.h b/core/fpdfapi/page/cpdf_psengine.h
index d3eec6629c..9bdaa67464 100644
--- a/core/fpdfapi/page/cpdf_psengine.h
+++ b/core/fpdfapi/page/cpdf_psengine.h
@@ -70,8 +70,8 @@ class CPDF_PSProc {
CPDF_PSProc();
~CPDF_PSProc();
- FX_BOOL Parse(CPDF_SimpleParser* parser, int depth);
- FX_BOOL Execute(CPDF_PSEngine* pEngine);
+ bool Parse(CPDF_SimpleParser* parser, int depth);
+ bool Execute(CPDF_PSEngine* pEngine);
private:
static const int kMaxDepth = 128;
@@ -83,9 +83,9 @@ class CPDF_PSEngine {
CPDF_PSEngine();
~CPDF_PSEngine();
- FX_BOOL Parse(const FX_CHAR* str, int size);
- FX_BOOL Execute();
- FX_BOOL DoOperator(PDF_PSOP op);
+ bool Parse(const FX_CHAR* str, int size);
+ bool Execute();
+ bool DoOperator(PDF_PSOP op);
void Reset() { m_StackCount = 0; }
void Push(FX_FLOAT value);
void Push(int value) { Push((FX_FLOAT)value); }
diff --git a/core/fpdfapi/page/cpdf_shadingpattern.cpp b/core/fpdfapi/page/cpdf_shadingpattern.cpp
index d2736870e1..3b0b439a31 100644
--- a/core/fpdfapi/page/cpdf_shadingpattern.cpp
+++ b/core/fpdfapi/page/cpdf_shadingpattern.cpp
@@ -62,12 +62,12 @@ CPDF_ShadingPattern* CPDF_ShadingPattern::AsShadingPattern() {
bool CPDF_ShadingPattern::Load() {
if (m_ShadingType != kInvalidShading)
- return TRUE;
+ return true;
CPDF_Dictionary* pShadingDict =
m_pShadingObj ? m_pShadingObj->GetDict() : nullptr;
if (!pShadingDict)
- return FALSE;
+ return false;
m_pFunctions.clear();
CPDF_Object* pFunc = pShadingDict->GetDirectObjectFor("Function");
@@ -82,7 +82,7 @@ bool CPDF_ShadingPattern::Load() {
}
CPDF_Object* pCSObj = pShadingDict->GetDirectObjectFor("ColorSpace");
if (!pCSObj)
- return FALSE;
+ return false;
CPDF_DocPageData* pDocPageData = m_pDocument->GetPageData();
m_pCS = pDocPageData->GetColorSpace(pCSObj, nullptr);
@@ -93,7 +93,7 @@ bool CPDF_ShadingPattern::Load() {
// We expect to have a stream if our shading type is a mesh.
if (IsMeshShading() && !ToStream(m_pShadingObj))
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index 4ad763e3b2..ed6701382c 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -285,7 +285,7 @@ CPDF_Object* CPDF_StreamContentParser::GetObject(uint32_t index) {
if (param.m_Type == ContentParam::OBJECT) {
return param.m_pObject;
}
- ASSERT(FALSE);
+ ASSERT(false);
return nullptr;
}
@@ -587,7 +587,7 @@ void CPDF_StreamContentParser::Handle_BeginImage() {
}
void CPDF_StreamContentParser::Handle_BeginMarkedContent() {
- m_CurContentMark.AddMark(GetString(0), nullptr, FALSE);
+ m_CurContentMark.AddMark(GetString(0), nullptr, false);
}
void CPDF_StreamContentParser::Handle_BeginText() {
@@ -697,7 +697,7 @@ void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) {
pFormObj->m_pForm->ParseContent(&status, nullptr, nullptr, m_Level + 1);
if (!m_pObjectHolder->BackgroundAlphaNeeded() &&
pFormObj->m_pForm->BackgroundAlphaNeeded()) {
- m_pObjectHolder->SetBackgroundAlphaNeeded(TRUE);
+ m_pObjectHolder->SetBackgroundAlphaNeeded(true);
}
pFormObj->CalcBoundingBox();
SetGraphicStates(pFormObj.get(), true, true, true);
@@ -1410,7 +1410,7 @@ void CPDF_StreamContentParser::AddPathObject(int FillType, bool bStroke) {
if (PathPointCount && PathClipType) {
CPDF_Path path;
path.AppendRect(0, 0, 0, 0);
- m_pCurStates->m_ClipPath.AppendPath(path, FXFILL_WINDING, TRUE);
+ m_pCurStates->m_ClipPath.AppendPath(path, FXFILL_WINDING, true);
}
return;
}
@@ -1439,7 +1439,7 @@ void CPDF_StreamContentParser::AddPathObject(int FillType, bool bStroke) {
Path.Transform(&matrix);
matrix.SetIdentity();
}
- m_pCurStates->m_ClipPath.AppendPath(Path, PathClipType, TRUE);
+ m_pCurStates->m_ClipPath.AppendPath(Path, PathClipType, true);
}
}
@@ -1484,7 +1484,7 @@ void CPDF_StreamContentParser::ParsePathObject() {
int last_pos = m_pSyntax->GetPos();
while (1) {
CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
- FX_BOOL bProcessed = TRUE;
+ bool bProcessed = true;
switch (type) {
case CPDF_StreamParser::EndOfData:
return;
@@ -1523,7 +1523,7 @@ void CPDF_StreamContentParser::ParsePathObject() {
nParams = 0;
break;
default:
- bProcessed = FALSE;
+ bProcessed = false;
break;
}
} else if (len == 2) {
@@ -1532,10 +1532,10 @@ void CPDF_StreamContentParser::ParsePathObject() {
AddPathRect(params[0], params[1], params[2], params[3]);
nParams = 0;
} else {
- bProcessed = FALSE;
+ bProcessed = false;
}
} else {
- bProcessed = FALSE;
+ bProcessed = false;
}
if (bProcessed) {
last_pos = m_pSyntax->GetPos();
@@ -1554,7 +1554,7 @@ void CPDF_StreamContentParser::ParsePathObject() {
break;
}
default:
- bProcessed = FALSE;
+ bProcessed = false;
}
if (!bProcessed) {
m_pSyntax->SetPos(last_pos);
diff --git a/core/fpdfapi/page/cpdf_textobject.cpp b/core/fpdfapi/page/cpdf_textobject.cpp
index 0b44522835..d5a2ea6d29 100644
--- a/core/fpdfapi/page/cpdf_textobject.cpp
+++ b/core/fpdfapi/page/cpdf_textobject.cpp
@@ -211,7 +211,7 @@ void CPDF_TextObject::SetText(const CFX_ByteString& str) {
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;
+ bool bVertWriting = false;
CPDF_CIDFont* pCIDFont = pFont->AsCIDFont();
if (pCIDFont) {
bVertWriting = pCIDFont->IsVertWriting();
@@ -248,7 +248,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
FX_FLOAT min_y = 10000 * 1.0f;
FX_FLOAT max_y = -10000 * 1.0f;
CPDF_Font* pFont = m_TextState.GetFont();
- FX_BOOL bVertWriting = FALSE;
+ bool bVertWriting = false;
CPDF_CIDFont* pCIDFont = pFont->AsCIDFont();
if (pCIDFont) {
bVertWriting = pCIDFont->IsVertWriting();
diff --git a/core/fpdfapi/page/cpdf_tilingpattern.cpp b/core/fpdfapi/page/cpdf_tilingpattern.cpp
index eb51fbac63..1b7bee4366 100644
--- a/core/fpdfapi/page/cpdf_tilingpattern.cpp
+++ b/core/fpdfapi/page/cpdf_tilingpattern.cpp
@@ -31,13 +31,13 @@ CPDF_ShadingPattern* CPDF_TilingPattern::AsShadingPattern() {
return nullptr;
}
-FX_BOOL CPDF_TilingPattern::Load() {
+bool CPDF_TilingPattern::Load() {
if (m_pForm)
- return TRUE;
+ return true;
CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
if (!pDict)
- return FALSE;
+ return false;
m_bColored = pDict->GetIntegerFor("PaintType") == 1;
m_XStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumberFor("XStep"));
@@ -45,10 +45,10 @@ FX_BOOL CPDF_TilingPattern::Load() {
CPDF_Stream* pStream = m_pPatternObj->AsStream();
if (!pStream)
- return FALSE;
+ return false;
m_pForm.reset(new CPDF_Form(m_pDocument, nullptr, pStream));
m_pForm->ParseContent(nullptr, &m_ParentMatrix, nullptr);
m_BBox = pDict->GetRectFor("BBox");
- return TRUE;
+ return true;
}
diff --git a/core/fpdfapi/page/cpdf_tilingpattern.h b/core/fpdfapi/page/cpdf_tilingpattern.h
index 3c9ffb206d..3f0851aa7e 100644
--- a/core/fpdfapi/page/cpdf_tilingpattern.h
+++ b/core/fpdfapi/page/cpdf_tilingpattern.h
@@ -27,7 +27,7 @@ class CPDF_TilingPattern : public CPDF_Pattern {
CPDF_TilingPattern* AsTilingPattern() override;
CPDF_ShadingPattern* AsShadingPattern() override;
- FX_BOOL Load();
+ bool Load();
bool colored() const { return m_bColored; }
const CFX_FloatRect& bbox() const { return m_BBox; }
diff --git a/core/fpdfapi/page/fpdf_page_colors.cpp b/core/fpdfapi/page/fpdf_page_colors.cpp
index e42b695c6c..3ee5328dbc 100644
--- a/core/fpdfapi/page/fpdf_page_colors.cpp
+++ b/core/fpdfapi/page/fpdf_page_colors.cpp
@@ -71,10 +71,10 @@ void ReverseRGB(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels) {
CPDF_DeviceCS::CPDF_DeviceCS(CPDF_Document* pDoc, int family)
: CPDF_ColorSpace(pDoc, family, ComponentsForFamily(family)) {}
-FX_BOOL CPDF_DeviceCS::GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const {
+bool CPDF_DeviceCS::GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const {
if (m_Family == PDFCS_DEVICERGB) {
R = pBuf[0];
if (R < 0) {
@@ -114,64 +114,64 @@ FX_BOOL CPDF_DeviceCS::GetRGB(FX_FLOAT* pBuf,
} else {
ASSERT(m_Family == PDFCS_PATTERN);
R = G = B = 0;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_DeviceCS::v_GetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT& c,
- FX_FLOAT& m,
- FX_FLOAT& y,
- FX_FLOAT& k) const {
+bool CPDF_DeviceCS::v_GetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT& c,
+ FX_FLOAT& m,
+ FX_FLOAT& y,
+ FX_FLOAT& k) const {
if (m_Family != PDFCS_DEVICECMYK) {
- return FALSE;
+ return false;
}
c = pBuf[0];
m = pBuf[1];
y = pBuf[2];
k = pBuf[3];
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_DeviceCS::SetRGB(FX_FLOAT* pBuf,
- FX_FLOAT R,
- FX_FLOAT G,
- FX_FLOAT B) const {
+bool CPDF_DeviceCS::SetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT R,
+ FX_FLOAT G,
+ FX_FLOAT B) const {
if (m_Family == PDFCS_DEVICERGB) {
pBuf[0] = R;
pBuf[1] = G;
pBuf[2] = B;
- return TRUE;
+ return true;
}
if (m_Family == PDFCS_DEVICEGRAY) {
if (R == G && R == B) {
*pBuf = R;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
if (m_Family == PDFCS_DEVICECMYK) {
sRGB_to_AdobeCMYK(R, G, B, pBuf[0], pBuf[1], pBuf[2], pBuf[3]);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDF_DeviceCS::v_SetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT c,
- FX_FLOAT m,
- FX_FLOAT y,
- FX_FLOAT k) const {
+bool CPDF_DeviceCS::v_SetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT c,
+ FX_FLOAT m,
+ FX_FLOAT y,
+ FX_FLOAT k) const {
if (m_Family == PDFCS_DEVICERGB) {
AdobeCMYK_to_sRGB(c, m, y, k, pBuf[0], pBuf[1], pBuf[2]);
- return TRUE;
+ return true;
}
if (m_Family == PDFCS_DEVICECMYK) {
pBuf[0] = c;
pBuf[1] = m;
pBuf[2] = y;
pBuf[3] = k;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CPDF_DeviceCS::TranslateImageLine(uint8_t* pDestBuf,
@@ -179,7 +179,7 @@ void CPDF_DeviceCS::TranslateImageLine(uint8_t* pDestBuf,
int pixels,
int image_width,
int image_height,
- FX_BOOL bTransMask) const {
+ bool bTransMask) const {
if (bTransMask && m_Family == PDFCS_DEVICECMYK) {
for (int i = 0; i < pixels; i++) {
int k = 255 - pSrcBuf[3];
@@ -217,10 +217,10 @@ void CPDF_DeviceCS::TranslateImageLine(uint8_t* pDestBuf,
}
CPDF_IccProfile::CPDF_IccProfile(const uint8_t* pData, uint32_t dwSize)
- : m_bsRGB(FALSE), m_pTransform(nullptr), m_nSrcComponents(0) {
+ : m_bsRGB(false), m_pTransform(nullptr), m_nSrcComponents(0) {
if (dwSize == 3144 &&
FXSYS_memcmp(pData + 0x190, "sRGB IEC61966-2.1", 17) == 0) {
- m_bsRGB = TRUE;
+ m_bsRGB = true;
m_nSrcComponents = 3;
} else if (CPDF_ModuleMgr::Get()->GetIccModule()) {
m_pTransform = CPDF_ModuleMgr::Get()->GetIccModule()->CreateTransform_sRGB(
diff --git a/core/fpdfapi/page/fpdf_page_func.cpp b/core/fpdfapi/page/fpdf_page_func.cpp
index df658844cd..a6c73b0e5f 100644
--- a/core/fpdfapi/page/fpdf_page_func.cpp
+++ b/core/fpdfapi/page/fpdf_page_func.cpp
@@ -84,31 +84,31 @@ class CPDF_PSFunc : public CPDF_Function {
~CPDF_PSFunc() override {}
// CPDF_Function
- FX_BOOL v_Init(CPDF_Object* pObj) override;
- FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
+ bool v_Init(CPDF_Object* pObj) override;
+ bool v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
private:
CPDF_PSEngine m_PS;
};
-FX_BOOL CPDF_PSFunc::v_Init(CPDF_Object* pObj) {
+bool CPDF_PSFunc::v_Init(CPDF_Object* pObj) {
CPDF_StreamAcc acc;
- acc.LoadAllData(pObj->AsStream(), FALSE);
+ acc.LoadAllData(pObj->AsStream(), false);
return m_PS.Parse(reinterpret_cast<const FX_CHAR*>(acc.GetData()),
acc.GetSize());
}
-FX_BOOL CPDF_PSFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const {
+bool CPDF_PSFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const {
CPDF_PSEngine& PS = const_cast<CPDF_PSEngine&>(m_PS);
PS.Reset();
for (uint32_t i = 0; i < m_nInputs; i++)
PS.Push(inputs[i]);
PS.Execute();
if (PS.GetStackSize() < m_nOutputs)
- return FALSE;
+ return false;
for (uint32_t i = 0; i < m_nOutputs; i++)
results[m_nOutputs - i - 1] = PS.Pop();
- return TRUE;
+ return true;
}
} // namespace
@@ -145,14 +145,14 @@ class CPDF_PSOP {
std::unique_ptr<CPDF_PSProc> m_proc;
};
-FX_BOOL CPDF_PSEngine::Execute() {
+bool CPDF_PSEngine::Execute() {
return m_MainProc.Execute(this);
}
CPDF_PSProc::CPDF_PSProc() {}
CPDF_PSProc::~CPDF_PSProc() {}
-FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine) {
+bool CPDF_PSProc::Execute(CPDF_PSEngine* pEngine) {
for (size_t i = 0; i < m_Operators.size(); ++i) {
const PDF_PSOP op = m_Operators[i]->GetOp();
if (op == PSOP_PROC)
@@ -165,14 +165,14 @@ FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine) {
if (op == PSOP_IF) {
if (i == 0 || m_Operators[i - 1]->GetOp() != PSOP_PROC)
- return FALSE;
+ return false;
if (static_cast<int>(pEngine->Pop()))
m_Operators[i - 1]->GetProc()->Execute(pEngine);
} else if (op == PSOP_IFELSE) {
if (i < 2 || m_Operators[i - 1]->GetOp() != PSOP_PROC ||
m_Operators[i - 2]->GetOp() != PSOP_PROC) {
- return FALSE;
+ return false;
}
size_t offset = static_cast<int>(pEngine->Pop()) ? 2 : 1;
m_Operators[i - offset]->GetProc()->Execute(pEngine);
@@ -180,7 +180,7 @@ FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine) {
pEngine->DoOperator(op);
}
}
- return TRUE;
+ return true;
}
CPDF_PSEngine::CPDF_PSEngine() {
@@ -199,33 +199,33 @@ FX_FLOAT CPDF_PSEngine::Pop() {
}
return m_Stack[--m_StackCount];
}
-FX_BOOL CPDF_PSEngine::Parse(const FX_CHAR* str, int size) {
+bool CPDF_PSEngine::Parse(const FX_CHAR* str, int size) {
CPDF_SimpleParser parser((uint8_t*)str, size);
CFX_ByteStringC word = parser.GetWord();
if (word != "{") {
- return FALSE;
+ return false;
}
return m_MainProc.Parse(&parser, 0);
}
-FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser* parser, int depth) {
+bool CPDF_PSProc::Parse(CPDF_SimpleParser* parser, int depth) {
if (depth > kMaxDepth)
- return FALSE;
+ return false;
while (1) {
CFX_ByteStringC word = parser->GetWord();
if (word.IsEmpty()) {
- return FALSE;
+ return false;
}
if (word == "}") {
- return TRUE;
+ return true;
}
if (word == "{") {
std::unique_ptr<CPDF_PSProc> proc(new CPDF_PSProc);
std::unique_ptr<CPDF_PSOP> op(new CPDF_PSOP(std::move(proc)));
m_Operators.push_back(std::move(op));
if (!m_Operators.back()->GetProc()->Parse(parser, depth + 1)) {
- return FALSE;
+ return false;
}
} else {
bool found = false;
@@ -245,7 +245,7 @@ FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser* parser, int depth) {
}
}
-FX_BOOL CPDF_PSEngine::DoOperator(PDF_PSOP op) {
+bool CPDF_PSEngine::DoOperator(PDF_PSOP op) {
int i1;
int i2;
FX_FLOAT d1;
@@ -474,14 +474,14 @@ FX_BOOL CPDF_PSEngine::DoOperator(PDF_PSOP op) {
default:
break;
}
- return TRUE;
+ return true;
}
CPDF_SampledFunc::CPDF_SampledFunc() : CPDF_Function(Type::kType0Sampled) {}
CPDF_SampledFunc::~CPDF_SampledFunc() {}
-FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) {
+bool CPDF_SampledFunc::v_Init(CPDF_Object* pObj) {
CPDF_Stream* pStream = pObj->AsStream();
if (!pStream)
return false;
@@ -492,11 +492,11 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) {
CPDF_Array* pDecode = pDict->GetArrayFor("Decode");
m_nBitsPerSample = pDict->GetIntegerFor("BitsPerSample");
if (!IsValidBitsPerSample(m_nBitsPerSample))
- return FALSE;
+ return false;
m_SampleMax = 0xffffffff >> (32 - m_nBitsPerSample);
m_pSampleStream.reset(new CPDF_StreamAcc);
- m_pSampleStream->LoadAllData(pStream, FALSE);
+ m_pSampleStream->LoadAllData(pStream, false);
FX_SAFE_UINT32 nTotalSampleBits = 1;
m_EncodeInfo.resize(m_nInputs);
for (uint32_t i = 0; i < m_nInputs; i++) {
@@ -520,7 +520,7 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) {
nTotalSampleBytes /= 8;
if (!nTotalSampleBytes.IsValid() || nTotalSampleBytes.ValueOrDie() == 0 ||
nTotalSampleBytes.ValueOrDie() > m_pSampleStream->GetSize()) {
- return FALSE;
+ return false;
}
m_DecodeInfo.resize(m_nOutputs);
for (uint32_t i = 0; i < m_nOutputs; i++) {
@@ -532,10 +532,10 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) {
m_DecodeInfo[i].decode_max = m_pRanges[i * 2 + 1];
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const {
+bool CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const {
int pos = 0;
CFX_FixedBufGrow<FX_FLOAT, 16> encoded_input_buf(m_nInputs);
FX_FLOAT* encoded_input = encoded_input_buf;
@@ -557,21 +557,21 @@ FX_BOOL CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const {
FX_SAFE_INT32 bits_to_output = m_nOutputs;
bits_to_output *= m_nBitsPerSample;
if (!bits_to_output.IsValid())
- return FALSE;
+ return false;
FX_SAFE_INT32 bitpos = pos;
bitpos *= bits_to_output.ValueOrDie();
if (!bitpos.IsValid())
- return FALSE;
+ return false;
FX_SAFE_INT32 range_check = bitpos;
range_check += bits_to_output.ValueOrDie();
if (!range_check.IsValid())
- return FALSE;
+ return false;
const uint8_t* pSampleData = m_pSampleStream->GetData();
if (!pSampleData)
- return FALSE;
+ return false;
for (uint32_t j = 0; j < m_nOutputs; j++) {
uint32_t sample =
@@ -589,7 +589,7 @@ FX_BOOL CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const {
bitpos2 += j;
bitpos2 *= m_nBitsPerSample;
if (!bitpos2.IsValid())
- return FALSE;
+ return false;
uint32_t sample1 =
GetBits32(pSampleData, bitpos2.ValueOrDie(), m_nBitsPerSample);
encoded += (encoded_input[i] - index[i]) *
@@ -600,7 +600,7 @@ FX_BOOL CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const {
PDF_Interpolate(encoded, 0, (FX_FLOAT)m_SampleMax,
m_DecodeInfo[j].decode_min, m_DecodeInfo[j].decode_max);
}
- return TRUE;
+ return true;
}
CPDF_ExpIntFunc::CPDF_ExpIntFunc()
@@ -612,10 +612,10 @@ CPDF_ExpIntFunc::~CPDF_ExpIntFunc() {
FX_Free(m_pBeginValues);
FX_Free(m_pEndValues);
}
-FX_BOOL CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj) {
+bool CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj) {
CPDF_Dictionary* pDict = pObj->GetDict();
if (!pDict) {
- return FALSE;
+ return false;
}
CPDF_Array* pArray0 = pDict->GetArrayFor("C0");
if (m_nOutputs == 0) {
@@ -634,12 +634,12 @@ FX_BOOL CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj) {
m_Exponent = pDict->GetFloatFor("N");
m_nOrigOutputs = m_nOutputs;
if (m_nOutputs && m_nInputs > INT_MAX / m_nOutputs) {
- return FALSE;
+ return false;
}
m_nOutputs *= m_nInputs;
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_ExpIntFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const {
+bool CPDF_ExpIntFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const {
for (uint32_t i = 0; i < m_nInputs; i++)
for (uint32_t j = 0; j < m_nOrigOutputs; j++) {
results[i * m_nOrigOutputs + j] =
@@ -647,7 +647,7 @@ FX_BOOL CPDF_ExpIntFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const {
(FX_FLOAT)FXSYS_pow(inputs[i], m_Exponent) *
(m_pEndValues[j] - m_pBeginValues[j]);
}
- return TRUE;
+ return true;
}
CPDF_StitchFunc::CPDF_StitchFunc()
@@ -660,36 +660,36 @@ CPDF_StitchFunc::~CPDF_StitchFunc() {
FX_Free(m_pEncode);
}
-FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj) {
+bool CPDF_StitchFunc::v_Init(CPDF_Object* pObj) {
CPDF_Dictionary* pDict = pObj->GetDict();
if (!pDict) {
- return FALSE;
+ return false;
}
if (m_nInputs != kRequiredNumInputs) {
- return FALSE;
+ return false;
}
CPDF_Array* pArray = pDict->GetArrayFor("Functions");
if (!pArray) {
- return FALSE;
+ return false;
}
uint32_t nSubs = pArray->GetCount();
if (nSubs == 0)
- return FALSE;
+ return false;
m_nOutputs = 0;
for (uint32_t i = 0; i < nSubs; i++) {
CPDF_Object* pSub = pArray->GetDirectObjectAt(i);
if (pSub == pObj)
- return FALSE;
+ return false;
std::unique_ptr<CPDF_Function> pFunc(CPDF_Function::Load(pSub));
if (!pFunc)
- return FALSE;
+ return false;
// Check that the input dimensionality is 1, and that all output
// dimensionalities are the same.
if (pFunc->CountInputs() != kRequiredNumInputs)
- return FALSE;
+ return false;
if (pFunc->CountOutputs() != m_nOutputs) {
if (m_nOutputs)
- return FALSE;
+ return false;
m_nOutputs = pFunc->CountOutputs();
}
@@ -700,21 +700,21 @@ FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj) {
m_pBounds[0] = m_pDomains[0];
pArray = pDict->GetArrayFor("Bounds");
if (!pArray)
- return FALSE;
+ return false;
for (uint32_t i = 0; i < nSubs - 1; i++)
m_pBounds[i + 1] = pArray->GetFloatAt(i);
m_pBounds[nSubs] = m_pDomains[1];
m_pEncode = FX_Alloc2D(FX_FLOAT, nSubs, 2);
pArray = pDict->GetArrayFor("Encode");
if (!pArray)
- return FALSE;
+ return false;
for (uint32_t i = 0; i < nSubs * 2; i++)
m_pEncode[i] = pArray->GetFloatAt(i);
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_StitchFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* outputs) const {
+bool CPDF_StitchFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* outputs) const {
FX_FLOAT input = inputs[0];
size_t i;
for (i = 0; i < m_pSubFunctions.size() - 1; i++) {
@@ -725,7 +725,7 @@ FX_BOOL CPDF_StitchFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* outputs) const {
m_pEncode[i * 2], m_pEncode[i * 2 + 1]);
int nresults;
m_pSubFunctions[i]->Call(&input, kRequiredNumInputs, outputs, nresults);
- return TRUE;
+ return true;
}
// static
@@ -777,17 +777,17 @@ CPDF_Function::~CPDF_Function() {
FX_Free(m_pRanges);
}
-FX_BOOL CPDF_Function::Init(CPDF_Object* pObj) {
+bool CPDF_Function::Init(CPDF_Object* pObj) {
CPDF_Stream* pStream = pObj->AsStream();
CPDF_Dictionary* pDict = pStream ? pStream->GetDict() : pObj->AsDictionary();
CPDF_Array* pDomains = pDict->GetArrayFor("Domain");
if (!pDomains)
- return FALSE;
+ return false;
m_nInputs = pDomains->GetCount() / 2;
if (m_nInputs == 0)
- return FALSE;
+ return false;
m_pDomains = FX_Alloc2D(FX_FLOAT, m_nInputs, 2);
for (uint32_t i = 0; i < m_nInputs * 2; i++) {
@@ -803,7 +803,7 @@ FX_BOOL CPDF_Function::Init(CPDF_Object* pObj) {
}
uint32_t old_outputs = m_nOutputs;
if (!v_Init(pObj))
- return FALSE;
+ return false;
if (m_pRanges && m_nOutputs > old_outputs) {
m_pRanges = FX_Realloc(FX_FLOAT, m_pRanges, m_nOutputs * 2);
if (m_pRanges) {
@@ -811,15 +811,15 @@ FX_BOOL CPDF_Function::Init(CPDF_Object* pObj) {
sizeof(FX_FLOAT) * (m_nOutputs - old_outputs) * 2);
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_Function::Call(FX_FLOAT* inputs,
- uint32_t ninputs,
- FX_FLOAT* results,
- int& nresults) const {
+bool CPDF_Function::Call(FX_FLOAT* inputs,
+ uint32_t ninputs,
+ FX_FLOAT* results,
+ int& nresults) const {
if (m_nInputs != ninputs) {
- return FALSE;
+ return false;
}
nresults = m_nOutputs;
for (uint32_t i = 0; i < m_nInputs; i++) {
@@ -837,7 +837,7 @@ FX_BOOL CPDF_Function::Call(FX_FLOAT* inputs,
results[i] = m_pRanges[i * 2 + 1];
}
}
- return TRUE;
+ return true;
}
const CPDF_SampledFunc* CPDF_Function::ToSampledFunc() const {
diff --git a/core/fpdfapi/page/fpdf_page_parser_old.cpp b/core/fpdfapi/page/fpdf_page_parser_old.cpp
index ccee12dd03..0d1db43825 100644
--- a/core/fpdfapi/page/fpdf_page_parser_old.cpp
+++ b/core/fpdfapi/page/fpdf_page_parser_old.cpp
@@ -96,11 +96,11 @@ uint32_t PDF_DecodeInlineStream(const uint8_t* src_buf,
return HexDecode(src_buf, limit, dest_buf, dest_size);
}
if (decoder == "FlateDecode" || decoder == "Fl") {
- return FPDFAPI_FlateOrLZWDecode(FALSE, src_buf, limit, pParam, dest_size,
+ return FPDFAPI_FlateOrLZWDecode(false, src_buf, limit, pParam, dest_size,
dest_buf, dest_size);
}
if (decoder == "LZWDecode" || decoder == "LZW") {
- return FPDFAPI_FlateOrLZWDecode(TRUE, src_buf, limit, pParam, 0, dest_buf,
+ return FPDFAPI_FlateOrLZWDecode(true, src_buf, limit, pParam, 0, dest_buf,
dest_size);
}
if (decoder == "DCTDecode" || decoder == "DCT") {
@@ -317,7 +317,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement() {
if (m_WordSize == 4) {
if (memcmp(m_WordBuffer, "true", 4) == 0) {
- m_pLastObj = new CPDF_Boolean(TRUE);
+ m_pLastObj = new CPDF_Boolean(true);
return Others;
}
if (memcmp(m_WordBuffer, "null", 4) == 0) {
@@ -326,7 +326,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement() {
}
} else if (m_WordSize == 5) {
if (memcmp(m_WordBuffer, "false", 5) == 0) {
- m_pLastObj = new CPDF_Boolean(FALSE);
+ m_pLastObj = new CPDF_Boolean(false);
return Others;
}
}
@@ -360,12 +360,12 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(bool bAllowNestedArray,
if (first_char == '(') {
CFX_ByteString str = ReadString();
- return new CPDF_String(m_pPool ? m_pPool->Intern(str) : str, FALSE);
+ return new CPDF_String(m_pPool ? m_pPool->Intern(str) : str, false);
}
if (first_char == '<') {
if (m_WordSize == 1)
- return new CPDF_String(ReadHexString(), TRUE);
+ return new CPDF_String(ReadHexString(), true);
CPDF_Dictionary* pDict = new CPDF_Dictionary(m_pPool);
while (1) {
@@ -415,11 +415,11 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(bool bAllowNestedArray,
}
if (m_WordSize == 5 && !memcmp(m_WordBuffer, "false", 5))
- return new CPDF_Boolean(FALSE);
+ return new CPDF_Boolean(false);
if (m_WordSize == 4) {
if (memcmp(m_WordBuffer, "true", 4) == 0)
- return new CPDF_Boolean(TRUE);
+ return new CPDF_Boolean(true);
if (memcmp(m_WordBuffer, "null", 4) == 0)
return new CPDF_Null;
@@ -679,7 +679,7 @@ void CPDF_ContentParser::Start(CPDF_Page* pPage) {
if (CPDF_Stream* pStream = pContent->AsStream()) {
m_nStreams = 0;
m_pSingleStream.reset(new CPDF_StreamAcc);
- m_pSingleStream->LoadAllData(pStream, FALSE);
+ m_pSingleStream->LoadAllData(pStream, false);
} else if (CPDF_Array* pArray = pContent->AsArray()) {
m_nStreams = pArray->GetCount();
if (m_nStreams)
@@ -728,7 +728,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm,
m_pParser->GetCurStates()->m_ParentMatrix = form_matrix;
if (ClipPath) {
m_pParser->GetCurStates()->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING,
- TRUE);
+ true);
}
if (pForm->m_Transparency & PDFTRANS_GROUP) {
CPDF_GeneralState* pState = &m_pParser->GetCurStates()->m_GeneralState;
@@ -739,7 +739,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm,
}
m_nStreams = 0;
m_pSingleStream.reset(new CPDF_StreamAcc);
- m_pSingleStream->LoadAllData(pForm->m_pFormStream, FALSE);
+ m_pSingleStream->LoadAllData(pForm->m_pFormStream, false);
m_pData = (uint8_t*)m_pSingleStream->GetData();
m_Size = m_pSingleStream->GetSize();
m_Status = ToBeContinued;
@@ -783,7 +783,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause) {
m_StreamArray[m_CurrentOffset].reset(new CPDF_StreamAcc);
CPDF_Stream* pStreamObj = ToStream(
pContent ? pContent->GetDirectObjectAt(m_CurrentOffset) : nullptr);
- m_StreamArray[m_CurrentOffset]->LoadAllData(pStreamObj, FALSE);
+ m_StreamArray[m_CurrentOffset]->LoadAllData(pStreamObj, false);
m_CurrentOffset++;
}
}
diff --git a/core/fpdfapi/page/pageint.h b/core/fpdfapi/page/pageint.h
index d70ecf1a6e..a96216bbb6 100644
--- a/core/fpdfapi/page/pageint.h
+++ b/core/fpdfapi/page/pageint.h
@@ -133,10 +133,10 @@ class CPDF_Function {
static Type IntegerToFunctionType(int iType);
virtual ~CPDF_Function();
- FX_BOOL Call(FX_FLOAT* inputs,
- uint32_t ninputs,
- FX_FLOAT* results,
- int& nresults) const;
+ bool Call(FX_FLOAT* inputs,
+ uint32_t ninputs,
+ FX_FLOAT* results,
+ int& nresults) const;
uint32_t CountInputs() const { return m_nInputs; }
uint32_t CountOutputs() const { return m_nOutputs; }
FX_FLOAT GetDomain(int i) const { return m_pDomains[i]; }
@@ -149,9 +149,9 @@ class CPDF_Function {
protected:
explicit CPDF_Function(Type type);
- FX_BOOL Init(CPDF_Object* pObj);
- virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0;
- virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0;
+ bool Init(CPDF_Object* pObj);
+ virtual bool v_Init(CPDF_Object* pObj) = 0;
+ virtual bool v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0;
uint32_t m_nInputs;
uint32_t m_nOutputs;
@@ -166,8 +166,8 @@ class CPDF_ExpIntFunc : public CPDF_Function {
~CPDF_ExpIntFunc() override;
// CPDF_Function
- FX_BOOL v_Init(CPDF_Object* pObj) override;
- FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
+ bool v_Init(CPDF_Object* pObj) override;
+ bool v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
uint32_t m_nOrigOutputs;
FX_FLOAT m_Exponent;
@@ -192,8 +192,8 @@ class CPDF_SampledFunc : public CPDF_Function {
~CPDF_SampledFunc() override;
// CPDF_Function
- FX_BOOL v_Init(CPDF_Object* pObj) override;
- FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
+ bool v_Init(CPDF_Object* pObj) override;
+ bool v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
const std::vector<SampleEncodeInfo>& GetEncodeInfo() const {
return m_EncodeInfo;
@@ -217,8 +217,8 @@ class CPDF_StitchFunc : public CPDF_Function {
~CPDF_StitchFunc() override;
// CPDF_Function
- FX_BOOL v_Init(CPDF_Object* pObj) override;
- FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
+ bool v_Init(CPDF_Object* pObj) override;
+ bool v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
const std::vector<std::unique_ptr<CPDF_Function>>& GetSubFunctions() const {
return m_pSubFunctions;
@@ -249,41 +249,41 @@ class CPDF_DeviceCS : public CPDF_ColorSpace {
public:
CPDF_DeviceCS(CPDF_Document* pDoc, int family);
- FX_BOOL GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const override;
- FX_BOOL SetRGB(FX_FLOAT* pBuf,
- FX_FLOAT R,
- FX_FLOAT G,
- FX_FLOAT B) const override;
- FX_BOOL v_GetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT& c,
- FX_FLOAT& m,
- FX_FLOAT& y,
- FX_FLOAT& k) const override;
- FX_BOOL v_SetCMYK(FX_FLOAT* pBuf,
- FX_FLOAT c,
- FX_FLOAT m,
- FX_FLOAT y,
- FX_FLOAT k) const override;
+ bool GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const override;
+ bool SetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT R,
+ FX_FLOAT G,
+ FX_FLOAT B) const override;
+ bool v_GetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT& c,
+ FX_FLOAT& m,
+ FX_FLOAT& y,
+ FX_FLOAT& k) const override;
+ bool v_SetCMYK(FX_FLOAT* pBuf,
+ FX_FLOAT c,
+ FX_FLOAT m,
+ FX_FLOAT y,
+ FX_FLOAT k) const override;
void TranslateImageLine(uint8_t* pDestBuf,
const uint8_t* pSrcBuf,
int pixels,
int image_width,
int image_height,
- FX_BOOL bTransMask = FALSE) const override;
+ bool bTransMask = false) const override;
};
class CPDF_PatternCS : public CPDF_ColorSpace {
public:
explicit CPDF_PatternCS(CPDF_Document* pDoc);
~CPDF_PatternCS() override;
- FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- FX_BOOL GetRGB(FX_FLOAT* pBuf,
- FX_FLOAT& R,
- FX_FLOAT& G,
- FX_FLOAT& B) const override;
+ bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ bool GetRGB(FX_FLOAT* pBuf,
+ FX_FLOAT& R,
+ FX_FLOAT& G,
+ FX_FLOAT& B) const override;
CPDF_ColorSpace* GetBaseCS() const override;
private: