summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_interform.cpp
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/fpdfdoc/cpdf_interform.cpp
parent3b3ce1a242f8445848d3f23d6c35ba01d7c645f4 (diff)
downloadpdfium-12f3e4a58f05850b93af35619cb04f0231d86acc.tar.xz
Remove FX_BOOL from core
Review-Url: https://codereview.chromium.org/2477443002
Diffstat (limited to 'core/fpdfdoc/cpdf_interform.cpp')
-rw-r--r--core/fpdfdoc/cpdf_interform.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index b8b4b68e29..f709c57961 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -163,19 +163,19 @@ CPDF_Font* GetNativeFont(CPDF_Dictionary* pFormDict,
return nullptr;
}
-FX_BOOL FindFont(CPDF_Dictionary* pFormDict,
- const CPDF_Font* pFont,
- CFX_ByteString& csNameTag) {
+bool FindFont(CPDF_Dictionary* pFormDict,
+ const CPDF_Font* pFont,
+ CFX_ByteString& csNameTag) {
if (!pFormDict || !pFont)
- return FALSE;
+ return false;
CPDF_Dictionary* pDR = pFormDict->GetDictFor("DR");
if (!pDR)
- return FALSE;
+ return false;
CPDF_Dictionary* pFonts = pDR->GetDictFor("Font");
if (!pFonts)
- return FALSE;
+ return false;
for (const auto& it : *pFonts) {
const CFX_ByteString& csKey = it.first;
@@ -190,27 +190,27 @@ FX_BOOL FindFont(CPDF_Dictionary* pFormDict,
continue;
if (pFont->GetFontDict() == pElement) {
csNameTag = csKey;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL FindFont(CPDF_Dictionary* pFormDict,
- CPDF_Document* pDocument,
- CFX_ByteString csFontName,
- CPDF_Font*& pFont,
- CFX_ByteString& csNameTag) {
+bool FindFont(CPDF_Dictionary* pFormDict,
+ CPDF_Document* pDocument,
+ CFX_ByteString csFontName,
+ CPDF_Font*& pFont,
+ CFX_ByteString& csNameTag) {
if (!pFormDict)
- return FALSE;
+ return false;
CPDF_Dictionary* pDR = pFormDict->GetDictFor("DR");
if (!pDR)
- return FALSE;
+ return false;
CPDF_Dictionary* pFonts = pDR->GetDictFor("Font");
if (!pFonts)
- return FALSE;
+ return false;
if (csFontName.GetLength() > 0)
csFontName.Remove(' ');
@@ -235,10 +235,10 @@ FX_BOOL FindFont(CPDF_Dictionary* pFormDict,
csBaseFont.Remove(' ');
if (csBaseFont == csFontName) {
csNameTag = csKey;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void AddFont(CPDF_Dictionary*& pFormDict,
@@ -329,7 +329,7 @@ class CFieldNameExtractor {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
typedef struct {
- FX_BOOL bFind;
+ bool bFind;
LOGFONTA lf;
} PDF_FONTDATA;
@@ -342,11 +342,11 @@ static int CALLBACK EnumFontFamExProc(ENUMLOGFONTEXA* lpelfe,
PDF_FONTDATA* pData = (PDF_FONTDATA*)lParam;
memcpy(&pData->lf, &lpelfe->elfLogFont, sizeof(LOGFONTA));
- pData->bFind = TRUE;
+ pData->bFind = true;
return 0;
}
-FX_BOOL RetrieveSpecificFont(LOGFONTA& lf) {
+bool RetrieveSpecificFont(LOGFONTA& lf) {
PDF_FONTDATA fd;
memset(&fd, 0, sizeof(PDF_FONTDATA));
HDC hDC = ::GetDC(nullptr);
@@ -359,10 +359,10 @@ FX_BOOL RetrieveSpecificFont(LOGFONTA& lf) {
return fd.bFind;
}
-FX_BOOL RetrieveSpecificFont(uint8_t charSet,
- uint8_t pitchAndFamily,
- LPCSTR pcsFontName,
- LOGFONTA& lf) {
+bool RetrieveSpecificFont(uint8_t charSet,
+ uint8_t pitchAndFamily,
+ LPCSTR pcsFontName,
+ LOGFONTA& lf) {
memset(&lf, 0, sizeof(LOGFONTA));
lf.lfCharSet = charSet;
lf.lfPitchAndFamily = pitchAndFamily;
@@ -730,7 +730,7 @@ CFX_ByteString CPDF_InterForm::GenerateNewResourceName(
int num = 0;
CFX_ByteString bsNum;
- while (TRUE) {
+ while (true) {
CFX_ByteString csKey = csTmp + bsNum;
if (!pDict->KeyExist(csKey))
return csKey;
@@ -764,7 +764,7 @@ CFX_ByteString CPDF_InterForm::GetNativeFont(uint8_t charSet, void* pLogFont) {
csFontName = "Helvetica";
return csFontName;
}
- FX_BOOL bRet = FALSE;
+ bool bRet = false;
if (charSet == FXFONT_SHIFTJIS_CHARSET) {
bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE,
"MS Mincho", lf);
@@ -809,7 +809,7 @@ CPDF_Font* CPDF_InterForm::AddNativeFont(uint8_t charSet,
if (!csFontName.IsEmpty()) {
if (csFontName == "Helvetica")
return AddStandardFont(pDocument, csFontName);
- return pDocument->AddWindowsFont(&lf, FALSE, TRUE);
+ return pDocument->AddWindowsFont(&lf, false, true);
}
#endif
return nullptr;
@@ -940,7 +940,7 @@ CPDF_FormControl* CPDF_InterForm::GetControlByDict(
return it != m_ControlMap.end() ? it->second : nullptr;
}
-FX_BOOL CPDF_InterForm::NeedConstructAP() const {
+bool CPDF_InterForm::NeedConstructAP() const {
return m_pFormDict && m_pFormDict->GetBooleanFor("NeedAppearances");
}
@@ -1061,7 +1061,7 @@ void CPDF_InterForm::LoadField(CPDF_Dictionary* pFieldDict, int nLevel) {
}
}
-FX_BOOL CPDF_InterForm::HasXFAForm() const {
+bool CPDF_InterForm::HasXFAForm() const {
return m_pFormDict && m_pFormDict->GetArrayFor("XFA");
}
@@ -1241,7 +1241,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(
pFieldDict->SetFor("T", new CPDF_String(fullname));
if (pField->GetType() == CPDF_FormField::CheckBox ||
pField->GetType() == CPDF_FormField::RadioButton) {
- CFX_WideString csExport = pField->GetCheckValue(FALSE);
+ CFX_WideString csExport = pField->GetCheckValue(false);
CFX_ByteString csBExport = PDF_EncodeText(csExport);
CPDF_Object* pOpt = FPDF_GetFieldAttr(pField->m_pDict, "Opt");
if (pOpt)
@@ -1261,7 +1261,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(
void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict,
const CFX_WideString& parent_name,
- FX_BOOL bNotify,
+ bool bNotify,
int nLevel) {
CFX_WideString name;
if (!parent_name.IsEmpty())