diff options
author | jaepark <jaepark@google.com> | 2016-07-29 18:17:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-29 18:17:45 -0700 |
commit | 9c987e9d233c855951db2611433b9cbc4f1b648f (patch) | |
tree | 81a2a615d56705ff10fd979d3b795268f241d6f7 /core/fpdfdoc/cpvt_generateap.cpp | |
parent | 3e454bfb00089eb022ee0b09e1631dbd61e324c4 (diff) | |
download | pdfium-9c987e9d233c855951db2611433b9cbc4f1b648f.tar.xz |
Use bool instead of FX_BOOL as return values in CPVT_GenerateAP.
Review-Url: https://codereview.chromium.org/2196903002
Diffstat (limited to 'core/fpdfdoc/cpvt_generateap.cpp')
-rw-r--r-- | core/fpdfdoc/cpvt_generateap.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index 7eb6188c94..fa69609e0e 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -20,14 +20,14 @@ namespace { -FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict, - const int32_t& nWidgetType) { +bool GenerateWidgetAP(CPDF_Document* pDoc, + CPDF_Dictionary* pAnnotDict, + const int32_t& nWidgetType) { CPDF_Dictionary* pFormDict = nullptr; if (CPDF_Dictionary* pRootDict = pDoc->GetRoot()) pFormDict = pRootDict->GetDictBy("AcroForm"); if (!pFormDict) - return FALSE; + return false; CFX_ByteString DA; if (CPDF_Object* pDAObj = FPDF_GetFieldAttr(pAnnotDict, "DA")) @@ -35,14 +35,14 @@ FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, if (DA.IsEmpty()) DA = pFormDict->GetStringBy("DA"); if (DA.IsEmpty()) - return FALSE; + return false; CPDF_SimpleParser syntax(DA.AsStringC()); syntax.FindTagParamFromStart("Tf", 2); CFX_ByteString sFontName(syntax.GetWord()); sFontName = PDF_NameDecode(sFontName); if (sFontName.IsEmpty()) - return FALSE; + return false; FX_FLOAT fFontSize = FX_atof(syntax.GetWord()); CPVT_Color crText = CPVT_Color::ParseColor(DA); @@ -64,7 +64,7 @@ FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, } } if (!pDRFontDict) - return FALSE; + return false; if (!pFontDict) { pFontDict = new CPDF_Dictionary; @@ -77,7 +77,7 @@ FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, } CPDF_Font* pDefFont = pDoc->LoadFont(pFontDict); if (!pDefFont) - return FALSE; + return false; CFX_FloatRect rcAnnot = pAnnotDict->GetRectBy("Rect"); int32_t nRotate = 0; @@ -440,15 +440,15 @@ FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, } } } - return TRUE; + return true; } } // namespace -FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) { - if (!pAnnotDict || pAnnotDict->GetStringBy("Subtype") != "Widget") { - return FALSE; - } +bool FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) { + if (!pAnnotDict || pAnnotDict->GetStringBy("Subtype") != "Widget") + return false; + CFX_ByteString field_type = FPDF_GetFieldAttr(pAnnotDict, "FT")->GetString(); uint32_t flags = FPDF_GetFieldAttr(pAnnotDict, "Ff") ? FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger() @@ -472,25 +472,25 @@ FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) { } } } - return FALSE; + return false; } // Static. -FX_BOOL CPVT_GenerateAP::GenerateTextFieldAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict) { - return GenerateWidgetAP(pDoc, pAnnotDict, 0); +bool CPVT_GenerateAP::GenerateComboBoxAP(CPDF_Document* pDoc, + CPDF_Dictionary* pAnnotDict) { + return GenerateWidgetAP(pDoc, pAnnotDict, 1); } // Static. -FX_BOOL CPVT_GenerateAP::GenerateComboBoxAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict) { - return GenerateWidgetAP(pDoc, pAnnotDict, 1); +bool CPVT_GenerateAP::GenerateListBoxAP(CPDF_Document* pDoc, + CPDF_Dictionary* pAnnotDict) { + return GenerateWidgetAP(pDoc, pAnnotDict, 2); } // Static. -FX_BOOL CPVT_GenerateAP::GenerateListBoxAP(CPDF_Document* pDoc, - CPDF_Dictionary* pAnnotDict) { - return GenerateWidgetAP(pDoc, pAnnotDict, 2); +bool CPVT_GenerateAP::GenerateTextFieldAP(CPDF_Document* pDoc, + CPDF_Dictionary* pAnnotDict) { + return GenerateWidgetAP(pDoc, pAnnotDict, 0); } // Static. |