diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:36:00 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:36:00 -0700 |
commit | f1e7c461dfabbff6b65a072f24f6711b34159361 (patch) | |
tree | 3b0bb772a59669f06b86824a444fd06642592d4b /fpdfsdk/src/formfiller | |
parent | 320b2313d19869333ed453af546e61a9fc2b81c9 (diff) | |
download | pdfium-f1e7c461dfabbff6b65a072f24f6711b34159361.tar.xz |
Revert "FX_BOOL considered harmful, part 2."
This reverts commit 320b2313d19869333ed453af546e61a9fc2b81c9.
Reason for revert: build failure.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1255693002 .
Diffstat (limited to 'fpdfsdk/src/formfiller')
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_CheckBox.cpp | 38 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_ComboBox.cpp | 66 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_FormFiller.cpp | 190 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_IFormFiller.cpp | 248 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_ListBox.cpp | 40 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_Notify.cpp | 90 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_PushButton.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_RadioButton.cpp | 42 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_TextField.cpp | 58 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_Utils.cpp | 10 |
11 files changed, 393 insertions, 393 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp index 6570b3ee15..699a7e4ffe 100644 --- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp +++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp @@ -230,7 +230,7 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString &sAlias) CPDF_Dictionary* pAcroFormDict = NULL; - bool bWidget = (m_pAnnotDict->GetString("Subtype") == "Widget"); + FX_BOOL bWidget = (m_pAnnotDict->GetString("Subtype") == "Widget"); if (bWidget) { diff --git a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp index 72ff575c11..55d2d45bc2 100644 --- a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp @@ -31,18 +31,18 @@ CPWL_Wnd* CFFL_CheckBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageVie return pWnd; } -bool CFFL_CheckBox::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags) +FX_BOOL CFFL_CheckBox::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags) { switch (nKeyCode) { case FWL_VKEY_Return: case FWL_VKEY_Space: - return true; + return TRUE; default: return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags); } } -bool CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) +FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) { switch (nChar) { @@ -55,57 +55,57 @@ bool CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); ASSERT(pPageView != NULL); - bool bReset = false; - bool bExit = false; + FX_BOOL bReset = FALSE; + FX_BOOL bExit = FALSE; pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit,nFlags); - if (bReset) return true; - if (bExit) return true; + if (bReset) return TRUE; + if (bExit) 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); } } -bool CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& 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()); // pWnd->SetCheck(!pWnd->IsChecked()); } - if (!CommitData(pPageView, nFlags)) return false; + if (!CommitData(pPageView, nFlags)) return FALSE; } - return true; + return TRUE; } -bool CFFL_CheckBox::IsDataChanged(CPDFSDK_PageView* pPageView) +FX_BOOL CFFL_CheckBox::IsDataChanged(CPDFSDK_PageView* pPageView) { ASSERT(m_pWidget != NULL); - if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, false)) + if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE)) { return pWnd->IsChecked() != m_pWidget->IsChecked(); } - return false; + return FALSE; } void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView) @@ -113,10 +113,10 @@ void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView) ASSERT(m_pWidget != NULL); - if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, false)) + if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE)) { - bool bNewChecked = pWnd->IsChecked(); + FX_BOOL bNewChecked = pWnd->IsChecked(); if (bNewChecked) @@ -136,7 +136,7 @@ void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView) } } - m_pWidget->SetCheck(bNewChecked, false); + m_pWidget->SetCheck(bNewChecked, FALSE); m_pWidget->UpdateField(); SetChangeMark(); } diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp index d6d4d3da4e..841b45ecba 100644 --- a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp @@ -78,16 +78,16 @@ CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageVie } -bool CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) +FX_BOOL CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) { return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); } -bool CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView) +FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView) { - CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, false); + 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)) @@ -103,28 +103,28 @@ 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 - bool bSetValue = true; + FX_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; @@ -132,15 +132,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(); @@ -155,7 +155,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) { @@ -177,7 +177,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) { @@ -203,7 +203,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) { @@ -217,7 +217,7 @@ void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AAc } } -bool CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, +FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew) { switch (type) @@ -229,14 +229,14 @@ bool CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PD 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(); @@ -252,7 +252,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); @@ -267,7 +267,7 @@ void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView) } } -CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue) +CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue) { if (bRestoreValue) SaveState(pPageView); @@ -279,17 +279,17 @@ CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bResto 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(bool bKeyDown, FX_UINT nFlag) +void CFFL_ComboBox::OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag) { ASSERT(m_pWidget != NULL); @@ -305,7 +305,7 @@ void CFFL_ComboBox::OnKeyStroke(bool bKeyDown, FX_UINT nFlag) if (CommitData(pPageView, nFlag)) { DestroyPDFWindow(pPageView); - m_bValid = false; + m_bValid = FALSE; } } } @@ -328,7 +328,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); } @@ -339,25 +339,25 @@ void CFFL_ComboBox::OnKillFocus(CPWL_Wnd* pWnd) ASSERT(m_pApp != NULL); } -bool CFFL_ComboBox::CanCopy(CPDFSDK_Document* pDocument) +FX_BOOL CFFL_ComboBox::CanCopy(CPDFSDK_Document* pDocument) { ASSERT(pDocument != NULL); - return false; + return FALSE; } -bool CFFL_ComboBox::CanCut(CPDFSDK_Document* pDocument) +FX_BOOL CFFL_ComboBox::CanCut(CPDFSDK_Document* pDocument) { ASSERT(pDocument != NULL); - return false; + return FALSE; } -bool CFFL_ComboBox::CanPaste(CPDFSDK_Document* pDocument) +FX_BOOL CFFL_ComboBox::CanPaste(CPDFSDK_Document* pDocument) { ASSERT(pDocument != NULL); - return false; + return FALSE; } void CFFL_ComboBox::OnAddUndo(CPWL_Edit* pEdit) @@ -371,7 +371,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(); } diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp index 34aa17cf06..1811cb0424 100644 --- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp +++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp @@ -20,7 +20,7 @@ CFFL_FormFiller::CFFL_FormFiller(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot) : m_pApp(pApp), m_pAnnot(pAnnot), - m_bValid(false), + m_bValid(FALSE), m_ptOldPos(0,0) { m_pWidget = (CPDFSDK_Widget*) pAnnot; @@ -40,15 +40,15 @@ CFFL_FormFiller::~CFFL_FormFiller() void CFFL_FormFiller::SetWindowRect(CPDFSDK_PageView* pPageView, const CPDF_Rect& rcWindow) { - if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false)) + if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { - pWnd->Move(CPDF_Rect(rcWindow), true, false); + pWnd->Move(CPDF_Rect(rcWindow), TRUE, FALSE); } } CPDF_Rect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView) { - if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false)) + if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { return pWnd->GetWindowRect(); } @@ -63,7 +63,7 @@ FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* CPDF_Rect rcAnnot = m_pWidget->GetRect(); - if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false)) + if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { CPDF_Rect rcWindow = pWnd->GetWindowRect(); rcAnnot = PWLtoFFL(rcWindow); @@ -86,7 +86,7 @@ void CFFL_FormFiller::OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); - if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false)) + if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) { CPDF_Matrix mt = GetCurMatrix(); mt.Concat(*pUser2Device); @@ -131,153 +131,153 @@ void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pA ASSERT(m_pWidget != NULL); } -bool CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { - if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, true)) + if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE)) { - m_bValid = 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; } -bool CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { - if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false)) + if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, 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; } - return false; + return FALSE; } -bool CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { - if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false)) + if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) { pWnd->OnLButtonDblClk(WndtoPWL(pPageView, point),nFlags); - return true; + return TRUE; } - return false; + return FALSE; } -bool CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { if ((m_ptOldPos.x != point.x) || (m_ptOldPos.y != point.y)) { m_ptOldPos = point; } - if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false)) + if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) { pWnd->OnMouseMove(WndtoPWL(pPageView, point),nFlags); - return true; + return TRUE; } - return false; + return FALSE; } -bool CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point) +FX_BOOL CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point) { - if (!IsValid()) return false; + if (!IsValid()) return FALSE; - if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, true)) + if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE)) { return pWnd->OnMouseWheel(zDelta, WndtoPWL(pPageView, point),nFlags); } - return false; + return FALSE; } -bool CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { - if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, true)) + if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE)) { pWnd->OnRButtonDown(WndtoPWL(pPageView, point),nFlags); - return true; + return TRUE; } - return false; + return FALSE; } -bool CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { - if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false)) + if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) { pWnd->OnRButtonUp(WndtoPWL(pPageView, point),nFlags); - return true; + return TRUE; } - return false; + return FALSE; } -bool CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags) +FX_BOOL CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags) { if (IsValid()) { CPDFSDK_PageView* pPageView = GetCurPageView(); ASSERT(pPageView != NULL); - if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false)) + if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) { return pWnd->OnKeyDown(nKeyCode,nFlags); } } - return false; + return FALSE; } -bool CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) +FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) { if (IsValid()) { CPDFSDK_PageView* pPageView = GetCurPageView(); ASSERT(pPageView != NULL); - if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false)) + if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) { return pWnd->OnChar(nChar,nFlags); } } - return false; + return FALSE; } -bool CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) +FX_BOOL CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; CPDF_Page* pPage = pWidget->GetPDFPage(); CPDFSDK_Document* pDoc = m_pApp->GetSDKDocument(); CPDFSDK_PageView* pPageView = pDoc->GetPageView(pPage); - 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); - return true; + return TRUE; } -bool CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) +FX_BOOL CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) { if (!IsValid()) - return true; + return TRUE; CPDFSDK_PageView* pPageView = GetCurPageView(); CommitData(pPageView, nFlag); - if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false)) + if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) pWnd->KillFocus(); switch (m_pWidget->GetFieldType()) @@ -285,16 +285,16 @@ bool CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) case FIELDTYPE_PUSHBUTTON: case FIELDTYPE_CHECKBOX: case FIELDTYPE_RADIOBUTTON: - EscapeFiller(pPageView, true); + EscapeFiller(pPageView, TRUE); break; default: - EscapeFiller(pPageView, false); + EscapeFiller(pPageView, FALSE); break; } - return true; + return TRUE; } -bool CFFL_FormFiller::IsValid() const +FX_BOOL CFFL_FormFiller::IsValid() const { return m_bValid; } @@ -370,7 +370,7 @@ PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() return cp; } -CPWL_Wnd* CFFL_FormFiller::GetPDFWindow(CPDFSDK_PageView* pPageView, bool bNew) +CPWL_Wnd* CFFL_FormFiller::GetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bNew) { ASSERT(pPageView); @@ -499,7 +499,7 @@ CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView() CPDF_Rect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) { - if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false)) + if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { CPDF_Rect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect())); CPDF_Rect rcPage = pPageView->GetPDFPage()->GetPageBBox(); @@ -561,44 +561,44 @@ CPDF_Rect CFFL_FormFiller::FFLtoWnd(CPDFSDK_PageView* pPageView, const CPDF_Rect return rect; } -bool CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag) +FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag) { if (IsDataChanged(pPageView)) { - bool bRC = true; - bool bExit = false; + FX_BOOL bRC = TRUE; + FX_BOOL bExit = FALSE; CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller(); pIFormFiller->OnKeyStrokeCommit(m_pWidget, pPageView, bRC, bExit, nFlag); if (bExit) - return true; + return TRUE; if (!bRC) { - ResetPDFWindow(pPageView, false); - return true; + ResetPDFWindow(pPageView, FALSE); + return TRUE; } pIFormFiller->OnValidate(m_pWidget, pPageView, bRC, bExit, nFlag); if (bExit) - return true; + return TRUE; if (!bRC) { - ResetPDFWindow(pPageView, false); - return true; + ResetPDFWindow(pPageView, FALSE); + return TRUE; } SaveData(pPageView); pIFormFiller->OnCalculate(m_pWidget, pPageView, bExit,nFlag); if (bExit) - return true; + return TRUE; pIFormFiller->OnFormat(m_pWidget, pPageView, bExit,nFlag); } - return true; + return TRUE; } -bool CFFL_FormFiller::IsDataChanged(CPDFSDK_PageView* pPageView) +FX_BOOL CFFL_FormFiller::IsDataChanged(CPDFSDK_PageView* pPageView) { - return false; + return FALSE; } void CFFL_FormFiller::SaveData(CPDFSDK_PageView* pPageView) @@ -621,10 +621,10 @@ void CFFL_FormFiller::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::A { } -bool CFFL_FormFiller::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, +FX_BOOL CFFL_FormFiller::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew) { - return false; + return FALSE; } void CFFL_FormFiller::SaveState(CPDFSDK_PageView* pPageView) @@ -635,9 +635,9 @@ void CFFL_FormFiller::RestoreState(CPDFSDK_PageView* pPageView) { } -CPWL_Wnd* CFFL_FormFiller::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue) +CPWL_Wnd* CFFL_FormFiller::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue) { - return GetPDFWindow(pPageView, false); + return GetPDFWindow(pPageView, FALSE); } void CFFL_FormFiller::TimerProc() @@ -650,13 +650,13 @@ IFX_SystemHandler* CFFL_FormFiller::GetSystemHandler() const return m_pApp->GetSysHandler(); } -void CFFL_FormFiller::OnKeyStroke(bool bKeyDown) +void CFFL_FormFiller::OnKeyStroke(FX_BOOL bKeyDown) { } -void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, bool bDestroyPDFWindow) +void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroyPDFWindow) { - m_bValid = false; + m_bValid = FALSE; FX_RECT rcRect = GetViewBBox(pPageView, m_pWidget); InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom); @@ -665,19 +665,19 @@ void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, bool bDestroyPDF DestroyPDFWindow(pPageView); } -bool CFFL_FormFiller::CanCopy(CPDFSDK_Document* pDocument) +FX_BOOL CFFL_FormFiller::CanCopy(CPDFSDK_Document* pDocument) { - return false; + return FALSE; } -bool CFFL_FormFiller::CanCut(CPDFSDK_Document* pDocument) +FX_BOOL CFFL_FormFiller::CanCut(CPDFSDK_Document* pDocument) { - return false; + return FALSE; } -bool CFFL_FormFiller::CanPaste(CPDFSDK_Document* pDocument) +FX_BOOL CFFL_FormFiller::CanPaste(CPDFSDK_Document* pDocument) { - return false; + return FALSE; } void CFFL_FormFiller::DoCopy(CPDFSDK_Document* pDocument) @@ -702,8 +702,8 @@ void CFFL_FormFiller::InvalidateRect(double left, double top, double right, doub CFFL_Button::CFFL_Button(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget) : CFFL_FormFiller(pApp, pWidget), - m_bMouseIn(false), - m_bMouseDown(false) + m_bMouseIn(FALSE), + m_bMouseDown(FALSE) { } @@ -713,14 +713,14 @@ 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); @@ -728,39 +728,39 @@ void CFFL_Button::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot ASSERT(m_pWidget != NULL); } -bool CFFL_Button::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { CPDF_Rect 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; } -bool CFFL_Button::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_Button::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { CPDF_Rect 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; } -bool CFFL_Button::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_Button::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { ASSERT(m_pApp != NULL); - return true; + return TRUE; } void CFFL_Button::OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp index 922d8c037e..7ce811e85b 100644 --- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp +++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp @@ -22,7 +22,7 @@ CFFL_IFormFiller::CFFL_IFormFiller(CPDFDoc_Environment* pApp) : m_pApp(pApp), - m_bNotifying(false) + m_bNotifying(FALSE) { } @@ -33,17 +33,17 @@ CFFL_IFormFiller::~CFFL_IFormFiller() m_Maps.clear(); } -bool CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,CPDFSDK_Annot* pAnnot, CPDF_Point point) +FX_BOOL CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,CPDFSDK_Annot* pAnnot, CPDF_Point point) { CPDF_Rect rc = pAnnot->GetRect(); if(rc.Contains(point.x, point.y)) - return true; - return false; + return TRUE; + return FALSE; } FX_RECT CFFL_IFormFiller::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 != NULL); @@ -65,7 +65,7 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_ if (IsVisible(pWidget)) { - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { if (pFormFiller->IsValid()) { @@ -98,7 +98,7 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_ } } - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) pFormFiller->OnDrawDeactive(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); else pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL); @@ -110,7 +110,7 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_ void CFFL_IFormFiller::OnCreate(CPDFSDK_Annot* pAnnot) { - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { pFormFiller->OnCreate(pAnnot); } @@ -118,7 +118,7 @@ void CFFL_IFormFiller::OnCreate(CPDFSDK_Annot* pAnnot) void CFFL_IFormFiller::OnLoad(CPDFSDK_Annot* pAnnot) { - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { pFormFiller->OnLoad(pAnnot); } @@ -126,7 +126,7 @@ void CFFL_IFormFiller::OnLoad(CPDFSDK_Annot* pAnnot) void CFFL_IFormFiller::OnDelete(CPDFSDK_Annot* pAnnot) { - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { pFormFiller->OnDelete(pAnnot); } @@ -144,7 +144,7 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; if (pWidget->GetAAction(CPDF_AAction::CursorEnter)) { - m_bNotifying = true; + m_bNotifying = TRUE; int nValueAge = pWidget->GetValueAge(); @@ -158,13 +158,13 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::CursorEnter, fa, pPageView ); - m_bNotifying = false; + m_bNotifying = FALSE; //if ( !IsValidAnnot(pPageView, 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); } @@ -172,7 +172,7 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* } } - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, true)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) { pFormFiller->OnMouseEnter(pPageView, pAnnot); } @@ -188,7 +188,7 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* p CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; if (pWidget->GetAAction(CPDF_AAction::CursorExit)) { - m_bNotifying = true; + m_bNotifying = TRUE; pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); pWidget->ClearAppModified(); @@ -202,13 +202,13 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* p fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::CursorExit, fa, pPageView); - m_bNotifying = false; + m_bNotifying = FALSE; //if (!IsValidAnnot(pPageView, 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()); } @@ -216,13 +216,13 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* p } } - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { pFormFiller->OnMouseExit(pPageView, pAnnot); } } -bool CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); @@ -232,7 +232,7 @@ bool CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; if (Annot_HitTest(pPageView, pAnnot, point) && pWidget->GetAAction(CPDF_AAction::ButtonDown)) { - m_bNotifying = true; + m_bNotifying = TRUE; pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); pWidget->ClearAppModified(); @@ -245,13 +245,13 @@ bool CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlags); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlags); pWidget->OnAAction(CPDF_AAction::ButtonDown, fa, pPageView); - m_bNotifying = false; + m_bNotifying = FALSE; - if (!IsValidAnnot(pPageView, pAnnot)) return true; + if (!IsValidAnnot(pPageView, pAnnot)) 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()); } @@ -259,15 +259,15 @@ bool CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* } } - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { return pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point); } - return false; + return FALSE; } -bool CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; @@ -286,24 +286,24 @@ bool CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* p break; } - bool bRet = false; + FX_BOOL bRet = FALSE; - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { bRet = pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point); } if (pDocument->GetFocusAnnot() == pAnnot) { - bool bExit = false; - bool bReset = false; + FX_BOOL bExit = FALSE; + FX_BOOL bReset = FALSE; OnButtonUp(pWidget, pPageView, bReset, bExit,nFlags); - if (bExit) return true; + if (bExit) return TRUE; } return bRet; } -void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bReset, bool& bExit,FX_UINT nFlag) +void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bReset, FX_BOOL& bExit,FX_UINT nFlag) { ASSERT(pWidget != NULL); @@ -311,7 +311,7 @@ void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPa { if (pWidget->GetAAction(CPDF_AAction::ButtonUp)) { - m_bNotifying = true; + m_bNotifying = TRUE; int nAge = pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); @@ -326,122 +326,122 @@ void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPa fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::ButtonUp, 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; } } } } -bool CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { return pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point); } - return false; + return FALSE; } -bool CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); //change cursor - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, true)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) { return pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point); } - return false; + return FALSE; } -bool CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point) +FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point) { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { return pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, point); } - return false; + return FALSE; } -bool CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { return pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point); } - return false; + return FALSE; } -bool CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { return pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point); } - return false; + return FALSE; } -bool CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags) +FX_BOOL CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags) { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "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; } -bool CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) +FX_BOOL CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "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; } -bool CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) +FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) { if (!pAnnot) - return false; + return FALSE; ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); @@ -450,7 +450,7 @@ bool CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; if (pWidget->GetAAction(CPDF_AAction::GetFocus)) { - m_bNotifying = true; + m_bNotifying = TRUE; pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); @@ -463,15 +463,15 @@ bool CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); - CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, true); - if(!pFormFiller) return false; + CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, TRUE); + if(!pFormFiller) return FALSE; pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa); pWidget->OnAAction(CPDF_AAction::GetFocus, fa, pPageView); - m_bNotifying = false; + m_bNotifying = FALSE; if (pWidget->IsAppModified()) { - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge()); } @@ -479,18 +479,18 @@ bool CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) } } - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, true)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) return pFormFiller->OnSetFocus(pAnnot, nFlag); - return true; + return TRUE; } -bool CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) +FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) { - if(!pAnnot) return false; + if(!pAnnot) return FALSE; ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); - if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false)) + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { if (pFormFiller->OnKillFocus(pAnnot, nFlag)) { @@ -499,7 +499,7 @@ bool CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; if (pWidget->GetAAction(CPDF_AAction::LoseFocus)) { - m_bNotifying = true; + m_bNotifying = TRUE; pWidget->ClearAppModified(); CPDFSDK_PageView* pPageView = pWidget->GetPageView(); @@ -512,24 +512,24 @@ bool CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa); pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView); - m_bNotifying = false; + m_bNotifying = FALSE; } } } else - return false; + return FALSE; } - return true; + return TRUE; } -bool CFFL_IFormFiller::IsVisible(CPDFSDK_Widget* pWidget) +FX_BOOL CFFL_IFormFiller::IsVisible(CPDFSDK_Widget* pWidget) { return pWidget->IsVisible(); } -bool CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget) +FX_BOOL CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget) { ASSERT(pWidget != NULL); @@ -538,12 +538,12 @@ bool CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget) return (nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY; } -bool CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) +FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) { ASSERT(pWidget != NULL); if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON) - return true; + return TRUE; else { CPDF_Page* pPage = pWidget->GetPDFPage(); @@ -557,10 +557,10 @@ bool CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) (dwPermissions&FPDFPERM_ANNOT_FORM) || (dwPermissions&FPDFPERM_MODIFY); } - return true; + return TRUE; } -CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot, bool bRegister) +CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister) { auto it = m_Maps.find(pAnnot); if (it != m_Maps.end()) @@ -666,7 +666,7 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX } FX_FLOAT fFactHeight = 0; - bool bBottom = true; + FX_BOOL bBottom = TRUE; FX_FLOAT fMaxListBoxHeight = 0; if (fPopupMax > FFL_MAXLISTBOXHEIGHT) { @@ -685,26 +685,26 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX 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; } } } @@ -713,14 +713,14 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX fPopupRet = fFactHeight; } -void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bRC, bool& bExit, FX_DWORD nFlag) +void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag) { if (!m_bNotifying) { ASSERT(pWidget != NULL); if (pWidget->GetAAction(CPDF_AAction::KeyStroke)) { - m_bNotifying = true; + m_bNotifying = TRUE; pWidget->ClearAppModified(); ASSERT(pPageView != NULL); @@ -728,11 +728,11 @@ void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageVi PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_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); ASSERT(pFormFiller != NULL); pFormFiller->GetActionData(pPageView, CPDF_AAction::KeyStroke, fa); @@ -744,19 +744,19 @@ void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageVi bRC = fa.bRC; // bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget); - m_bNotifying = false; + m_bNotifying = FALSE; } } } -void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bRC, bool& bExit, FX_DWORD nFlag) +void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag) { if (!m_bNotifying) { ASSERT(pWidget != NULL); if (pWidget->GetAAction(CPDF_AAction::Validate)) { - m_bNotifying = true; + m_bNotifying = TRUE; pWidget->ClearAppModified(); ASSERT(pPageView != NULL); @@ -768,10 +768,10 @@ void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPa PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_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); ASSERT(pFormFiller != NULL); pFormFiller->GetActionData(pPageView, CPDF_AAction::Validate, fa); @@ -783,12 +783,12 @@ void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPa bRC = fa.bRC; // bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget); - m_bNotifying = false; + m_bNotifying = FALSE; } } } -void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bExit, FX_DWORD nFlag) +void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag) { if (!m_bNotifying) { @@ -806,11 +806,11 @@ void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pP // bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget); - m_bNotifying = false; + m_bNotifying = FALSE; } } -void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bExit, FX_DWORD nFlag) +void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag) { if (!m_bNotifying) { @@ -824,7 +824,7 @@ void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPage CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm(); ASSERT(pInterForm != NULL); - bool bFormated = false; + FX_BOOL bFormated = FALSE; CFX_WideString sValue = pInterForm->OnFormat(pWidget->GetFormField(), bFormated); // bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget); @@ -833,15 +833,15 @@ void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPage if (bFormated) { - pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(), true); + pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(), TRUE); pInterForm->UpdateField(pWidget->GetFormField()); } - m_bNotifying = false; + m_bNotifying = FALSE; } } -bool CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) +FX_BOOL CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) { ASSERT(pPageView != NULL); @@ -850,26 +850,26 @@ bool CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* if(pPageView) return pPageView->IsValidAnnot(pAnnot->GetPDFAnnot()); else - return false; + return FALSE; } -void CFFL_IFormFiller::OnBeforeKeyStroke(bool bEditOrList, void* pPrivateData, int32_t nKeyCode, +void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode, CFX_WideString & strChange, const CFX_WideString& strChangeEx, int nSelStart, int nSelEnd, - bool bKeyDown, bool & bRC, bool & bExit, FX_DWORD nFlag) + FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag) { ASSERT(pPrivateData != NULL); CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; ASSERT(pData->pWidget != NULL); - CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, false); + CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE); ASSERT(pFormFiller != NULL); if (!m_bNotifying) { if (pData->pWidget->GetAAction(CPDF_AAction::KeyStroke)) { - m_bNotifying = true; + m_bNotifying = TRUE; int nAge = pData->pWidget->GetAppearanceAge(); int nValueAge = pData->pWidget->GetValueAge(); @@ -882,8 +882,8 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(bool bEditOrList, void* pPrivateData, i 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; @@ -895,8 +895,8 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(bool bEditOrList, void* pPrivateData, i { if (!IsValidAnnot(pData->pPageView, pData->pWidget)) { - bExit = true; - m_bNotifying = false; + bExit = TRUE; + m_bNotifying = FALSE; return; } @@ -904,48 +904,48 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(bool bEditOrList, void* pPrivateData, i { 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 (pDocument->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; } } } -void CFFL_IFormFiller::OnAfterKeyStroke(bool bEditOrList, void* pPrivateData, bool & bExit,FX_DWORD nFlag) +void CFFL_IFormFiller::OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit,FX_DWORD nFlag) { ASSERT(pPrivateData != NULL); CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; ASSERT(pData->pWidget != NULL); - CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, false); + CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE); ASSERT(pFormFiller != NULL); if (!bEditOrList) diff --git a/fpdfsdk/src/formfiller/FFL_ListBox.cpp b/fpdfsdk/src/formfiller/FFL_ListBox.cpp index ef113dad96..c105cfcbdd 100644 --- a/fpdfsdk/src/formfiller/FFL_ListBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_ListBox.cpp @@ -73,7 +73,7 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView { m_OriginSelections.clear(); - bool bSetCaret = false; + FX_BOOL bSetCaret = FALSE; for (int32_t i=0,sz=m_pWidget->CountOptions(); i<sz; i++) { if (m_pWidget->IsOptionSelected(i)) @@ -81,7 +81,7 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView if (!bSetCaret) { pWnd->SetCaret(i); - bSetCaret = true; + bSetCaret = TRUE; } pWnd->Select(i); m_OriginSelections.insert(i); @@ -106,23 +106,23 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView } -bool CFFL_ListBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) +FX_BOOL CFFL_ListBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) { return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); } -bool CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView) +FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView) { - CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false); + CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE); if (!pListBox) - return false; + return FALSE; if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) { int 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++; } @@ -137,7 +137,7 @@ void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) { ASSERT(m_pWidget != NULL); - if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false)) + if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE)) { CFX_IntArray aOldSelect, aNewSelect; @@ -154,7 +154,7 @@ void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) int32_t nNewTopIndex = pListBox->GetTopVisibleIndex(); - m_pWidget->ClearSelection(false); + m_pWidget->ClearSelection(FALSE); if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) { @@ -162,19 +162,19 @@ void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) { if (pListBox->IsItemSelected(i)) { - m_pWidget->SetOptionSelection(i, true, false); + m_pWidget->SetOptionSelection(i, TRUE, FALSE); aNewSelect.Add(i); } } } else { - m_pWidget->SetOptionSelection(pListBox->GetCurSel(), true, false); + m_pWidget->SetOptionSelection(pListBox->GetCurSel(), TRUE, FALSE); aNewSelect.Add(pListBox->GetCurSel()); } m_pWidget->SetTopVisibleIndex(nNewTopIndex); - m_pWidget->ResetFieldAppearance(true); + m_pWidget->ResetFieldAppearance(TRUE); m_pWidget->UpdateField(); SetChangeMark(); } @@ -192,7 +192,7 @@ void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AAct } else { - if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false)) + if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE)) { ASSERT(m_pWidget != NULL); int32_t nCurSel = pListBox->GetCurSel(); @@ -230,7 +230,7 @@ void CFFL_ListBox::SaveState(CPDFSDK_PageView* pPageView) { ASSERT(pPageView != NULL); - 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++) { @@ -244,14 +244,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, bool bRestoreValue) +CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue) { if (bRestoreValue) SaveState(pPageView); @@ -263,17 +263,17 @@ CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestor 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_ListBox::OnKeyStroke(bool bKeyDown, FX_DWORD nFlag) +void CFFL_ListBox::OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag) { ASSERT(m_pWidget != NULL); @@ -289,7 +289,7 @@ void CFFL_ListBox::OnKeyStroke(bool bKeyDown, FX_DWORD nFlag) if (CommitData(pPageView, nFlag)) { DestroyPDFWindow(pPageView); - m_bValid = false; + m_bValid = FALSE; } } } diff --git a/fpdfsdk/src/formfiller/FFL_Notify.cpp b/fpdfsdk/src/formfiller/FFL_Notify.cpp index fdc4bcf7b1..58a2202b61 100644 --- a/fpdfsdk/src/formfiller/FFL_Notify.cpp +++ b/fpdfsdk/src/formfiller/FFL_Notify.cpp @@ -15,7 +15,7 @@ //#pragma warning(disable: 4800) CFFL_Notify::CFFL_Notify(CFFL_FormFiller * pFormFiller) : - m_bDoActioning(false), + m_bDoActioning(FALSE), m_nNotifyFlag(0) { ASSERT(pFormFiller != NULL); @@ -36,116 +36,116 @@ void CFFL_Notify::AfterNotify() m_nNotifyFlag --; } -bool CFFL_Notify::OnMouseUp(bool & bExit) +FX_BOOL CFFL_Notify::OnMouseUp(FX_BOOL & bExit) { BeforeNotify(); - bool bRet = false;//DoAAction(CPDF_AAction::AActionType::ButtonUp, bExit); + FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::ButtonUp, bExit); AfterNotify(); return bRet; } -bool CFFL_Notify::OnMouseDown(bool & bExit) +FX_BOOL CFFL_Notify::OnMouseDown(FX_BOOL & bExit) { BeforeNotify(); - bool bRet = false;//DoAAction(CPDF_AAction::AActionType::ButtonDown, bExit); + FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::ButtonDown, bExit); AfterNotify(); return bRet; } -bool CFFL_Notify::OnMouseEnter(bool & bExit) +FX_BOOL CFFL_Notify::OnMouseEnter(FX_BOOL & bExit) { BeforeNotify(); - bool bRet = false;//DoAAction(CPDF_AAction::AActionType::CursorEnter, bExit); + FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::CursorEnter, bExit); AfterNotify(); return bRet; } -bool CFFL_Notify::OnMouseExit(bool & bExit) +FX_BOOL CFFL_Notify::OnMouseExit(FX_BOOL & bExit) { BeforeNotify(); - bool bRet = false;//DoAAction(CPDF_AAction::AActionType::CursorExit, bExit); + FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::CursorExit, bExit); AfterNotify(); return bRet; } -bool CFFL_Notify::OnSetFocus(bool & bExit) +FX_BOOL CFFL_Notify::OnSetFocus(FX_BOOL & bExit) { BeforeNotify(); - bool bRet = false;//DoAAction(CPDF_AAction::AActionType::GetFocus, bExit); + FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::GetFocus, bExit); AfterNotify(); return bRet; } -bool CFFL_Notify::OnKillFocus(bool & bExit) +FX_BOOL CFFL_Notify::OnKillFocus(FX_BOOL & bExit) { BeforeNotify(); - bool bRet = false;//DoAAction(CPDF_AAction::AActionType::LoseFocus, bExit); + FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::LoseFocus, bExit); AfterNotify(); return bRet; } -bool CFFL_Notify::OnCalculate() +FX_BOOL CFFL_Notify::OnCalculate() { - return true; + return TRUE; } -bool CFFL_Notify::OnFormat(int iCommitKey) +FX_BOOL CFFL_Notify::OnFormat(int iCommitKey) { - return true; + return TRUE; } -bool CFFL_Notify::OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange, - const CFX_WideString& strChangeEx, bool bKeyDown, bool bModifier, - bool bShift, bool bWillCommit, bool bFieldFull, - int& nSelStart, int& nSelEnd, bool& bRC) +FX_BOOL CFFL_Notify::OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange, + const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier, + FX_BOOL bShift, FX_BOOL bWillCommit, FX_BOOL bFieldFull, + int& nSelStart, int& nSelEnd, FX_BOOL& bRC) { - return true; + return TRUE; } -bool CFFL_Notify::OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange, - const CFX_WideString& strChangeEx, bool bKeyDown, bool bModifier, - bool bShift, bool & bRC) +FX_BOOL CFFL_Notify::OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange, + const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier, + FX_BOOL bShift, FX_BOOL & bRC) { - return true; + return TRUE; } -bool CFFL_Notify::DoAAction(CPDF_AAction::AActionType eAAT, bool & bExit) +FX_BOOL CFFL_Notify::DoAAction(CPDF_AAction::AActionType eAAT, FX_BOOL & bExit) { if (m_bDoActioning) - return false; + return FALSE; CPDF_Action action; if (!FindAAction(eAAT, action)) - return false; + return FALSE; - m_bDoActioning = true; + m_bDoActioning = TRUE; ExecuteActionTree(eAAT,action,bExit); - m_bDoActioning = false; - return true; + m_bDoActioning = FALSE; + return TRUE; } -bool CFFL_Notify::ExecuteActionTree(CPDF_AAction::AActionType eAAT,CPDF_Action & action, bool& bExit) +FX_BOOL CFFL_Notify::ExecuteActionTree(CPDF_AAction::AActionType eAAT,CPDF_Action & action, FX_BOOL& bExit) { - if (!ExecuteAction(eAAT,action,bExit)) return false; - if (bExit) return true; + if (!ExecuteAction(eAAT,action,bExit)) return FALSE; + if (bExit) return TRUE; for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++) { CPDF_Action subaction = action.GetSubAction(i); - if (!ExecuteActionTree(eAAT,subaction,bExit)) return false; + if (!ExecuteActionTree(eAAT,subaction,bExit)) return FALSE; if (bExit) break; } - return true; + return TRUE; } -bool CFFL_Notify::FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action) +FX_BOOL CFFL_Notify::FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action) { - return false; + return FALSE; } -bool CFFL_Notify::FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action) +FX_BOOL CFFL_Notify::FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action) { CPDF_Action MyAction; @@ -154,20 +154,20 @@ bool CFFL_Notify::FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAA MyAction = aaction.GetAction(eAAT); } else - return false; + return FALSE; if (MyAction.GetType() == CPDF_Action::Unknown) - return false; + return FALSE; action = MyAction; - return true; + return TRUE; } -bool CFFL_Notify::ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,bool& bExit) +FX_BOOL CFFL_Notify::ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,FX_BOOL& bExit) { - return false; + return FALSE; } //#pragma warning(default: 4800) diff --git a/fpdfsdk/src/formfiller/FFL_PushButton.cpp b/fpdfsdk/src/formfiller/FFL_PushButton.cpp index 44e4ed03f3..a5df48840c 100644 --- a/fpdfsdk/src/formfiller/FFL_PushButton.cpp +++ b/fpdfsdk/src/formfiller/FFL_PushButton.cpp @@ -28,7 +28,7 @@ CPWL_Wnd* CFFL_PushButton::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageV } -bool CFFL_PushButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) +FX_BOOL CFFL_PushButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) { return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); } diff --git a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp index e7b334828a..1f73e8ccaa 100644 --- a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp +++ b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp @@ -31,19 +31,19 @@ CPWL_Wnd* CFFL_RadioButton::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_Page return pWnd; } -bool CFFL_RadioButton::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags) +FX_BOOL CFFL_RadioButton::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags) { switch (nKeyCode) { case FWL_VKEY_Return: case FWL_VKEY_Space: - return true; + return TRUE; default: return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags); } } -bool CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) +FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) { switch (nChar) { @@ -56,61 +56,61 @@ bool CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFla CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); ASSERT(pPageView != NULL); - bool bReset = false; - bool bExit = false; + FX_BOOL bReset = FALSE; + FX_BOOL bExit = FALSE; pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit,nFlags); - if (bReset) return true; - if (bExit) return true; + if (bReset) return TRUE; + if (bExit) return TRUE; CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); - if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, true)) - pWnd->SetCheck(true); + if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE)) + pWnd->SetCheck(TRUE); CommitData(pPageView,nFlags); - return true; + return TRUE; } default: return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); } } -bool CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) +FX_BOOL CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point); if (IsValid()) { - if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, true)) - pWnd->SetCheck(true); + if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE)) + pWnd->SetCheck(TRUE); - if (!CommitData(pPageView,nFlags)) return false; + if (!CommitData(pPageView,nFlags)) return FALSE; } - return true; + return TRUE; } -bool CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView) +FX_BOOL CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView) { ASSERT(m_pWidget != NULL); - if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, false)) + if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE)) { return pWnd->IsChecked() != m_pWidget->IsChecked(); } - return false; + return FALSE; } void CFFL_RadioButton::SaveData(CPDFSDK_PageView* pPageView) { ASSERT(m_pWidget != NULL); - if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, false)) + if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE)) { - bool bNewChecked = pWnd->IsChecked(); + FX_BOOL bNewChecked = pWnd->IsChecked(); if (bNewChecked) { @@ -129,7 +129,7 @@ void CFFL_RadioButton::SaveData(CPDFSDK_PageView* pPageView) } } - m_pWidget->SetCheck(bNewChecked, false); + m_pWidget->SetCheck(bNewChecked, FALSE); m_pWidget->UpdateField(); SetChangeMark(); } diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp index a8695f4aa5..a4b87263ed 100644 --- a/fpdfsdk/src/formfiller/FFL_TextField.cpp +++ b/fpdfsdk/src/formfiller/FFL_TextField.cpp @@ -129,7 +129,7 @@ CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageVi } -bool CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) +FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) { switch (nChar) { @@ -144,7 +144,7 @@ bool CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags if (m_bValid) { - if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true)) + if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) pWnd->SetFocus(); } else @@ -152,9 +152,9 @@ bool CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags if (CommitData(pPageView, nFlags)) { DestroyPDFWindow(pPageView); - return true; + return TRUE; } - return false; + return FALSE; } } break; @@ -162,35 +162,35 @@ bool CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags { CPDFSDK_PageView* pPageView = GetCurPageView(); ASSERT(pPageView != NULL); - EscapeFiller(pPageView,true); - return true; + EscapeFiller(pPageView,TRUE); + return TRUE; } } return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); } -bool CFFL_TextField::IsDataChanged(CPDFSDK_PageView* pPageView) +FX_BOOL CFFL_TextField::IsDataChanged(CPDFSDK_PageView* pPageView) { ASSERT(m_pWidget != NULL); - if (CPWL_Edit * pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, false)) + 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) { ASSERT(m_pWidget != NULL); - 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(); } @@ -202,7 +202,7 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AA 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(); @@ -216,7 +216,7 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AA } 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(); } @@ -237,7 +237,7 @@ void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AA 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); @@ -250,7 +250,7 @@ void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AA } -bool CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, +FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew) { switch (type) @@ -262,14 +262,14 @@ bool CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const P break; } - return false; + return FALSE; } void CFFL_TextField::SaveState(CPDFSDK_PageView* pPageView) { ASSERT(pPageView != NULL); - 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(); @@ -280,14 +280,14 @@ void CFFL_TextField::RestoreState(CPDFSDK_PageView* pPageView) { ASSERT(pPageView != NULL); - if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, true)) + if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, TRUE)) { pWnd->SetText(m_State.sValue.c_str()); pWnd->SetSel(m_State.nStart, m_State.nEnd); } } -CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue) +CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue) { if (bRestoreValue) SaveState(pPageView); @@ -299,10 +299,10 @@ CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRest if (bRestoreValue) { RestoreState(pPageView); - pRet = GetPDFWindow(pPageView, false); + pRet = GetPDFWindow(pPageView, FALSE); } else - pRet = GetPDFWindow(pPageView, true); + pRet = GetPDFWindow(pPageView, TRUE); m_pWidget->UpdateField(); @@ -326,7 +326,7 @@ 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_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, true); + m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, TRUE); pEdit->SetEditNotify(this); //pUndo->BeginEdit(pDocument); @@ -338,19 +338,19 @@ void CFFL_TextField::OnKillFocus(CPWL_Wnd* pWnd) } -bool CFFL_TextField::CanCopy(CPDFSDK_Document* pDocument) +FX_BOOL CFFL_TextField::CanCopy(CPDFSDK_Document* pDocument) { - return false; + return FALSE; } -bool CFFL_TextField::CanCut(CPDFSDK_Document* pDocument) +FX_BOOL CFFL_TextField::CanCut(CPDFSDK_Document* pDocument) { - return false; + return FALSE; } -bool CFFL_TextField::CanPaste(CPDFSDK_Document* pDocument) +FX_BOOL CFFL_TextField::CanPaste(CPDFSDK_Document* pDocument) { - return false; + return FALSE; } void CFFL_TextField::OnAddUndo(CPWL_Edit* pEdit) diff --git a/fpdfsdk/src/formfiller/FFL_Utils.cpp b/fpdfsdk/src/formfiller/FFL_Utils.cpp index 0e5022c9c1..8d2d76d73c 100644 --- a/fpdfsdk/src/formfiller/FFL_Utils.cpp +++ b/fpdfsdk/src/formfiller/FFL_Utils.cpp @@ -41,9 +41,9 @@ CPDF_Rect CFFL_Utils::DeflateRect(const CPDF_Rect & crRect,const FX_FLOAT & fSiz return crNew; } -bool CFFL_Utils::TraceObject(CPDF_Object* pObj) +FX_BOOL CFFL_Utils::TraceObject(CPDF_Object* pObj) { - if (!pObj) return false; + if (!pObj) return FALSE; FX_DWORD dwObjNum = pObj->GetObjNum(); switch (pObj->GetType()) @@ -71,7 +71,7 @@ bool CFFL_Utils::TraceObject(CPDF_Object* pObj) //TRACE(csKey + "\n"); if (!pElement) break; TraceObject(pElement); - }while (true); + }while (TRUE); } break; @@ -107,8 +107,8 @@ bool CFFL_Utils::TraceObject(CPDF_Object* pObj) default: break; } - if (dwObjNum == 0) return false; + if (dwObjNum == 0) return FALSE; - return true; + return TRUE; } |