Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: fpdfsdk/src/formfiller/FFL_ComboBox.cpp

Issue 1252613002: FX_BOOL considered harmful. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Manual edits. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_CheckBox.cpp ('k') | fpdfsdk/src/formfiller/FFL_FormFiller.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/formfiller/FFL_ComboBox.cpp
diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
index d3a494405f9f919f961673cf82183a8332a50a9f..d85083fe2858879a1e08f419b0461b4bf12ec163 100644
--- a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
@@ -78,14 +78,14 @@ CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageVie
}
-FX_BOOL CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+bool CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
-FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView)
+bool CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView)
{
- if (CPWL_ComboBox * pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ if (CPWL_ComboBox * pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
{
int32_t nCurSel = pWnd->GetSelect();
@@ -108,35 +108,35 @@ FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView)
}
}
- return FALSE;
+ return false;
}
void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView)
{
ASSERT(m_pWidget != NULL);
- if (CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ if (CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
{
CFX_WideString swText = pWnd->GetText();
int32_t nCurSel = pWnd->GetSelect();
//mantis:0004157
- FX_BOOL bSetValue = TRUE;
+ bool bSetValue = true;
if (m_pWidget->GetFieldFlags() & FIELDFLAG_EDIT)
{
if (nCurSel >= 0)
{
if (swText != m_pWidget->GetOptionLabel(nCurSel))
- bSetValue = TRUE;
+ bSetValue = true;
else
- bSetValue = FALSE;
+ bSetValue = false;
}
else
- bSetValue = TRUE;
+ bSetValue = true;
}
else
- bSetValue = FALSE;
+ bSetValue = false;
CFX_WideString sOldValue;
@@ -144,15 +144,15 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView)
if (bSetValue)
{
sOldValue = m_pWidget->GetValue();
- m_pWidget->SetValue(swText, FALSE);
+ m_pWidget->SetValue(swText, false);
}
else
{
m_pWidget->GetSelectedIndex(0);
- m_pWidget->SetOptionSelection(nCurSel, TRUE, FALSE);
+ m_pWidget->SetOptionSelection(nCurSel, true, false);
}
- m_pWidget->ResetFieldAppearance(TRUE);
+ m_pWidget->ResetFieldAppearance(true);
m_pWidget->UpdateField();
SetChangeMark();
@@ -167,7 +167,7 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView)
switch (type)
{
case CPDF_AAction::KeyStroke:
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
{
if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
{
@@ -189,7 +189,7 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView)
}
break;
case CPDF_AAction::Validate:
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
{
if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
{
@@ -215,7 +215,7 @@ void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AAc
switch (type)
{
case CPDF_AAction::KeyStroke:
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
{
if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
{
@@ -229,7 +229,7 @@ void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AAc
}
}
-FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+bool CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
const PDFSDK_FieldAction& faNew)
{
switch (type)
@@ -241,14 +241,14 @@ FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const
break;
}
- return FALSE;
+ return false;
}
void CFFL_ComboBox::SaveState(CPDFSDK_PageView* pPageView)
{
ASSERT(pPageView != NULL);
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
{
m_State.nIndex = pComboBox->GetSelect();
@@ -264,7 +264,7 @@ void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView)
{
ASSERT(pPageView != NULL);
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, TRUE))
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, true))
{
if (m_State.nIndex >= 0)
pComboBox->SetSelect(m_State.nIndex);
@@ -279,7 +279,7 @@ void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView)
}
}
-CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
+CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue)
{
if (bRestoreValue)
SaveState(pPageView);
@@ -291,17 +291,17 @@ CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRe
if (bRestoreValue)
{
RestoreState(pPageView);
- pRet = GetPDFWindow(pPageView, FALSE);
+ pRet = GetPDFWindow(pPageView, false);
}
else
- pRet = GetPDFWindow(pPageView, TRUE);
+ pRet = GetPDFWindow(pPageView, true);
m_pWidget->UpdateField();
return pRet;
}
-void CFFL_ComboBox::OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag)
+void CFFL_ComboBox::OnKeyStroke(bool bKeyDown, FX_UINT nFlag)
{
ASSERT(m_pWidget != NULL);
@@ -317,7 +317,7 @@ void CFFL_ComboBox::OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag)
if (CommitData(pPageView, nFlag))
{
DestroyPDFWindow(pPageView);
- m_bValid = FALSE;
+ m_bValid = false;
}
}
}
@@ -340,7 +340,7 @@ void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd)
int nCharacters = wsText.GetLength();
CFX_ByteString bsUTFText = wsText.UTF16LE_Encode();
unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str();
- m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, TRUE);
+ m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, true);
pEdit->SetEditNotify(this);
}
@@ -351,25 +351,25 @@ void CFFL_ComboBox::OnKillFocus(CPWL_Wnd* pWnd)
ASSERT(m_pApp != NULL);
}
-FX_BOOL CFFL_ComboBox::CanCopy(CPDFSDK_Document* pDocument)
+bool CFFL_ComboBox::CanCopy(CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_ComboBox::CanCut(CPDFSDK_Document* pDocument)
+bool CFFL_ComboBox::CanCut(CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_ComboBox::CanPaste(CPDFSDK_Document* pDocument)
+bool CFFL_ComboBox::CanPaste(CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
- return FALSE;
+ return false;
}
void CFFL_ComboBox::OnAddUndo(CPWL_Edit* pEdit)
@@ -383,7 +383,7 @@ CFX_WideString CFFL_ComboBox::GetSelectExportText()
int nExport = -1;
CPDFSDK_PageView *pPageView = GetCurPageView();
- if (CPWL_ComboBox * pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ if (CPWL_ComboBox * pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
{
nExport = pComboBox->GetSelect();
}
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_CheckBox.cpp ('k') | fpdfsdk/src/formfiller/FFL_FormFiller.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698