summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-02 14:37:54 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-02 14:37:55 -0700
commit4cf551577856f89103e162edc761def44ffb96fc (patch)
tree452684db6c2dd2b9aa697415ff4b752e59123b77 /fpdfsdk/formfiller
parent66bd67023f747c489d7144aaf4ca6222c686cd26 (diff)
downloadpdfium-4cf551577856f89103e162edc761def44ffb96fc.tar.xz
Remove FX_BOOL from fpdfsdk.
Review-Url: https://codereview.chromium.org/2453683011
Diffstat (limited to 'fpdfsdk/formfiller')
-rw-r--r--fpdfsdk/formfiller/cffl_checkbox.cpp46
-rw-r--r--fpdfsdk/formfiller/cffl_checkbox.h18
-rw-r--r--fpdfsdk/formfiller/cffl_combobox.cpp54
-rw-r--r--fpdfsdk/formfiller/cffl_combobox.h16
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp243
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.h112
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp353
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.h133
-rw-r--r--fpdfsdk/formfiller/cffl_listbox.cpp40
-rw-r--r--fpdfsdk/formfiller/cffl_listbox.h8
-rw-r--r--fpdfsdk/formfiller/cffl_pushbutton.cpp6
-rw-r--r--fpdfsdk/formfiller/cffl_pushbutton.h4
-rw-r--r--fpdfsdk/formfiller/cffl_radiobutton.cpp50
-rw-r--r--fpdfsdk/formfiller/cffl_radiobutton.h18
-rw-r--r--fpdfsdk/formfiller/cffl_textfield.cpp60
-rw-r--r--fpdfsdk/formfiller/cffl_textfield.h16
16 files changed, 576 insertions, 601 deletions
diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp
index 8b5a97c01d..ffa3a032cf 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.cpp
+++ b/fpdfsdk/formfiller/cffl_checkbox.cpp
@@ -26,76 +26,76 @@ CPWL_Wnd* CFFL_CheckBox::NewPDFWindow(const PWL_CREATEPARAM& cp,
return pWnd;
}
-FX_BOOL CFFL_CheckBox::OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags) {
+bool CFFL_CheckBox::OnKeyDown(CPDFSDK_Annot* pAnnot,
+ uint32_t nKeyCode,
+ uint32_t nFlags) {
switch (nKeyCode) {
case FWL_VKEY_Return:
case FWL_VKEY_Space:
- return TRUE;
+ return true;
default:
return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags);
}
}
-FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) {
+bool CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot,
+ uint32_t nChar,
+ uint32_t nFlags) {
switch (nChar) {
case FWL_VKEY_Return:
case FWL_VKEY_Space: {
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
ASSERT(pPageView);
- FX_BOOL bReset = FALSE;
- FX_BOOL bExit = FALSE;
+ bool bReset = false;
+ bool bExit = false;
CPDFSDK_Annot::ObservedPtr pObserved(m_pWidget);
m_pFormFillEnv->GetInteractiveFormFiller()->OnButtonUp(
&pObserved, pPageView, bReset, bExit, nFlags);
if (!pObserved) {
m_pWidget = nullptr;
- return TRUE;
+ return true;
}
if (bReset || bExit)
- return TRUE;
+ return true;
CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
- if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE))
+ if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, true))
pWnd->SetCheck(!pWnd->IsChecked());
CommitData(pPageView, nFlags);
- return TRUE;
+ return true;
}
default:
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
}
-FX_BOOL CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+bool CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point);
if (IsValid()) {
- if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE)) {
+ if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, true)) {
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
pWnd->SetCheck(!pWidget->IsChecked());
}
if (!CommitData(pPageView, nFlags))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_CheckBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
- CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE);
+bool CFFL_CheckBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
+ CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, false);
return pWnd && pWnd->IsChecked() != m_pWidget->IsChecked();
}
void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView) {
- if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, false)) {
bool bNewChecked = pWnd->IsChecked();
if (bNewChecked) {
diff --git a/fpdfsdk/formfiller/cffl_checkbox.h b/fpdfsdk/formfiller/cffl_checkbox.h
index 0c62d5741b..65dba29f2e 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.h
+++ b/fpdfsdk/formfiller/cffl_checkbox.h
@@ -17,17 +17,15 @@ class CFFL_CheckBox : public CFFL_Button {
// CFFL_Button
CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp,
CPDFSDK_PageView* pPageView) override;
- FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags) override;
- FX_BOOL OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
+ bool OnKeyDown(CPDFSDK_Annot* pAnnot,
+ uint32_t nKeyCode,
uint32_t nFlags) override;
- FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) override;
- FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView) override;
+ bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override;
+ bool OnLButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) override;
+ bool IsDataChanged(CPDFSDK_PageView* pPageView) override;
void SaveData(CPDFSDK_PageView* pPageView) override;
};
diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp
index cb2fdf4d73..c8438a3a28 100644
--- a/fpdfsdk/formfiller/cffl_combobox.cpp
+++ b/fpdfsdk/formfiller/cffl_combobox.cpp
@@ -75,16 +75,16 @@ CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp,
return pWnd;
}
-FX_BOOL CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) {
+bool CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot,
+ uint32_t nChar,
+ uint32_t nFlags) {
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
-FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
- CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE);
+bool CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
+ CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, false);
if (!pWnd)
- return FALSE;
+ return false;
int32_t nCurSel = pWnd->GetSelect();
if (!(m_pWidget->GetFieldFlags() & FIELDFLAG_EDIT))
@@ -98,7 +98,7 @@ FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView) {
CPWL_ComboBox* pWnd =
- static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE));
+ static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, false));
if (!pWnd)
return;
@@ -111,13 +111,13 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView) {
bSetValue = (nCurSel < 0) || (swText != m_pWidget->GetOptionLabel(nCurSel));
if (bSetValue) {
- 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();
@@ -130,7 +130,7 @@ void CFFL_ComboBox::GetActionData(CPDFSDK_PageView* pPageView,
switch (type) {
case CPDF_AAction::KeyStroke:
if (CPWL_ComboBox* pComboBox =
- static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
+ static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, false))) {
if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
fa.bFieldFull = pEdit->IsTextFull();
int nSelStart = 0;
@@ -150,7 +150,7 @@ void CFFL_ComboBox::GetActionData(CPDFSDK_PageView* pPageView,
break;
case CPDF_AAction::Validate:
if (CPWL_ComboBox* pComboBox =
- static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
+ static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, false))) {
if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
fa.sValue = pEdit->GetText();
}
@@ -171,7 +171,7 @@ void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView,
switch (type) {
case CPDF_AAction::KeyStroke:
if (CPWL_ComboBox* pComboBox =
- static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
+ static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, false))) {
if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
pEdit->SetSel(fa.nSelStart, fa.nSelEnd);
pEdit->ReplaceSel(fa.sChange);
@@ -183,9 +183,9 @@ void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView,
}
}
-FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& faOld,
- const PDFSDK_FieldAction& faNew) {
+bool CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& faOld,
+ const PDFSDK_FieldAction& faNew) {
switch (type) {
case CPDF_AAction::KeyStroke:
return (!faOld.bFieldFull && faOld.nSelEnd != faNew.nSelEnd) ||
@@ -195,14 +195,14 @@ FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type,
break;
}
- return FALSE;
+ return false;
}
void CFFL_ComboBox::SaveState(CPDFSDK_PageView* pPageView) {
ASSERT(pPageView);
if (CPWL_ComboBox* pComboBox =
- static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
+ static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, false))) {
m_State.nIndex = pComboBox->GetSelect();
if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
@@ -216,7 +216,7 @@ void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView) {
ASSERT(pPageView);
if (CPWL_ComboBox* pComboBox =
- static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, TRUE))) {
+ static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, true))) {
if (m_State.nIndex >= 0) {
pComboBox->SetSelect(m_State.nIndex);
} else {
@@ -229,7 +229,7 @@ void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView) {
}
CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView,
- FX_BOOL bRestoreValue) {
+ bool bRestoreValue) {
if (bRestoreValue)
SaveState(pPageView);
@@ -239,9 +239,9 @@ CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView,
if (bRestoreValue) {
RestoreState(pPageView);
- pRet = GetPDFWindow(pPageView, FALSE);
+ pRet = GetPDFWindow(pPageView, false);
} else {
- pRet = GetPDFWindow(pPageView, TRUE);
+ pRet = GetPDFWindow(pPageView, true);
}
m_pWidget->UpdateField();
@@ -250,13 +250,13 @@ CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView,
}
#ifdef PDF_ENABLE_XFA
-FX_BOOL CFFL_ComboBox::IsFieldFull(CPDFSDK_PageView* pPageView) {
+bool CFFL_ComboBox::IsFieldFull(CPDFSDK_PageView* pPageView) {
if (CPWL_ComboBox* pComboBox =
- static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
+ static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, false))) {
if (CPWL_Edit* pEdit = pComboBox->GetEdit())
return pEdit->IsTextFull();
}
- return FALSE;
+ return false;
}
#endif // PDF_ENABLE_XFA
@@ -273,7 +273,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_pFormFillEnv->OnSetFieldInputFocus(pBuffer, nCharacters, TRUE);
+ m_pFormFillEnv->OnSetFieldInputFocus(pBuffer, nCharacters, true);
}
}
@@ -283,7 +283,7 @@ CFX_WideString CFFL_ComboBox::GetSelectExportText() {
int nExport = -1;
CPDFSDK_PageView* pPageView = GetCurPageView(true);
if (CPWL_ComboBox* pComboBox =
- (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) {
+ (CPWL_ComboBox*)GetPDFWindow(pPageView, false)) {
nExport = pComboBox->GetSelect();
}
diff --git a/fpdfsdk/formfiller/cffl_combobox.h b/fpdfsdk/formfiller/cffl_combobox.h
index 6881038353..aab10b90e1 100644
--- a/fpdfsdk/formfiller/cffl_combobox.h
+++ b/fpdfsdk/formfiller/cffl_combobox.h
@@ -28,10 +28,8 @@ class CFFL_ComboBox : public CFFL_FormFiller, public IPWL_FocusHandler {
PWL_CREATEPARAM GetCreateParam() override;
CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp,
CPDFSDK_PageView* pPageView) override;
- FX_BOOL OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) override;
- FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView) override;
+ bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override;
+ bool IsDataChanged(CPDFSDK_PageView* pPageView) override;
void SaveData(CPDFSDK_PageView* pPageView) override;
void GetActionData(CPDFSDK_PageView* pPageView,
CPDF_AAction::AActionType type,
@@ -39,20 +37,20 @@ class CFFL_ComboBox : public CFFL_FormFiller, public IPWL_FocusHandler {
void SetActionData(CPDFSDK_PageView* pPageView,
CPDF_AAction::AActionType type,
const PDFSDK_FieldAction& fa) override;
- FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& faOld,
- const PDFSDK_FieldAction& faNew) override;
+ bool IsActionDataChanged(CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& faOld,
+ const PDFSDK_FieldAction& faNew) override;
void SaveState(CPDFSDK_PageView* pPageView) override;
void RestoreState(CPDFSDK_PageView* pPageView) override;
CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView,
- FX_BOOL bRestoreValue) override;
+ bool bRestoreValue) override;
// IPWL_FocusHandler:
void OnSetFocus(CPWL_Wnd* pWnd) override;
#ifdef PDF_ENABLE_XFA
// CFFL_FormFiller:
- FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView) override;
+ bool IsFieldFull(CPDFSDK_PageView* pPageView) override;
#endif // PDF_ENABLE_XFA
private:
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index 1e58d10799..7c1dec46b3 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -23,7 +23,7 @@
CFFL_FormFiller::CFFL_FormFiller(CPDFSDK_FormFillEnvironment* pFormFillEnv,
CPDFSDK_Annot* pAnnot)
- : m_pFormFillEnv(pFormFillEnv), m_pAnnot(pAnnot), m_bValid(FALSE) {
+ : m_pFormFillEnv(pFormFillEnv), m_pAnnot(pAnnot), m_bValid(false) {
m_pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
}
@@ -45,13 +45,13 @@ void CFFL_FormFiller::DestroyWindows() {
void CFFL_FormFiller::SetWindowRect(CPDFSDK_PageView* pPageView,
const CFX_FloatRect& rcWindow) {
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
- pWnd->Move(CFX_FloatRect(rcWindow), TRUE, FALSE);
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false)) {
+ pWnd->Move(CFX_FloatRect(rcWindow), true, false);
}
}
CFX_FloatRect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView) {
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false)) {
return pWnd->GetWindowRect();
}
@@ -65,7 +65,7 @@ FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
CFX_FloatRect rcAnnot = m_pWidget->GetRect();
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false)) {
CFX_FloatRect rcWindow = pWnd->GetWindowRect();
rcAnnot = PWLtoFFL(rcWindow);
}
@@ -87,7 +87,7 @@ void CFFL_FormFiller::OnDraw(CPDFSDK_PageView* pPageView,
CFX_Matrix* pUser2Device) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false)) {
CFX_Matrix mt = GetCurMatrix();
mt.Concat(*pUser2Device);
pWnd->DrawAppearance(pDevice, &mt);
@@ -116,139 +116,139 @@ void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
ASSERT(m_pWidget);
}
-FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) {
- m_bValid = TRUE;
+bool CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true)) {
+ m_bValid = true;
FX_RECT rect = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
if (!rect.Contains((int)point.x, (int)point.y))
- return FALSE;
+ return false;
return pWnd->OnLButtonDown(WndtoPWL(pPageView, point), nFlags);
}
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
- CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE);
+bool CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
+ CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false);
if (!pWnd)
- return FALSE;
+ return false;
FX_RECT rcFFL = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rcFFL.left, rcFFL.top, rcFFL.right, rcFFL.bottom);
pWnd->OnLButtonUp(WndtoPWL(pPageView, point), nFlags);
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
- CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE);
+bool CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
+ CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false);
if (!pWnd)
- return FALSE;
+ return false;
pWnd->OnLButtonDblClk(WndtoPWL(pPageView, point), nFlags);
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+bool CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
if (m_ptOldPos != point)
m_ptOldPos = point;
- CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE);
+ CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false);
if (!pWnd)
- return FALSE;
+ return false;
pWnd->OnMouseMove(WndtoPWL(pPageView, point), nFlags);
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- short zDelta,
- const CFX_FloatPoint& point) {
+bool CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ short zDelta,
+ const CFX_FloatPoint& point) {
if (!IsValid())
- return FALSE;
+ return false;
- CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE);
+ CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true);
return pWnd && pWnd->OnMouseWheel(zDelta, WndtoPWL(pPageView, point), nFlags);
}
-FX_BOOL CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
- CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE);
+bool CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
+ CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true);
if (!pWnd)
- return FALSE;
+ return false;
pWnd->OnRButtonDown(WndtoPWL(pPageView, point), nFlags);
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
- CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE);
+bool CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
+ CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false);
if (!pWnd)
- return FALSE;
+ return false;
pWnd->OnRButtonUp(WndtoPWL(pPageView, point), nFlags);
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags) {
+bool CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot,
+ uint32_t nKeyCode,
+ uint32_t nFlags) {
if (IsValid()) {
CPDFSDK_PageView* pPageView = GetCurPageView(true);
ASSERT(pPageView);
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false)) {
return pWnd->OnKeyDown(nKeyCode, nFlags);
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) {
+bool CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot,
+ uint32_t nChar,
+ uint32_t nFlags) {
if (IsValid()) {
CPDFSDK_PageView* pPageView = GetCurPageView(true);
ASSERT(pPageView);
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false)) {
return pWnd->OnChar(nChar, nFlags);
}
}
- return FALSE;
+ return false;
}
void CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag) {
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
UnderlyingPageType* pPage = pWidget->GetUnderlyingPage();
CPDFSDK_PageView* pPageView = m_pFormFillEnv->GetPageView(pPage, true);
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE))
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true))
pWnd->SetFocus();
- m_bValid = TRUE;
+ m_bValid = true;
FX_RECT rcRect = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom);
}
@@ -263,24 +263,24 @@ void CFFL_FormFiller::KillFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag) {
CommitData(pPageView, nFlag);
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE))
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false))
pWnd->KillFocus();
- FX_BOOL bDestroyPDFWindow;
+ bool bDestroyPDFWindow;
switch (m_pWidget->GetFieldType()) {
case FIELDTYPE_PUSHBUTTON:
case FIELDTYPE_CHECKBOX:
case FIELDTYPE_RADIOBUTTON:
- bDestroyPDFWindow = TRUE;
+ bDestroyPDFWindow = true;
break;
default:
- bDestroyPDFWindow = FALSE;
+ bDestroyPDFWindow = false;
break;
}
EscapeFiller(pPageView, bDestroyPDFWindow);
}
-FX_BOOL CFFL_FormFiller::IsValid() const {
+bool CFFL_FormFiller::IsValid() const {
return m_bValid;
}
@@ -342,7 +342,7 @@ PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() {
}
CPWL_Wnd* CFFL_FormFiller::GetPDFWindow(CPDFSDK_PageView* pPageView,
- FX_BOOL bNew) {
+ bool bNew) {
ASSERT(pPageView);
auto it = m_Maps.find(pPageView);
@@ -454,7 +454,7 @@ CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView(bool renew) {
}
CFX_FloatRect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) {
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false)) {
CFX_FloatRect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect()));
CFX_FloatRect rcPage = pPageView->GetPDFPage()->GetPageBBox();
if (rcPage.Contains(rcFocus))
@@ -511,47 +511,46 @@ CFX_FloatRect CFFL_FormFiller::FFLtoWnd(CPDFSDK_PageView* pPageView,
return rect;
}
-FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView,
- uint32_t nFlag) {
+bool CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, uint32_t nFlag) {
if (IsDataChanged(pPageView)) {
- FX_BOOL bRC = TRUE;
- FX_BOOL bExit = FALSE;
+ bool bRC = true;
+ bool bExit = false;
CFFL_InteractiveFormFiller* pFormFiller =
m_pFormFillEnv->GetInteractiveFormFiller();
CPDFSDK_Annot::ObservedPtr pObserved(m_pWidget);
pFormFiller->OnKeyStrokeCommit(&pObserved, pPageView, bRC, bExit, nFlag);
if (!pObserved || bExit)
- return TRUE;
+ return true;
if (!bRC) {
- ResetPDFWindow(pPageView, FALSE);
- return TRUE;
+ ResetPDFWindow(pPageView, false);
+ return true;
}
pFormFiller->OnValidate(&pObserved, pPageView, bRC, bExit, nFlag);
if (!pObserved || bExit)
- return TRUE;
+ return true;
if (!bRC) {
- ResetPDFWindow(pPageView, FALSE);
- return TRUE;
+ ResetPDFWindow(pPageView, false);
+ return true;
}
SaveData(pPageView);
pFormFiller->OnCalculate(m_pWidget, pPageView, bExit, nFlag);
if (bExit)
- return TRUE;
+ return true;
pFormFiller->OnFormat(m_pWidget, pPageView, bExit, nFlag);
}
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_FormFiller::IsDataChanged(CPDFSDK_PageView* pPageView) {
- return FALSE;
+bool CFFL_FormFiller::IsDataChanged(CPDFSDK_PageView* pPageView) {
+ return false;
}
void CFFL_FormFiller::SaveData(CPDFSDK_PageView* pPageView) {}
#ifdef PDF_ENABLE_XFA
-FX_BOOL CFFL_FormFiller::IsFieldFull(CPDFSDK_PageView* pPageView) {
- return FALSE;
+bool CFFL_FormFiller::IsFieldFull(CPDFSDK_PageView* pPageView) {
+ return false;
}
#endif // PDF_ENABLE_XFA
@@ -569,10 +568,10 @@ void CFFL_FormFiller::SetActionData(CPDFSDK_PageView* pPageView,
CPDF_AAction::AActionType type,
const PDFSDK_FieldAction& fa) {}
-FX_BOOL CFFL_FormFiller::IsActionDataChanged(CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& faOld,
- const PDFSDK_FieldAction& faNew) {
- return FALSE;
+bool CFFL_FormFiller::IsActionDataChanged(CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& faOld,
+ const PDFSDK_FieldAction& faNew) {
+ return false;
}
void CFFL_FormFiller::SaveState(CPDFSDK_PageView* pPageView) {}
@@ -580,8 +579,8 @@ void CFFL_FormFiller::SaveState(CPDFSDK_PageView* pPageView) {}
void CFFL_FormFiller::RestoreState(CPDFSDK_PageView* pPageView) {}
CPWL_Wnd* CFFL_FormFiller::ResetPDFWindow(CPDFSDK_PageView* pPageView,
- FX_BOOL bRestoreValue) {
- return GetPDFWindow(pPageView, FALSE);
+ bool bRestoreValue) {
+ return GetPDFWindow(pPageView, false);
}
void CFFL_FormFiller::TimerProc() {}
@@ -591,8 +590,8 @@ CFX_SystemHandler* CFFL_FormFiller::GetSystemHandler() const {
}
void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView,
- FX_BOOL bDestroyPDFWindow) {
- m_bValid = FALSE;
+ bool bDestroyPDFWindow) {
+ m_bValid = false;
FX_RECT rcRect = GetViewBBox(pPageView, m_pWidget);
InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom);
@@ -611,20 +610,20 @@ void CFFL_FormFiller::InvalidateRect(double left,
CFFL_Button::CFFL_Button(CPDFSDK_FormFillEnvironment* pApp,
CPDFSDK_Annot* pWidget)
- : CFFL_FormFiller(pApp, pWidget), m_bMouseIn(FALSE), m_bMouseDown(FALSE) {}
+ : CFFL_FormFiller(pApp, pWidget), m_bMouseIn(false), m_bMouseDown(false) {}
CFFL_Button::~CFFL_Button() {}
void CFFL_Button::OnMouseEnter(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot) {
- m_bMouseIn = TRUE;
+ m_bMouseIn = true;
FX_RECT rect = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
}
void CFFL_Button::OnMouseExit(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot) {
- m_bMouseIn = FALSE;
+ m_bMouseIn = false;
FX_RECT rect = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
@@ -632,44 +631,44 @@ void CFFL_Button::OnMouseExit(CPDFSDK_PageView* pPageView,
ASSERT(m_pWidget);
}
-FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+bool CFFL_Button::OnLButtonDown(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
CFX_FloatRect rcAnnot = pAnnot->GetRect();
if (!rcAnnot.Contains(point.x, point.y))
- return FALSE;
+ return false;
- m_bMouseDown = TRUE;
- m_bValid = TRUE;
+ m_bMouseDown = true;
+ m_bValid = true;
FX_RECT rect = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_Button::OnLButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+bool CFFL_Button::OnLButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
CFX_FloatRect rcAnnot = pAnnot->GetRect();
if (!rcAnnot.Contains(point.x, point.y))
- return FALSE;
+ return false;
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
m_pWidget->GetPDFPage();
FX_RECT rect = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_Button::OnMouseMove(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+bool CFFL_Button::OnMouseMove(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
ASSERT(m_pFormFillEnv);
- return TRUE;
+ return true;
}
void CFFL_Button::OnDraw(CPDFSDK_PageView* pPageView,
diff --git a/fpdfsdk/formfiller/cffl_formfiller.h b/fpdfsdk/formfiller/cffl_formfiller.h
index cd04de4765..cf1aaf7205 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.h
+++ b/fpdfsdk/formfiller/cffl_formfiller.h
@@ -38,42 +38,40 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler {
virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot);
virtual void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot);
- virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point);
- virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point);
- virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point);
- virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point);
- virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView,
+ virtual bool OnLButtonDown(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point);
+ virtual bool OnLButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point);
+ virtual bool OnLButtonDblClk(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
uint32_t nFlags,
- short zDelta,
const CFX_FloatPoint& point);
- virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point);
- virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point);
-
- virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags);
- virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
+ virtual bool OnMouseMove(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point);
+ virtual bool OnMouseWheel(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ short zDelta,
+ const CFX_FloatPoint& point);
+ virtual bool OnRButtonDown(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point);
+ virtual bool OnRButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point);
+
+ virtual bool OnKeyDown(CPDFSDK_Annot* pAnnot,
+ uint32_t nKeyCode,
uint32_t nFlags);
+ virtual bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags);
void SetFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag);
void KillFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag);
@@ -92,15 +90,15 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler {
virtual void SetActionData(CPDFSDK_PageView* pPageView,
CPDF_AAction::AActionType type,
const PDFSDK_FieldAction& fa);
- virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& faOld,
- const PDFSDK_FieldAction& faNew);
+ virtual bool IsActionDataChanged(CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& faOld,
+ const PDFSDK_FieldAction& faNew);
virtual void SaveState(CPDFSDK_PageView* pPageView);
virtual void RestoreState(CPDFSDK_PageView* pPageView);
virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView,
- FX_BOOL bRestoreValue);
+ bool bRestoreValue);
CFX_Matrix GetCurMatrix();
@@ -118,24 +116,24 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler {
const CFX_FloatRect& rcWindow);
CFX_FloatRect GetWindowRect(CPDFSDK_PageView* pPageView);
- FX_BOOL CommitData(CPDFSDK_PageView* pPageView, uint32_t nFlag);
- virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
+ bool CommitData(CPDFSDK_PageView* pPageView, uint32_t nFlag);
+ virtual bool IsDataChanged(CPDFSDK_PageView* pPageView);
virtual void SaveData(CPDFSDK_PageView* pPageView);
#ifdef PDF_ENABLE_XFA
- virtual FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView);
+ virtual bool IsFieldFull(CPDFSDK_PageView* pPageView);
#endif // PDF_ENABLE_XFA
- CPWL_Wnd* GetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bNew);
+ CPWL_Wnd* GetPDFWindow(CPDFSDK_PageView* pPageView, bool bNew);
void DestroyPDFWindow(CPDFSDK_PageView* pPageView);
- void EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroyPDFWindow);
+ void EscapeFiller(CPDFSDK_PageView* pPageView, bool bDestroyPDFWindow);
virtual PWL_CREATEPARAM GetCreateParam();
virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp,
CPDFSDK_PageView* pPageView) = 0;
virtual CFX_FloatRect GetFocusBox(CPDFSDK_PageView* pPageView);
- FX_BOOL IsValid() const;
+ bool IsValid() const;
CFX_FloatRect GetPDFWindowRect() const;
CPDFSDK_PageView* GetCurPageView(bool renew);
@@ -162,7 +160,7 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler {
CPDFSDK_Widget* m_pWidget;
CPDFSDK_Annot* m_pAnnot;
- FX_BOOL m_bValid;
+ bool m_bValid;
CFFL_PageView2PDFWindow m_Maps;
CFX_FloatPoint m_ptOldPos;
};
@@ -177,18 +175,18 @@ class CFFL_Button : public CFFL_FormFiller {
void OnMouseEnter(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot) override;
void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) override;
- FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) override;
- FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) override;
- FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) override;
+ bool OnLButtonDown(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) override;
+ bool OnLButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) override;
+ bool OnMouseMove(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) override;
void OnDraw(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice,
@@ -199,8 +197,8 @@ class CFFL_Button : public CFFL_FormFiller {
CFX_Matrix* pUser2Device) override;
protected:
- FX_BOOL m_bMouseIn;
- FX_BOOL m_bMouseDown;
+ bool m_bMouseIn;
+ bool m_bMouseDown;
};
#endif // FPDFSDK_FORMFILLER_CFFL_FORMFILLER_H_
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index a699522aa8..01009d25f0 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -28,20 +28,20 @@
CFFL_InteractiveFormFiller::CFFL_InteractiveFormFiller(
CPDFSDK_FormFillEnvironment* pFormFillEnv)
- : m_pFormFillEnv(pFormFillEnv), m_bNotifying(FALSE) {}
+ : m_pFormFillEnv(pFormFillEnv), m_bNotifying(false) {}
CFFL_InteractiveFormFiller::~CFFL_InteractiveFormFiller() {}
-FX_BOOL CFFL_InteractiveFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- CFX_FloatPoint point) {
+bool CFFL_InteractiveFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ CFX_FloatPoint point) {
CFX_FloatRect rc = pAnnot->GetRect();
return rc.Contains(point.x, point.y);
}
FX_RECT CFFL_InteractiveFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot) {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
return pFormFiller->GetViewBBox(pPageView, pAnnot);
ASSERT(pPageView);
@@ -61,7 +61,7 @@ void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
if (!IsVisible(pWidget))
return;
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) {
if (pFormFiller->IsValid()) {
pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device);
pAnnot->GetPDFPage();
@@ -90,7 +90,7 @@ void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
}
}
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) {
pFormFiller->OnDrawDeactive(pPageView, pAnnot, pDevice, pUser2Device);
} else {
pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr);
@@ -112,7 +112,7 @@ void CFFL_InteractiveFormFiller::OnMouseEnter(
if (!m_bNotifying) {
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot->Get());
if (pWidget->GetAAction(CPDF_AAction::CursorEnter).GetDict()) {
- m_bNotifying = TRUE;
+ m_bNotifying = true;
int nValueAge = pWidget->GetValueAge();
pWidget->ClearAppModified();
@@ -122,19 +122,19 @@ void CFFL_InteractiveFormFiller::OnMouseEnter(
fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag);
fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag);
pWidget->OnAAction(CPDF_AAction::CursorEnter, fa, pPageView);
- m_bNotifying = FALSE;
+ m_bNotifying = false;
if (!(*pAnnot))
return;
if (pWidget->IsAppModified()) {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false)) {
pFormFiller->ResetPDFWindow(pPageView,
pWidget->GetValueAge() == nValueAge);
}
}
}
}
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), TRUE))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), true))
pFormFiller->OnMouseEnter(pPageView, pAnnot->Get());
}
@@ -145,7 +145,7 @@ void CFFL_InteractiveFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
if (!m_bNotifying) {
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot->Get());
if (pWidget->GetAAction(CPDF_AAction::CursorExit).GetDict()) {
- m_bNotifying = TRUE;
+ m_bNotifying = true;
pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
@@ -156,23 +156,23 @@ void CFFL_InteractiveFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag);
fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag);
pWidget->OnAAction(CPDF_AAction::CursorExit, fa, pPageView);
- m_bNotifying = FALSE;
+ m_bNotifying = false;
if (!(*pAnnot))
return;
if (pWidget->IsAppModified()) {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false)) {
pFormFiller->ResetPDFWindow(pPageView,
nValueAge == pWidget->GetValueAge());
}
}
}
}
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), FALSE))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false))
pFormFiller->OnMouseExit(pPageView, pAnnot->Get());
}
-FX_BOOL CFFL_InteractiveFormFiller::OnLButtonDown(
+bool CFFL_InteractiveFormFiller::OnLButtonDown(
CPDFSDK_PageView* pPageView,
CPDFSDK_Annot::ObservedPtr* pAnnot,
uint32_t nFlags,
@@ -182,7 +182,7 @@ FX_BOOL CFFL_InteractiveFormFiller::OnLButtonDown(
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot->Get());
if (Annot_HitTest(pPageView, pAnnot->Get(), point) &&
pWidget->GetAAction(CPDF_AAction::ButtonDown).GetDict()) {
- m_bNotifying = TRUE;
+ m_bNotifying = true;
pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
@@ -193,32 +193,31 @@ FX_BOOL CFFL_InteractiveFormFiller::OnLButtonDown(
fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlags);
fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlags);
pWidget->OnAAction(CPDF_AAction::ButtonDown, fa, pPageView);
- m_bNotifying = FALSE;
+ m_bNotifying = false;
if (!(*pAnnot))
- return TRUE;
+ return true;
if (!IsValidAnnot(pPageView, pAnnot->Get()))
- return TRUE;
+ return true;
if (pWidget->IsAppModified()) {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false)) {
pFormFiller->ResetPDFWindow(pPageView,
nValueAge == pWidget->GetValueAge());
}
}
}
}
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), FALSE))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false))
return pFormFiller->OnLButtonDown(pPageView, pAnnot->Get(), nFlags, point);
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_InteractiveFormFiller::OnLButtonUp(
- CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot::ObservedPtr* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+bool CFFL_InteractiveFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot::ObservedPtr* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot->Get());
@@ -235,20 +234,20 @@ FX_BOOL CFFL_InteractiveFormFiller::OnLButtonUp(
break;
}
- FX_BOOL bRet = FALSE;
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), FALSE))
+ bool bRet = false;
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false))
bRet = pFormFiller->OnLButtonUp(pPageView, pAnnot->Get(), nFlags, point);
if (m_pFormFillEnv->GetFocusAnnot() == pAnnot->Get()) {
- FX_BOOL bExit = FALSE;
- FX_BOOL bReset = FALSE;
+ bool bExit = false;
+ bool bReset = false;
OnButtonUp(pAnnot, pPageView, bReset, bExit, nFlags);
if (!pAnnot || bExit)
- return TRUE;
+ return true;
#ifdef PDF_ENABLE_XFA
OnClick(pWidget, pPageView, bReset, bExit, nFlags);
if (!pAnnot || bExit)
- return TRUE;
+ return true;
#endif // PDF_ENABLE_XFA
}
return bRet;
@@ -256,13 +255,13 @@ FX_BOOL CFFL_InteractiveFormFiller::OnLButtonUp(
void CFFL_InteractiveFormFiller::OnButtonUp(CPDFSDK_Annot::ObservedPtr* pAnnot,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
+ bool& bReset,
+ bool& bExit,
uint32_t nFlag) {
if (!m_bNotifying) {
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot->Get());
if (pWidget->GetAAction(CPDF_AAction::ButtonUp).GetDict()) {
- m_bNotifying = TRUE;
+ m_bNotifying = true;
int nAge = pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
@@ -272,123 +271,120 @@ void CFFL_InteractiveFormFiller::OnButtonUp(CPDFSDK_Annot::ObservedPtr* pAnnot,
fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag);
fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag);
pWidget->OnAAction(CPDF_AAction::ButtonUp, fa, pPageView);
- m_bNotifying = FALSE;
+ m_bNotifying = false;
if (!(*pAnnot) || !IsValidAnnot(pPageView, pWidget)) {
- bExit = TRUE;
+ bExit = true;
return;
}
if (nAge != pWidget->GetAppearanceAge()) {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false)) {
pFormFiller->ResetPDFWindow(pPageView,
nValueAge == pWidget->GetValueAge());
}
- bReset = TRUE;
+ bReset = true;
}
}
}
}
-FX_BOOL CFFL_InteractiveFormFiller::OnLButtonDblClk(
+bool CFFL_InteractiveFormFiller::OnLButtonDblClk(
CPDFSDK_PageView* pPageView,
CPDFSDK_Annot::ObservedPtr* pAnnot,
uint32_t nFlags,
const CFX_FloatPoint& point) {
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
- CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), FALSE);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false);
return pFormFiller &&
pFormFiller->OnLButtonDblClk(pPageView, pAnnot->Get(), nFlags, point);
}
-FX_BOOL CFFL_InteractiveFormFiller::OnMouseMove(
- CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot::ObservedPtr* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+bool CFFL_InteractiveFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot::ObservedPtr* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
- CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), TRUE);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), true);
return pFormFiller &&
pFormFiller->OnMouseMove(pPageView, pAnnot->Get(), nFlags, point);
}
-FX_BOOL CFFL_InteractiveFormFiller::OnMouseWheel(
+bool CFFL_InteractiveFormFiller::OnMouseWheel(
CPDFSDK_PageView* pPageView,
CPDFSDK_Annot::ObservedPtr* pAnnot,
uint32_t nFlags,
short zDelta,
const CFX_FloatPoint& point) {
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
- CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), FALSE);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false);
return pFormFiller &&
pFormFiller->OnMouseWheel(pPageView, pAnnot->Get(), nFlags, zDelta,
point);
}
-FX_BOOL CFFL_InteractiveFormFiller::OnRButtonDown(
+bool CFFL_InteractiveFormFiller::OnRButtonDown(
CPDFSDK_PageView* pPageView,
CPDFSDK_Annot::ObservedPtr* pAnnot,
uint32_t nFlags,
const CFX_FloatPoint& point) {
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
- CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), FALSE);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false);
return pFormFiller &&
pFormFiller->OnRButtonDown(pPageView, pAnnot->Get(), nFlags, point);
}
-FX_BOOL CFFL_InteractiveFormFiller::OnRButtonUp(
- CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot::ObservedPtr* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+bool CFFL_InteractiveFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot::ObservedPtr* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
- CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), FALSE);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false);
return pFormFiller &&
pFormFiller->OnRButtonUp(pPageView, pAnnot->Get(), nFlags, point);
}
-FX_BOOL CFFL_InteractiveFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags) {
+bool CFFL_InteractiveFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot,
+ uint32_t nKeyCode,
+ uint32_t nFlags) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) {
return pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlags);
}
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_InteractiveFormFiller::OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) {
+bool CFFL_InteractiveFormFiller::OnChar(CPDFSDK_Annot* pAnnot,
+ uint32_t nChar,
+ uint32_t nFlags) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
if (nChar == FWL_VKEY_Tab)
- return TRUE;
+ return true;
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
return pFormFiller->OnChar(pAnnot, nChar, nFlags);
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_InteractiveFormFiller::OnSetFocus(
- CPDFSDK_Annot::ObservedPtr* pAnnot,
- uint32_t nFlag) {
+bool CFFL_InteractiveFormFiller::OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot,
+ uint32_t nFlag) {
if (!(*pAnnot))
- return FALSE;
+ return false;
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
if (!m_bNotifying) {
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot->Get());
if (pWidget->GetAAction(CPDF_AAction::GetFocus).GetDict()) {
- m_bNotifying = TRUE;
+ m_bNotifying = true;
pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
pWidget->ClearAppModified();
- CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, TRUE);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, true);
if (!pFormFiller)
- return FALSE;
+ return false;
CPDFSDK_PageView* pPageView = (*pAnnot)->GetPageView();
ASSERT(pPageView);
@@ -398,12 +394,12 @@ FX_BOOL CFFL_InteractiveFormFiller::OnSetFocus(
fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag);
pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa);
pWidget->OnAAction(CPDF_AAction::GetFocus, fa, pPageView);
- m_bNotifying = FALSE;
+ m_bNotifying = false;
if (!(*pAnnot))
- return FALSE;
+ return false;
if (pWidget->IsAppModified()) {
- if (CFFL_FormFiller* pFiller = GetFormFiller(pWidget, FALSE)) {
+ if (CFFL_FormFiller* pFiller = GetFormFiller(pWidget, false)) {
pFiller->ResetPDFWindow(pPageView,
nValueAge == pWidget->GetValueAge());
}
@@ -411,25 +407,24 @@ FX_BOOL CFFL_InteractiveFormFiller::OnSetFocus(
}
}
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), TRUE))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), true))
pFormFiller->SetFocusForAnnot(pAnnot->Get(), nFlag);
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_InteractiveFormFiller::OnKillFocus(
- CPDFSDK_Annot::ObservedPtr* pAnnot,
- uint32_t nFlag) {
+bool CFFL_InteractiveFormFiller::OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot,
+ uint32_t nFlag) {
if (!(*pAnnot))
- return FALSE;
+ return false;
ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), FALSE)) {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false)) {
pFormFiller->KillFocusForAnnot(pAnnot->Get(), nFlag);
if (!m_bNotifying) {
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot->Get());
if (pWidget->GetAAction(CPDF_AAction::LoseFocus).GetDict()) {
- m_bNotifying = TRUE;
+ m_bNotifying = true;
pWidget->ClearAppModified();
CPDFSDK_PageView* pPageView = pWidget->GetPageView();
@@ -440,27 +435,27 @@ FX_BOOL CFFL_InteractiveFormFiller::OnKillFocus(
fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag);
pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa);
pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView);
- m_bNotifying = FALSE;
+ m_bNotifying = false;
if (!(*pAnnot))
- return FALSE;
+ return false;
}
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_InteractiveFormFiller::IsVisible(CPDFSDK_Widget* pWidget) {
+bool CFFL_InteractiveFormFiller::IsVisible(CPDFSDK_Widget* pWidget) {
return pWidget->IsVisible();
}
-FX_BOOL CFFL_InteractiveFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget) {
+bool CFFL_InteractiveFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget) {
int nFieldFlags = pWidget->GetFieldFlags();
return (nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY;
}
-FX_BOOL CFFL_InteractiveFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) {
+bool CFFL_InteractiveFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) {
if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return TRUE;
+ return true;
CPDF_Page* pPage = pWidget->GetPDFPage();
CPDF_Document* pDocument = pPage->m_pDocument;
@@ -472,7 +467,7 @@ FX_BOOL CFFL_InteractiveFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) {
CFFL_FormFiller* CFFL_InteractiveFormFiller::GetFormFiller(
CPDFSDK_Annot* pAnnot,
- FX_BOOL bRegister) {
+ bool bRegister) {
auto it = m_Maps.find(pAnnot);
if (it != m_Maps.end())
return it->second.get();
@@ -567,7 +562,7 @@ void CFFL_InteractiveFormFiller::QueryWherePopup(void* pPrivateData,
}
FX_FLOAT fFactHeight = 0;
- FX_BOOL bBottom = TRUE;
+ bool bBottom = true;
FX_FLOAT fMaxListBoxHeight = 0;
if (fPopupMax > FFL_MAXLISTBOXHEIGHT) {
if (fPopupMin > FFL_MAXLISTBOXHEIGHT) {
@@ -581,18 +576,18 @@ void CFFL_InteractiveFormFiller::QueryWherePopup(void* pPrivateData,
if (fBottom > fMaxListBoxHeight) {
fFactHeight = fMaxListBoxHeight;
- bBottom = TRUE;
+ bBottom = true;
} else {
if (fTop > fMaxListBoxHeight) {
fFactHeight = fMaxListBoxHeight;
- bBottom = FALSE;
+ bBottom = false;
} else {
if (fTop > fBottom) {
fFactHeight = fTop;
- bBottom = FALSE;
+ bBottom = false;
} else {
fFactHeight = fBottom;
- bBottom = TRUE;
+ bBottom = true;
}
}
}
@@ -604,24 +599,24 @@ void CFFL_InteractiveFormFiller::QueryWherePopup(void* pPrivateData,
void CFFL_InteractiveFormFiller::OnKeyStrokeCommit(
CPDFSDK_Annot::ObservedPtr* pAnnot,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bRC,
- FX_BOOL& bExit,
+ bool& bRC,
+ bool& bExit,
uint32_t nFlag) {
if (!m_bNotifying) {
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot->Get());
if (pWidget->GetAAction(CPDF_AAction::KeyStroke).GetDict()) {
ASSERT(pPageView);
- m_bNotifying = TRUE;
+ m_bNotifying = true;
pWidget->ClearAppModified();
PDFSDK_FieldAction fa;
fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag);
fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag);
- fa.bWillCommit = TRUE;
- fa.bKeyDown = TRUE;
- fa.bRC = TRUE;
+ fa.bWillCommit = true;
+ fa.bKeyDown = true;
+ fa.bRC = true;
- CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false);
pFormFiller->GetActionData(pPageView, CPDF_AAction::KeyStroke, fa);
pFormFiller->SaveState(pPageView);
pWidget->OnAAction(CPDF_AAction::KeyStroke, fa, pPageView);
@@ -629,30 +624,30 @@ void CFFL_InteractiveFormFiller::OnKeyStrokeCommit(
return;
bRC = fa.bRC;
- m_bNotifying = FALSE;
+ m_bNotifying = false;
}
}
}
void CFFL_InteractiveFormFiller::OnValidate(CPDFSDK_Annot::ObservedPtr* pAnnot,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bRC,
- FX_BOOL& bExit,
+ bool& bRC,
+ bool& bExit,
uint32_t nFlag) {
if (!m_bNotifying) {
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot->Get());
if (pWidget->GetAAction(CPDF_AAction::Validate).GetDict()) {
ASSERT(pPageView);
- m_bNotifying = TRUE;
+ m_bNotifying = true;
pWidget->ClearAppModified();
PDFSDK_FieldAction fa;
fa.bModifier = m_pFormFillEnv->IsCTRLKeyDown(nFlag);
fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag);
- fa.bKeyDown = TRUE;
- fa.bRC = TRUE;
+ fa.bKeyDown = true;
+ fa.bRC = true;
- CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false);
pFormFiller->GetActionData(pPageView, CPDF_AAction::Validate, fa);
pFormFiller->SaveState(pPageView);
pWidget->OnAAction(CPDF_AAction::Validate, fa, pPageView);
@@ -660,32 +655,32 @@ void CFFL_InteractiveFormFiller::OnValidate(CPDFSDK_Annot::ObservedPtr* pAnnot,
return;
bRC = fa.bRC;
- m_bNotifying = FALSE;
+ m_bNotifying = false;
}
}
}
void CFFL_InteractiveFormFiller::OnCalculate(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bExit,
+ bool& bExit,
uint32_t nFlag) {
if (!m_bNotifying) {
ASSERT(pWidget);
CPDFSDK_InterForm* pInterForm = pPageView->GetFormFillEnv()->GetInterForm();
pInterForm->OnCalculate(pWidget->GetFormField());
- m_bNotifying = FALSE;
+ m_bNotifying = false;
}
}
void CFFL_InteractiveFormFiller::OnFormat(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bExit,
+ bool& bExit,
uint32_t nFlag) {
if (!m_bNotifying) {
ASSERT(pWidget);
CPDFSDK_InterForm* pInterForm = pPageView->GetFormFillEnv()->GetInterForm();
- FX_BOOL bFormatted = FALSE;
+ bool bFormatted = false;
CFX_WideString sValue =
pInterForm->OnFormat(pWidget->GetFormField(), bFormatted);
@@ -693,23 +688,23 @@ void CFFL_InteractiveFormFiller::OnFormat(CPDFSDK_Widget* pWidget,
return;
if (bFormatted) {
- pInterForm->ResetFieldAppearance(pWidget->GetFormField(), &sValue, TRUE);
+ pInterForm->ResetFieldAppearance(pWidget->GetFormField(), &sValue, true);
pInterForm->UpdateField(pWidget->GetFormField());
}
- m_bNotifying = FALSE;
+ m_bNotifying = false;
}
}
#ifdef PDF_ENABLE_XFA
void CFFL_InteractiveFormFiller::OnClick(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
+ bool& bReset,
+ bool& bExit,
uint32_t nFlag) {
if (!m_bNotifying) {
if (pWidget->HasXFAAAction(PDFSDK_XFA_Click)) {
- m_bNotifying = TRUE;
+ m_bNotifying = true;
int nAge = pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
@@ -718,20 +713,20 @@ void CFFL_InteractiveFormFiller::OnClick(CPDFSDK_Widget* pWidget,
fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag);
pWidget->OnXFAAAction(PDFSDK_XFA_Click, fa, pPageView);
- m_bNotifying = FALSE;
+ m_bNotifying = false;
if (!IsValidAnnot(pPageView, pWidget)) {
- bExit = TRUE;
+ bExit = true;
return;
}
if (nAge != pWidget->GetAppearanceAge()) {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false)) {
pFormFiller->ResetPDFWindow(pPageView,
nValueAge == pWidget->GetValueAge());
}
- bReset = TRUE;
+ bReset = true;
}
}
}
@@ -739,12 +734,12 @@ void CFFL_InteractiveFormFiller::OnClick(CPDFSDK_Widget* pWidget,
void CFFL_InteractiveFormFiller::OnFull(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
+ bool& bReset,
+ bool& bExit,
uint32_t nFlag) {
if (!m_bNotifying) {
if (pWidget->HasXFAAAction(PDFSDK_XFA_Full)) {
- m_bNotifying = TRUE;
+ m_bNotifying = true;
int nAge = pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
@@ -753,61 +748,61 @@ void CFFL_InteractiveFormFiller::OnFull(CPDFSDK_Widget* pWidget,
fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag);
pWidget->OnXFAAAction(PDFSDK_XFA_Full, fa, pPageView);
- m_bNotifying = FALSE;
+ m_bNotifying = false;
if (!IsValidAnnot(pPageView, pWidget)) {
- bExit = TRUE;
+ bExit = true;
return;
}
if (nAge != pWidget->GetAppearanceAge()) {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false)) {
pFormFiller->ResetPDFWindow(pPageView,
nValueAge == pWidget->GetValueAge());
}
- bReset = TRUE;
+ bReset = true;
}
}
}
}
void CFFL_InteractiveFormFiller::OnPopupPreOpen(void* pPrivateData,
- FX_BOOL& bExit,
+ bool& bExit,
uint32_t nFlag) {
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
ASSERT(pData);
ASSERT(pData->pWidget);
- FX_BOOL bTempReset = FALSE;
- FX_BOOL bTempExit = FALSE;
+ bool bTempReset = false;
+ bool bTempExit = false;
OnPreOpen(pData->pWidget, pData->pPageView, bTempReset, bTempExit, nFlag);
if (bTempReset || bTempExit)
- bExit = TRUE;
+ bExit = true;
}
void CFFL_InteractiveFormFiller::OnPopupPostOpen(void* pPrivateData,
- FX_BOOL& bExit,
+ bool& bExit,
uint32_t nFlag) {
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
ASSERT(pData);
ASSERT(pData->pWidget);
- FX_BOOL bTempReset = FALSE;
- FX_BOOL bTempExit = FALSE;
+ bool bTempReset = false;
+ bool bTempExit = false;
OnPostOpen(pData->pWidget, pData->pPageView, bTempReset, bTempExit, nFlag);
if (bTempReset || bTempExit)
- bExit = TRUE;
+ bExit = true;
}
void CFFL_InteractiveFormFiller::OnPreOpen(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
+ bool& bReset,
+ bool& bExit,
uint32_t nFlag) {
if (!m_bNotifying) {
if (pWidget->HasXFAAAction(PDFSDK_XFA_PreOpen)) {
- m_bNotifying = TRUE;
+ m_bNotifying = true;
int nAge = pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
@@ -816,20 +811,20 @@ void CFFL_InteractiveFormFiller::OnPreOpen(CPDFSDK_Widget* pWidget,
fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag);
pWidget->OnXFAAAction(PDFSDK_XFA_PreOpen, fa, pPageView);
- m_bNotifying = FALSE;
+ m_bNotifying = false;
if (!IsValidAnnot(pPageView, pWidget)) {
- bExit = TRUE;
+ bExit = true;
return;
}
if (nAge != pWidget->GetAppearanceAge()) {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false)) {
pFormFiller->ResetPDFWindow(pPageView,
nValueAge == pWidget->GetValueAge());
}
- bReset = TRUE;
+ bReset = true;
}
}
}
@@ -837,12 +832,12 @@ void CFFL_InteractiveFormFiller::OnPreOpen(CPDFSDK_Widget* pWidget,
void CFFL_InteractiveFormFiller::OnPostOpen(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
+ bool& bReset,
+ bool& bExit,
uint32_t nFlag) {
if (!m_bNotifying) {
if (pWidget->HasXFAAAction(PDFSDK_XFA_PostOpen)) {
- m_bNotifying = TRUE;
+ m_bNotifying = true;
int nAge = pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
@@ -851,28 +846,28 @@ void CFFL_InteractiveFormFiller::OnPostOpen(CPDFSDK_Widget* pWidget,
fa.bShift = m_pFormFillEnv->IsSHIFTKeyDown(nFlag);
pWidget->OnXFAAAction(PDFSDK_XFA_PostOpen, fa, pPageView);
- m_bNotifying = FALSE;
+ m_bNotifying = false;
if (!IsValidAnnot(pPageView, pWidget)) {
- bExit = TRUE;
+ bExit = true;
return;
}
if (nAge != pWidget->GetAppearanceAge()) {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false)) {
pFormFiller->ResetPDFWindow(pPageView,
nValueAge == pWidget->GetValueAge());
}
- bReset = TRUE;
+ bReset = true;
}
}
}
}
#endif // PDF_ENABLE_XFA
-FX_BOOL CFFL_InteractiveFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot) {
+bool CFFL_InteractiveFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot) {
return pPageView && pPageView->IsValidAnnot(pAnnot->GetPDFAnnot());
}
@@ -882,23 +877,23 @@ void CFFL_InteractiveFormFiller::OnBeforeKeyStroke(
const CFX_WideString& strChangeEx,
int nSelStart,
int nSelEnd,
- FX_BOOL bKeyDown,
- FX_BOOL& bRC,
- FX_BOOL& bExit,
+ bool bKeyDown,
+ bool& bRC,
+ bool& bExit,
uint32_t nFlag) {
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
ASSERT(pData->pWidget);
- CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, false);
#ifdef PDF_ENABLE_XFA
if (pFormFiller->IsFieldFull(pData->pPageView)) {
- FX_BOOL bFullExit = FALSE;
- FX_BOOL bFullReset = FALSE;
+ bool bFullExit = false;
+ bool bFullReset = false;
OnFull(pData->pWidget, pData->pPageView, bFullReset, bFullExit, nFlag);
if (bFullReset || bFullExit) {
- bExit = TRUE;
+ bExit = true;
return;
}
}
@@ -906,7 +901,7 @@ void CFFL_InteractiveFormFiller::OnBeforeKeyStroke(
if (!m_bNotifying) {
if (pData->pWidget->GetAAction(CPDF_AAction::KeyStroke).GetDict()) {
- m_bNotifying = TRUE;
+ m_bNotifying = true;
int nAge = pData->pWidget->GetAppearanceAge();
int nValueAge = pData->pWidget->GetValueAge();
@@ -919,8 +914,8 @@ void CFFL_InteractiveFormFiller::OnBeforeKeyStroke(
fa.sChange = strChange;
fa.sChangeEx = strChangeEx;
fa.bKeyDown = bKeyDown;
- fa.bWillCommit = FALSE;
- fa.bRC = TRUE;
+ fa.bWillCommit = false;
+ fa.bRC = true;
fa.nSelStart = nSelStart;
fa.nSelEnd = nSelEnd;
@@ -931,8 +926,8 @@ void CFFL_InteractiveFormFiller::OnBeforeKeyStroke(
if (pData->pWidget->OnAAction(CPDF_AAction::KeyStroke, fa,
pData->pPageView)) {
if (!pObserved || !IsValidAnnot(pData->pPageView, pData->pWidget)) {
- bExit = TRUE;
- m_bNotifying = FALSE;
+ bExit = true;
+ m_bNotifying = false;
return;
}
@@ -940,31 +935,31 @@ void CFFL_InteractiveFormFiller::OnBeforeKeyStroke(
CPWL_Wnd* pWnd = pFormFiller->ResetPDFWindow(
pData->pPageView, nValueAge == pData->pWidget->GetValueAge());
pData = (CFFL_PrivateData*)pWnd->GetAttachedData();
- bExit = TRUE;
+ bExit = true;
}
if (fa.bRC) {
pFormFiller->SetActionData(pData->pPageView, CPDF_AAction::KeyStroke,
fa);
- bRC = FALSE;
+ bRC = false;
} else {
pFormFiller->RestoreState(pData->pPageView);
- bRC = FALSE;
+ bRC = false;
}
if (pFormFillEnv->GetFocusAnnot() != pData->pWidget) {
pFormFiller->CommitData(pData->pPageView, nFlag);
- bExit = TRUE;
+ bExit = true;
}
} else {
if (!IsValidAnnot(pData->pPageView, pData->pWidget)) {
- bExit = TRUE;
- m_bNotifying = FALSE;
+ bExit = true;
+ m_bNotifying = false;
return;
}
}
- m_bNotifying = FALSE;
+ m_bNotifying = false;
}
}
}
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.h b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
index 70ec43ddd6..e81d3c88d0 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.h
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
@@ -25,9 +25,9 @@ class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify {
CPDFSDK_FormFillEnvironment* pFormFillEnv);
~CFFL_InteractiveFormFiller() override;
- FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- CFX_FloatPoint point);
+ bool Annot_HitTest(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ CFX_FloatPoint point);
FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot);
void OnDraw(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
@@ -42,95 +42,94 @@ class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify {
void OnMouseExit(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot::ObservedPtr* pAnnot,
uint32_t nFlag);
- FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot::ObservedPtr* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point);
- FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot::ObservedPtr* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point);
- FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot::ObservedPtr* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point);
- FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot::ObservedPtr* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point);
- FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView,
+ bool OnLButtonDown(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot::ObservedPtr* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point);
+ bool OnLButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot::ObservedPtr* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point);
+ bool OnLButtonDblClk(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot::ObservedPtr* pAnnot,
uint32_t nFlags,
- short zDelta,
const CFX_FloatPoint& point);
- FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot::ObservedPtr* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point);
- FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot::ObservedPtr* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point);
-
- FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, uint32_t nKeyCode, uint32_t nFlags);
- FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags);
-
- FX_BOOL OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag);
- FX_BOOL OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag);
-
- CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister);
+ bool OnMouseMove(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot::ObservedPtr* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point);
+ bool OnMouseWheel(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot::ObservedPtr* pAnnot,
+ uint32_t nFlags,
+ short zDelta,
+ const CFX_FloatPoint& point);
+ bool OnRButtonDown(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot::ObservedPtr* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point);
+ bool OnRButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot::ObservedPtr* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point);
+
+ bool OnKeyDown(CPDFSDK_Annot* pAnnot, uint32_t nKeyCode, uint32_t nFlags);
+ bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags);
+
+ bool OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag);
+ bool OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag);
+
+ CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, bool bRegister);
void RemoveFormFiller(CPDFSDK_Annot* pAnnot);
- static FX_BOOL IsVisible(CPDFSDK_Widget* pWidget);
- static FX_BOOL IsReadOnly(CPDFSDK_Widget* pWidget);
- static FX_BOOL IsFillingAllowed(CPDFSDK_Widget* pWidget);
- static FX_BOOL IsValidAnnot(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot);
+ static bool IsVisible(CPDFSDK_Widget* pWidget);
+ static bool IsReadOnly(CPDFSDK_Widget* pWidget);
+ static bool IsFillingAllowed(CPDFSDK_Widget* pWidget);
+ static bool IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot);
void OnKeyStrokeCommit(CPDFSDK_Annot::ObservedPtr* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bRC,
- FX_BOOL& bExit,
+ bool& bRC,
+ bool& bExit,
uint32_t nFlag);
void OnValidate(CPDFSDK_Annot::ObservedPtr* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bRC,
- FX_BOOL& bExit,
+ bool& bRC,
+ bool& bExit,
uint32_t nFlag);
void OnCalculate(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bExit,
+ bool& bExit,
uint32_t nFlag);
void OnFormat(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bExit,
+ bool& bExit,
uint32_t nFlag);
void OnButtonUp(CPDFSDK_Annot::ObservedPtr* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
+ bool& bReset,
+ bool& bExit,
uint32_t nFlag);
#ifdef PDF_ENABLE_XFA
void OnClick(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
+ bool& bReset,
+ bool& bExit,
uint32_t nFlag);
void OnFull(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
+ bool& bReset,
+ bool& bExit,
uint32_t nFlag);
void OnPreOpen(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
+ bool& bReset,
+ bool& bExit,
uint32_t nFlag);
void OnPostOpen(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
- FX_BOOL& bReset,
- FX_BOOL& bExit,
+ bool& bReset,
+ bool& bExit,
uint32_t nFlag);
#endif // PDF_ENABLE_XFA
@@ -149,26 +148,22 @@ class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify {
const CFX_WideString& strChangeEx,
int nSelStart,
int nSelEnd,
- FX_BOOL bKeyDown,
- FX_BOOL& bRC,
- FX_BOOL& bExit,
+ bool bKeyDown,
+ bool& bRC,
+ bool& bExit,
uint32_t nFlag) override;
#ifdef PDF_ENABLE_XFA
- void OnPopupPreOpen(void* pPrivateData,
- FX_BOOL& bExit,
- uint32_t nFlag) override;
+ void OnPopupPreOpen(void* pPrivateData, bool& bExit, uint32_t nFlag) override;
void OnPopupPostOpen(void* pPrivateData,
- FX_BOOL& bExit,
+ bool& bExit,
uint32_t nFlag) override;
- void SetFocusAnnotTab(CPDFSDK_Annot* pWidget,
- FX_BOOL bSameField,
- FX_BOOL bNext);
+ void SetFocusAnnotTab(CPDFSDK_Annot* pWidget, bool bSameField, bool bNext);
#endif // PDF_ENABLE_XFA
void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot);
CPDFSDK_FormFillEnvironment* const m_pFormFillEnv;
CFFL_Widget2Filler m_Maps;
- FX_BOOL m_bNotifying;
+ bool m_bNotifying;
};
class CFFL_PrivateData {
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index 85b907017c..bc3bb6c4ab 100644
--- a/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -59,12 +59,12 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp,
if (pWnd->HasFlag(PLBS_MULTIPLESEL)) {
m_OriginSelections.clear();
- FX_BOOL bSetCaret = FALSE;
+ bool bSetCaret = false;
for (int32_t i = 0, sz = m_pWidget->CountOptions(); i < sz; i++) {
if (m_pWidget->IsOptionSelected(i)) {
if (!bSetCaret) {
pWnd->SetCaret(i);
- bSetCaret = TRUE;
+ bSetCaret = true;
}
pWnd->Select(i);
m_OriginSelections.insert(i);
@@ -84,23 +84,23 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp,
return pWnd;
}
-FX_BOOL CFFL_ListBox::OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) {
+bool CFFL_ListBox::OnChar(CPDFSDK_Annot* pAnnot,
+ uint32_t nChar,
+ uint32_t nFlags) {
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
-FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
- CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE);
+bool CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
+ CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false);
if (!pListBox)
- return FALSE;
+ return false;
if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) {
size_t nSelCount = 0;
for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; ++i) {
if (pListBox->IsItemSelected(i)) {
if (m_OriginSelections.count(i) == 0)
- return TRUE;
+ return true;
++nSelCount;
}
@@ -113,22 +113,22 @@ FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) {
CPWL_ListBox* pListBox =
- static_cast<CPWL_ListBox*>(GetPDFWindow(pPageView, FALSE));
+ static_cast<CPWL_ListBox*>(GetPDFWindow(pPageView, false));
if (!pListBox)
return;
int32_t nNewTopIndex = pListBox->GetTopVisibleIndex();
- m_pWidget->ClearSelection(FALSE);
+ m_pWidget->ClearSelection(false);
if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) {
for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; i++) {
if (pListBox->IsItemSelected(i))
- m_pWidget->SetOptionSelection(i, TRUE, FALSE);
+ m_pWidget->SetOptionSelection(i, true, false);
}
} else {
- m_pWidget->SetOptionSelection(pListBox->GetCurSel(), TRUE, FALSE);
+ m_pWidget->SetOptionSelection(pListBox->GetCurSel(), true, false);
}
m_pWidget->SetTopVisibleIndex(nNewTopIndex);
- m_pWidget->ResetFieldAppearance(TRUE);
+ m_pWidget->ResetFieldAppearance(true);
m_pWidget->UpdateField();
SetChangeMark();
}
@@ -142,7 +142,7 @@ void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView,
fa.sValue = L"";
} else {
if (CPWL_ListBox* pListBox =
- (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE)) {
+ (CPWL_ListBox*)GetPDFWindow(pPageView, false)) {
int32_t nCurSel = pListBox->GetCurSel();
if (nCurSel >= 0)
fa.sValue = m_pWidget->GetOptionLabel(nCurSel);
@@ -167,7 +167,7 @@ void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView,
void CFFL_ListBox::SaveState(CPDFSDK_PageView* pPageView) {
ASSERT(pPageView);
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false)) {
for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; i++) {
if (pListBox->IsItemSelected(i)) {
m_State.Add(i);
@@ -177,14 +177,14 @@ void CFFL_ListBox::SaveState(CPDFSDK_PageView* pPageView) {
}
void CFFL_ListBox::RestoreState(CPDFSDK_PageView* pPageView) {
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false)) {
for (int i = 0, sz = m_State.GetSize(); i < sz; i++)
pListBox->Select(m_State[i]);
}
}
CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView,
- FX_BOOL bRestoreValue) {
+ bool bRestoreValue) {
if (bRestoreValue)
SaveState(pPageView);
@@ -194,9 +194,9 @@ CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView,
if (bRestoreValue) {
RestoreState(pPageView);
- pRet = GetPDFWindow(pPageView, FALSE);
+ pRet = GetPDFWindow(pPageView, false);
} else {
- pRet = GetPDFWindow(pPageView, TRUE);
+ pRet = GetPDFWindow(pPageView, true);
}
m_pWidget->UpdateField();
diff --git a/fpdfsdk/formfiller/cffl_listbox.h b/fpdfsdk/formfiller/cffl_listbox.h
index eebe2f58ed..e97ede0deb 100644
--- a/fpdfsdk/formfiller/cffl_listbox.h
+++ b/fpdfsdk/formfiller/cffl_listbox.h
@@ -23,10 +23,8 @@ class CFFL_ListBox : public CFFL_FormFiller {
PWL_CREATEPARAM GetCreateParam() override;
CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp,
CPDFSDK_PageView* pPageView) override;
- FX_BOOL OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) override;
- FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView) override;
+ bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override;
+ bool IsDataChanged(CPDFSDK_PageView* pPageView) override;
void SaveData(CPDFSDK_PageView* pPageView) override;
void GetActionData(CPDFSDK_PageView* pPageView,
CPDF_AAction::AActionType type,
@@ -34,7 +32,7 @@ class CFFL_ListBox : public CFFL_FormFiller {
void SaveState(CPDFSDK_PageView* pPageView) override;
void RestoreState(CPDFSDK_PageView* pPageView) override;
CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView,
- FX_BOOL bRestoreValue) override;
+ bool bRestoreValue) override;
private:
std::unique_ptr<CBA_FontMap> m_pFontMap;
diff --git a/fpdfsdk/formfiller/cffl_pushbutton.cpp b/fpdfsdk/formfiller/cffl_pushbutton.cpp
index 4fb7b09cc8..9b4121af9d 100644
--- a/fpdfsdk/formfiller/cffl_pushbutton.cpp
+++ b/fpdfsdk/formfiller/cffl_pushbutton.cpp
@@ -23,9 +23,9 @@ CPWL_Wnd* CFFL_PushButton::NewPDFWindow(const PWL_CREATEPARAM& cp,
return pWnd;
}
-FX_BOOL CFFL_PushButton::OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) {
+bool CFFL_PushButton::OnChar(CPDFSDK_Annot* pAnnot,
+ uint32_t nChar,
+ uint32_t nFlags) {
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
diff --git a/fpdfsdk/formfiller/cffl_pushbutton.h b/fpdfsdk/formfiller/cffl_pushbutton.h
index 9b0a7b30e3..1d50595c87 100644
--- a/fpdfsdk/formfiller/cffl_pushbutton.h
+++ b/fpdfsdk/formfiller/cffl_pushbutton.h
@@ -17,9 +17,7 @@ class CFFL_PushButton : public CFFL_Button {
// CFFL_Button
CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp,
CPDFSDK_PageView* pPageView) override;
- FX_BOOL OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) override;
+ bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override;
void OnDraw(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice,
diff --git a/fpdfsdk/formfiller/cffl_radiobutton.cpp b/fpdfsdk/formfiller/cffl_radiobutton.cpp
index 8186c2f137..70d4c0dee6 100644
--- a/fpdfsdk/formfiller/cffl_radiobutton.cpp
+++ b/fpdfsdk/formfiller/cffl_radiobutton.cpp
@@ -28,77 +28,77 @@ CPWL_Wnd* CFFL_RadioButton::NewPDFWindow(const PWL_CREATEPARAM& cp,
return pWnd;
}
-FX_BOOL CFFL_RadioButton::OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags) {
+bool CFFL_RadioButton::OnKeyDown(CPDFSDK_Annot* pAnnot,
+ uint32_t nKeyCode,
+ uint32_t nFlags) {
switch (nKeyCode) {
case FWL_VKEY_Return:
case FWL_VKEY_Space:
- return TRUE;
+ return true;
default:
return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags);
}
}
-FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) {
+bool CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot,
+ uint32_t nChar,
+ uint32_t nFlags) {
switch (nChar) {
case FWL_VKEY_Return:
case FWL_VKEY_Space: {
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
ASSERT(pPageView);
- FX_BOOL bReset = FALSE;
- FX_BOOL bExit = FALSE;
+ bool bReset = false;
+ bool bExit = false;
CPDFSDK_Annot::ObservedPtr pObserved(m_pWidget);
m_pFormFillEnv->GetInteractiveFormFiller()->OnButtonUp(
&pObserved, pPageView, bReset, bExit, nFlags);
if (!pObserved || bReset || bExit)
- return TRUE;
+ return true;
CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
if (CPWL_RadioButton* pWnd =
- (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE))
- pWnd->SetCheck(TRUE);
+ (CPWL_RadioButton*)GetPDFWindow(pPageView, true))
+ pWnd->SetCheck(true);
CommitData(pPageView, nFlags);
- return TRUE;
+ return true;
}
default:
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
}
-FX_BOOL CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+bool CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point);
if (IsValid()) {
if (CPWL_RadioButton* pWnd =
- (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE))
- pWnd->SetCheck(TRUE);
+ (CPWL_RadioButton*)GetPDFWindow(pPageView, true))
+ pWnd->SetCheck(true);
if (!CommitData(pPageView, nFlags))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView) {
+bool CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView) {
if (CPWL_RadioButton* pWnd =
- (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE)) {
+ (CPWL_RadioButton*)GetPDFWindow(pPageView, false)) {
return pWnd->IsChecked() != m_pWidget->IsChecked();
}
- return FALSE;
+ return false;
}
void CFFL_RadioButton::SaveData(CPDFSDK_PageView* pPageView) {
if (CPWL_RadioButton* pWnd =
- (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE)) {
+ (CPWL_RadioButton*)GetPDFWindow(pPageView, false)) {
bool bNewChecked = pWnd->IsChecked();
if (bNewChecked) {
diff --git a/fpdfsdk/formfiller/cffl_radiobutton.h b/fpdfsdk/formfiller/cffl_radiobutton.h
index b3656b945c..49a658f84e 100644
--- a/fpdfsdk/formfiller/cffl_radiobutton.h
+++ b/fpdfsdk/formfiller/cffl_radiobutton.h
@@ -17,17 +17,15 @@ class CFFL_RadioButton : public CFFL_Button {
// CFFL_Button
CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp,
CPDFSDK_PageView* pPageView) override;
- FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot,
- uint32_t nKeyCode,
- uint32_t nFlags) override;
- FX_BOOL OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
+ bool OnKeyDown(CPDFSDK_Annot* pAnnot,
+ uint32_t nKeyCode,
uint32_t nFlags) override;
- FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) override;
- FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView) override;
+ bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override;
+ bool OnLButtonUp(CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot* pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) override;
+ bool IsDataChanged(CPDFSDK_PageView* pPageView) override;
void SaveData(CPDFSDK_PageView* pPageView) override;
};
diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp
index 566051c2de..c1cd7868c8 100644
--- a/fpdfsdk/formfiller/cffl_textfield.cpp
+++ b/fpdfsdk/formfiller/cffl_textfield.cpp
@@ -105,9 +105,9 @@ CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp,
return pWnd;
}
-FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) {
+bool CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot,
+ uint32_t nChar,
+ uint32_t nFlags) {
switch (nChar) {
case FWL_VKEY_Return:
if (!(m_pWidget->GetFieldFlags() & FIELDFLAG_MULTILINE)) {
@@ -119,42 +119,42 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot,
rcAnnot.top, rcAnnot.right, rcAnnot.bottom);
if (m_bValid) {
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE))
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true))
pWnd->SetFocus();
} else {
if (CommitData(pPageView, nFlags)) {
DestroyPDFWindow(pPageView);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
}
break;
case FWL_VKEY_Escape: {
CPDFSDK_PageView* pPageView = GetCurPageView(true);
ASSERT(pPageView);
- EscapeFiller(pPageView, TRUE);
- return TRUE;
+ EscapeFiller(pPageView, true);
+ return true;
}
}
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
-FX_BOOL CFFL_TextField::IsDataChanged(CPDFSDK_PageView* pPageView) {
- if (CPWL_Edit* pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
+bool CFFL_TextField::IsDataChanged(CPDFSDK_PageView* pPageView) {
+ if (CPWL_Edit* pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, false))
return pEdit->GetText() != m_pWidget->GetValue();
- return FALSE;
+ return false;
}
void CFFL_TextField::SaveData(CPDFSDK_PageView* pPageView) {
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false)) {
CFX_WideString sOldValue = m_pWidget->GetValue();
CFX_WideString sNewValue = pWnd->GetText();
- m_pWidget->SetValue(sNewValue, FALSE);
- m_pWidget->ResetFieldAppearance(TRUE);
+ m_pWidget->SetValue(sNewValue, false);
+ m_pWidget->ResetFieldAppearance(true);
m_pWidget->UpdateField();
SetChangeMark();
}
@@ -165,7 +165,7 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView,
PDFSDK_FieldAction& fa) {
switch (type) {
case CPDF_AAction::KeyStroke:
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false)) {
fa.bFieldFull = pWnd->IsTextFull();
fa.sValue = pWnd->GetText();
@@ -177,7 +177,7 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView,
}
break;
case CPDF_AAction::Validate:
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false)) {
fa.sValue = pWnd->GetText();
}
break;
@@ -195,7 +195,7 @@ void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView,
const PDFSDK_FieldAction& fa) {
switch (type) {
case CPDF_AAction::KeyStroke:
- if (CPWL_Edit* pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Edit* pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, false)) {
pEdit->SetFocus();
pEdit->SetSel(fa.nSelStart, fa.nSelEnd);
pEdit->ReplaceSel(fa.sChange);
@@ -206,9 +206,9 @@ void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView,
}
}
-FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& faOld,
- const PDFSDK_FieldAction& faNew) {
+bool CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& faOld,
+ const PDFSDK_FieldAction& faNew) {
switch (type) {
case CPDF_AAction::KeyStroke:
return (!faOld.bFieldFull && faOld.nSelEnd != faNew.nSelEnd) ||
@@ -218,13 +218,13 @@ FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type,
break;
}
- return FALSE;
+ return false;
}
void CFFL_TextField::SaveState(CPDFSDK_PageView* pPageView) {
ASSERT(pPageView);
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false)) {
pWnd->GetSel(m_State.nStart, m_State.nEnd);
m_State.sValue = pWnd->GetText();
}
@@ -233,14 +233,14 @@ void CFFL_TextField::SaveState(CPDFSDK_PageView* pPageView) {
void CFFL_TextField::RestoreState(CPDFSDK_PageView* pPageView) {
ASSERT(pPageView);
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, TRUE)) {
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, true)) {
pWnd->SetText(m_State.sValue);
pWnd->SetSel(m_State.nStart, m_State.nEnd);
}
}
CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView,
- FX_BOOL bRestoreValue) {
+ bool bRestoreValue) {
if (bRestoreValue)
SaveState(pPageView);
@@ -250,9 +250,9 @@ CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView,
if (bRestoreValue) {
RestoreState(pPageView);
- pRet = GetPDFWindow(pPageView, FALSE);
+ pRet = GetPDFWindow(pPageView, false);
} else {
- pRet = GetPDFWindow(pPageView, TRUE);
+ pRet = GetPDFWindow(pPageView, true);
}
m_pWidget->UpdateField();
@@ -261,12 +261,12 @@ CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView,
}
#ifdef PDF_ENABLE_XFA
-FX_BOOL CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) {
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
+bool CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) {
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false)) {
return pWnd->IsTextFull();
}
- return FALSE;
+ return false;
}
#endif // PDF_ENABLE_XFA
@@ -282,6 +282,6 @@ void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) {
int nCharacters = wsText.GetLength();
CFX_ByteString bsUTFText = wsText.UTF16LE_Encode();
unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str();
- m_pFormFillEnv->OnSetFieldInputFocus(pBuffer, nCharacters, TRUE);
+ m_pFormFillEnv->OnSetFieldInputFocus(pBuffer, nCharacters, true);
}
}
diff --git a/fpdfsdk/formfiller/cffl_textfield.h b/fpdfsdk/formfiller/cffl_textfield.h
index 74381e5e1c..29579f72a5 100644
--- a/fpdfsdk/formfiller/cffl_textfield.h
+++ b/fpdfsdk/formfiller/cffl_textfield.h
@@ -34,10 +34,8 @@ class CFFL_TextField : public CFFL_FormFiller, public IPWL_FocusHandler {
PWL_CREATEPARAM GetCreateParam() override;
CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp,
CPDFSDK_PageView* pPageView) override;
- FX_BOOL OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) override;
- FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView) override;
+ bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override;
+ bool IsDataChanged(CPDFSDK_PageView* pPageView) override;
void SaveData(CPDFSDK_PageView* pPageView) override;
void GetActionData(CPDFSDK_PageView* pPageView,
CPDF_AAction::AActionType type,
@@ -45,20 +43,20 @@ class CFFL_TextField : public CFFL_FormFiller, public IPWL_FocusHandler {
void SetActionData(CPDFSDK_PageView* pPageView,
CPDF_AAction::AActionType type,
const PDFSDK_FieldAction& fa) override;
- FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& faOld,
- const PDFSDK_FieldAction& faNew) override;
+ bool IsActionDataChanged(CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& faOld,
+ const PDFSDK_FieldAction& faNew) override;
void SaveState(CPDFSDK_PageView* pPageView) override;
void RestoreState(CPDFSDK_PageView* pPageView) override;
CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView,
- FX_BOOL bRestoreValue) override;
+ bool bRestoreValue) override;
// IPWL_FocusHandler:
void OnSetFocus(CPWL_Wnd* pWnd) override;
#ifdef PDF_ENABLE_XFA
// CFFL_FormFiller:
- FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView) override;
+ bool IsFieldFull(CPDFSDK_PageView* pPageView) override;
#endif // PDF_ENABLE_XFA
private: