diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:36:00 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:36:00 -0700 |
commit | f1e7c461dfabbff6b65a072f24f6711b34159361 (patch) | |
tree | 3b0bb772a59669f06b86824a444fd06642592d4b /core/src/fpdfdoc | |
parent | 320b2313d19869333ed453af546e61a9fc2b81c9 (diff) | |
download | pdfium-f1e7c461dfabbff6b65a072f24f6711b34159361.tar.xz |
Revert "FX_BOOL considered harmful, part 2."
This reverts commit 320b2313d19869333ed453af546e61a9fc2b81c9.
Reason for revert: build failure.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1255693002 .
Diffstat (limited to 'core/src/fpdfdoc')
-rw-r--r-- | core/src/fpdfdoc/doc_action.cpp | 4 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_annot.cpp | 32 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_ap.cpp | 96 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_basic.cpp | 20 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_form.cpp | 164 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_formcontrol.cpp | 36 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_formfield.cpp | 200 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_metadata.cpp | 2 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_ocg.cpp | 72 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_tagged.cpp | 36 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_utils.cpp | 54 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_utils.h | 8 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_viewerPreferences.cpp | 8 | ||||
-rw-r--r-- | core/src/fpdfdoc/doc_vt.cpp | 290 | ||||
-rw-r--r-- | core/src/fpdfdoc/pdf_vt.h | 72 | ||||
-rw-r--r-- | core/src/fpdfdoc/tagged_int.h | 14 |
16 files changed, 554 insertions, 554 deletions
diff --git a/core/src/fpdfdoc/doc_action.cpp b/core/src/fpdfdoc/doc_action.cpp index e7a339ce36..851b2d6709 100644 --- a/core/src/fpdfdoc/doc_action.cpp +++ b/core/src/fpdfdoc/doc_action.cpp @@ -289,10 +289,10 @@ const FX_CHAR* g_sAATypes[] = {"E", "X", "D", "U", "Fo", "Bl", "PO", "PC", "PV", "WC", "WS", "DS", "WP", "DP", "" }; -bool CPDF_AAction::ActionExist(AActionType eType) const +FX_BOOL CPDF_AAction::ActionExist(AActionType eType) const { if (m_pDict == NULL) { - return false; + return FALSE; } return m_pDict->KeyExist(g_sAATypes[(int)eType]); } diff --git a/core/src/fpdfdoc/doc_annot.cpp b/core/src/fpdfdoc/doc_annot.cpp index 5430079abc..0a746190c0 100644 --- a/core/src/fpdfdoc/doc_annot.cpp +++ b/core/src/fpdfdoc/doc_annot.cpp @@ -22,7 +22,7 @@ CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage) } CPDF_Dictionary* pRoot = m_pDocument->GetRoot(); CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm"); - bool bRegenerateAP = pAcroForm && pAcroForm->GetBoolean("NeedAppearances"); + FX_BOOL bRegenerateAP = pAcroForm && pAcroForm->GetBoolean("NeedAppearances"); for (FX_DWORD i = 0; i < pAnnots->GetCount(); ++i) { CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementValue(i); if (pDict == NULL || pDict->GetType() != PDFOBJ_DICTIONARY) { @@ -55,12 +55,12 @@ CPDF_AnnotList::~CPDF_AnnotList() } } void CPDF_AnnotList::DisplayPass(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, - CPDF_RenderContext* pContext, bool bPrinting, CFX_AffineMatrix* pMatrix, - bool bWidgetPass, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect) + CPDF_RenderContext* pContext, FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, + FX_BOOL bWidgetPass, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect) { for (int i = 0; i < m_AnnotList.GetSize(); ++i) { CPDF_Annot* pAnnot = (CPDF_Annot*)m_AnnotList[i]; - bool bWidget = pAnnot->GetSubType() == "Widget"; + FX_BOOL bWidget = pAnnot->GetSubType() == "Widget"; if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget)) { continue; } @@ -103,24 +103,24 @@ void CPDF_AnnotList::DisplayPass(const CPDF_Page* pPage, CFX_RenderDevice* pDevi } void CPDF_AnnotList::DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, CFX_AffineMatrix* pUser2Device, - bool bShowWidget, CPDF_RenderOptions* pOptions) + FX_BOOL bShowWidget, CPDF_RenderOptions* pOptions) { FX_RECT clip_rect; if (pDevice) { clip_rect = pDevice->GetClipBox(); } - bool bPrinting = pDevice->GetDeviceClass() == FXDC_PRINTER || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW)); + FX_BOOL bPrinting = pDevice->GetDeviceClass() == FXDC_PRINTER || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW)); DisplayAnnots(pPage, pDevice, NULL, bPrinting, pUser2Device, bShowWidget ? 3 : 1, pOptions, &clip_rect); } void CPDF_AnnotList::DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, CPDF_RenderContext* pContext, - bool bPrinting, CFX_AffineMatrix* pUser2Device, FX_DWORD dwAnnotFlags, + FX_BOOL bPrinting, CFX_AffineMatrix* pUser2Device, FX_DWORD dwAnnotFlags, CPDF_RenderOptions* pOptions, FX_RECT* pClipRect) { if (dwAnnotFlags & 0x01) { - DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, false, pOptions, pClipRect); + DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, FALSE, pOptions, pClipRect); } if (dwAnnotFlags & 0x02) { - DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, true, pOptions, pClipRect); + DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, TRUE, pOptions, pClipRect); } } int CPDF_AnnotList::GetIndex(CPDF_Annot* pAnnot) @@ -246,28 +246,28 @@ static CPDF_Form* FPDFDOC_Annot_GetMatrix(const CPDF_Page* pPage, CPDF_Annot* pA matrix.Concat(*pUser2Device); return pForm; } -bool CPDF_Annot::DrawAppearance(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device, +FX_BOOL CPDF_Annot::DrawAppearance(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device, AppearanceMode mode, const CPDF_RenderOptions* pOptions) { CFX_Matrix matrix; CPDF_Form* pForm = FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix); if (!pForm) { - return false; + return FALSE; } CPDF_RenderContext context; context.Create((CPDF_Page*)pPage); context.DrawObjectList(pDevice, pForm, &matrix, pOptions); - return true; + return TRUE; } -bool CPDF_Annot::DrawInContext(const CPDF_Page* pPage, const CPDF_RenderContext* pContext, const CFX_AffineMatrix* pUser2Device, AppearanceMode mode) +FX_BOOL CPDF_Annot::DrawInContext(const CPDF_Page* pPage, const CPDF_RenderContext* pContext, const CFX_AffineMatrix* pUser2Device, AppearanceMode mode) { CFX_Matrix matrix; CPDF_Form* pForm = FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix); if (!pForm) { - return false; + return FALSE; } ((CPDF_RenderContext*)pContext)->AppendObjectList(pForm, &matrix); - return true; + return TRUE; } void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device, const CPDF_RenderOptions* pOptions) { @@ -278,7 +278,7 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CFX_AffineMatrix* p if (annot_flags & ANNOTFLAG_HIDDEN) { return; } - bool bPrinting = pDevice->GetDeviceClass() == FXDC_PRINTER || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW)); + FX_BOOL bPrinting = pDevice->GetDeviceClass() == FXDC_PRINTER || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW)); if (bPrinting && (annot_flags & ANNOTFLAG_PRINT) == 0) { return; } diff --git a/core/src/fpdfdoc/doc_ap.cpp b/core/src/fpdfdoc/doc_ap.cpp index 4f3f178007..f94a4d60e0 100644 --- a/core/src/fpdfdoc/doc_ap.cpp +++ b/core/src/fpdfdoc/doc_ap.cpp @@ -8,10 +8,10 @@ #include "../../include/fpdfdoc/fpdf_vt.h" #include "pdf_vt.h" #include "../../include/fpdfdoc/fpdf_ap.h" -bool FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) +FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) { if (!pAnnotDict || pAnnotDict->GetConstString("Subtype") != FX_BSTRC("Widget")) { - return false; + return FALSE; } CFX_ByteString field_type = FPDF_GetFieldAttr(pAnnotDict, "FT")->GetString(); FX_DWORD flags = FPDF_GetFieldAttr(pAnnotDict, "Ff")? FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger() : 0; @@ -34,7 +34,7 @@ bool FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) } } } - return false; + return FALSE; } class CPVT_FontMap : public IPVT_FontMap { @@ -154,12 +154,12 @@ int32_t CPVT_Provider::GetWordFontIndex(FX_WORD word, int32_t charset, int32_t n } return -1; } -bool CPVT_Provider::IsLatinWord(FX_WORD word) +FX_BOOL CPVT_Provider::IsLatinWord(FX_WORD word) { if ((word >= 0x61 && word <= 0x7A) || (word >= 0x41 && word <= 0x5A) || word == 0x2D || word == 0x27) { - return true; + return TRUE; } - return false; + return FALSE; } int32_t CPVT_Provider::GetDefaultFontIndex() { @@ -244,14 +244,14 @@ static CPVT_Color ParseColor(const CPDF_Array & array) } return rt; } -static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, const int32_t & nWidgetType) +static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, const int32_t & nWidgetType) { CPDF_Dictionary* pFormDict = NULL; if (CPDF_Dictionary * pRootDict = pDoc->GetRoot()) { pFormDict = pRootDict->GetDict("AcroForm"); } if (!pFormDict) { - return false; + return FALSE; } CFX_ByteString DA; if (CPDF_Object* pDAObj = FPDF_GetFieldAttr(pAnnotDict, "DA")) { @@ -261,23 +261,23 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c DA = pFormDict->GetString("DA"); } if (DA.IsEmpty()) { - return false; + return FALSE; } CPDF_SimpleParser syntax(DA); syntax.FindTagParam("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 = ParseColor(DA); - bool bUseFormRes = false; + FX_BOOL bUseFormRes = FALSE; CPDF_Dictionary * pFontDict = NULL; CPDF_Dictionary* pDRDict = pAnnotDict->GetDict(FX_BSTRC("DR")); if (pDRDict == NULL) { pDRDict = pFormDict->GetDict(FX_BSTRC("DR")); - bUseFormRes = true; + bUseFormRes = TRUE; } CPDF_Dictionary * pDRFontDict = NULL; if (pDRDict && (pDRFontDict = pDRDict->GetDict("Font"))) { @@ -291,12 +291,12 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c } } if (!pDRFontDict) { - return false; + return FALSE; } if (!pFontDict) { pFontDict = CPDF_Dictionary::Create(); if (pFontDict == NULL) { - return false; + return FALSE; } pFontDict->SetAtName(FX_BSTRC("Type"), "Font"); pFontDict->SetAtName(FX_BSTRC("Subtype"), "Type1"); @@ -307,7 +307,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c } CPDF_Font* pDefFont = pDoc->LoadFont(pFontDict); if (!pDefFont) { - return false; + return FALSE; } CPDF_Rect rcAnnot = pAnnotDict->GetRect("Rect"); int32_t nRotate = 0; @@ -378,7 +378,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c } } CFX_ByteTextBuf sAppStream; - CFX_ByteString sBG = CPVT_GenerateAP::GenerateColorAP(crBG, true); + CFX_ByteString sBG = CPVT_GenerateAP::GenerateColorAP(crBG, TRUE); if (sBG.GetLength() > 0) { sAppStream << "q\n" << sBG << rcBBox.left << " " << rcBBox.bottom << " " << rcBBox.Width() << " " << rcBBox.Height() << " re f\n" << "Q\n"; @@ -395,7 +395,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c if (pAPDict == NULL) { pAPDict = CPDF_Dictionary::Create(); if (pAPDict == NULL) { - return false; + return FALSE; } pAnnotDict->SetAt("AP", pAPDict); } @@ -403,7 +403,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c if (pNormalStream == NULL) { pNormalStream = CPDF_Stream::Create(NULL, 0, NULL); if (pNormalStream == NULL) { - return false; + return FALSE; } int32_t objnum = pDoc->AddIndirectObject(pNormalStream); pAnnotDict->GetDict("AP")->SetAtReference("N", pDoc, objnum); @@ -418,7 +418,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c if (!pStreamResFontList) { pStreamResFontList = CPDF_Dictionary::Create(); if (pStreamResFontList == NULL) { - return false; + return FALSE; } pStreamResList->SetAt("Font", pStreamResFontList); } @@ -443,21 +443,21 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c vt.SetPlateRect(rcBody); vt.SetAlignment(nAlign); if (IsFloatZero(fFontSize)) { - vt.SetAutoFontSize(true); + vt.SetAutoFontSize(TRUE); } else { vt.SetFontSize(fFontSize); } - bool bMultiLine = (dwFlags >> 12) & 1; + FX_BOOL bMultiLine = (dwFlags >> 12) & 1; if (bMultiLine) { - vt.SetMultiLine(true); - vt.SetAutoReturn(true); + vt.SetMultiLine(TRUE); + vt.SetAutoReturn(TRUE); } FX_WORD subWord = 0; if ((dwFlags >> 13) & 1) { subWord = '*'; vt.SetPasswordChar(subWord); } - bool bCharArray = (dwFlags >> 24) & 1; + FX_BOOL bCharArray = (dwFlags >> 24) & 1; if (bCharArray) { vt.SetCharArray(dwMaxLen); } else { @@ -479,7 +479,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c sAppStream << rcBody.left << " " << rcBody.bottom << " " << rcBody.Width() << " " << rcBody.Height() << " re\nW\nn\n"; } - sAppStream << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, true) << sBody << "ET\n" << "Q\nEMC\n"; + sAppStream << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << sBody << "ET\n" << "Q\nEMC\n"; } } break; @@ -497,7 +497,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c rcEdit.Normalize(); vt.SetPlateRect(rcEdit); if (IsFloatZero(fFontSize)) { - vt.SetAutoFontSize(true); + vt.SetAutoFontSize(TRUE); } else { vt.SetFontSize(fFontSize); } @@ -506,14 +506,14 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c vt.RearrangeAll(); CPDF_Rect rcContent = vt.GetContentRect(); CPDF_Point ptOffset = CPDF_Point(0.0f, (rcContent.Height() - rcEdit.Height()) / 2.0f); - CFX_ByteString sEdit = CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), ptOffset, true, 0); + CFX_ByteString sEdit = CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), ptOffset, TRUE, 0); if (sEdit.GetLength() > 0) { sAppStream << "/Tx BMC\n" << "q\n"; sAppStream << rcEdit.left << " " << rcEdit.bottom << " " << rcEdit.Width() << " " << rcEdit.Height() << " re\nW\nn\n"; - sAppStream << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, true) << sEdit << "ET\n" << "Q\nEMC\n"; + sAppStream << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << sEdit << "ET\n" << "Q\nEMC\n"; } - CFX_ByteString sButton = CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_RGB, 220.0f / 255.0f, 220.0f / 255.0f, 220.0f / 255.0f), true); + CFX_ByteString sButton = CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_RGB, 220.0f / 255.0f, 220.0f / 255.0f, 220.0f / 255.0f), TRUE); if (sButton.GetLength() > 0 && !rcButton.IsEmpty()) { sAppStream << "q\n" << sButton; sAppStream << rcButton.left << " " << rcButton.bottom << " " @@ -555,11 +555,11 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c } else if (pOpt->GetType() == PDFOBJ_ARRAY) { swItem = ((CPDF_Array*)pOpt)->GetElementValue(1)->GetUnicodeText(); } - bool bSelected = false; + FX_BOOL bSelected = FALSE; if (pSels) { for (FX_DWORD s = 0, ssz = pSels->GetCount(); s < ssz; s++) { if (i == pSels->GetInteger(s)) { - bSelected = true; + bSelected = TRUE; break; } } @@ -578,11 +578,11 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c FX_FLOAT fItemHeight = vt.GetContentRect().Height(); if (bSelected) { CPDF_Rect rcItem = CPDF_Rect(rcBody.left, fy - fItemHeight, rcBody.right, fy); - sBody << "q\n" << CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_RGB, 0, 51.0f / 255.0f, 113.0f / 255.0f), true) + sBody << "q\n" << CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_RGB, 0, 51.0f / 255.0f, 113.0f / 255.0f), TRUE) << rcItem.left << " " << rcItem.bottom << " " << rcItem.Width() << " " << rcItem.Height() << " re f\n" << "Q\n"; - sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_GRAY, 1), true) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), CPDF_Point(0.0f, fy), true, 0) << "ET\n"; + sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_GRAY, 1), TRUE) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), CPDF_Point(0.0f, fy), TRUE, 0) << "ET\n"; } else { - sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, true) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), CPDF_Point(0.0f, fy), true, 0) << "ET\n"; + sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), CPDF_Point(0.0f, fy), TRUE, 0) << "ET\n"; } fy -= fItemHeight; } @@ -598,7 +598,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c break; } if (pNormalStream) { - pNormalStream->SetData((uint8_t*)sAppStream.GetBuffer(), sAppStream.GetSize(), false, false); + pNormalStream->SetData((uint8_t*)sAppStream.GetBuffer(), sAppStream.GetSize(), FALSE, FALSE); pStreamDict = pNormalStream->GetDict(); if (pStreamDict) { pStreamDict->SetAtMatrix("Matrix", matrix); @@ -609,7 +609,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c if (!pStreamResFontList) { pStreamResFontList = CPDF_Dictionary::Create(); if (pStreamResFontList == NULL) { - return false; + return FALSE; } pStreamResList->SetAt("Font", pStreamResFontList); } @@ -622,21 +622,21 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c } } } - return true; + return TRUE; } -bool CPVT_GenerateAP::GenerateTextFieldAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) +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) +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) +FX_BOOL CPVT_GenerateAP::GenerateListBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) { return GenerateWidgetAP(pDoc, pAnnotDict, 2); } -CFX_ByteString CPVT_GenerateAP::GenerateEditAP(IPVT_FontMap * pFontMap, IPDF_VariableText_Iterator* pIterator, const CPDF_Point & ptOffset, bool bContinuous, FX_WORD SubWord, const CPVT_WordRange * pVisible) +CFX_ByteString CPVT_GenerateAP::GenerateEditAP(IPVT_FontMap * pFontMap, IPDF_VariableText_Iterator* pIterator, const CPDF_Point & ptOffset, FX_BOOL bContinuous, FX_WORD SubWord, const CPVT_WordRange * pVisible) { CFX_ByteTextBuf sEditStream, sLineStream, sWords; CPDF_Point ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); @@ -726,7 +726,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA switch (nStyle) { default: case PBS_SOLID: - sColor = GenerateColorAP(color, true); + sColor = GenerateColorAP(color, TRUE); if (sColor.GetLength() > 0) { sAppStream << sColor; sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n"; @@ -736,7 +736,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA } break; case PBS_DASH: - sColor = GenerateColorAP(color, false); + sColor = GenerateColorAP(color, FALSE); if (sColor.GetLength() > 0) { sAppStream << sColor; sAppStream << fWidth << " w" << " [" << dash.nDash << " " << dash.nGap << "] " << dash.nPhase << " d\n"; @@ -749,7 +749,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA break; case PBS_BEVELED: case PBS_INSET: - sColor = GenerateColorAP(crLeftTop, true); + sColor = GenerateColorAP(crLeftTop, TRUE); if (sColor.GetLength() > 0) { sAppStream << sColor; sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " m\n"; @@ -759,7 +759,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA sAppStream << fLeft + fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l\n"; sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l f\n"; } - sColor = GenerateColorAP(crRightBottom, true); + sColor = GenerateColorAP(crRightBottom, TRUE); if (sColor.GetLength() > 0) { sAppStream << sColor; sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth << " m\n"; @@ -769,7 +769,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA sAppStream << fRight - fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l\n"; sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l f\n"; } - sColor = GenerateColorAP(color, true); + sColor = GenerateColorAP(color, TRUE); if (sColor.GetLength() > 0) { sAppStream << sColor; sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n"; @@ -778,7 +778,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA } break; case PBS_UNDERLINED: - sColor = GenerateColorAP(color, false); + sColor = GenerateColorAP(color, FALSE); if (sColor.GetLength() > 0) { sAppStream << sColor; sAppStream << fWidth << " w\n"; @@ -790,7 +790,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA } return sAppStream.GetByteString(); } -CFX_ByteString CPVT_GenerateAP::GenerateColorAP(const CPVT_Color & color, const bool & bFillOrStroke) +CFX_ByteString CPVT_GenerateAP::GenerateColorAP(const CPVT_Color & color, const FX_BOOL & bFillOrStroke) { CFX_ByteTextBuf sColorStream; switch (color.nColorType) { diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp index 647b7cb718..3ba109b016 100644 --- a/core/src/fpdfdoc/doc_basic.cpp +++ b/core/src/fpdfdoc/doc_basic.cpp @@ -313,10 +313,10 @@ static CFX_WideString FILESPEC_DecodeFileName(const CFX_WideStringC& filepath) return filepath; #endif } -bool CPDF_FileSpec::GetFileName(CFX_WideString &csFileName) const +FX_BOOL CPDF_FileSpec::GetFileName(CFX_WideString &csFileName) const { if (m_pObj == NULL) { - return false; + return FALSE; } if (m_pObj->GetType() == PDFOBJ_DICTIONARY) { CPDF_Dictionary* pDict = (CPDF_Dictionary*)m_pObj; @@ -325,7 +325,7 @@ bool CPDF_FileSpec::GetFileName(CFX_WideString &csFileName) const csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("F"))); } if (pDict->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL")) { - return true; + return TRUE; } if (csFileName.IsEmpty()) { if (pDict->KeyExist(FX_BSTRC("DOS"))) { @@ -335,14 +335,14 @@ bool CPDF_FileSpec::GetFileName(CFX_WideString &csFileName) const } else if (pDict->KeyExist(FX_BSTRC("Unix"))) { csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("Unix"))); } else { - return false; + return FALSE; } } } else { csFileName = CFX_WideString::FromLocal(m_pObj->GetString()); } csFileName = FILESPEC_DecodeFileName(csFileName); - return true; + return TRUE; } CPDF_FileSpec::CPDF_FileSpec() { @@ -351,13 +351,13 @@ CPDF_FileSpec::CPDF_FileSpec() ((CPDF_Dictionary*)m_pObj)->SetAtName(FX_BSTRC("Type"), FX_BSTRC("Filespec")); } } -bool CPDF_FileSpec::IsURL() const +FX_BOOL CPDF_FileSpec::IsURL() const { if (m_pObj == NULL) { - return false; + return FALSE; } if (m_pObj->GetType() != PDFOBJ_DICTIONARY) { - return false; + return FALSE; } return ((CPDF_Dictionary*)m_pObj)->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL"); } @@ -416,7 +416,7 @@ CPDF_Stream* CPDF_FileSpec::GetFileStream() const } return NULL; } -static void FPDFDOC_FILESPEC_SetFileName(CPDF_Object *pObj, const CFX_WideStringC& wsFileName, bool bURL) +static void FPDFDOC_FILESPEC_SetFileName(CPDF_Object *pObj, const CFX_WideStringC& wsFileName, FX_BOOL bURL) { ASSERT(pObj != NULL); CFX_WideString wsStr; @@ -434,7 +434,7 @@ static void FPDFDOC_FILESPEC_SetFileName(CPDF_Object *pObj, const CFX_WideString pDict->SetAtString(FX_BSTRC("UF"), PDF_EncodeText(wsStr)); } } -void CPDF_FileSpec::SetFileName(const CFX_WideStringC& wsFileName, bool bURL) +void CPDF_FileSpec::SetFileName(const CFX_WideStringC& wsFileName, FX_BOOL bURL) { ASSERT(m_pObj != NULL); if (m_pObj->GetType() == PDFOBJ_DICTIONARY && bURL) { diff --git a/core/src/fpdfdoc/doc_form.cpp b/core/src/fpdfdoc/doc_form.cpp index 6057f56437..735231cc1d 100644 --- a/core/src/fpdfdoc/doc_form.cpp +++ b/core/src/fpdfdoc/doc_form.cpp @@ -241,12 +241,12 @@ CFieldTree::_Node *CFieldTree::FindNode(const CFX_WideString& full_name) } return pNode; } -CPDF_InterForm::CPDF_InterForm(CPDF_Document* pDocument, bool bGenerateAP) : CFX_PrivateData() +CPDF_InterForm::CPDF_InterForm(CPDF_Document* pDocument, FX_BOOL bGenerateAP) : CFX_PrivateData() { m_pDocument = pDocument; m_bGenerateAP = bGenerateAP; m_pFormNotify = NULL; - m_bUpdated = false; + m_bUpdated = FALSE; m_pFieldTree = new CFieldTree; CPDF_Dictionary* pRoot = m_pDocument->GetRoot(); m_pFormDict = pRoot->GetDict("AcroForm"); @@ -280,12 +280,12 @@ CPDF_InterForm::~CPDF_InterForm() delete m_pFieldTree; } } -bool CPDF_InterForm::m_bUpdateAP = true; -bool CPDF_InterForm::UpdatingAPEnabled() +FX_BOOL CPDF_InterForm::m_bUpdateAP = TRUE; +FX_BOOL CPDF_InterForm::UpdatingAPEnabled() { return m_bUpdateAP; } -void CPDF_InterForm::EnableUpdateAP(bool bUpdateAP) +void CPDF_InterForm::EnableUpdateAP(FX_BOOL bUpdateAP) { m_bUpdateAP = bUpdateAP; } @@ -328,7 +328,7 @@ CFX_ByteString CPDF_InterForm::GenerateNewResourceName(const CPDF_Dictionary* pR } int num = 0; CFX_ByteString bsNum; - while (true) { + while (TRUE) { if (!pDict->KeyExist(csTmp + bsNum)) { return csTmp + bsNum; } @@ -343,7 +343,7 @@ CFX_ByteString CPDF_InterForm::GenerateNewResourceName(const CPDF_Dictionary* pR } #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ typedef struct _PDF_FONTDATA { - bool bFind; + FX_BOOL bFind; LOGFONTA lf; } PDF_FONTDATA, FAR* LPDF_FONTDATA; static int CALLBACK EnumFontFamExProc( ENUMLOGFONTEXA *lpelfe, @@ -357,10 +357,10 @@ static int CALLBACK EnumFontFamExProc( ENUMLOGFONTEXA *lpelfe, } LPDF_FONTDATA pData = (LPDF_FONTDATA)lParam; memcpy(&pData->lf, &lpelfe->elfLogFont, sizeof(LOGFONTA)); - pData->bFind = true; + pData->bFind = TRUE; return 0; } -static bool RetrieveSpecificFont(LOGFONTA& lf) +static FX_BOOL RetrieveSpecificFont(LOGFONTA& lf) { PDF_FONTDATA fd; memset(&fd, 0, sizeof(PDF_FONTDATA)); @@ -372,7 +372,7 @@ static bool RetrieveSpecificFont(LOGFONTA& lf) } return fd.bFind; } -static bool RetrieveSpecificFont(uint8_t charSet, uint8_t pitchAndFamily, LPCSTR pcsFontName, LOGFONTA& lf) +static FX_BOOL RetrieveSpecificFont(uint8_t charSet, uint8_t pitchAndFamily, LPCSTR pcsFontName, LOGFONTA& lf) { memset(&lf, 0, sizeof(LOGFONTA)); lf.lfCharSet = charSet; @@ -382,7 +382,7 @@ static bool RetrieveSpecificFont(uint8_t charSet, uint8_t pitchAndFamily, LPCSTR } return RetrieveSpecificFont(lf); } -static bool RetrieveStockFont(int iFontObject, uint8_t charSet, LOGFONTA& lf) +static FX_BOOL RetrieveStockFont(int iFontObject, uint8_t charSet, LOGFONTA& lf) { HFONT hFont = (HFONT)::GetStockObject(iFontObject); if (hFont != NULL) { @@ -392,7 +392,7 @@ static bool RetrieveStockFont(int iFontObject, uint8_t charSet, LOGFONTA& lf) return RetrieveSpecificFont(lf); } } - return false; + return FALSE; } #endif CPDF_Font* CPDF_InterForm::AddSystemDefaultFont(const CPDF_Document* pDocument) @@ -403,13 +403,13 @@ CPDF_Font* CPDF_InterForm::AddSystemDefaultFont(const CPDF_Document* pDocument) CPDF_Font* pFont = NULL; #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ LOGFONTA lf; - bool bRet; + FX_BOOL bRet; bRet = RetrieveStockFont(DEFAULT_GUI_FONT, 255, lf); if (!bRet) { bRet = RetrieveStockFont(SYSTEM_FONT, 255, lf); } if (bRet) { - pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, false, true); + pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE); } #endif return pFont; @@ -430,7 +430,7 @@ CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_Byt ::GetObjectA(hFont, sizeof(LOGFONTA), &lf); ::DeleteObject(hFont); if (strlen(lf.lfFaceName) > 0) { - return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, false, true); + return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE); } } #endif @@ -452,7 +452,7 @@ CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_Wid ::GetObject(hFont, sizeof(LOGFONTA), &lf); ::DeleteObject(hFont); if (strlen(lf.lfFaceName) > 0) { - return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, false, true); + return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE); } } #endif @@ -477,12 +477,12 @@ CFX_ByteString CPDF_InterForm::GetNativeFont(uint8_t charSet, void* pLogFont) CFX_ByteString csFontName; #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ LOGFONTA lf; - bool bRet; + FX_BOOL bRet; if (charSet == ANSI_CHARSET) { csFontName = "Helvetica"; return csFontName; } - bRet = false; + bRet = FALSE; if (charSet == SHIFTJIS_CHARSET) { bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, "MS Mincho", lf); } else if (charSet == GB2312_CHARSET) { @@ -591,7 +591,7 @@ CPDF_Font* CPDF_InterForm::AddNativeFont(uint8_t charSet, const CPDF_Document* p if (csFontName == "Helvetica") { pFont = AddStandardFont(pDocument, csFontName); } else { - pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, false, true); + pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE); } } #endif @@ -607,15 +607,15 @@ CPDF_Font* CPDF_InterForm::AddNativeFont(const CPDF_Document* pDocument) pFont = AddNativeFont(charSet, pDocument); return pFont; } -bool CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl) +FX_BOOL CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl) { if (csNewFieldName.IsEmpty()) { - return false; + return FALSE; } int iPos = 0; int iLength = csNewFieldName.GetLength(); CFX_WideString csSub; - while (true) { + while (TRUE) { while (iPos < iLength && (csNewFieldName[iPos] == L'.' || csNewFieldName[iPos] == L' ')) { iPos ++; } @@ -651,15 +651,15 @@ bool CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType int iRet = CompareFieldName(csSub, csFullName); if (iRet == 1) { if (pField->GetFieldType() != iType) { - return false; + return FALSE; } } else if (iRet == 2 && csSub == csNewFieldName) { if (csFullName[iPos] == L'.') { - return false; + return FALSE; } } else if (iRet == 3 && csSub == csNewFieldName) { if (csNewFieldName[csFullName.GetLength()] == L'.') { - return false; + return FALSE; } } } @@ -668,26 +668,26 @@ bool CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType } } if (csSub.IsEmpty()) { - return false; + return FALSE; } csNewFieldName = csSub; - return true; + return TRUE; } -bool CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType) +FX_BOOL CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType) { return ValidateFieldName(csNewFieldName, iType, NULL, NULL); } -bool CPDF_InterForm::ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName) +FX_BOOL CPDF_InterForm::ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName) { if (pField == NULL || csNewFieldName.IsEmpty()) { - return false; + return FALSE; } return ValidateFieldName(csNewFieldName, ((CPDF_FormField*)pField)->GetFieldType(), pField, NULL); } -bool CPDF_InterForm::ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName) +FX_BOOL CPDF_InterForm::ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName) { if (pControl == NULL || csNewFieldName.IsEmpty()) { - return false; + return FALSE; } CPDF_FormField* pField = ((CPDF_FormControl*)pControl)->GetField(); return ValidateFieldName(csNewFieldName, pField->GetFieldType(), pField, pControl); @@ -764,19 +764,19 @@ void CPDF_InterForm::GetAllFieldNames(CFX_WideStringArray& allFieldNames) } } } -bool CPDF_InterForm::IsValidFormField(const void* pField) +FX_BOOL CPDF_InterForm::IsValidFormField(const void* pField) { if (pField == NULL) { - return false; + return FALSE; } int nCount = m_pFieldTree->m_Root.CountFields(); for (int i = 0; i < nCount; i++) { CPDF_FormField *pFormField = m_pFieldTree->m_Root.GetField(i); if (pField == pFormField) { - return true; + return TRUE; } } - return false; + return FALSE; } CPDF_FormField* CPDF_InterForm::GetFieldByDict(CPDF_Dictionary* pFieldDict) const { @@ -808,10 +808,10 @@ CPDF_FormControl* CPDF_InterForm::GetControl(FX_DWORD index, CFX_WideString csFi } return NULL; } -bool CPDF_InterForm::IsValidFormControl(const void* pControl) +FX_BOOL CPDF_InterForm::IsValidFormControl(const void* pControl) { if (pControl == NULL) { - return false; + return FALSE; } FX_POSITION pos = m_ControlMap.GetStartPosition(); while (pos) { @@ -819,10 +819,10 @@ bool CPDF_InterForm::IsValidFormControl(const void* pControl) void* pFormControl = NULL; m_ControlMap.GetNextAssoc(pos, (void*&)pWidgetDict, pFormControl); if (pControl == pFormControl) { - return true; + return TRUE; } } - return false; + return FALSE; } int CPDF_InterForm::CountPageControls(CPDF_Page* pPage) const { @@ -919,7 +919,7 @@ FX_DWORD CPDF_InterForm::CountInternalFields(const CFX_WideString& csFieldName) csSub += csFieldName[iPos ++]; } int iCount = pArray->GetCount(); - bool bFind = false; + FX_BOOL bFind = FALSE; for (int i = 0; i < iCount; i ++) { pDict = pArray->GetDict(i); if (pDict == NULL) { @@ -927,7 +927,7 @@ FX_DWORD CPDF_InterForm::CountInternalFields(const CFX_WideString& csFieldName) } CFX_WideString csT = pDict->GetUnicodeText("T"); if (csT == csSub) { - bFind = true; + bFind = TRUE; break; } } @@ -970,7 +970,7 @@ CPDF_Dictionary* CPDF_InterForm::GetInternalField(FX_DWORD index, const CFX_Wide csSub += csFieldName[iPos ++]; } int iCount = pArray->GetCount(); - bool bFind = false; + FX_BOOL bFind = FALSE; for (int i = 0; i < iCount; i ++) { pDict = pArray->GetDict(i); if (pDict == NULL) { @@ -978,7 +978,7 @@ CPDF_Dictionary* CPDF_InterForm::GetInternalField(FX_DWORD index, const CFX_Wide } CFX_WideString csT = pDict->GetUnicodeText("T"); if (csT == csSub) { - bFind = true; + bFind = TRUE; break; } } @@ -996,14 +996,14 @@ CPDF_Dictionary* CPDF_InterForm::GetInternalField(FX_DWORD index, const CFX_Wide pArray = pDict->GetArray("Kids"); return pArray ? pArray->GetDict(index) : pDict; } -bool CPDF_InterForm::NeedConstructAP() +FX_BOOL CPDF_InterForm::NeedConstructAP() { if (m_pFormDict == NULL) { - return false; + return FALSE; } return m_pFormDict->GetBoolean("NeedAppearances"); } -void CPDF_InterForm::NeedConstructAP(bool bNeedAP) +void CPDF_InterForm::NeedConstructAP(FX_BOOL bNeedAP) { if (m_pFormDict == NULL) { InitInterFormDict(m_pFormDict, m_pDocument); @@ -1078,37 +1078,37 @@ CPDF_Font* CPDF_InterForm::GetNativeFormFont(CFX_ByteString& csNameTag) { return GetNativeInterFormFont(m_pFormDict, m_pDocument, csNameTag); } -bool CPDF_InterForm::FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag) +FX_BOOL CPDF_InterForm::FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag) { return FindInterFormFont(m_pFormDict, pFont, csNameTag); } -bool CPDF_InterForm::FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag) +FX_BOOL CPDF_InterForm::FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag) { return FindInterFormFont(m_pFormDict, m_pDocument, csFontName, pFont, csNameTag); } void CPDF_InterForm::AddFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag) { AddInterFormFont(m_pFormDict, m_pDocument, pFont, csNameTag); - m_bUpdated = true; + m_bUpdated = TRUE; } CPDF_Font* CPDF_InterForm::AddNativeFormFont(uint8_t charSet, CFX_ByteString& csNameTag) { - m_bUpdated = true; + m_bUpdated = TRUE; return AddNativeInterFormFont(m_pFormDict, m_pDocument, charSet, csNameTag); } CPDF_Font* CPDF_InterForm::AddNativeFormFont(CFX_ByteString& csNameTag) { - m_bUpdated = true; + m_bUpdated = TRUE; return AddNativeInterFormFont(m_pFormDict, m_pDocument, csNameTag); } void CPDF_InterForm::RemoveFormFont(const CPDF_Font* pFont) { - m_bUpdated = true; + m_bUpdated = TRUE; RemoveInterFormFont(m_pFormDict, pFont); } void CPDF_InterForm::RemoveFormFont(CFX_ByteString csNameTag) { - m_bUpdated = true; + m_bUpdated = TRUE; RemoveInterFormFont(m_pFormDict, csNameTag); } CPDF_DefaultAppearance CPDF_InterForm::GetDefaultAppearance() @@ -1131,12 +1131,12 @@ int CPDF_InterForm::GetFormAlignment() } return m_pFormDict->GetInteger("Q", 0); } -bool CPDF_InterForm::ResetForm(const CFX_PtrArray& fields, bool bIncludeOrExclude, bool bNotify) +FX_BOOL CPDF_InterForm::ResetForm(const CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude, FX_BOOL bNotify) { if (bNotify && m_pFormNotify != NULL) { int iRet = m_pFormNotify->BeforeFormReset(this); if (iRet < 0) { - return false; + return FALSE; } } int nCount = m_pFieldTree->m_Root.CountFields(); @@ -1145,11 +1145,11 @@ bool CPDF_InterForm::ResetForm(const CFX_PtrArray& fields, bool bIncludeOrExclud if (pField == NULL) { continue; } - bool bFind = false; + FX_BOOL bFind = FALSE; int iCount = fields.GetSize(); for (int i = 0; i < iCount; i ++) { if (pField == (CPDF_FormField*)fields[i]) { - bFind = true; + bFind = TRUE; break; } } @@ -1160,14 +1160,14 @@ bool CPDF_InterForm::ResetForm(const CFX_PtrArray& fields, bool bIncludeOrExclud if (bNotify && m_pFormNotify != NULL) { m_pFormNotify->AfterFormReset(this); } - return true; + return TRUE; } -bool CPDF_InterForm::ResetForm(bool bNotify) +FX_BOOL CPDF_InterForm::ResetForm(FX_BOOL bNotify) { if (bNotify && m_pFormNotify != NULL) { int iRet = m_pFormNotify->BeforeFormReset(this); if (iRet < 0) { - return false; + return FALSE; } } int nCount = m_pFieldTree->m_Root.CountFields(); @@ -1181,7 +1181,7 @@ bool CPDF_InterForm::ResetForm(bool bNotify) if (bNotify && m_pFormNotify != NULL) { m_pFormNotify->AfterFormReset(this); } - return true; + return TRUE; } void CPDF_InterForm::ReloadForm() { @@ -1242,7 +1242,7 @@ void CPDF_InterForm::LoadField(CPDF_Dictionary* pFieldDict, int nLevel) AddTerminalField(pFieldDict); } } -bool CPDF_InterForm::HasXFAForm() const +FX_BOOL CPDF_InterForm::HasXFAForm() const { return m_pFormDict && m_pFormDict->GetArray(FX_BSTRC("XFA")) != NULL; } @@ -1303,7 +1303,7 @@ CPDF_FormField* CPDF_InterForm::AddTerminalField(const CPDF_Dictionary* pFieldDi pField = new CPDF_FormField(this, pParent); CPDF_Object* pTObj = pDict->GetElement("T"); if (pTObj && pTObj->GetType() == PDFOBJ_REFERENCE) { - CPDF_Object* pClone = pTObj->Clone(true); + CPDF_Object* pClone = pTObj->Clone(TRUE); if (pClone) { pDict->SetAt("T", pClone); } else { @@ -1342,7 +1342,7 @@ CPDF_FormControl* CPDF_InterForm::AddControl(const CPDF_FormField* pField, const ((CPDF_FormField*)pField)->m_ControlList.Add(pControl); return pControl; } -CPDF_FormField* CPDF_InterForm::CheckRequiredFields(const CFX_PtrArray *fields, bool bIncludeOrExclude) const +CPDF_FormField* CPDF_InterForm::CheckRequiredFields(const CFX_PtrArray *fields, FX_BOOL bIncludeOrExclude) const { int nCount = m_pFieldTree->m_Root.CountFields(); for (int i = 0; i < nCount; i++) { @@ -1358,7 +1358,7 @@ CPDF_FormField* CPDF_InterForm::CheckRequiredFields(const CFX_PtrArray *fields, if (dwFlags & 0x04) { continue; } - bool bFind = true; + FX_BOOL bFind = TRUE; if (fields != NULL) { bFind = fields->Find(pField, 0) >= 0; } @@ -1371,7 +1371,7 @@ CPDF_FormField* CPDF_InterForm::CheckRequiredFields(const CFX_PtrArray *fields, } return NULL; } -CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, bool bSimpleFileSpec) const +CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, FX_BOOL bSimpleFileSpec) const { CFX_PtrArray fields; int nCount = m_pFieldTree->m_Root.CountFields(); @@ -1379,10 +1379,10 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, bool CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i); fields.Add(pField); } - return ExportToFDF(pdf_path, fields, true, bSimpleFileSpec); + return ExportToFDF(pdf_path, fields, TRUE, bSimpleFileSpec); } CFX_WideString FILESPEC_EncodeFileName(const CFX_WideStringC& filepath); -CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, CFX_PtrArray& fields, bool bIncludeOrExclude, bool bSimpleFileSpec) const +CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude, FX_BOOL bSimpleFileSpec) const { CFDF_Document* pDoc = CFDF_Document::CreateNewDoc(); if (pDoc == NULL) { @@ -1415,7 +1415,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, CFX_ if (dwFlags & 0x04) { continue; } - bool bFind = fields.Find(pField, 0) >= 0; + FX_BOOL bFind = fields.Find(pField, 0) >= 0; if ((bIncludeOrExclude && bFind) || (!bIncludeOrExclude && !bFind)) { if ((dwFlags & 0x02) != 0 && pField->m_pDict->GetString("V").IsEmpty()) { continue; @@ -1432,7 +1432,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, CFX_ } pFieldDict->SetAt("T", pString); 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 == NULL) { @@ -1443,7 +1443,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, CFX_ } else { CPDF_Object* pV = FPDF_GetFieldAttr(pField->m_pDict, "V"); if (pV != NULL) { - pFieldDict->SetAt("V", pV->Clone(true)); + pFieldDict->SetAt("V", pV->Clone(TRUE)); } } pFields->Add(pFieldDict); @@ -1483,7 +1483,7 @@ static void FPDFDOC_FDF_GetFieldValue(CPDF_Dictionary *pFieldDict, CFX_WideStrin csValue = CFX_WideString::FromLocal(csBValue); } } -void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict, const CFX_WideString& parent_name, bool bNotify, int nLevel) +void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict, const CFX_WideString& parent_name, FX_BOOL bNotify, int nLevel) { CFX_WideString name; if (!parent_name.IsEmpty()) { @@ -1531,7 +1531,7 @@ void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict, const CFX_Wide pField->SetValue(csWValue); CPDF_FormField::Type eType = pField->GetType(); if ((eType == CPDF_FormField::ListBox || eType == CPDF_FormField::ComboBox) && pFieldDict->KeyExist("Opt")) { - pField->m_pDict->SetAt("Opt", pFieldDict->GetElementValue("Opt")->Clone(true)); + pField->m_pDict->SetAt("Opt", pFieldDict->GetElementValue("Opt")->Clone(TRUE)); } if (bNotify && m_pFormNotify != NULL) { if (iType == FIELDTYPE_CHECKBOX || iType == FIELDTYPE_RADIOBUTTON) { @@ -1546,24 +1546,24 @@ void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict, const CFX_Wide pField->UpdateAP(NULL); } } -bool CPDF_InterForm::ImportFromFDF(const CFDF_Document* pFDF, bool bNotify) +FX_BOOL CPDF_InterForm::ImportFromFDF(const CFDF_Document* pFDF, FX_BOOL bNotify) { if (pFDF == NULL) { - return false; + return FALSE; } CPDF_Dictionary* pMainDict = pFDF->GetRoot()->GetDict("FDF"); if (pMainDict == NULL) { - return false; + return FALSE; } CPDF_Array* pFields = pMainDict->GetArray("Fields"); if (pFields == NULL) { - return false; + return FALSE; } m_bsEncoding = pMainDict->GetString(FX_BSTRC("Encoding")); if (bNotify && m_pFormNotify != NULL) { int iRet = m_pFormNotify->BeforeFormImportData(this); if (iRet < 0) { - return false; + return FALSE; } } for (FX_DWORD i = 0; i < pFields->GetCount(); i ++) { @@ -1576,13 +1576,13 @@ bool CPDF_InterForm::ImportFromFDF(const CFDF_Document* pFDF, bool bNotify) if (bNotify && m_pFormNotify != NULL) { m_pFormNotify->AfterFormImportData(this); } - return true; + return TRUE; } void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { m_pFormNotify = (CPDF_FormNotify*)pNotify; } -int CPDF_InterForm::GetPageWithWidget(int iCurPage, bool bNext) +int CPDF_InterForm::GetPageWithWidget(int iCurPage, FX_BOOL bNext) { if (iCurPage < 0) { return -1; @@ -1622,6 +1622,6 @@ int CPDF_InterForm::GetPageWithWidget(int iCurPage, bool bNext) return iNewPage; } } - } while (true); + } while (TRUE); return -1; } diff --git a/core/src/fpdfdoc/doc_formcontrol.cpp b/core/src/fpdfdoc/doc_formcontrol.cpp index 62eb591f94..87eee92c2e 100644 --- a/core/src/fpdfdoc/doc_formcontrol.cpp +++ b/core/src/fpdfdoc/doc_formcontrol.cpp @@ -113,25 +113,25 @@ CFX_WideString CPDF_FormControl::GetExportValue() CFX_WideString csWOn = PDF_DecodeText(csOn); return csWOn; } -bool CPDF_FormControl::IsChecked() +FX_BOOL CPDF_FormControl::IsChecked() { ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton); CFX_ByteString csOn = GetOnStateName(); CFX_ByteString csAS = m_pWidgetDict->GetString("AS"); return csAS == csOn; } -bool CPDF_FormControl::IsDefaultChecked() +FX_BOOL CPDF_FormControl::IsDefaultChecked() { ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton); CPDF_Object* pDV = FPDF_GetFieldAttr(m_pField->m_pDict, "DV"); if (pDV == NULL) { - return false; + return FALSE; } CFX_ByteString csDV = pDV->GetString(); CFX_ByteString csOn = GetOnStateName(); return (csDV == csOn); } -void CPDF_FormControl::CheckControl(bool bChecked) +void CPDF_FormControl::CheckControl(FX_BOOL bChecked) { ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton); CFX_ByteString csOn = GetOnStateName(); @@ -144,7 +144,7 @@ void CPDF_FormControl::CheckControl(bool bChecked) return; } m_pWidgetDict->SetAtName("AS", csAS); - m_pForm->m_bUpdated = true; + m_pForm->m_bUpdated = TRUE; } CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, CPDF_Annot::AppearanceMode mode); void CPDF_FormControl::DrawControl(CFX_RenderDevice* pDevice, CFX_AffineMatrix* pMatrix, CPDF_Page* pPage, @@ -186,7 +186,7 @@ CPDF_FormControl::HighlightingMode CPDF_FormControl::GetHighlightingMode() } return Invert; } -CPDF_ApSettings CPDF_FormControl::GetMK(bool bCreate) +CPDF_ApSettings CPDF_FormControl::GetMK(FX_BOOL bCreate) { if (!m_pWidgetDict) { return NULL; @@ -201,49 +201,49 @@ CPDF_ApSettings CPDF_FormControl::GetMK(bool bCreate) } return mk; } -bool CPDF_FormControl::HasMKEntry(CFX_ByteString csEntry) +FX_BOOL CPDF_FormControl::HasMKEntry(CFX_ByteString csEntry) { - CPDF_ApSettings mk = GetMK(false); + CPDF_ApSettings mk = GetMK(FALSE); return mk.HasMKEntry(csEntry); } int CPDF_FormControl::GetRotation() { - CPDF_ApSettings mk = GetMK(false); + CPDF_ApSettings mk = GetMK(FALSE); return mk.GetRotation(); } FX_ARGB CPDF_FormControl::GetColor(int& iColorType, CFX_ByteString csEntry) { - CPDF_ApSettings mk = GetMK(false); + CPDF_ApSettings mk = GetMK(FALSE); return mk.GetColor(iColorType, csEntry); } FX_FLOAT CPDF_FormControl::GetOriginalColor(int index, CFX_ByteString csEntry) { - CPDF_ApSettings mk = GetMK(false); + CPDF_ApSettings mk = GetMK(FALSE); return mk.GetOriginalColor(index, csEntry); } void CPDF_FormControl::GetOriginalColor(int& iColorType, FX_FLOAT fc[4], CFX_ByteString csEntry) { - CPDF_ApSettings mk = GetMK(false); + CPDF_ApSettings mk = GetMK(FALSE); mk.GetOriginalColor(iColorType, fc, csEntry); } CFX_WideString CPDF_FormControl::GetCaption(CFX_ByteString csEntry) { - CPDF_ApSettings mk = GetMK(false); + CPDF_ApSettings mk = GetMK(FALSE); return mk.GetCaption(csEntry); } CPDF_Stream* CPDF_FormControl::GetIcon(CFX_ByteString csEntry) { - CPDF_ApSettings mk = GetMK(false); + CPDF_ApSettings mk = GetMK(FALSE); return mk.GetIcon(csEntry); } CPDF_IconFit CPDF_FormControl::GetIconFit() { - CPDF_ApSettings mk = GetMK(false); + CPDF_ApSettings mk = GetMK(FALSE); return mk.GetIconFit(); } int CPDF_FormControl::GetTextPosition() { - CPDF_ApSettings mk = GetMK(false); + CPDF_ApSettings mk = GetMK(FALSE); return mk.GetTextPosition(); } CPDF_Action CPDF_FormControl::GetAction() @@ -343,10 +343,10 @@ int CPDF_FormControl::GetControlAlignment() } return pObj->GetInteger(); } -bool CPDF_ApSettings::HasMKEntry(const CFX_ByteStringC& csEntry) +FX_BOOL CPDF_ApSettings::HasMKEntry(const CFX_ByteStringC& csEntry) { if (m_pDict == NULL) { - return false; + return FALSE; } return m_pDict->KeyExist(csEntry); } diff --git a/core/src/fpdfdoc/doc_formfield.cpp b/core/src/fpdfdoc/doc_formfield.cpp index 8d9887e796..087eba8aa4 100644 --- a/core/src/fpdfdoc/doc_formfield.cpp +++ b/core/src/fpdfdoc/doc_formfield.cpp @@ -7,11 +7,11 @@ #include "../../include/fpdfdoc/fpdf_doc.h" #include "doc_utils.h" -bool PDF_FormField_IsUnison(CPDF_FormField *pField) +FX_BOOL PDF_FormField_IsUnison(CPDF_FormField *pField) { - bool bUnison = false; + FX_BOOL bUnison = FALSE; if (pField->GetType() == CPDF_FormField::CheckBox) { - bUnison = true; + bUnison = TRUE; } else { FX_DWORD dwFlags = pField->GetFieldFlags(); bUnison = ((dwFlags & 0x2000000) != 0); @@ -100,7 +100,7 @@ CFX_WideString CPDF_FormField::GetFullName() { return ::GetFullName(m_pDict); } -bool CPDF_FormField::ResetField(bool bNotify) +FX_BOOL CPDF_FormField::ResetField(FX_BOOL bNotify) { switch (m_Type) { case CPDF_FormField::CheckBox: @@ -113,13 +113,13 @@ bool CPDF_FormField::ResetField(bool bNotify) if (iCount) { if (PDF_FormField_IsUnison(this)) { for(int i = 0; i < iCount; i++) { - CheckControl(i, GetControl(i)->IsDefaultChecked(), false); + CheckControl(i, GetControl(i)->IsDefaultChecked(), FALSE); } } else { for (int i = 0; i < iCount; i ++) { CPDF_FormControl* pControl = GetControl(i); - bool bChecked = pControl->IsDefaultChecked(); - CheckControl(i, bChecked, false); + FX_BOOL bChecked = pControl->IsDefaultChecked(); + CheckControl(i, bChecked, FALSE); } } } @@ -138,10 +138,10 @@ bool CPDF_FormField::ResetField(bool bNotify) if (bNotify && m_pForm->m_pFormNotify != NULL) { int iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue); if (iRet < 0) { - return false; + return FALSE; } } - SetItemSelection(iIndex, true); + SetItemSelection(iIndex, TRUE); if (bNotify && m_pForm->m_pFormNotify != NULL) { m_pForm->m_pFormNotify->AfterValueChange(this); } @@ -157,10 +157,10 @@ bool CPDF_FormField::ResetField(bool bNotify) if (bNotify && m_pForm->m_pFormNotify != NULL) { int iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue); if (iRet < 0) { - return false; + return FALSE; } } - SetItemSelection(iIndex, true); + SetItemSelection(iIndex, TRUE); if (bNotify && m_pForm->m_pFormNotify != NULL) { m_pForm->m_pFormNotify->AfterSelectionChange(this); } @@ -182,12 +182,12 @@ bool CPDF_FormField::ResetField(bool bNotify) } CPDF_Object* pRV = FPDF_GetFieldAttr(m_pDict, "RV"); if (!pRV && (csDValue == csValue)) { - return false; + return FALSE; } if (bNotify && m_pForm->m_pFormNotify != NULL) { int iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csDValue); if (iRet < 0) { - return false; + return FALSE; } } if (pDV == NULL) { @@ -196,7 +196,7 @@ bool CPDF_FormField::ResetField(bool bNotify) } else { CPDF_Object* pClone = pDV->Clone(); if (pClone == NULL) { - return false; + return FALSE; } m_pDict->SetAt("V", pClone); if(pRV) { @@ -207,11 +207,11 @@ bool CPDF_FormField::ResetField(bool bNotify) if (bNotify && m_pForm->m_pFormNotify != NULL) { m_pForm->m_pFormNotify->AfterValueChange(this); } - m_pForm->m_bUpdated = true; + m_pForm->m_bUpdated = TRUE; } break; } - return true; + return TRUE; } int CPDF_FormField::GetControlIndex(const CPDF_FormControl* pControl) { @@ -299,7 +299,7 @@ CFX_WideString CPDF_FormField::GetRichTextString() } return pObj->GetUnicodeText(); } -CFX_WideString CPDF_FormField::GetValue(bool bDefault) +CFX_WideString CPDF_FormField::GetValue(FX_BOOL bDefault) { if (GetType() == CheckBox || GetType() == RadioButton) { return GetCheckValue(bDefault); @@ -333,19 +333,19 @@ CFX_WideString CPDF_FormField::GetValue(bool bDefault) } CFX_WideString CPDF_FormField::GetValue() { - return GetValue(false); + return GetValue(FALSE); } CFX_WideString CPDF_FormField::GetDefaultValue() { - return GetValue(true); + return GetValue(TRUE); } -bool CPDF_FormField::SetValue(const CFX_WideString& value, bool bDefault, bool bNotify) +FX_BOOL CPDF_FormField::SetValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify) { switch (m_Type) { case CheckBox: case RadioButton: { SetCheckValue(value, bDefault, bNotify); - return true; + return TRUE; } case File: case RichText: @@ -355,7 +355,7 @@ bool CPDF_FormField::SetValue(const CFX_WideString& value, bool bDefault, bool b if (bNotify && m_pForm->m_pFormNotify != NULL) { int iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue); if (iRet < 0) { - return false; + return FALSE; } } int iIndex = FindOptionValue(csValue); @@ -371,39 +371,39 @@ bool CPDF_FormField::SetValue(const CFX_WideString& value, bool bDefault, bool b if (bDefault) { } else { ClearSelection(); - SetItemSelection(iIndex, true); + SetItemSelection(iIndex, TRUE); } } if (bNotify && m_pForm->m_pFormNotify != NULL) { m_pForm->m_pFormNotify->AfterValueChange(this); } - m_pForm->m_bUpdated = true; + m_pForm->m_bUpdated = TRUE; } break; case ListBox: { int iIndex = FindOptionValue(value); if (iIndex < 0) { - return false; + return FALSE; } if (bDefault && iIndex == GetDefaultSelectedItem()) { - return false; + return FALSE; } if (bNotify && m_pForm->m_pFormNotify != NULL) { CFX_WideString csValue = value; int iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue); if (iRet < 0) { - return false; + return FALSE; } } if (bDefault) { } else { ClearSelection(); - SetItemSelection(iIndex, true); + SetItemSelection(iIndex, TRUE); } if (bNotify && m_pForm->m_pFormNotify != NULL) { m_pForm->m_pFormNotify->AfterSelectionChange(this); } - m_pForm->m_bUpdated = true; + m_pForm->m_bUpdated = TRUE; break; } default: @@ -412,11 +412,11 @@ bool CPDF_FormField::SetValue(const CFX_WideString& value, bool bDefault, bool b if (CPDF_InterForm::m_bUpdateAP) { UpdateAP(NULL); } - return true; + return TRUE; } -bool CPDF_FormField::SetValue(const CFX_WideString& value, bool bNotify) +FX_BOOL CPDF_FormField::SetValue(const CFX_WideString& value, FX_BOOL bNotify) { - return SetValue(value, false, bNotify); + return SetValue(value, FALSE, bNotify); } int CPDF_FormField::GetMaxLen() { @@ -506,7 +506,7 @@ int CPDF_FormField::GetSelectedIndex(int index) } return -1; } -bool CPDF_FormField::ClearSelection(bool bNotify) +FX_BOOL CPDF_FormField::ClearSelection(FX_BOOL bNotify) { if (bNotify && m_pForm->m_pFormNotify != NULL) { int iRet = 0; @@ -522,7 +522,7 @@ bool CPDF_FormField::ClearSelection(bool bNotify) iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue); } if (iRet < 0) { - return false; + return FALSE; } } m_pDict->RemoveAt("V"); @@ -538,43 +538,43 @@ bool CPDF_FormField::ClearSelection(bool bNotify) if (CPDF_InterForm::m_bUpdateAP) { UpdateAP(NULL); } - m_pForm->m_bUpdated = true; - return true; + m_pForm->m_bUpdated = TRUE; + return TRUE; } -bool CPDF_FormField::IsItemSelected(int index) +FX_BOOL CPDF_FormField::IsItemSelected(int index) { ASSERT(GetType() == ComboBox || GetType() == ListBox); if (index < 0 || index >= CountOptions()) { - return false; + return FALSE; } if (IsOptionSelected(index)) { - return true; + return TRUE; } CFX_WideString opt_value = GetOptionValue(index); CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "V"); if (pValue == NULL) { pValue = FPDF_GetFieldAttr(m_pDict, "I"); if (pValue == NULL) { - return false; + return FALSE; } } if (pValue->GetType() == PDFOBJ_STRING) { if (pValue->GetUnicodeText() == opt_value) { - return true; + return TRUE; } - return false; + return FALSE; } if (pValue->GetType() == PDFOBJ_NUMBER) { if (pValue->GetString().IsEmpty()) { - return false; + return FALSE; } if (pValue->GetInteger() == index) { - return true; + return TRUE; } - return false; + return FALSE; } if (pValue->GetType() != PDFOBJ_ARRAY) { - return false; + return FALSE; } CPDF_Array* pArray = (CPDF_Array*)pValue; int iPos = -1; @@ -586,15 +586,15 @@ bool CPDF_FormField::IsItemSelected(int index) } for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) if (pArray->GetElementValue(i)->GetUnicodeText() == opt_value && (int)i == iPos) { - return true; + return TRUE; } - return false; + return FALSE; } -bool CPDF_FormField::SetItemSelection(int index, bool bSelected, bool bNotify) +FX_BOOL CPDF_FormField::SetItemSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify) { ASSERT(GetType() == ComboBox || GetType() == ListBox); if (index < 0 || index >= CountOptions()) { - return false; + return FALSE; } CFX_WideString opt_value = GetOptionValue(index); if (bNotify && m_pForm->m_pFormNotify != NULL) { @@ -606,14 +606,14 @@ bool CPDF_FormField::SetItemSelection(int index, bool bSelected, bool bNotify) iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, opt_value); } if (iRet < 0) { - return false; + return FALSE; } } if (!bSelected) { CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "V"); if (pValue != NULL) { if (m_Type == ListBox) { - SelectOption(index, false); + SelectOption(index, FALSE); if (pValue->GetType() == PDFOBJ_STRING) { if (pValue->GetUnicodeText() == opt_value) { m_pDict->RemoveAt("V"); @@ -621,7 +621,7 @@ bool CPDF_FormField::SetItemSelection(int index, bool bSelected, bool bNotify) } else if (pValue->GetType() == PDFOBJ_ARRAY) { CPDF_Array* pArray = CPDF_Array::Create(); if (pArray == NULL) { - return false; + return FALSE; } int iCount = CountOptions(); for (int i = 0; i < iCount; i ++) { @@ -645,21 +645,21 @@ bool CPDF_FormField::SetItemSelection(int index, bool bSelected, bool bNotify) } } else { if (m_Type == ListBox) { - SelectOption(index, true); + SelectOption(index, TRUE); if (!(m_Flags & FORMLIST_MULTISELECT)) { m_pDict->SetAtString("V", PDF_EncodeText(opt_value)); } else { CPDF_Array* pArray = CPDF_Array::Create(); if (pArray == NULL) { - return false; + return FALSE; } - bool bSelected; + FX_BOOL bSelected; int iCount = CountOptions(); for (int i = 0; i < iCount; i ++) { if (i != index) { bSelected = IsItemSelected(i); } else { - bSelected = true; + bSelected = TRUE; } if (bSelected) { opt_value = GetOptionValue(i); @@ -672,7 +672,7 @@ bool CPDF_FormField::SetItemSelection(int index, bool bSelected, bool bNotify) m_pDict->SetAtString("V", PDF_EncodeText(opt_value)); CPDF_Array* pI = CPDF_Array::Create(); if (pI == NULL) { - return false; + return FALSE; } pI->AddInteger(index); m_pDict->SetAt("I", pI); @@ -689,18 +689,18 @@ bool CPDF_FormField::SetItemSelection(int index, bool bSelected, bool bNotify) if (CPDF_InterForm::m_bUpdateAP) { UpdateAP(NULL); } - m_pForm->m_bUpdated = true; - return true; + m_pForm->m_bUpdated = TRUE; + return TRUE; } -bool CPDF_FormField::IsItemDefaultSelected(int index) +FX_BOOL CPDF_FormField::IsItemDefaultSelected(int index) { ASSERT(GetType() == ComboBox || GetType() == ListBox); if (index < 0 || index >= CountOptions()) { - return false; + return FALSE; } int iDVIndex = GetDefaultSelectedItem(); if (iDVIndex < 0) { - return false; + return FALSE; } return (iDVIndex == index); } @@ -798,15 +798,15 @@ int CPDF_FormField::FindOptionValue(const CFX_WideString& csOptValue, int iStart } return -1; } -bool CPDF_FormField::CheckControl(int iControlIndex, bool bChecked, bool bNotify) +FX_BOOL CPDF_FormField::CheckControl(int iControlIndex, FX_BOOL bChecked, FX_BOOL bNotify) { ASSERT(GetType() == CheckBox || GetType() == RadioButton); CPDF_FormControl* pControl = GetControl(iControlIndex); if (pControl == NULL) { - return false; + return FALSE; } if (!bChecked && pControl->IsChecked() == bChecked) { - return false; + return FALSE; } CFX_ByteArray statusArray; if (bNotify && m_pForm->m_pFormNotify != NULL) { @@ -815,7 +815,7 @@ bool CPDF_FormField::CheckControl(int iControlIndex, bool bChecked, bool bNotify CFX_WideString csWExport = pControl->GetExportValue(); CFX_ByteString csBExport = PDF_EncodeText(csWExport); int iCount = CountControls(); - bool bUnison = PDF_FormField_IsUnison(this); + FX_BOOL bUnison = PDF_FormField_IsUnison(this); for (int i = 0; i < iCount; i ++) { CPDF_FormControl* pCtrl = GetControl(i); if (bUnison) { @@ -824,16 +824,16 @@ bool CPDF_FormField::CheckControl(int iControlIndex, bool bChecked, bool bNotify if (pCtrl->GetOnStateName() == pControl->GetOnStateName()) { pCtrl->CheckControl(bChecked); } else if (bChecked) { - pCtrl->CheckControl(false); + pCtrl->CheckControl(FALSE); } } else if (bChecked) { - pCtrl->CheckControl(false); + pCtrl->CheckControl(FALSE); } } else { if (i == iControlIndex) { pCtrl->CheckControl(bChecked); } else if (bChecked) { - pCtrl->CheckControl(false); + pCtrl->CheckControl(FALSE); } } } @@ -859,14 +859,14 @@ bool CPDF_FormField::CheckControl(int iControlIndex, bool bChecked, bool bNotify if (bNotify && m_pForm->m_pFormNotify != NULL) { m_pForm->m_pFormNotify->AfterCheckedStatusChange(this, statusArray); } - m_pForm->m_bUpdated = true; - return true; + m_pForm->m_bUpdated = TRUE; + return TRUE; } -CFX_WideString CPDF_FormField::GetCheckValue(bool bDefault) +CFX_WideString CPDF_FormField::GetCheckValue(FX_BOOL bDefault) { ASSERT(GetType() == CheckBox || GetType() == RadioButton); CFX_WideString csExport = L"Off"; - bool bChecked; + FX_BOOL bChecked; int iCount = CountControls(); for (int i = 0; i < iCount; i ++) { CPDF_FormControl* pControl = GetControl(i); @@ -882,7 +882,7 @@ CFX_WideString CPDF_FormField::GetCheckValue(bool bDefault) } return csExport; } -bool CPDF_FormField::SetCheckValue(const CFX_WideString& value, bool bDefault, bool bNotify) +FX_BOOL CPDF_FormField::SetCheckValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify) { ASSERT(GetType() == CheckBox || GetType() == RadioButton); CFX_ByteArray statusArray; @@ -896,21 +896,21 @@ bool CPDF_FormField::SetCheckValue(const CFX_WideString& value, bool bDefault, b if (csExport == value) { if (bDefault) { } else { - CheckControl(GetControlIndex(pControl), true); + CheckControl(GetControlIndex(pControl), TRUE); } break; } else { if (bDefault) { } else { - CheckControl(GetControlIndex(pControl), false); + CheckControl(GetControlIndex(pControl), FALSE); } } } if (bNotify && m_pForm->m_pFormNotify != NULL) { m_pForm->m_pFormNotify->AfterCheckedStatusChange(this, statusArray); } - m_pForm->m_bUpdated = true; - return true; + m_pForm->m_bUpdated = TRUE; + return TRUE; } int CPDF_FormField::GetTopVisibleIndex() { @@ -948,43 +948,43 @@ int CPDF_FormField::GetSelectedOptionIndex(int index) } return -1; } -bool CPDF_FormField::IsOptionSelected(int iOptIndex) +FX_BOOL CPDF_FormField::IsOptionSelected(int iOptIndex) { CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "I"); if (pObj == NULL) { - return false; + return FALSE; } CPDF_Array* pArray = pObj->GetArray(); if (pArray == NULL) { - return false; + return FALSE; } int iCount = (int)pArray->GetCount(); for (int i = 0; i < iCount; i ++) { if (pArray->GetInteger(i) == iOptIndex) { - return true; + return TRUE; } } - return false; + return FALSE; } -bool CPDF_FormField::SelectOption(int iOptIndex, bool bSelected, bool bNotify) +FX_BOOL CPDF_FormField::SelectOption(int iOptIndex, FX_BOOL bSelected, FX_BOOL bNotify) { CPDF_Array* pArray = m_pDict->GetArray("I"); if (pArray == NULL) { if (!bSelected) { - return true; + return TRUE; } pArray = CPDF_Array::Create(); if (pArray == NULL) { - return false; + return FALSE; } m_pDict->SetAt("I", pArray); } - bool bReturn = false; + FX_BOOL bReturn = FALSE; for (int i = 0; i < (int)pArray->GetCount(); i ++) { int iFind = pArray->GetInteger(i); if (iFind == iOptIndex) { if (bSelected) { - return true; + return TRUE; } if (bNotify && m_pForm->m_pFormNotify != NULL) { int iRet = 0; @@ -996,11 +996,11 @@ bool CPDF_FormField::SelectOption(int iOptIndex, bool bSelected, bool bNotify) iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue); } if (iRet < 0) { - return false; + return FALSE; } } pArray->RemoveAt(i); - bReturn = true; + bReturn = TRUE; break; } else if (iFind > iOptIndex) { if (!bSelected) { @@ -1016,15 +1016,15 @@ bool CPDF_FormField::SelectOption(int iOptIndex, bool bSelected, bool bNotify) iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue); } if (iRet < 0) { - return false; + return FALSE; } } CPDF_Number* pNum = CPDF_Number::Create(iOptIndex); if (pNum == NULL) { - return false; + return FALSE; } pArray->InsertAt(i, pNum); - bReturn = true; + bReturn = TRUE; break; } } @@ -1044,10 +1044,10 @@ bool CPDF_FormField::SelectOption(int iOptIndex, bool bSelected, bool bNotify) m_pForm->m_pFormNotify->AfterValueChange(this); } } - m_pForm->m_bUpdated = true; - return true; + m_pForm->m_bUpdated = TRUE; + return TRUE; } -bool CPDF_FormField::ClearSelectedOptions(bool bNotify) +FX_BOOL CPDF_FormField::ClearSelectedOptions(FX_BOOL bNotify) { if (bNotify && m_pForm->m_pFormNotify != NULL) { int iRet = 0; @@ -1063,7 +1063,7 @@ bool CPDF_FormField::ClearSelectedOptions(bool bNotify) iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue); } if (iRet < 0) { - return false; + return FALSE; } } m_pDict->RemoveAt("I"); @@ -1075,8 +1075,8 @@ bool CPDF_FormField::ClearSelectedOptions(bool bNotify) m_pForm->m_pFormNotify->AfterValueChange(this); } } - m_pForm->m_bUpdated = true; - return true; + m_pForm->m_bUpdated = TRUE; + return TRUE; } void CPDF_FormField::LoadDA() { diff --git a/core/src/fpdfdoc/doc_metadata.cpp b/core/src/fpdfdoc/doc_metadata.cpp index 33e1e23d0f..aeeb1d1f60 100644 --- a/core/src/fpdfdoc/doc_metadata.cpp +++ b/core/src/fpdfdoc/doc_metadata.cpp @@ -58,7 +58,7 @@ void CPDF_Metadata::LoadDoc(CPDF_Document *pDoc) return; } CPDF_StreamAcc acc; - acc.LoadAllData(pStream, false); + acc.LoadAllData(pStream, FALSE); int size = acc.GetSize(); const uint8_t* pBuf = acc.GetData(); CXML_Element *&pXmlElmnt = ((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt; diff --git a/core/src/fpdfdoc/doc_ocg.cpp b/core/src/fpdfdoc/doc_ocg.cpp index 6e88309fee..d525227219 100644 --- a/core/src/fpdfdoc/doc_ocg.cpp +++ b/core/src/fpdfdoc/doc_ocg.cpp @@ -25,7 +25,7 @@ static int32_t FPDFDOC_OCG_FindGroup(const CPDF_Object *pObject, const CPDF_Dict } return -1; } -static bool FPDFDOC_OCG_HasIntent(const CPDF_Dictionary *pDict, const CFX_ByteStringC& csElement, const CFX_ByteStringC& csDef = FX_BSTRC("")) +static FX_BOOL FPDFDOC_OCG_HasIntent(const CPDF_Dictionary *pDict, const CFX_ByteStringC& csElement, const CFX_ByteStringC& csDef = FX_BSTRC("")) { FXSYS_assert(pDict != NULL); CPDF_Object *pIntent = pDict->GetElementValue(FX_BSTRC("Intent")); @@ -38,10 +38,10 @@ static bool FPDFDOC_OCG_HasIntent(const CPDF_Dictionary *pDict, const CFX_ByteSt for (FX_DWORD i = 0; i < dwCount; i++) { bsIntent = ((CPDF_Array*)pIntent)->GetString(i); if (bsIntent == FX_BSTRC("All") || bsIntent == csElement) { - return true; + return TRUE; } } - return false; + return FALSE; } bsIntent = pIntent->GetString(); return bsIntent == FX_BSTRC("All") || bsIntent == csElement; @@ -101,24 +101,24 @@ CPDF_OCContext::~CPDF_OCContext() { m_OCGStates.clear(); } -bool CPDF_OCContext::LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, const CPDF_Dictionary *pOCGDict, bool &bValidConfig) const +FX_BOOL CPDF_OCContext::LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, const CPDF_Dictionary *pOCGDict, FX_BOOL &bValidConfig) const { CPDF_Dictionary *pConfig = FPDFDOC_OCG_GetConfig(m_pDocument, pOCGDict, csConfig); if (!pConfig) { - return true; + return TRUE; } - bValidConfig = true; - bool bState = pConfig->GetString(FX_BSTRC("BaseState"), FX_BSTRC("ON")) != FX_BSTRC("OFF"); + bValidConfig = TRUE; + FX_BOOL bState = pConfig->GetString(FX_BSTRC("BaseState"), FX_BSTRC("ON")) != FX_BSTRC("OFF"); CPDF_Array *pArray = pConfig->GetArray(FX_BSTRC("ON")); if (pArray) { if (FPDFDOC_OCG_FindGroup(pArray, pOCGDict) >= 0) { - bState = true; + bState = TRUE; } } pArray = pConfig->GetArray(FX_BSTRC("OFF")); if (pArray) { if (FPDFDOC_OCG_FindGroup(pArray, pOCGDict) >= 0) { - bState = false; + bState = FALSE; } } pArray = pConfig->GetArray(FX_BSTRC("AS")); @@ -149,10 +149,10 @@ bool CPDF_OCContext::LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, con } return bState; } -bool CPDF_OCContext::LoadOCGState(const CPDF_Dictionary *pOCGDict) const +FX_BOOL CPDF_OCContext::LoadOCGState(const CPDF_Dictionary *pOCGDict) const { if (!FPDFDOC_OCG_HasIntent(pOCGDict, FX_BSTRC("View"), FX_BSTRC("View"))) { - return true; + return TRUE; } CFX_ByteString csState = FPDFDOC_OCG_GetUsageTypeString(m_eUsageType); CPDF_Dictionary *pUsage = pOCGDict->GetDict(FX_BSTRC("Usage")); @@ -171,31 +171,31 @@ bool CPDF_OCContext::LoadOCGState(const CPDF_Dictionary *pOCGDict) const } } } - bool bDefValid = false; + FX_BOOL bDefValid = FALSE; return LoadOCGStateFromConfig(csState, pOCGDict, bDefValid); } -bool CPDF_OCContext::GetOCGVisible(const CPDF_Dictionary* pOCGDict) +FX_BOOL CPDF_OCContext::GetOCGVisible(const CPDF_Dictionary* pOCGDict) { if (!pOCGDict) - return false; + return FALSE; const auto it = m_OCGStates.find(pOCGDict); if (it != m_OCGStates.end()) return it->second; - bool bState = LoadOCGState(pOCGDict); + FX_BOOL bState = LoadOCGState(pOCGDict); m_OCGStates[pOCGDict] = bState; return bState; } -bool CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, bool bFromConfig, int nLevel) +FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, int nLevel) { if (nLevel > 32) { - return false; + return FALSE; } if (pExpression == NULL) { - return false; + return FALSE; } int32_t iCount = pExpression->GetCount(); CPDF_Object *pOCGObj; @@ -203,7 +203,7 @@ bool CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, bool bFromConfig, int nLe if (csOperator == FX_BSTRC("Not")) { pOCGObj = pExpression->GetElementValue(1); if (pOCGObj == NULL) { - return false; + return FALSE; } if (pOCGObj->GetType() == PDFOBJ_DICTIONARY) { return !(bFromConfig ? LoadOCGState((CPDF_Dictionary*)pOCGObj) : GetOCGVisible((CPDF_Dictionary*)pOCGObj)); @@ -211,16 +211,16 @@ bool CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, bool bFromConfig, int nLe if (pOCGObj->GetType() == PDFOBJ_ARRAY) { return !GetOCGVE((CPDF_Array*)pOCGObj, bFromConfig, nLevel + 1); } - return false; + return FALSE; } if (csOperator == FX_BSTRC("Or") || csOperator == FX_BSTRC("And")) { - bool bValue = false; + FX_BOOL bValue = FALSE; for (int32_t i = 1; i < iCount; i ++) { pOCGObj = pExpression->GetElementValue(1); if (pOCGObj == NULL) { continue; } - bool bItem = false; + FX_BOOL bItem = FALSE; if (pOCGObj->GetType() == PDFOBJ_DICTIONARY) { bItem = bFromConfig ? LoadOCGState((CPDF_Dictionary*)pOCGObj) : GetOCGVisible((CPDF_Dictionary*)pOCGObj); } else if (pOCGObj->GetType() == PDFOBJ_ARRAY) { @@ -238,9 +238,9 @@ bool CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, bool bFromConfig, int nLe } return bValue; } - return false; + return FALSE; } -bool CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary *pOCMDDict, bool bFromConfig) +FX_BOOL CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary *pOCMDDict, FX_BOOL bFromConfig) { FXSYS_assert(pOCMDDict != NULL); CPDF_Array *pVE = pOCMDDict->GetArray(FX_BSTRC("VE")); @@ -250,50 +250,50 @@ bool CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary *pOCMDDict, bool bFromC CFX_ByteString csP = pOCMDDict->GetString(FX_BSTRC("P"), FX_BSTRC("AnyOn")); CPDF_Object *pOCGObj = pOCMDDict->GetElementValue(FX_BSTRC("OCGs")); if (pOCGObj == NULL) { - return true; + return TRUE; } if (pOCGObj->GetType() == PDFOBJ_DICTIONARY) { return bFromConfig ? LoadOCGState((CPDF_Dictionary*)pOCGObj) : GetOCGVisible((CPDF_Dictionary*)pOCGObj); } if (pOCGObj->GetType() != PDFOBJ_ARRAY) { - return true; + return TRUE; } - bool bState = false; + FX_BOOL bState = FALSE; if (csP == FX_BSTRC("AllOn") || csP == FX_BSTRC("AllOff")) { - bState = true; + bState = TRUE; } int32_t iCount = ((CPDF_Array*)pOCGObj)->GetCount(); for (int32_t i = 0; i < iCount; i ++) { - bool bItem = true; + FX_BOOL bItem = TRUE; CPDF_Dictionary* pItemDict = ((CPDF_Array*)pOCGObj)->GetDict(i); if (pItemDict) { bItem = bFromConfig ? LoadOCGState(pItemDict) : GetOCGVisible(pItemDict); } if (csP == FX_BSTRC("AnyOn") && bItem) { - return true; + return TRUE; } if (csP == FX_BSTRC("AnyOff") && !bItem) { - return true; + return TRUE; } if (csP == FX_BSTRC("AllOn") && !bItem) { - return false; + return FALSE; } if (csP == FX_BSTRC("AllOff") && bItem) { - return false; + return FALSE; } } return bState; } -bool CPDF_OCContext::CheckOCGVisible(const CPDF_Dictionary *pOCGDict) +FX_BOOL CPDF_OCContext::CheckOCGVisible(const CPDF_Dictionary *pOCGDict) { if (!pOCGDict) { - return true; + return TRUE; } CFX_ByteString csType = pOCGDict->GetString(FX_BSTRC("Type"), FX_BSTRC("OCG")); if (csType == FX_BSTRC("OCG")) { return GetOCGVisible(pOCGDict); } - return LoadOCMDState(pOCGDict, false); + return LoadOCMDState(pOCGDict, FALSE); } void CPDF_OCContext::ResetOCContext() { diff --git a/core/src/fpdfdoc/doc_tagged.cpp b/core/src/fpdfdoc/doc_tagged.cpp index 3e44b1ac9b..e9f0c55e2b 100644 --- a/core/src/fpdfdoc/doc_tagged.cpp +++ b/core/src/fpdfdoc/doc_tagged.cpp @@ -9,7 +9,7 @@ #include "../../include/fpdfdoc/fpdf_tagged.h" #include "tagged_int.h" const int nMaxRecursion = 32; -static bool IsTagged(const CPDF_Document* pDoc) +static FX_BOOL IsTagged(const CPDF_Document* pDoc) { CPDF_Dictionary* pCatalog = pDoc->GetRoot(); CPDF_Dictionary* pMarkInfo = pCatalog->GetDict(FX_BSTRC("MarkInfo")); @@ -138,7 +138,7 @@ CPDF_StructElementImpl* CPDF_StructTreeImpl::AddPageNode(CPDF_Dictionary* pDict, } } else { CPDF_StructElementImpl* pParentElement = AddPageNode(pParent, map, nLevel + 1); - bool bSave = false; + FX_BOOL bSave = FALSE; for (int i = 0; i < pParentElement->m_Kids.GetSize(); i ++) { if (pParentElement->m_Kids[i].m_Type != CPDF_StructKid::Element) { continue; @@ -147,7 +147,7 @@ CPDF_StructElementImpl* CPDF_StructTreeImpl::AddPageNode(CPDF_Dictionary* pDict, continue; } pParentElement->m_Kids[i].m_Element.m_pElement = pElement->Retain(); - bSave = true; + bSave = TRUE; } if (!bSave) { pElement->Release(); @@ -156,11 +156,11 @@ CPDF_StructElementImpl* CPDF_StructTreeImpl::AddPageNode(CPDF_Dictionary* pDict, } return pElement; } -bool CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructElementImpl* pElement) +FX_BOOL CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructElementImpl* pElement) { CPDF_Object *pObj = m_pTreeRoot->GetElementValue(FX_BSTRC("K")); if (!pObj) { - return false; + return FALSE; } if (pObj->GetType() == PDFOBJ_DICTIONARY) { if (pObj->GetObjNum() == pDict->GetObjNum()) { @@ -169,13 +169,13 @@ bool CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructEle } m_Kids[0] = pElement->Retain(); } else { - return false; + return FALSE; } } if (pObj->GetType() == PDFOBJ_ARRAY) { CPDF_Array* pTopKids = (CPDF_Array*)pObj; FX_DWORD i; - bool bSave = false; + FX_BOOL bSave = FALSE; for (i = 0; i < pTopKids->GetCount(); i ++) { CPDF_Object* pKidRef = pTopKids->GetElement(i); if (pKidRef == NULL || pKidRef->GetType() != PDFOBJ_REFERENCE) { @@ -188,13 +188,13 @@ bool CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructEle m_Kids[i]->Release(); } m_Kids[i] = pElement->Retain(); - bSave = true; + bSave = TRUE; } if (!bSave) { - return false; + return FALSE; } } - return true; + return TRUE; } CPDF_StructElementImpl::CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_StructElementImpl* pParent, CPDF_Dictionary* pDict) : m_RefCount(0) @@ -340,20 +340,20 @@ static CPDF_Dictionary* FindAttrDict(CPDF_Object* pAttrs, const CFX_ByteStringC& } return NULL; } -CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable, FX_FLOAT fLevel) +CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_BOOL bInheritable, FX_FLOAT fLevel) { if (fLevel > nMaxRecursion) { return NULL; } if (bInheritable) { - CPDF_Object* pAttr = GetAttr(owner, name, false); + CPDF_Object* pAttr = GetAttr(owner, name, FALSE); if (pAttr) { return pAttr; } if (m_pParent == NULL) { return NULL; } - return m_pParent->GetAttr(owner, name, true, fLevel + 1); + return m_pParent->GetAttr(owner, name, TRUE, fLevel + 1); } CPDF_Object* pA = m_pDict->GetElementValue(FX_BSTRC("A")); if (pA) { @@ -391,7 +391,7 @@ CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const } return NULL; } -CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable, int subindex) +CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_BOOL bInheritable, int subindex) { CPDF_Object* pAttr = GetAttr(owner, name, bInheritable); if (pAttr == NULL || subindex == -1 || pAttr->GetType() != PDFOBJ_ARRAY) { @@ -403,7 +403,7 @@ CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const } return pArray->GetElementValue(subindex); } -CFX_ByteString CPDF_StructElementImpl::GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, bool bInheritable, int subindex) +CFX_ByteString CPDF_StructElementImpl::GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, FX_BOOL bInheritable, int subindex) { CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex); if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NAME) { @@ -411,7 +411,7 @@ CFX_ByteString CPDF_StructElementImpl::GetName(const CFX_ByteStringC& owner, con } return pAttr->GetString(); } -FX_ARGB CPDF_StructElementImpl::GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, bool bInheritable, int subindex) +FX_ARGB CPDF_StructElementImpl::GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, FX_BOOL bInheritable, int subindex) { CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex); if (pAttr == NULL || pAttr->GetType() != PDFOBJ_ARRAY) { @@ -420,7 +420,7 @@ FX_ARGB CPDF_StructElementImpl::GetColor(const CFX_ByteStringC& owner, const CFX CPDF_Array* pArray = (CPDF_Array*)pAttr; return 0xff000000 | ((int)(pArray->GetNumber(0) * 255) << 16) | ((int)(pArray->GetNumber(1) * 255) << 8) | (int)(pArray->GetNumber(2) * 255); } -FX_FLOAT CPDF_StructElementImpl::GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, bool bInheritable, int subindex) +FX_FLOAT CPDF_StructElementImpl::GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, FX_BOOL bInheritable, int subindex) { CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex); if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NUMBER) { @@ -428,7 +428,7 @@ FX_FLOAT CPDF_StructElementImpl::GetNumber(const CFX_ByteStringC& owner, const C } return pAttr->GetNumber(); } -int CPDF_StructElementImpl::GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, bool bInheritable, int subindex) +int CPDF_StructElementImpl::GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, FX_BOOL bInheritable, int subindex) { CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex); if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NUMBER) { diff --git a/core/src/fpdfdoc/doc_utils.cpp b/core/src/fpdfdoc/doc_utils.cpp index 26c93f1791..96d2ccf689 100644 --- a/core/src/fpdfdoc/doc_utils.cpp +++ b/core/src/fpdfdoc/doc_utils.cpp @@ -26,10 +26,10 @@ CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict) } return full_name; } -bool CPDF_DefaultAppearance::HasFont() +FX_BOOL CPDF_DefaultAppearance::HasFont() { if (m_csDA.IsEmpty()) { - return false; + return FALSE; } CPDF_SimpleParser syntax(m_csDA); return syntax.FindTagParam("Tf", 2); @@ -65,23 +65,23 @@ void CPDF_DefaultAppearance::GetFont(CFX_ByteString& csFontNameTag, FX_FLOAT& fF } csFontNameTag = PDF_NameDecode(csFontNameTag); } -bool CPDF_DefaultAppearance::HasColor(bool bStrokingOperation) +FX_BOOL CPDF_DefaultAppearance::HasColor(FX_BOOL bStrokingOperation) { if (m_csDA.IsEmpty()) { - return false; + return FALSE; } CPDF_SimpleParser syntax(m_csDA); if (syntax.FindTagParam(bStrokingOperation ? "G" : "g", 1)) { - return true; + return TRUE; } syntax.SetPos(0); if (syntax.FindTagParam(bStrokingOperation ? "RG" : "rg", 3)) { - return true; + return TRUE; } syntax.SetPos(0); return syntax.FindTagParam(bStrokingOperation ? "K" : "k", 4); } -CFX_ByteString CPDF_DefaultAppearance::GetColorString(bool bStrokingOperation) +CFX_ByteString CPDF_DefaultAppearance::GetColorString(FX_BOOL bStrokingOperation) { CFX_ByteString csColor; if (m_csDA.IsEmpty()) { @@ -119,7 +119,7 @@ CFX_ByteString CPDF_DefaultAppearance::GetColorString(bool bStrokingOperation) } return csColor; } -void CPDF_DefaultAppearance::GetColor(int& iColorType, FX_FLOAT fc[4], bool bStrokingOperation) +void CPDF_DefaultAppearance::GetColor(int& iColorType, FX_FLOAT fc[4], FX_BOOL bStrokingOperation) { iColorType = COLORTYPE_TRANSPARENT; for (int c = 0; c < 4; c ++) { @@ -151,7 +151,7 @@ void CPDF_DefaultAppearance::GetColor(int& iColorType, FX_FLOAT fc[4], bool bStr fc[3] = FX_atof((CFX_ByteString)syntax.GetWord()); } } -void CPDF_DefaultAppearance::GetColor(FX_ARGB& color, int& iColorType, bool bStrokingOperation) +void CPDF_DefaultAppearance::GetColor(FX_ARGB& color, int& iColorType, FX_BOOL bStrokingOperation) { color = 0; iColorType = COLORTYPE_TRANSPARENT; @@ -187,10 +187,10 @@ void CPDF_DefaultAppearance::GetColor(FX_ARGB& color, int& iColorType, bool bStr color = ArgbEncode(255, (int)(r * 255 + 0.5f), (int)(g * 255 + 0.5f), (int)(b * 255 + 0.5f)); } } -bool CPDF_DefaultAppearance::HasTextMatrix() +FX_BOOL CPDF_DefaultAppearance::HasTextMatrix() { if (m_csDA.IsEmpty()) { - return false; + return FALSE; } CPDF_SimpleParser syntax(m_csDA); return syntax.FindTagParam("Tm", 6); @@ -468,18 +468,18 @@ CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDo } return GetNativeInterFormFont(pFormDict, pDocument, charSet, csNameTag); } -bool FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag) +FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag) { if (pFormDict == NULL || pFont == NULL) { - return false; + return FALSE; } CPDF_Dictionary* pDR = pFormDict->GetDict("DR"); if (pDR == NULL) { - return false; + return FALSE; } CPDF_Dictionary* pFonts = pDR->GetDict("Font"); if (pFonts == NULL) { - return false; + return FALSE; } FX_POSITION pos = pFonts->GetStartPos(); while (pos) { @@ -499,23 +499,23 @@ bool FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_B } if (pFont->GetFontDict() == pElement) { csNameTag = csKey; - return true; + return TRUE; } } - return false; + return FALSE; } -bool FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag) +FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag) { if (pFormDict == NULL) { - return false; + return FALSE; } CPDF_Dictionary* pDR = pFormDict->GetDict("DR"); if (pDR == NULL) { - return false; + return FALSE; } CPDF_Dictionary* pFonts = pDR->GetDict("Font"); if (pFonts == NULL) { - return false; + return FALSE; } if (csFontName.GetLength() > 0) { csFontName.Remove(' '); @@ -545,10 +545,10 @@ bool FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX csBaseFont.Remove(' '); if (csBaseFont == csFontName) { csNameTag = csKey; - return true; + return TRUE; } } - return false; + return FALSE; } void AddInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont, CFX_ByteString& csNameTag) { @@ -670,10 +670,10 @@ CPDF_IconFit::ScaleMethod CPDF_IconFit::GetScaleMethod() } return Always; } -bool CPDF_IconFit::IsProportionalScale() +FX_BOOL CPDF_IconFit::IsProportionalScale() { if (m_pDict == NULL) { - return true; + return TRUE; } return m_pDict->GetString("S", "P") != "A"; } @@ -694,10 +694,10 @@ void CPDF_IconFit::GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom) } } } -bool CPDF_IconFit::GetFittingBounds() +FX_BOOL CPDF_IconFit::GetFittingBounds() { if (m_pDict == NULL) { - return false; + return FALSE; } return m_pDict->GetBoolean("FB"); } diff --git a/core/src/fpdfdoc/doc_utils.h b/core/src/fpdfdoc/doc_utils.h index 6dcf5b0d28..6bb1d30dbb 100644 --- a/core/src/fpdfdoc/doc_utils.h +++ b/core/src/fpdfdoc/doc_utils.h @@ -15,8 +15,8 @@ CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocumen CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CFX_ByteString& csNameTag); CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, uint8_t charSet, CFX_ByteString& csNameTag); CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag); -bool FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag); -bool FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag); +FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag); +FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag); void AddInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont, CFX_ByteString& csNameTag); CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, uint8_t charSet, CFX_ByteString& csNameTag); CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag); @@ -25,8 +25,8 @@ void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag) CPDF_Font* GetDefaultInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument); void SetDefaultInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont); void SaveCheckedFieldStatus(CPDF_FormField* pField, CFX_ByteArray& statusArray); -bool NeedPDFEncodeForFieldFullName(const CFX_WideString& csFieldName); -bool NeedPDFEncodeForFieldTree(CPDF_Dictionary* pFieldDict, int nLevel = 0); +FX_BOOL NeedPDFEncodeForFieldFullName(const CFX_WideString& csFieldName); +FX_BOOL NeedPDFEncodeForFieldTree(CPDF_Dictionary* pFieldDict, int nLevel = 0); void EncodeFieldName(const CFX_WideString& csName, CFX_ByteString& csT); void UpdateEncodeFieldName(CPDF_Dictionary* pFieldDict, int nLevel = 0); diff --git a/core/src/fpdfdoc/doc_viewerPreferences.cpp b/core/src/fpdfdoc/doc_viewerPreferences.cpp index 1c014dbd38..eb824eb5a4 100644 --- a/core/src/fpdfdoc/doc_viewerPreferences.cpp +++ b/core/src/fpdfdoc/doc_viewerPreferences.cpp @@ -11,21 +11,21 @@ CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document *pDoc): m_pDoc(pDoc CPDF_ViewerPreferences::~CPDF_ViewerPreferences() { } -bool CPDF_ViewerPreferences::IsDirectionR2L() const +FX_BOOL CPDF_ViewerPreferences::IsDirectionR2L() const { CPDF_Dictionary *pDict = m_pDoc->GetRoot(); pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); if (!pDict) { - return false; + return FALSE; } return FX_BSTRC("R2L") == pDict->GetString(FX_BSTRC("Direction")); } -bool CPDF_ViewerPreferences::PrintScaling() const +FX_BOOL CPDF_ViewerPreferences::PrintScaling() const { CPDF_Dictionary *pDict = m_pDoc->GetRoot(); pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); if (!pDict) { - return true; + return TRUE; } return FX_BSTRC("None") != pDict->GetString(FX_BSTRC("PrintScaling")); } diff --git a/core/src/fpdfdoc/doc_vt.cpp b/core/src/fpdfdoc/doc_vt.cpp index 8cc6b7c9f5..230ba764e4 100644 --- a/core/src/fpdfdoc/doc_vt.cpp +++ b/core/src/fpdfdoc/doc_vt.cpp @@ -183,8 +183,8 @@ CPVT_WordPlace CSection::SearchWordPlace(const CPDF_Point & point) const { ASSERT(m_pVT != NULL); CPVT_WordPlace place = GetBeginWordPlace(); - bool bUp = true; - bool bDown = true; + FX_BOOL bUp = TRUE; + FX_BOOL bDown = TRUE; int32_t nLeft = 0; int32_t nRight = m_LineArray.GetSize() - 1; int32_t nMid = m_LineArray.GetSize() / 2; @@ -195,10 +195,10 @@ CPVT_WordPlace CSection::SearchWordPlace(const CPDF_Point & point) const fTop = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineAscent - m_pVT->GetLineLeading(m_SecInfo); fBottom = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineDescent; if (IsFloatBigger(point.y, fTop)) { - bUp = false; + bUp = FALSE; } if (IsFloatSmaller(point.y, fBottom)) { - bDown = false; + bDown = FALSE; } if (IsFloatSmaller(point.y, fTop)) { nRight = nMid - 1; @@ -394,7 +394,7 @@ CPVT_Size CTypeset::GetEditSize(FX_FLOAT fFontSize) { ASSERT(m_pSection != NULL); ASSERT(m_pVT != NULL); - SplitLines(false, fFontSize); + SplitLines(FALSE, fFontSize); return CPVT_Size(m_rcRet.Width(), m_rcRet.Height()); } CPVT_FloatRect CTypeset::Typeset() @@ -402,7 +402,7 @@ CPVT_FloatRect CTypeset::Typeset() ASSERT(m_pSection != NULL); ASSERT(m_pVT != NULL); m_pSection->m_LineArray.Empty(); - SplitLines(true, 0.0f); + SplitLines(TRUE, 0.0f); m_pSection->m_LineArray.Clear(); OutputLines(); return m_rcRet; @@ -425,11 +425,11 @@ static int special_chars[128] = { 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x000C, 0x0000, 0x0008, 0x0000, 0x0000, }; -static bool IsLatin(FX_WORD word) +static FX_BOOL IsLatin(FX_WORD word) { if (word <= 0x007F) { if (special_chars[word] & 0x0001) { - return true; + return TRUE; } } if ((word >= 0x00C0 && word <= 0x00FF) || @@ -439,15 +439,15 @@ static bool IsLatin(FX_WORD word) (word >= 0xA720 && word <= 0xA7FF) || (word >= 0xFF21 && word <= 0xFF3A) || (word >= 0xFF41 && word <= 0xFF5A)) { - return true; + return TRUE; } - return false; + return FALSE; } -static bool IsDigit(FX_DWORD word) +static FX_BOOL IsDigit(FX_DWORD word) { - return (word >= 0x0030 && word <= 0x0039) ? true : false; + return (word >= 0x0030 && word <= 0x0039) ? TRUE : FALSE; } -static bool IsCJK(FX_DWORD word) +static FX_BOOL IsCJK(FX_DWORD word) { if ((word >= 0x1100 && word <= 0x11FF) || (word >= 0x2E80 && word <= 0x2FFF) || @@ -457,33 +457,33 @@ static bool IsCJK(FX_DWORD word) (word >= 0xFE30 && word <= 0xFE4F) || (word >= 0x20000 && word <= 0x2A6DF) || (word >= 0x2F800 && word <= 0x2FA1F)) { - return true; + return TRUE; } if (word >= 0x3000 && word <= 0x303F) { if (word == 0x3005 || word == 0x3006 || word == 0x3021 || word == 0x3022 || word == 0x3023 || word == 0x3024 || word == 0x3025 || word == 0x3026 || word == 0x3027 || word == 0x3028 || word == 0x3029 || word == 0x3031 || word == 0x3032 || word == 0x3033 || word == 0x3034 || word == 0x3035) { - return true; + return TRUE; } - return false; + return FALSE; } if (word >= 0xFF66 && word <= 0xFF9D) { - return true; + return TRUE; } - return false; + return FALSE; } -static bool IsPunctuation(FX_DWORD word) +static FX_BOOL IsPunctuation(FX_DWORD word) { if (word <= 0x007F) { if ((special_chars[word] >> 3) & 1) { - return true; + return TRUE; } } else if (word >= 0x0080 && word <= 0x00FF) { if (word == 0x0082 || word == 0x0084 || word == 0x0085 || word == 0x0091 || word == 0x0092 || word == 0x0093 || word <= 0x0094 || word == 0x0096 || word == 0x00B4 || word == 0x00B8) { - return true; + return TRUE; } } else if (word >= 0x2000 && word <= 0x206F) { if (word == 0x2010 || word == 0x2011 || word == 0x2012 || word == 0x2013 || @@ -492,7 +492,7 @@ static bool IsPunctuation(FX_DWORD word) word == 0x2032 || word == 0x2033 || word == 0x2034 || word == 0x2035 || word == 0x2036 || word == 0x2037 || word == 0x203C || word == 0x203D || word == 0x203E || word == 0x2044) { - return true; + return TRUE; } } else if (word >= 0x3000 && word <= 0x303F) { if (word == 0x3001 || word == 0x3002 || word == 0x3003 || word == 0x3005 || @@ -501,11 +501,11 @@ static bool IsPunctuation(FX_DWORD word) word == 0x3011 || word == 0x3014 || word == 0x3015 || word == 0x3016 || word == 0x3017 || word == 0x3018 || word == 0x3019 || word == 0x301A || word == 0x301B || word == 0x301D || word == 0x301E || word == 0x301F) { - return true; + return TRUE; } } else if (word >= 0xFE50 && word <= 0xFE6F) { if ((word >= 0xFE50 && word <= 0xFE5E) || word == 0xFE63) { - return true; + return TRUE; } } else if (word >= 0xFF00 && word <= 0xFFEF) { if (word == 0xFF01 || word == 0xFF02 || word == 0xFF07 || word == 0xFF08 || @@ -514,83 +514,83 @@ static bool IsPunctuation(FX_DWORD word) word == 0xFF3D || word == 0xFF40 || word == 0xFF5B || word == 0xFF5C || word == 0xFF5D || word == 0xFF61 || word == 0xFF62 || word == 0xFF63 || word == 0xFF64 || word == 0xFF65 || word == 0xFF9E || word == 0xFF9F) { - return true; + return TRUE; } } - return false; + return FALSE; } -static bool IsConnectiveSymbol(FX_DWORD word) +static FX_BOOL IsConnectiveSymbol(FX_DWORD word) { if (word <= 0x007F) { if ((special_chars[word] >> 5) & 1) { - return true; + return TRUE; } } - return false; + return FALSE; } -static bool IsOpenStylePunctuation(FX_DWORD word) +static FX_BOOL IsOpenStylePunctuation(FX_DWORD word) { if (word <= 0x007F) { if ((special_chars[word] >> 2) & 1) { - return true; + return TRUE; } } else if (word == 0x300A || word == 0x300C || word == 0x300E || word == 0x3010 || word == 0x3014 || word == 0x3016 || word == 0x3018 || word == 0x301A || word == 0xFF08 || word == 0xFF3B || word == 0xFF5B || word == 0xFF62) { - return true; + return TRUE; } - return false; + return FALSE; } -static bool IsCurrencySymbol(FX_WORD word) +static FX_BOOL IsCurrencySymbol(FX_WORD word) { if (word == 0x0024 || word == 0x0080 || word == 0x00A2 || word == 0x00A3 || word == 0x00A4 || word == 0x00A5 || (word >= 0x20A0 && word <= 0x20CF) || word == 0xFE69 || word == 0xFF04 || word == 0xFFE0 || word == 0xFFE1 || word == 0xFFE5 || word == 0xFFE6) { - return true; + return TRUE; } - return false; + return FALSE; } -static bool IsPrefixSymbol(FX_WORD word) +static FX_BOOL IsPrefixSymbol(FX_WORD word) { if (IsCurrencySymbol(word)) { - return true; + return TRUE; } if (word == 0x2116) { - return true; + return TRUE; } - return false; + return FALSE; } -static bool IsSpace(FX_WORD word) +static FX_BOOL IsSpace(FX_WORD word) { - return (word == 0x0020 || word == 0x3000) ? true : false; + return (word == 0x0020 || word == 0x3000) ? TRUE : FALSE; } -static bool NeedDivision(FX_WORD prevWord, FX_WORD curWord) +static FX_BOOL NeedDivision(FX_WORD prevWord, FX_WORD curWord) { if ((IsLatin(prevWord) || IsDigit(prevWord)) && (IsLatin(curWord) || IsDigit(curWord))) { - return false; + return FALSE; } if (IsSpace(curWord) || IsPunctuation(curWord)) { - return false; + return FALSE; } if (IsConnectiveSymbol(prevWord) || IsConnectiveSymbol(curWord)) { - return false; + return FALSE; } if (IsSpace(prevWord) || IsPunctuation(prevWord)) { - return true; + return TRUE; } if (IsPrefixSymbol(prevWord)) { - return false; + return FALSE; } if (IsPrefixSymbol(curWord) || IsCJK(curWord)) { - return true; + return TRUE; } if (IsCJK(prevWord)) { - return true; + return TRUE; } - return false; + return FALSE; } -void CTypeset::SplitLines(bool bTypeset, FX_FLOAT fFontSize) +void CTypeset::SplitLines(FX_BOOL bTypeset, FX_FLOAT fFontSize) { ASSERT(m_pVT != NULL); ASSERT(m_pSection != NULL); @@ -601,14 +601,14 @@ void CTypeset::SplitLines(bool bTypeset, FX_FLOAT fFontSize) FX_FLOAT fLineAscent = 0.0f, fBackupLineAscent = 0.0f; FX_FLOAT fLineDescent = 0.0f, fBackupLineDescent = 0.0f; int32_t nWordStartPos = 0; - bool bFullWord = false; + FX_BOOL bFullWord = FALSE; int32_t nLineFullWordIndex = 0; int32_t nCharIndex = 0; CPVT_LineInfo line; FX_FLOAT fWordWidth = 0; FX_FLOAT fTypesetWidth = FPDF_MAX(m_pVT->GetPlateWidth() - m_pVT->GetLineIndent(m_pSection->m_SecInfo), 0.0f); int32_t nTotalWords = m_pSection->m_WordArray.GetSize(); - bool bOpened = false; + FX_BOOL bOpened = FALSE; if (nTotalWords > 0) { int32_t i = 0; while (i < nTotalWords) { @@ -619,8 +619,8 @@ void CTypeset::SplitLines(bool bTypeset, FX_FLOAT fFontSize) } if (pWord) { if (bTypeset) { - fLineAscent = FPDF_MAX(fLineAscent, m_pVT->GetWordAscent(*pWord, true)); - fLineDescent = FPDF_MIN(fLineDescent, m_pVT->GetWordDescent(*pWord, true)); + fLineAscent = FPDF_MAX(fLineAscent, m_pVT->GetWordAscent(*pWord, TRUE)); + fLineDescent = FPDF_MIN(fLineDescent, m_pVT->GetWordDescent(*pWord, TRUE)); fWordWidth = m_pVT->GetWordWidth(*pWord); } else { fLineAscent = FPDF_MAX(fLineAscent, m_pVT->GetWordAscent(*pWord, fFontSize)); @@ -636,20 +636,20 @@ void CTypeset::SplitLines(bool bTypeset, FX_FLOAT fFontSize) } if (!bOpened) { if (IsOpenStylePunctuation(pWord->Word)) { - bOpened = true; - bFullWord = true; + bOpened = TRUE; + bFullWord = TRUE; } else if (pOldWord != NULL) { if (NeedDivision(pOldWord->Word, pWord->Word)) { - bFullWord = true; + bFullWord = TRUE; } } } else { if (!IsSpace(pWord->Word) && !IsOpenStylePunctuation(pWord->Word)) { - bOpened = false; + bOpened = FALSE; } } if (bFullWord) { - bFullWord = false; + bFullWord = FALSE; if (nCharIndex > 0) { nLineFullWordIndex ++; } @@ -691,7 +691,7 @@ void CTypeset::SplitLines(bool bTypeset, FX_FLOAT fFontSize) fLineDescent = 0.0f; nCharIndex = 0; nLineFullWordIndex = 0; - bFullWord = false; + bFullWord = FALSE; } else { fLineWidth += fWordWidth; i++; @@ -809,17 +809,17 @@ void CTypeset::OutputLines() CPDF_VariableText::CPDF_VariableText() : m_nLimitChar(0), m_nCharArray(0), - m_bMultiLine(false), - m_bLimitWidth(false), - m_bAutoFontSize(false), + m_bMultiLine(FALSE), + m_bLimitWidth(FALSE), + m_bAutoFontSize(FALSE), m_nAlignment(0), m_fLineLeading(0.0f), m_fCharSpace(0.0f), m_nHorzScale(100), m_wSubWord(0), m_fFontSize(0.0f), - m_bInitial(false), - m_bRichText(false), + m_bInitial(FALSE), + m_bRichText(FALSE), m_pVTProvider(NULL), m_pVTIterator(NULL) { @@ -848,12 +848,12 @@ void CPDF_VariableText::Initialize() if (CSection * pSection = m_SectionArray.GetAt(0)) { pSection->ResetLinePlace(); } - m_bInitial = true; + m_bInitial = TRUE; } } void CPDF_VariableText::ResetAll() { - m_bInitial = false; + m_bInitial = FALSE; ResetSectionArray(); } CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace & place, FX_WORD word, int32_t charset, @@ -956,7 +956,7 @@ CPVT_WordPlace CPDF_VariableText::InsertText(const CPVT_WordPlace & place, const } CPVT_WordPlace CPDF_VariableText::DeleteWords(const CPVT_WordRange & PlaceRange) { - bool bLastSecPos = false; + FX_BOOL bLastSecPos = FALSE; if (CSection * pSection = m_SectionArray.GetAt(PlaceRange.EndPos.nSecIndex)) { bLastSecPos = (PlaceRange.EndPos == pSection->GetEndWordPlace()); } @@ -971,11 +971,11 @@ CPVT_WordPlace CPDF_VariableText::DeleteWords(const CPVT_WordRange & PlaceRange) } CPVT_WordPlace CPDF_VariableText::DeleteWord(const CPVT_WordPlace & place) { - return ClearRightWord(AjustLineHeader(place, true)); + return ClearRightWord(AjustLineHeader(place, TRUE)); } CPVT_WordPlace CPDF_VariableText::BackSpaceWord(const CPVT_WordPlace & place) { - return ClearLeftWord(AjustLineHeader(place, true)); + return ClearLeftWord(AjustLineHeader(place, TRUE)); } void CPDF_VariableText::SetText(const FX_WCHAR* text, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps) @@ -1044,7 +1044,7 @@ void CPDF_VariableText::UpdateWordPlace(CPVT_WordPlace & place) const if (place.nSecIndex >= m_SectionArray.GetSize()) { place = GetEndWordPlace(); } - place = AjustLineHeader(place, true); + place = AjustLineHeader(place, TRUE); if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) { pSection->UpdateWordPlace(place); } @@ -1073,19 +1073,19 @@ CPVT_WordPlace CPDF_VariableText::WordIndexToWordPlace(int32_t index) const { CPVT_WordPlace place = GetBeginWordPlace(); int32_t nOldIndex = 0 , nIndex = 0; - bool bFind = false; + FX_BOOL bFind = FALSE; for (int32_t i = 0, sz = m_SectionArray.GetSize(); i < sz; i++) { if (CSection * pSection = m_SectionArray.GetAt(i)) { nIndex += pSection->m_WordArray.GetSize(); if (nIndex == index) { place = pSection->GetEndWordPlace(); - bFind = true; + bFind = TRUE; break; } else if (nIndex > index) { place.nSecIndex = i; place.nWordIndex = index - nOldIndex - 1; pSection->UpdateWordPlace(place); - bFind = true; + bFind = TRUE; break; } if (i != m_SectionArray.GetSize() - 1) { @@ -1155,15 +1155,15 @@ CPVT_WordPlace CPDF_VariableText::SearchWordPlace(const CPDF_Point & point) cons int32_t nLeft = 0; int32_t nRight = m_SectionArray.GetSize() - 1; int32_t nMid = m_SectionArray.GetSize() / 2; - bool bUp = true; - bool bDown = true; + FX_BOOL bUp = TRUE; + FX_BOOL bDown = TRUE; while (nLeft <= nRight) { if (CSection * pSection = m_SectionArray.GetAt(nMid)) { if (IsFloatBigger(pt.y, pSection->m_SecInfo.rcSection.top)) { - bUp = false; + bUp = FALSE; } if (IsFloatBigger(pSection->m_SecInfo.rcSection.bottom, pt.y)) { - bDown = false; + bDown = FALSE; } if (IsFloatSmaller(pt.y, pSection->m_SecInfo.rcSection.top)) { nRight = nMid - 1; @@ -1303,49 +1303,49 @@ CPVT_WordPlace CPDF_VariableText::AddWord(const CPVT_WordPlace & place, const CP } return place; } -bool CPDF_VariableText::GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo) +FX_BOOL CPDF_VariableText::GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo) { if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) { if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(place.nWordIndex)) { wordinfo = *pWord; - return true; + return TRUE; } } - return false; + return FALSE; } -bool CPDF_VariableText::SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo) +FX_BOOL CPDF_VariableText::SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo) { if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) { if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(place.nWordIndex)) { *pWord = wordinfo; - return true; + return TRUE; } } - return false; + return FALSE; } -bool CPDF_VariableText::GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo) +FX_BOOL CPDF_VariableText::GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo) { if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) { if (CLine * pLine = pSection->m_LineArray.GetAt(place.nLineIndex)) { lineinfo = pLine->m_LineInfo; - return true; + return TRUE; } } - return false; + return FALSE; } -bool CPDF_VariableText::GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo) +FX_BOOL CPDF_VariableText::GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo) { if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) { secinfo = pSection->m_SecInfo; - return true; + return TRUE; } - return false; + return FALSE; } CPDF_Rect CPDF_VariableText::GetContentRect() const { return InToOut(CPDF_EditContainer::GetContentRect()); } -FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo & WordInfo, bool bFactFontSize) +FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize) { return m_bRichText && WordInfo.pWordProps ? (WordInfo.pWordProps->nScriptType == PVTWORD_SCRIPT_NORMAL || bFactFontSize ? WordInfo.pWordProps->fFontSize : WordInfo.pWordProps->fFontSize * PVT_HALF) : GetFontSize(); } @@ -1391,11 +1391,11 @@ FX_FLOAT CPDF_VariableText::GetWordDescent(const CPVT_WordInfo & WordInfo, FX_FL { return GetFontDescent(GetWordFontIndex(WordInfo), fFontSize); } -FX_FLOAT CPDF_VariableText::GetWordAscent(const CPVT_WordInfo & WordInfo, bool bFactFontSize) +FX_FLOAT CPDF_VariableText::GetWordAscent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize) { return GetFontAscent(GetWordFontIndex(WordInfo), GetWordFontSize(WordInfo, bFactFontSize)); } -FX_FLOAT CPDF_VariableText::GetWordDescent(const CPVT_WordInfo & WordInfo, bool bFactFontSize) +FX_FLOAT CPDF_VariableText::GetWordDescent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize) { return GetFontDescent(GetWordFontIndex(WordInfo), GetWordFontSize(WordInfo, bFactFontSize)); } @@ -1421,7 +1421,7 @@ int32_t CPDF_VariableText::GetHorzScale(const CPVT_WordInfo & WordInfo) } void CPDF_VariableText::ClearSectionRightWords(const CPVT_WordPlace & place) { - CPVT_WordPlace wordplace = AjustLineHeader(place, true); + CPVT_WordPlace wordplace = AjustLineHeader(place, TRUE); if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) { for (int32_t w = pSection->m_WordArray.GetSize() - 1; w > wordplace.nWordIndex; w--) { delete pSection->m_WordArray.GetAt(w); @@ -1429,26 +1429,26 @@ void CPDF_VariableText::ClearSectionRightWords(const CPVT_WordPlace & place) } } } -CPVT_WordPlace CPDF_VariableText::AjustLineHeader(const CPVT_WordPlace & place, bool bPrevOrNext) const +CPVT_WordPlace CPDF_VariableText::AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const { if (place.nWordIndex < 0 && place.nLineIndex > 0) { return bPrevOrNext ? GetPrevWordPlace(place) : GetNextWordPlace(place); } return place; } -bool CPDF_VariableText::ClearEmptySection(const CPVT_WordPlace & place) +FX_BOOL CPDF_VariableText::ClearEmptySection(const CPVT_WordPlace & place) { if (place.nSecIndex == 0 && m_SectionArray.GetSize() == 1) { - return false; + return FALSE; } if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) { if (pSection->m_WordArray.GetSize() == 0) { delete pSection; m_SectionArray.RemoveAt(place.nSecIndex); - return true; + return TRUE; } } - return false; + return FALSE; } void CPDF_VariableText::ClearEmptySections(const CPVT_WordRange & PlaceRange) { @@ -1460,7 +1460,7 @@ void CPDF_VariableText::ClearEmptySections(const CPVT_WordRange & PlaceRange) } void CPDF_VariableText::LinkLatterSection(const CPVT_WordPlace & place) { - CPVT_WordPlace oldplace = AjustLineHeader(place, true); + CPVT_WordPlace oldplace = AjustLineHeader(place, TRUE); if (CSection * pNextSection = m_SectionArray.GetAt(place.nSecIndex + 1)) { if (CSection * pSection = m_SectionArray.GetAt(oldplace.nSecIndex)) { for (int32_t w = 0, sz = pNextSection->m_WordArray.GetSize(); w < sz; w++) { @@ -1477,8 +1477,8 @@ void CPDF_VariableText::LinkLatterSection(const CPVT_WordPlace & place) void CPDF_VariableText::ClearWords(const CPVT_WordRange & PlaceRange) { CPVT_WordRange NewRange; - NewRange.BeginPos = AjustLineHeader(PlaceRange.BeginPos, true); - NewRange.EndPos = AjustLineHeader(PlaceRange.EndPos, true); + NewRange.BeginPos = AjustLineHeader(PlaceRange.BeginPos, TRUE); + NewRange.EndPos = AjustLineHeader(PlaceRange.EndPos, TRUE); for (int32_t s = NewRange.EndPos.nSecIndex; s >= NewRange.BeginPos.nSecIndex; s--) { if (CSection * pSection = m_SectionArray.GetAt(s)) { pSection->ClearWords(NewRange); @@ -1507,7 +1507,7 @@ CPVT_WordPlace CPDF_VariableText::ClearLeftWord(const CPVT_WordPlace & place) CPVT_WordPlace CPDF_VariableText::ClearRightWord(const CPVT_WordPlace & place) { if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) { - CPVT_WordPlace rightplace = AjustLineHeader(GetNextWordPlace(place), false); + CPVT_WordPlace rightplace = AjustLineHeader(GetNextWordPlace(place), FALSE); if (rightplace != place) { if(rightplace.nSecIndex != place.nSecIndex) { LinkLatterSection(place); @@ -1568,9 +1568,9 @@ FX_FLOAT CPDF_VariableText::GetAutoFontSize() } return (FX_FLOAT)gFontSizeSteps[nMid]; } -bool CPDF_VariableText::IsBigger(FX_FLOAT fFontSize) +FX_BOOL CPDF_VariableText::IsBigger(FX_FLOAT fFontSize) { - bool bBigger = false; + FX_BOOL bBigger = FALSE; CPVT_Size szTotal; for (int32_t s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) { if (CSection * pSection = m_SectionArray.GetAt(s)) { @@ -1580,7 +1580,7 @@ bool CPDF_VariableText::IsBigger(FX_FLOAT fFontSize) if (IsFloatBigger(szTotal.x, GetPlateWidth()) || IsFloatBigger(szTotal.y, GetPlateHeight()) ) { - bBigger = true; + bBigger = TRUE; break; } } @@ -1652,9 +1652,9 @@ int32_t CPDF_VariableText::GetDefaultFontIndex() { return m_pVTProvider ? m_pVTProvider->GetDefaultFontIndex() : -1; } -bool CPDF_VariableText::IsLatinWord(FX_WORD word) +FX_BOOL CPDF_VariableText::IsLatinWord(FX_WORD word) { - return m_pVTProvider ? m_pVTProvider->IsLatinWord(word) : false; + return m_pVTProvider ? m_pVTProvider->IsLatinWord(word) : FALSE; } IPDF_VariableText_Iterator * CPDF_VariableText::GetIterator() { @@ -1687,70 +1687,70 @@ void CPDF_VariableText_Iterator::SetAt(const CPVT_WordPlace & place) ASSERT(m_pVT != NULL); m_CurPos = place; } -bool CPDF_VariableText_Iterator::NextWord() +FX_BOOL CPDF_VariableText_Iterator::NextWord() { if (m_CurPos == m_pVT->GetEndWordPlace()) { - return false; + return FALSE; } m_CurPos = m_pVT->GetNextWordPlace(m_CurPos); - return true; + return TRUE; } -bool CPDF_VariableText_Iterator::PrevWord() +FX_BOOL CPDF_VariableText_Iterator::PrevWord() { if (m_CurPos == m_pVT->GetBeginWordPlace()) { - return false; + return FALSE; } m_CurPos = m_pVT->GetPrevWordPlace(m_CurPos); - return true; + return TRUE; } -bool CPDF_VariableText_Iterator::NextLine() +FX_BOOL CPDF_VariableText_Iterator::NextLine() { if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) { if (m_CurPos.nLineIndex < pSection->m_LineArray.GetSize() - 1) { m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex + 1, -1); - return true; + return TRUE; } if (m_CurPos.nSecIndex < m_pVT->m_SectionArray.GetSize() - 1) { m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex + 1, 0, -1); - return true; + return TRUE; } } - return false; + return FALSE; } -bool CPDF_VariableText_Iterator::PrevLine() +FX_BOOL CPDF_VariableText_Iterator::PrevLine() { if (m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) { if (m_CurPos.nLineIndex > 0) { m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex - 1, -1); - return true; + return TRUE; } if (m_CurPos.nSecIndex > 0) { if (CSection * pLastSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex - 1)) { m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex - 1, pLastSection->m_LineArray.GetSize() - 1, -1); - return true; + return TRUE; } } } - return false; + return FALSE; } -bool CPDF_VariableText_Iterator::NextSection() +FX_BOOL CPDF_VariableText_Iterator::NextSection() { if (m_CurPos.nSecIndex < m_pVT->m_SectionArray.GetSize() - 1) { m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex + 1, 0, -1); - return true; + return TRUE; } - return false; + return FALSE; } -bool CPDF_VariableText_Iterator::PrevSection() +FX_BOOL CPDF_VariableText_Iterator::PrevSection() { ASSERT(m_pVT != NULL); if (m_CurPos.nSecIndex > 0) { m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex - 1, 0, -1); - return true; + return TRUE; } - return false; + return FALSE; } -bool CPDF_VariableText_Iterator::GetWord(CPVT_Word & word) const +FX_BOOL CPDF_VariableText_Iterator::GetWord(CPVT_Word & word) const { ASSERT(m_pVT != NULL); word.WordPlace = m_CurPos; @@ -1770,13 +1770,13 @@ bool CPDF_VariableText_Iterator::GetWord(CPVT_Word & word) const } word.nFontIndex = m_pVT->GetWordFontIndex(*pWord); word.fFontSize = m_pVT->GetWordFontSize(*pWord); - return true; + return TRUE; } } } - return false; + return FALSE; } -bool CPDF_VariableText_Iterator::SetWord(const CPVT_Word & word) +FX_BOOL CPDF_VariableText_Iterator::SetWord(const CPVT_Word & word) { ASSERT(m_pVT != NULL); if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) { @@ -1784,12 +1784,12 @@ bool CPDF_VariableText_Iterator::SetWord(const CPVT_Word & word) if (pWord->pWordProps) { *pWord->pWordProps = word.WordProps; } - return true; + return TRUE; } } - return false; + return FALSE; } -bool CPDF_VariableText_Iterator::GetLine(CPVT_Line & line) const +FX_BOOL CPDF_VariableText_Iterator::GetLine(CPVT_Line & line) const { ASSERT(m_pVT != NULL); line.lineplace = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex, -1); @@ -1802,12 +1802,12 @@ bool CPDF_VariableText_Iterator::GetLine(CPVT_Line & line) const line.fLineAscent = pLine->m_LineInfo.fLineAscent; line.fLineDescent = pLine->m_LineInfo.fLineDescent; line.lineEnd = pLine->GetEndWordPlace(); - return true; + return TRUE; } } - return false; + return FALSE; } -bool CPDF_VariableText_Iterator::GetSection(CPVT_Section & section) const +FX_BOOL CPDF_VariableText_Iterator::GetSection(CPVT_Section & section) const { ASSERT(m_pVT != NULL); section.secplace = CPVT_WordPlace(m_CurPos.nSecIndex, 0, -1); @@ -1819,11 +1819,11 @@ bool CPDF_VariableText_Iterator::GetSection(CPVT_Section & section) const if (pSection->m_SecInfo.pWordProps) { section.WordProps = *pSection->m_SecInfo.pWordProps; } - return true; + return TRUE; } - return false; + return FALSE; } -bool CPDF_VariableText_Iterator::SetSection(const CPVT_Section & section) +FX_BOOL CPDF_VariableText_Iterator::SetSection(const CPVT_Section & section) { ASSERT(m_pVT != NULL); if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) { @@ -1833,7 +1833,7 @@ bool CPDF_VariableText_Iterator::SetSection(const CPVT_Section & section) if (pSection->m_SecInfo.pWordProps) { *pSection->m_SecInfo.pWordProps = section.WordProps; } - return true; + return TRUE; } - return false; + return FALSE; } diff --git a/core/src/fpdfdoc/pdf_vt.h b/core/src/fpdfdoc/pdf_vt.h index fb7910bff5..a75490fcd5 100644 --- a/core/src/fpdfdoc/pdf_vt.h +++ b/core/src/fpdfdoc/pdf_vt.h @@ -191,7 +191,7 @@ struct CPVT_FloatRange { template<class TYPE> class CPVT_ArrayTemplate : public CFX_ArrayTemplate<TYPE> { public: - bool IsEmpty() + FX_BOOL IsEmpty() { return CFX_ArrayTemplate<TYPE>::GetSize() <= 0; } @@ -316,7 +316,7 @@ public: CPVT_FloatRect Typeset(); CPVT_FloatRect CharArray(); private: - void SplitLines(bool bTypeset, FX_FLOAT fFontSize); + void SplitLines(FX_BOOL bTypeset, FX_FLOAT fFontSize); void OutputLines(); CPVT_FloatRect m_rcRet; @@ -423,11 +423,11 @@ public: { m_nHorzScale = nHorzScale; } - void SetMultiLine(bool bMultiLine = true) + void SetMultiLine(FX_BOOL bMultiLine = TRUE) { m_bMultiLine = bMultiLine; } - void SetAutoReturn(bool bAuto = true) + void SetAutoReturn(FX_BOOL bAuto = TRUE) { m_bLimitWidth = bAuto; } @@ -439,11 +439,11 @@ public: { m_nCharArray = nCharArray; } - void SetAutoFontSize(bool bAuto = true) + void SetAutoFontSize(FX_BOOL bAuto = TRUE) { m_bAutoFontSize = bAuto; } - void SetRichText(bool bRichText) + void SetRichText(FX_BOOL bRichText) { m_bRichText = bRichText; } @@ -452,11 +452,11 @@ public: m_fLineLeading = fLineLeading; } void Initialize(); - bool IsValid() const + FX_BOOL IsValid() const { return m_bInitial; } - bool IsRichText() const + FX_BOOL IsRichText() const { return m_bRichText; } @@ -496,7 +496,7 @@ public: { return m_nLimitChar; } - bool IsMultiLine() const + FX_BOOL IsMultiLine() const { return m_bMultiLine; } @@ -537,25 +537,25 @@ private: int32_t GetTypeDescent(int32_t nFontIndex); int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex); int32_t GetDefaultFontIndex(); - bool IsLatinWord(FX_WORD word); + FX_BOOL IsLatinWord(FX_WORD word); private: CPVT_WordPlace AddSection(const CPVT_WordPlace & place, const CPVT_SectionInfo & secinfo); CPVT_WordPlace AddLine(const CPVT_WordPlace & place, const CPVT_LineInfo & lineinfo); CPVT_WordPlace AddWord(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo); - bool GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo); - bool SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo); - bool GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo); - bool GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo); - FX_FLOAT GetWordFontSize(const CPVT_WordInfo & WordInfo, bool bFactFontSize = false); + FX_BOOL GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo); + FX_BOOL SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo); + FX_BOOL GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo); + FX_BOOL GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo); + FX_FLOAT GetWordFontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); FX_FLOAT GetWordWidth(int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord, FX_FLOAT fCharSpace, int32_t nHorzScale, FX_FLOAT fFontSize, FX_FLOAT fWordTail, int32_t nWordStyle); FX_FLOAT GetWordWidth(const CPVT_WordInfo & WordInfo); FX_FLOAT GetWordAscent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize); FX_FLOAT GetWordDescent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize); - FX_FLOAT GetWordAscent(const CPVT_WordInfo & WordInfo, bool bFactFontSize = false); - FX_FLOAT GetWordDescent(const CPVT_WordInfo & WordInfo, bool bFactFontSize = false); + FX_FLOAT GetWordAscent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); + FX_FLOAT GetWordDescent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); FX_FLOAT GetLineAscent(const CPVT_SectionInfo & SecInfo); FX_FLOAT GetLineDescent(const CPVT_SectionInfo & SecInfo); FX_FLOAT GetFontAscent(int32_t nFontIndex, FX_FLOAT fFontSize); @@ -568,8 +568,8 @@ private: int32_t GetAlignment(const CPVT_SectionInfo& SecInfo); void ClearSectionRightWords(const CPVT_WordPlace & place); - CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, bool bPrevOrNext) const; - bool ClearEmptySection(const CPVT_WordPlace & place); + CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const; + FX_BOOL ClearEmptySection(const CPVT_WordPlace & place); void ClearEmptySections(const CPVT_WordRange & PlaceRange); void LinkLatterSection(const CPVT_WordPlace & place); void ClearWords(const CPVT_WordRange & PlaceRange); @@ -578,7 +578,7 @@ private: private: CPVT_FloatRect Rearrange(const CPVT_WordRange & PlaceRange); FX_FLOAT GetAutoFontSize(); - bool IsBigger(FX_FLOAT fFontSize); + FX_BOOL IsBigger(FX_FLOAT fFontSize); CPVT_FloatRect RearrangeSections(const CPVT_WordRange & PlaceRange); private: void ResetSectionArray(); @@ -586,9 +586,9 @@ private: CPVT_ArrayTemplate<CSection*> m_SectionArray; int32_t m_nLimitChar; int32_t m_nCharArray; - bool m_bMultiLine; - bool m_bLimitWidth; - bool m_bAutoFontSize; + FX_BOOL m_bMultiLine; + FX_BOOL m_bLimitWidth; + FX_BOOL m_bAutoFontSize; int32_t m_nAlignment; FX_FLOAT m_fLineLeading; FX_FLOAT m_fCharSpace; @@ -597,8 +597,8 @@ private: FX_FLOAT m_fFontSize; private: - bool m_bInitial; - bool m_bRichText; + FX_BOOL m_bInitial; + FX_BOOL m_bRichText; IPDF_VariableText_Provider * m_pVTProvider; CPDF_VariableText_Iterator * m_pVTIterator; }; @@ -607,17 +607,17 @@ class CPDF_VariableText_Iterator : public IPDF_VariableText_Iterator public: CPDF_VariableText_Iterator(CPDF_VariableText * pVT); virtual ~CPDF_VariableText_Iterator(); - bool NextWord(); - bool PrevWord(); - bool NextLine(); - bool PrevLine(); - bool NextSection(); - bool PrevSection(); - bool SetWord(const CPVT_Word & word); - bool GetWord(CPVT_Word & word) const; - bool GetLine(CPVT_Line & line) const; - bool GetSection(CPVT_Section & section) const; - bool SetSection(const CPVT_Section & section); + FX_BOOL NextWord(); + FX_BOOL PrevWord(); + FX_BOOL NextLine(); + FX_BOOL PrevLine(); + FX_BOOL NextSection(); + FX_BOOL PrevSection(); + FX_BOOL SetWord(const CPVT_Word & word); + FX_BOOL GetWord(CPVT_Word & word) const; + FX_BOOL GetLine(CPVT_Line & line) const; + FX_BOOL GetSection(CPVT_Section & section) const; + FX_BOOL SetSection(const CPVT_Section & section); void SetAt(int32_t nWordIndex); void SetAt(const CPVT_WordPlace & place); const CPVT_WordPlace & GetAt() const diff --git a/core/src/fpdfdoc/tagged_int.h b/core/src/fpdfdoc/tagged_int.h index 1279617681..9c643a6d6b 100644 --- a/core/src/fpdfdoc/tagged_int.h +++ b/core/src/fpdfdoc/tagged_int.h @@ -26,7 +26,7 @@ public: void LoadDocTree(); void LoadPageTree(const CPDF_Dictionary* pPageDict); CPDF_StructElementImpl* AddPageNode(CPDF_Dictionary* pElement, CFX_MapPtrToPtr& map, int nLevel = 0); - bool AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructElementImpl* pElement); + FX_BOOL AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructElementImpl* pElement); protected: const CPDF_Dictionary* m_pTreeRoot; const CPDF_Dictionary* m_pRoleMap; @@ -67,16 +67,16 @@ public: return &m_ObjectArray; } - CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable = false, FX_FLOAT fLevel = 0.0F); + CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_BOOL bInheritable = FALSE, FX_FLOAT fLevel = 0.0F); - CFX_ByteString GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, bool bInheritable = false, int subindex = -1); - FX_ARGB GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, bool bInheritable = false, int subindex = -1); - FX_FLOAT GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, bool bInheritable = false, int subindex = -1); - int GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, bool bInheritable = false, int subindex = -1); + CFX_ByteString GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, FX_BOOL bInheritable = FALSE, int subindex = -1); + FX_ARGB GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, FX_BOOL bInheritable = FALSE, int subindex = -1); + FX_FLOAT GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, FX_BOOL bInheritable = FALSE, int subindex = -1); + int GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, FX_BOOL bInheritable = FALSE, int subindex = -1); CFX_PtrArray m_ObjectArray; void LoadKids(CPDF_Dictionary* pDict); void LoadKid(FX_DWORD PageObjNum, CPDF_Object* pObj, CPDF_StructKid* pKid); - CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable, int subindex); + CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_BOOL bInheritable, int subindex); CPDF_StructElementImpl* Retain(); void Release(); protected: |