summaryrefslogtreecommitdiff
path: root/fpdfsdk/src
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src')
-rw-r--r--fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp2
-rw-r--r--fpdfsdk/src/formfiller/FFL_CheckBox.cpp38
-rw-r--r--fpdfsdk/src/formfiller/FFL_ComboBox.cpp66
-rw-r--r--fpdfsdk/src/formfiller/FFL_FormFiller.cpp190
-rw-r--r--fpdfsdk/src/formfiller/FFL_IFormFiller.cpp248
-rw-r--r--fpdfsdk/src/formfiller/FFL_ListBox.cpp40
-rw-r--r--fpdfsdk/src/formfiller/FFL_Notify.cpp90
-rw-r--r--fpdfsdk/src/formfiller/FFL_PushButton.cpp2
-rw-r--r--fpdfsdk/src/formfiller/FFL_RadioButton.cpp42
-rw-r--r--fpdfsdk/src/formfiller/FFL_TextField.cpp58
-rw-r--r--fpdfsdk/src/formfiller/FFL_Utils.cpp10
-rw-r--r--fpdfsdk/src/fpdf_dataavail.cpp4
-rw-r--r--fpdfsdk/src/fpdf_ext.cpp20
-rw-r--r--fpdfsdk/src/fpdf_flatten.cpp24
-rw-r--r--fpdfsdk/src/fpdf_progressive.cpp6
-rw-r--r--fpdfsdk/src/fpdf_sysfontinfo.cpp22
-rw-r--r--fpdfsdk/src/fpdf_transformpage.cpp28
-rw-r--r--fpdfsdk/src/fpdfdoc.cpp22
-rw-r--r--fpdfsdk/src/fpdfeditimg.cpp14
-rw-r--r--fpdfsdk/src/fpdfeditpage.cpp22
-rw-r--r--fpdfsdk/src/fpdfformfill.cpp30
-rw-r--r--fpdfsdk/src/fpdfppo.cpp64
-rw-r--r--fpdfsdk/src/fpdfsave.cpp22
-rw-r--r--fpdfsdk/src/fpdftext.cpp4
-rw-r--r--fpdfsdk/src/fpdfview.cpp54
-rw-r--r--fpdfsdk/src/fsdk_actionhandler.cpp136
-rw-r--r--fpdfsdk/src/fsdk_annothandler.cpp138
-rw-r--r--fpdfsdk/src/fsdk_baseannot.cpp76
-rw-r--r--fpdfsdk/src/fsdk_baseform.cpp248
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp166
-rw-r--r--fpdfsdk/src/fsdk_rendercontext.cpp4
-rw-r--r--fpdfsdk/src/fxedit/fxet_ap.cpp2
-rw-r--r--fpdfsdk/src/fxedit/fxet_edit.cpp468
-rw-r--r--fpdfsdk/src/fxedit/fxet_list.cpp106
-rw-r--r--fpdfsdk/src/fxedit/fxet_pageobjs.cpp10
-rw-r--r--fpdfsdk/src/javascript/Document.cpp476
-rw-r--r--fpdfsdk/src/javascript/Field.cpp880
-rw-r--r--fpdfsdk/src/javascript/Icon.cpp6
-rw-r--r--fpdfsdk/src/javascript/JS_Context.cpp64
-rw-r--r--fpdfsdk/src/javascript/JS_EventHandler.cpp102
-rw-r--r--fpdfsdk/src/javascript/JS_GlobalData.cpp24
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp68
-rw-r--r--fpdfsdk/src/javascript/JS_Value.cpp34
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp376
-rw-r--r--fpdfsdk/src/javascript/app.cpp178
-rw-r--r--fpdfsdk/src/javascript/color.cpp24
-rw-r--r--fpdfsdk/src/javascript/console.cpp18
-rw-r--r--fpdfsdk/src/javascript/event.cpp140
-rw-r--r--fpdfsdk/src/javascript/global.cpp68
-rw-r--r--fpdfsdk/src/javascript/report.cpp8
-rw-r--r--fpdfsdk/src/javascript/util.cpp46
-rw-r--r--fpdfsdk/src/jsapi/fxjs_v8.cpp6
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Button.cpp14
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Caret.cpp22
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp100
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Edit.cpp228
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp108
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_FontMap.cpp18
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Icon.cpp8
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_IconList.cpp60
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Label.cpp2
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ListBox.cpp80
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp8
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Note.cpp194
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp94
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Signature.cpp20
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp36
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Utils.cpp104
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Wnd.cpp94
69 files changed, 3092 insertions, 3092 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
index 699a7e4ffe..6570b3ee15 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;
- FX_BOOL bWidget = (m_pAnnotDict->GetString("Subtype") == "Widget");
+ 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 55d2d45bc2..72ff575c11 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;
}
-FX_BOOL CFFL_CheckBox::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
+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);
}
}
-FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+bool CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
switch (nChar)
{
@@ -55,57 +55,57 @@ FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFla
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
ASSERT(pPageView != NULL);
- FX_BOOL bReset = FALSE;
- FX_BOOL bExit = FALSE;
+ bool bReset = false;
+ 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);
}
}
-FX_BOOL CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_CheckBox::IsDataChanged(CPDFSDK_PageView* pPageView)
+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))
{
- FX_BOOL bNewChecked = pWnd->IsChecked();
+ 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 841b45ecba..d6d4d3da4e 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
}
-FX_BOOL CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+bool CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
-FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView)
+bool CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView)
{
- 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
- FX_BOOL bSetValue = TRUE;
+ bool bSetValue = true;
if (m_pWidget->GetFieldFlags() & FIELDFLAG_EDIT)
{
if (nCurSel >= 0)
{
if (swText != m_pWidget->GetOptionLabel(nCurSel))
- bSetValue = TRUE;
+ bSetValue = true;
else
- bSetValue = FALSE;
+ bSetValue = false;
}
else
- bSetValue = TRUE;
+ bSetValue = true;
}
else
- bSetValue = FALSE;
+ bSetValue = false;
CFX_WideString sOldValue;
@@ -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
}
}
-FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+bool CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
const PDFSDK_FieldAction& faNew)
{
switch (type)
@@ -229,14 +229,14 @@ FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const
break;
}
- return FALSE;
+ return false;
}
void CFFL_ComboBox::SaveState(CPDFSDK_PageView* pPageView)
{
ASSERT(pPageView != NULL);
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
{
m_State.nIndex = pComboBox->GetSelect();
@@ -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, FX_BOOL bRestoreValue)
+CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue)
{
if (bRestoreValue)
SaveState(pPageView);
@@ -279,17 +279,17 @@ CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRe
if (bRestoreValue)
{
RestoreState(pPageView);
- pRet = GetPDFWindow(pPageView, FALSE);
+ pRet = GetPDFWindow(pPageView, false);
}
else
- pRet = GetPDFWindow(pPageView, TRUE);
+ pRet = GetPDFWindow(pPageView, true);
m_pWidget->UpdateField();
return pRet;
}
-void CFFL_ComboBox::OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag)
+void CFFL_ComboBox::OnKeyStroke(bool bKeyDown, FX_UINT nFlag)
{
ASSERT(m_pWidget != NULL);
@@ -305,7 +305,7 @@ void CFFL_ComboBox::OnKeyStroke(FX_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);
}
-FX_BOOL CFFL_ComboBox::CanCopy(CPDFSDK_Document* pDocument)
+bool CFFL_ComboBox::CanCopy(CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_ComboBox::CanCut(CPDFSDK_Document* pDocument)
+bool CFFL_ComboBox::CanCut(CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_ComboBox::CanPaste(CPDFSDK_Document* pDocument)
+bool CFFL_ComboBox::CanPaste(CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
- return FALSE;
+ return false;
}
void CFFL_ComboBox::OnAddUndo(CPWL_Edit* pEdit)
@@ -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 1811cb0424..34aa17cf06 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);
}
-FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
+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;
}
-FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+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;
}
-FX_BOOL CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
+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;
}
-FX_BOOL CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
+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 @@ FX_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;
}
-FX_BOOL CFFL_FormFiller::IsValid() const
+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, FX_BOOL bNew)
+CPWL_Wnd* CFFL_FormFiller::GetPDFWindow(CPDFSDK_PageView* pPageView, 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;
}
-FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag)
+bool CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag)
{
if (IsDataChanged(pPageView))
{
- FX_BOOL bRC = TRUE;
- FX_BOOL bExit = FALSE;
+ bool bRC = true;
+ 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;
}
-FX_BOOL CFFL_FormFiller::IsDataChanged(CPDFSDK_PageView* pPageView)
+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
{
}
-FX_BOOL CFFL_FormFiller::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+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, FX_BOOL bRestoreValue)
+CPWL_Wnd* CFFL_FormFiller::ResetPDFWindow(CPDFSDK_PageView* pPageView, 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(FX_BOOL bKeyDown)
+void CFFL_FormFiller::OnKeyStroke(bool bKeyDown)
{
}
-void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroyPDFWindow)
+void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, 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, FX_BOOL bDestroy
DestroyPDFWindow(pPageView);
}
-FX_BOOL CFFL_FormFiller::CanCopy(CPDFSDK_Document* pDocument)
+bool CFFL_FormFiller::CanCopy(CPDFSDK_Document* pDocument)
{
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_FormFiller::CanCut(CPDFSDK_Document* pDocument)
+bool CFFL_FormFiller::CanCut(CPDFSDK_Document* pDocument)
{
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_FormFiller::CanPaste(CPDFSDK_Document* pDocument)
+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);
}
-FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_Button::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_Button::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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 7ce811e85b..922d8c037e 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();
}
-FX_BOOL CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,CPDFSDK_Annot* pAnnot, CPDF_Point point)
+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);
}
}
-FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Ann
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 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Ann
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 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Ann
}
}
- 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;
}
-FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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 @@ FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot
break;
}
- FX_BOOL bRet = FALSE;
+ 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)
{
- FX_BOOL bExit = FALSE;
- FX_BOOL bReset = FALSE;
+ bool bExit = false;
+ 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, FX_BOOL& bReset, FX_BOOL& bExit,FX_UINT nFlag)
+void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bReset, 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;
}
}
}
}
-FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
+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;
}
-FX_BOOL CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+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;
}
-FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
+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 @@ FX_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 @@ FX_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 @@ FX_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;
}
-FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
+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 @@ FX_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 @@ FX_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;
}
-FX_BOOL CFFL_IFormFiller::IsVisible(CPDFSDK_Widget* pWidget)
+bool CFFL_IFormFiller::IsVisible(CPDFSDK_Widget* pWidget)
{
return pWidget->IsVisible();
}
-FX_BOOL CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget)
+bool CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget)
{
ASSERT(pWidget != NULL);
@@ -538,12 +538,12 @@ FX_BOOL CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget)
return (nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY;
}
-FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget)
+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 @@ FX_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, FX_BOOL bRegister)
+CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot, 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;
- FX_BOOL bBottom = TRUE;
+ 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, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag)
+void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bRC, 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, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag)
+void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bRC, 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, FX_BOOL& bExit, FX_DWORD nFlag)
+void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, 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, FX_BOOL& bExit, FX_DWORD nFlag)
+void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, 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);
- FX_BOOL bFormated = FALSE;
+ 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;
}
}
-FX_BOOL CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot)
+bool CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot)
{
ASSERT(pPageView != NULL);
@@ -850,26 +850,26 @@ FX_BOOL CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Anno
if(pPageView)
return pPageView->IsValidAnnot(pAnnot->GetPDFAnnot());
else
- return FALSE;
+ return false;
}
-void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode,
+void CFFL_IFormFiller::OnBeforeKeyStroke(bool bEditOrList, void* pPrivateData, int32_t nKeyCode,
CFX_WideString & strChange, const CFX_WideString& strChangeEx,
int nSelStart, int nSelEnd,
- FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag)
+ bool bKeyDown, bool & bRC, 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(FX_BOOL bEditOrList, void* pPrivateData
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(FX_BOOL bEditOrList, void* pPrivateData
{
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(FX_BOOL bEditOrList, void* pPrivateData
{
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(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit,FX_DWORD nFlag)
+void CFFL_IFormFiller::OnAfterKeyStroke(bool bEditOrList, void* pPrivateData, 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 c105cfcbdd..ef113dad96 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();
- FX_BOOL bSetCaret = FALSE;
+ 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
}
-FX_BOOL CFFL_ListBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+bool CFFL_ListBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
-FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView)
+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, FX_BOOL bRestoreValue)
+CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue)
{
if (bRestoreValue)
SaveState(pPageView);
@@ -263,17 +263,17 @@ CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRes
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(FX_BOOL bKeyDown, FX_DWORD nFlag)
+void CFFL_ListBox::OnKeyStroke(bool bKeyDown, FX_DWORD nFlag)
{
ASSERT(m_pWidget != NULL);
@@ -289,7 +289,7 @@ void CFFL_ListBox::OnKeyStroke(FX_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 58a2202b61..fdc4bcf7b1 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 --;
}
-FX_BOOL CFFL_Notify::OnMouseUp(FX_BOOL & bExit)
+bool CFFL_Notify::OnMouseUp(bool & bExit)
{
BeforeNotify();
- FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::ButtonUp, bExit);
+ bool bRet = false;//DoAAction(CPDF_AAction::AActionType::ButtonUp, bExit);
AfterNotify();
return bRet;
}
-FX_BOOL CFFL_Notify::OnMouseDown(FX_BOOL & bExit)
+bool CFFL_Notify::OnMouseDown(bool & bExit)
{
BeforeNotify();
- FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::ButtonDown, bExit);
+ bool bRet = false;//DoAAction(CPDF_AAction::AActionType::ButtonDown, bExit);
AfterNotify();
return bRet;
}
-FX_BOOL CFFL_Notify::OnMouseEnter(FX_BOOL & bExit)
+bool CFFL_Notify::OnMouseEnter(bool & bExit)
{
BeforeNotify();
- FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::CursorEnter, bExit);
+ bool bRet = false;//DoAAction(CPDF_AAction::AActionType::CursorEnter, bExit);
AfterNotify();
return bRet;
}
-FX_BOOL CFFL_Notify::OnMouseExit(FX_BOOL & bExit)
+bool CFFL_Notify::OnMouseExit(bool & bExit)
{
BeforeNotify();
- FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::CursorExit, bExit);
+ bool bRet = false;//DoAAction(CPDF_AAction::AActionType::CursorExit, bExit);
AfterNotify();
return bRet;
}
-FX_BOOL CFFL_Notify::OnSetFocus(FX_BOOL & bExit)
+bool CFFL_Notify::OnSetFocus(bool & bExit)
{
BeforeNotify();
- FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::GetFocus, bExit);
+ bool bRet = false;//DoAAction(CPDF_AAction::AActionType::GetFocus, bExit);
AfterNotify();
return bRet;
}
-FX_BOOL CFFL_Notify::OnKillFocus(FX_BOOL & bExit)
+bool CFFL_Notify::OnKillFocus(bool & bExit)
{
BeforeNotify();
- FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::LoseFocus, bExit);
+ bool bRet = false;//DoAAction(CPDF_AAction::AActionType::LoseFocus, bExit);
AfterNotify();
return bRet;
}
-FX_BOOL CFFL_Notify::OnCalculate()
+bool CFFL_Notify::OnCalculate()
{
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_Notify::OnFormat(int iCommitKey)
+bool CFFL_Notify::OnFormat(int iCommitKey)
{
- return TRUE;
+ return true;
}
-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)
+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)
{
- return TRUE;
+ return true;
}
-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)
+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)
{
- return TRUE;
+ return true;
}
-FX_BOOL CFFL_Notify::DoAAction(CPDF_AAction::AActionType eAAT, FX_BOOL & bExit)
+bool CFFL_Notify::DoAAction(CPDF_AAction::AActionType eAAT, 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;
}
-FX_BOOL CFFL_Notify::ExecuteActionTree(CPDF_AAction::AActionType eAAT,CPDF_Action & action, FX_BOOL& bExit)
+bool CFFL_Notify::ExecuteActionTree(CPDF_AAction::AActionType eAAT,CPDF_Action & action, 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;
}
-FX_BOOL CFFL_Notify::FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action)
+bool CFFL_Notify::FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action)
{
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_Notify::FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action)
+bool CFFL_Notify::FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action)
{
CPDF_Action MyAction;
@@ -154,20 +154,20 @@ FX_BOOL CFFL_Notify::FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType
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;
}
-FX_BOOL CFFL_Notify::ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,FX_BOOL& bExit)
+bool CFFL_Notify::ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,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 a5df48840c..44e4ed03f3 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
}
-FX_BOOL CFFL_PushButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+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 1f73e8ccaa..e7b334828a 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;
}
-FX_BOOL CFFL_RadioButton::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
+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);
}
}
-FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+bool CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
switch (nChar)
{
@@ -56,61 +56,61 @@ FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT n
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
ASSERT(pPageView != NULL);
- FX_BOOL bReset = FALSE;
- FX_BOOL bExit = FALSE;
+ bool bReset = false;
+ 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);
}
}
-FX_BOOL CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+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;
}
-FX_BOOL CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView)
+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))
{
- FX_BOOL bNewChecked = pWnd->IsChecked();
+ 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 a4b87263ed..a8695f4aa5 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
}
-FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+bool CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
switch (nChar)
{
@@ -144,7 +144,7 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFl
if (m_bValid)
{
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE))
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true))
pWnd->SetFocus();
}
else
@@ -152,9 +152,9 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFl
if (CommitData(pPageView, nFlags))
{
DestroyPDFWindow(pPageView);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
}
break;
@@ -162,35 +162,35 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFl
{
CPDFSDK_PageView* pPageView = GetCurPageView();
ASSERT(pPageView != NULL);
- 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)
+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
}
-FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+bool CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
const PDFSDK_FieldAction& faNew)
{
switch (type)
@@ -262,14 +262,14 @@ FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, cons
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, FX_BOOL bRestoreValue)
+CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue)
{
if (bRestoreValue)
SaveState(pPageView);
@@ -299,10 +299,10 @@ CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bR
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)
}
-FX_BOOL CFFL_TextField::CanCopy(CPDFSDK_Document* pDocument)
+bool CFFL_TextField::CanCopy(CPDFSDK_Document* pDocument)
{
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_TextField::CanCut(CPDFSDK_Document* pDocument)
+bool CFFL_TextField::CanCut(CPDFSDK_Document* pDocument)
{
- return FALSE;
+ return false;
}
-FX_BOOL CFFL_TextField::CanPaste(CPDFSDK_Document* pDocument)
+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 8d2d76d73c..0e5022c9c1 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;
}
-FX_BOOL CFFL_Utils::TraceObject(CPDF_Object* pObj)
+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 @@ FX_BOOL CFFL_Utils::TraceObject(CPDF_Object* pObj)
//TRACE(csKey + "\n");
if (!pElement) break;
TraceObject(pElement);
- }while (TRUE);
+ }while (true);
}
break;
@@ -107,8 +107,8 @@ FX_BOOL CFFL_Utils::TraceObject(CPDF_Object* pObj)
default:
break;
}
- if (dwObjNum == 0) return FALSE;
+ if (dwObjNum == 0) return false;
- return TRUE;
+ return true;
}
diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp
index b26d2af10a..85eba55212 100644
--- a/fpdfsdk/src/fpdf_dataavail.cpp
+++ b/fpdfsdk/src/fpdf_dataavail.cpp
@@ -21,7 +21,7 @@ public:
m_pfileAvail = pfileAvail;
}
- virtual FX_BOOL IsDataAvail( FX_FILESIZE offset, FX_DWORD size)
+ virtual bool IsDataAvail( FX_FILESIZE offset, FX_DWORD size)
{
return m_pfileAvail->IsDataAvail(m_pfileAvail, offset, size);
}
@@ -48,7 +48,7 @@ public:
return m_pFileAccess->m_FileLen;
}
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+ virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
{
return m_pFileAccess->m_GetBlock(m_pFileAccess->m_Param, offset, (uint8_t*)buffer, size);
}
diff --git a/fpdfsdk/src/fpdf_ext.cpp b/fpdfsdk/src/fpdf_ext.cpp
index 0d8db417ac..741347474c 100644
--- a/fpdfsdk/src/fpdf_ext.cpp
+++ b/fpdfsdk/src/fpdf_ext.cpp
@@ -14,7 +14,7 @@ class CFSDK_UnsupportInfo_Adapter
{
public:
CFSDK_UnsupportInfo_Adapter(UNSUPPORT_INFO* unsp_info){ m_unsp_info = unsp_info;}
-// FX_BOOL NeedToPauseNow();
+// bool NeedToPauseNow();
void ReportError(int nErrorType);
private:
@@ -35,25 +35,25 @@ void FreeUnsupportInfo(void* pData)
delete pAdapter;
}
-FX_BOOL FPDF_UnSupportError(int nError)
+bool FPDF_UnSupportError(int nError)
{
CFSDK_UnsupportInfo_Adapter * pAdapter = (CFSDK_UnsupportInfo_Adapter *)CPDF_ModuleMgr::Get()->GetPrivateData((void *)FPDFSDK_UNSUPPORT_CALL);
if(!pAdapter)
- return FALSE;
+ return false;
pAdapter->ReportError(nError);
- return TRUE;
+ return true;
}
DLLEXPORT FPDF_BOOL STDCALL FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info)
{
if (!unsp_info || unsp_info->version!=1)
- return FALSE;
+ return false;
CFSDK_UnsupportInfo_Adapter * pAdapter = new CFSDK_UnsupportInfo_Adapter(unsp_info);
CPDF_ModuleMgr::Get()->SetPrivateData((void *)FPDFSDK_UNSUPPORT_CALL,pAdapter, &FreeUnsupportInfo);
- return TRUE;
+ return true;
}
void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot)
@@ -104,7 +104,7 @@ void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot)
}
-FX_BOOL CheckSharedForm(CXML_Element * pElement, CFX_ByteString cbName)
+bool CheckSharedForm(CXML_Element * pElement, CFX_ByteString cbName)
{
int count = pElement->CountAttrs();
int i=0;
@@ -143,10 +143,10 @@ FX_BOOL CheckSharedForm(CXML_Element * pElement, CFX_ByteString cbName)
{
CXML_Element * pChild = pElement->GetElement(i);
if(CheckSharedForm(pChild, cbName))
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code)
@@ -206,7 +206,7 @@ void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code)
CheckSharedForm(pElement, "workflowType");
// XFA Forms
- CPDF_InterForm * pInterForm = new CPDF_InterForm(pDoc,FALSE);
+ CPDF_InterForm * pInterForm = new CPDF_InterForm(pDoc,false);
if (pInterForm->HasXFAForm())
{
FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM);
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp
index 988d7f46b5..3dbb0a1e69 100644
--- a/fpdfsdk/src/fpdf_flatten.cpp
+++ b/fpdfsdk/src/fpdf_flatten.cpp
@@ -13,17 +13,17 @@ typedef CFX_ArrayTemplate<CPDF_Rect> CPDF_RectArray;
enum FPDF_TYPE { MAX, MIN };
enum FPDF_VALUE { TOP, LEFT, RIGHT, BOTTOM };
-FX_BOOL IsValiableRect(CPDF_Rect rect, CPDF_Rect rcPage)
+bool IsValiableRect(CPDF_Rect rect, CPDF_Rect rcPage)
{
if ( rect.left - rect.right > 0.000001f ||
rect.bottom - rect.top > 0.000001f)
- return FALSE;
+ return false;
if (rect.left == 0.0f &&
rect.top == 0.0f &&
rect.right == 0.0f &&
rect.bottom == 0.0f)
- return FALSE;
+ return false;
if (!rcPage.IsEmpty())
{
@@ -31,17 +31,17 @@ FX_BOOL IsValiableRect(CPDF_Rect rect, CPDF_Rect rcPage)
rect.right - rcPage.right > 10.000001f ||
rect.top - rcPage.top > 10.000001f ||
rect.bottom - rcPage.bottom < -10.000001f)
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL GetContentsRect( CPDF_Document * pDoc, CPDF_Dictionary* pDict, CPDF_RectArray * pRectArray )
+bool GetContentsRect( CPDF_Document * pDoc, CPDF_Dictionary* pDict, CPDF_RectArray * pRectArray )
{
CPDF_Page* pPDFPage = new CPDF_Page;
- pPDFPage->Load( pDoc, pDict, FALSE );
+ pPDFPage->Load( pDoc, pDict, false );
pPDFPage->ParseContent();
FX_POSITION pos = pPDFPage->GetFirstObjectPosition();
@@ -64,7 +64,7 @@ FX_BOOL GetContentsRect( CPDF_Document * pDoc, CPDF_Dictionary* pDict, CPDF_Rect
}
delete pPDFPage;
- return TRUE;
+ return true;
}
@@ -217,7 +217,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document*
CFX_ByteString sStream;
sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str());
- pNewContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE);
+ pNewContents->SetData((const uint8_t*)sStream, sStream.GetLength(), false, false);
}
return;
}
@@ -237,7 +237,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document*
CFX_ByteString sStream = "q\n";
CFX_ByteString sBody = CFX_ByteString((const FX_CHAR*)acc.GetData(), acc.GetSize());
sStream = sStream + sBody + "\nQ";
- pContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE);
+ pContents->SetData((const uint8_t*)sStream, sStream.GetLength(), false, false);
pContentsArray->AddReference(pDocument, dwObjNum);
break;
}
@@ -264,7 +264,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document*
CFX_ByteString sStream;
sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str());
- pNewContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE);
+ pNewContents->SetData((const uint8_t*)sStream, sStream.GetLength(), false, false);
}
}
@@ -538,7 +538,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag)
sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f, sFormName.c_str());
sStream += sTemp;
- pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE);
+ pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), false, false);
}
pPageDict->RemoveAt( "Annots" );
diff --git a/fpdfsdk/src/fpdf_progressive.cpp b/fpdfsdk/src/fpdf_progressive.cpp
index 4ec73ac2ba..0c49df6c84 100644
--- a/fpdfsdk/src/fpdf_progressive.cpp
+++ b/fpdfsdk/src/fpdf_progressive.cpp
@@ -29,20 +29,20 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE
#ifdef _SKIA_SUPPORT_
pContext->m_pDevice = new CFX_SkiaDevice;
if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
+ ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,true);
else
((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
#else
pContext->m_pDevice = new CFX_FxgeDevice;
if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
+ ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,true);
else
((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
#endif
IFSDK_PAUSE_Adapter IPauseAdapter(pause);
FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
- rotate, flags,FALSE, &IPauseAdapter);
+ rotate, flags,false, &IPauseAdapter);
if (pContext->m_pRenderer)
return CPDF_ProgressiveRenderer::ToFPDFStatus(pContext->m_pRenderer->GetStatus());
diff --git a/fpdfsdk/src/fpdf_sysfontinfo.cpp b/fpdfsdk/src/fpdf_sysfontinfo.cpp
index cf0cdd915b..691710798c 100644
--- a/fpdfsdk/src/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/src/fpdf_sysfontinfo.cpp
@@ -20,16 +20,16 @@ public:
delete this;
}
- virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) override
+ virtual bool EnumFontList(CFX_FontMapper* pMapper) override
{
if (m_pInfo->EnumFonts) {
m_pInfo->EnumFonts(m_pInfo, pMapper);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
- virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact) override
+ virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact) override
{
if (m_pInfo->MapFont)
return m_pInfo->MapFont(m_pInfo, weight, bItalic, charset, pitch_family, family, &iExact);
@@ -50,25 +50,25 @@ public:
return 0;
}
- virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) override
+ virtual bool GetFaceName(void* hFont, CFX_ByteString& name) override
{
- if (m_pInfo->GetFaceName == NULL) return FALSE;
+ if (m_pInfo->GetFaceName == NULL) return false;
FX_DWORD size = m_pInfo->GetFaceName(m_pInfo, hFont, NULL, 0);
- if (size == 0) return FALSE;
+ if (size == 0) return false;
char* buffer = FX_Alloc(char, size);
size = m_pInfo->GetFaceName(m_pInfo, hFont, buffer, size);
name = CFX_ByteString(buffer, size);
FX_Free(buffer);
- return TRUE;
+ return true;
}
- virtual FX_BOOL GetFontCharset(void* hFont, int& charset) override
+ virtual bool GetFontCharset(void* hFont, int& charset) override
{
if (m_pInfo->GetFontCharset) {
charset = m_pInfo->GetFontCharset(m_pInfo, hFont);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
virtual void DeleteFont(void* hFont) override
diff --git a/fpdfsdk/src/fpdf_transformpage.cpp b/fpdfsdk/src/fpdf_transformpage.cpp
index a29db5a9dc..cf17f20ddc 100644
--- a/fpdfsdk/src/fpdf_transformpage.cpp
+++ b/fpdfsdk/src/fpdf_transformpage.cpp
@@ -42,7 +42,7 @@ DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, float left, float bot
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top)
{
if(!page)
- return FALSE;
+ return false;
CPDF_Page* pPage = (CPDF_Page*)page;
CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
CPDF_Array* pArray = pPageDict->GetArray("MediaBox");
@@ -52,15 +52,15 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, fl
*bottom = pArray->GetFloat(1);
*right = pArray->GetFloat(2);
*top = pArray->GetFloat(3);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top)
{
if(!page)
- return FALSE;
+ return false;
CPDF_Page* pPage = (CPDF_Page*)page;
CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
CPDF_Array* pArray = pPageDict->GetArray("CropBox");
@@ -70,15 +70,15 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, float* left, flo
*bottom = pArray->GetFloat(1);
*right = pArray->GetFloat(2);
*top = pArray->GetFloat(3);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX* matrix, FS_RECTF* clipRect)
{
if(!page)
- return FALSE;
+ return false;
CFX_ByteTextBuf textBuf;
textBuf<<"q ";
@@ -99,19 +99,19 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX
if(!pContentObj)
pContentObj = pPageDic ? pPageDic->GetArray("Contents") : NULL;
if(!pContentObj)
- return FALSE;
+ return false;
CPDF_Dictionary* pDic = new CPDF_Dictionary;
CPDF_Stream* pStream = new CPDF_Stream(NULL,0, pDic);
- pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize(), FALSE, FALSE);
+ pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize(), false, false);
CPDF_Document* pDoc = pPage->m_pDocument;
if(!pDoc)
- return FALSE;
+ return false;
pDoc->AddIndirectObject(pStream);
pDic = new CPDF_Dictionary;
CPDF_Stream* pEndStream = new CPDF_Stream(NULL,0, pDic);
- pEndStream->SetData((const uint8_t*)" Q", 2, FALSE, FALSE);
+ pEndStream->SetData((const uint8_t*)" Q", 2, false, false);
pDoc->AddIndirectObject(pEndStream);
CPDF_Array* pContentArray = NULL;
@@ -181,7 +181,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX
}
}
- return TRUE;
+ return true;
}
DLLEXPORT void STDCALL FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object,double a, double b, double c, double d, double e, double f)
@@ -205,7 +205,7 @@ DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, float bottom, fl
CPDF_Path Path;
Path.GetModify();
Path.AppendRect(left, bottom, right, top);
- pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, FALSE);
+ pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, false);
return pNewClipPath;
}
@@ -282,7 +282,7 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clip
}
CPDF_Dictionary* pDic = new CPDF_Dictionary;
CPDF_Stream* pStream = new CPDF_Stream(NULL,0, pDic);
- pStream->SetData(strClip.GetBuffer(), strClip.GetSize(), FALSE, FALSE);
+ pStream->SetData(strClip.GetBuffer(), strClip.GetSize(), false, false);
CPDF_Document* pDoc = pPage->m_pDocument;
if(!pDoc)
return;
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp
index f75197bdbf..e2640697bb 100644
--- a/fpdfsdk/src/fpdfdoc.cpp
+++ b/fpdfsdk/src/fpdfdoc.cpp
@@ -208,13 +208,13 @@ DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK pDict)
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FPDF_LINK* linkAnnot)
{
if(!page || !startPos || !linkAnnot)
- return FALSE;
+ return false;
CPDF_Page* pPage = (CPDF_Page*)page;
if(!pPage->m_pFormDict)
- return FALSE;
+ return false;
CPDF_Array* pAnnots = pPage->m_pFormDict->GetArray("Annots");
if(!pAnnots)
- return FALSE;
+ return false;
for (int i = *startPos; i < (int)pAnnots->GetCount(); i++) {
CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementValue(i);
if (!pDict || pDict->GetType() != PDFOBJ_DICTIONARY)
@@ -222,23 +222,23 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FP
if(pDict->GetString(FX_BSTRC("Subtype")).Equal(FX_BSTRC("Link"))) {
*startPos = i + 1;
*linkAnnot = (FPDF_LINK)pDict;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, FS_RECTF* rect)
{
if(!linkAnnot || !rect)
- return FALSE;
+ return false;
CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot;
CPDF_Rect rt = pAnnotDict->GetRect(FX_BSTRC("Rect"));
rect->left = rt.left;
rect->bottom = rt.bottom;
rect->right = rt.right;
rect->top = rt.top;
- return TRUE;
+ return true;
}
DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot)
@@ -255,12 +255,12 @@ DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot)
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, int quadIndex, FS_QUADPOINTSF* quadPoints)
{
if(!linkAnnot || !quadPoints)
- return FALSE;
+ return false;
CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot;
CPDF_Array* pArray = pAnnotDict->GetArray(FX_BSTRC("QuadPoints"));
if (pArray) {
if (quadIndex < 0 || quadIndex >= (int)pArray->GetCount()/8 || ((quadIndex*8+7) >= (int)pArray->GetCount()))
- return FALSE;
+ return false;
quadPoints->x1 = pArray->GetNumber(quadIndex*8);
quadPoints->y1 = pArray->GetNumber(quadIndex*8+1);
quadPoints->x2 = pArray->GetNumber(quadIndex*8+2);
@@ -269,9 +269,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, int quad
quadPoints->y3 = pArray->GetNumber(quadIndex*8+5);
quadPoints->x4 = pArray->GetNumber(quadIndex*8+6);
quadPoints->y4 = pArray->GetNumber(quadIndex*8+7);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc, FPDF_BYTESTRING tag,
diff --git a/fpdfsdk/src/fpdfeditimg.cpp b/fpdfsdk/src/fpdfeditimg.cpp
index 96cfba4194..cec3e2296d 100644
--- a/fpdfsdk/src/fpdfeditimg.cpp
+++ b/fpdfsdk/src/fpdfeditimg.cpp
@@ -21,7 +21,7 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document)
DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCount,FPDF_PAGEOBJECT image_object, FPDF_FILEACCESS* fileAccess)
{
if (!image_object || !fileAccess)
- return FALSE;
+ return false;
IFX_FileRead* pFile = new CPDF_CustomAccess(fileAccess);
CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
@@ -33,7 +33,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCou
}
pImgObj->m_pImage->SetJpegImage(pFile);
- return TRUE;
+ return true;
}
@@ -41,7 +41,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix (FPDF_PAGEOBJECT image_object
double a, double b, double c, double d, double e, double f)
{
if (!image_object)
- return FALSE;
+ return false;
CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
pImgObj->m_Matrix.a = (FX_FLOAT)a;
pImgObj->m_Matrix.b = (FX_FLOAT)b;
@@ -50,13 +50,13 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix (FPDF_PAGEOBJECT image_object
pImgObj->m_Matrix.e = (FX_FLOAT)e;
pImgObj->m_Matrix.f = (FX_FLOAT)f;
pImgObj->CalcBoundingBox();
- return TRUE;
+ return true;
}
DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,int nCount,FPDF_PAGEOBJECT image_object,FPDF_BITMAP bitmap)
{
if (!image_object || !bitmap)
- return FALSE;
+ return false;
CFX_DIBitmap* pBmp = NULL;
pBmp = (CFX_DIBitmap*)bitmap;
CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
@@ -66,8 +66,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,int nCount,F
CPDF_Page* pPage = (CPDF_Page*)pages[index];
pImgObj->m_pImage->ResetCache(pPage,NULL);
}
- pImgObj->m_pImage->SetImage(pBmp,FALSE);
+ pImgObj->m_pImage->SetImage(pBmp,false);
pImgObj->CalcBoundingBox();
- return TRUE;
+ return true;
}
diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp
index 12c2cce1e2..8236cb206d 100644
--- a/fpdfsdk/src/fpdfeditpage.cpp
+++ b/fpdfsdk/src/fpdfeditpage.cpp
@@ -215,7 +215,7 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPage_GetObject(FPDF_PAGE page, int index)
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page)
{
- if(!page) return FALSE;
+ if(!page) return false;
CPDF_Page* pPage = (CPDF_Page*)page;
return pPage->BackgroundAlphaNeeded();
@@ -223,34 +223,34 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page)
DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject)
{
- if(!pageObject) return FALSE;
+ if(!pageObject) return false;
CPDF_PageObject* pPageObj = (CPDF_PageObject*)pageObject;
const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState;
int blend_type = pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL;
- if (blend_type != FXDIB_BLEND_NORMAL) return TRUE;
+ if (blend_type != FXDIB_BLEND_NORMAL) return true;
CPDF_Dictionary* pSMaskDict = pGeneralState ? (CPDF_Dictionary*)pGeneralState->m_pSoftMask : NULL;
- if(pSMaskDict) return TRUE;
+ if(pSMaskDict) return true;
if(pGeneralState && pGeneralState->m_FillAlpha != 1.0f)
- return TRUE;
+ return true;
if(pPageObj->m_Type == PDFPAGE_PATH)
{
if(pGeneralState && pGeneralState->m_StrokeAlpha != 1.0f)
- return TRUE;
+ return true;
}
if(pPageObj->m_Type == PDFPAGE_FORM)
{
CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj;
if(pFormObj->m_pForm && (pFormObj->m_pForm->m_Transparency & PDFTRANS_ISOLATED))
- return TRUE;
+ return true;
if(pFormObj->m_pForm && (!(pFormObj->m_pForm->m_Transparency & PDFTRANS_ISOLATED) && (pFormObj->m_pForm->m_Transparency & PDFTRANS_GROUP)))
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page)
@@ -259,12 +259,12 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page)
if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") || !pPage->m_pFormDict->GetElement("Type")->GetDirect()
|| pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
{
- return FALSE;
+ return false;
}
CPDF_PageContentGenerate CG(pPage);
CG.GenerateContent();
- return TRUE;
+ return true;
}
DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object,
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index d21d5d209d..21a441ca57 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -28,7 +28,7 @@ CPDFSDK_InterForm* FormHandleToInterForm(FPDF_FORMHANDLE hHandle)
CPDFSDK_PageView* FormHandleToPageView(FPDF_FORMHANDLE hHandle, FPDF_PAGE page)
{
CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle);
- return pSDKDoc ? pSDKDoc->GetPageView((CPDF_Page*)page, TRUE) : nullptr;
+ return pSDKDoc ? pSDKDoc->GetPageView((CPDF_Page*)page, true) : nullptr;
}
} // namespace
@@ -41,7 +41,7 @@ DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(
CPDF_Page* pPage = (CPDF_Page*) page;
nonstd::unique_ptr<CPDF_InterForm> pInterForm(
- new CPDF_InterForm(pPage->m_pDocument, FALSE));
+ new CPDF_InterForm(pPage->m_pDocument, false));
CPDF_FormControl* pFormCtrl = pInterForm->GetControlAtPoint(
pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y);
if (!pFormCtrl)
@@ -84,7 +84,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, FPDF_PAGE
{
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
- return FALSE;
+ return false;
CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
return pPageView->OnMouseMove(pt, modifier);
@@ -94,7 +94,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, FPDF_PAG
{
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
- return FALSE;
+ return false;
CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
return pPageView->OnLButtonDown(pt, modifier);
@@ -104,7 +104,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE
{
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
- return FALSE;
+ return false;
CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
return pPageView->OnLButtonUp(pt, modifier);
@@ -114,7 +114,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE pa
{
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
- return FALSE;
+ return false;
return pPageView->OnKeyDown(nKeyCode, modifier);
}
@@ -123,7 +123,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page
{
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
- return FALSE;
+ return false;
return pPageView->OnKeyUp(nKeyCode, modifier);
}
@@ -132,7 +132,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle, FPDF_PAGE page,
{
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
- return FALSE;
+ return false;
return pPageView->OnChar(nChar, modifier);
}
@@ -141,7 +141,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle)
{
CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle);
if (!pSDKDoc)
- return FALSE;
+ return false;
return pSDKDoc->KillFocusAnnot(0);
}
@@ -216,7 +216,7 @@ DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle)
DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle)
{
if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page))
- pPageView->SetValid(TRUE);
+ pPageView->SetValid(true);
}
DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle)
@@ -229,10 +229,10 @@ DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hH
return;
CPDF_Page* pPage = (CPDF_Page*)page;
- CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
+ CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, false);
if (pPageView)
{
- pPageView->SetValid(FALSE);
+ pPageView->SetValid(false);
// ReMovePageView() takes care of the delete for us.
pSDKDoc->ReMovePageView(pPage);
}
@@ -279,7 +279,7 @@ DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandl
return;
CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument();
CPDF_Page* pPage = (CPDF_Page*)page;
- CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
+ CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, false);
if(pPageView)
{
CPDFDoc_Environment *pEnv = pSDKDoc->GetEnv();
@@ -293,8 +293,8 @@ DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandl
CPDF_AAction aa = pPageDict->GetDict(FX_BSTRC("AA"));
- FX_BOOL bExistOAAction = FALSE;
- FX_BOOL bExistCAAction = FALSE;
+ bool bExistOAAction = false;
+ bool bExistCAAction = false;
if (FPDFPAGE_AACTION_OPEN == aaType)
{
bExistOAAction = aa.ActionExist(CPDF_AAction::OpenPage);
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp
index 40d56b304d..1ef69bf032 100644
--- a/fpdfsdk/src/fpdfppo.cpp
+++ b/fpdfsdk/src/fpdfppo.cpp
@@ -15,14 +15,14 @@ public:
CPDF_PageOrganizer();
~CPDF_PageOrganizer();
- FX_BOOL PDFDocInit(CPDF_Document* pDestPDFDoc, CPDF_Document* pSrcPDFDoc);
- FX_BOOL ExportPage(CPDF_Document* pSrcPDFDoc,
+ bool PDFDocInit(CPDF_Document* pDestPDFDoc, CPDF_Document* pSrcPDFDoc);
+ bool ExportPage(CPDF_Document* pSrcPDFDoc,
CFX_WordArray* nPageNum,
CPDF_Document* pDestPDFDoc,
int nIndex);
CPDF_Object* PageDictGetInheritableTag(CPDF_Dictionary* pDict,
CFX_ByteString nSrctag);
- FX_BOOL UpdateReference(CPDF_Object* pObj,
+ bool UpdateReference(CPDF_Object* pObj,
CPDF_Document* pDoc,
ObjectNumberMap* pObjNumberMap);
FX_DWORD GetNewObjId(CPDF_Document* pDoc,
@@ -39,21 +39,21 @@ CPDF_PageOrganizer::~CPDF_PageOrganizer()
{
}
-FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document* pDestPDFDoc,
+bool CPDF_PageOrganizer::PDFDocInit(CPDF_Document* pDestPDFDoc,
CPDF_Document* pSrcPDFDoc)
{
if (!pDestPDFDoc || !pSrcPDFDoc)
- return FALSE;
+ return false;
CPDF_Dictionary* pNewRoot = pDestPDFDoc->GetRoot();
if (!pNewRoot)
- return FALSE;
+ return false;
//Set the document information////////////////////////////////////////////
CPDF_Dictionary* DInfoDict = pDestPDFDoc->GetInfo();
if (!DInfoDict)
- return FALSE;
+ return false;
CFX_ByteString producerstr;
producerstr.Format("PDFium");
@@ -89,10 +89,10 @@ FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document* pDestPDFDoc,
pNewPages->SetAt("Count", new CPDF_Number(0));
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
+bool CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
CFX_WordArray* nPageNum,
CPDF_Document* pDestPDFDoc,
int nIndex)
@@ -106,7 +106,7 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
CPDF_Dictionary* pSrcPageDict =
pSrcPDFDoc->GetPage(nPageNum->GetAt(i) - 1);
if (!pSrcPageDict || !pCurPageDict)
- return FALSE;
+ return false;
// Clone the page dictionary///////////
FX_POSITION SrcPos = pSrcPageDict->GetStartPos();
@@ -151,7 +151,7 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
if (!pCurPageDict->KeyExist("Resources")) {
pInheritable = PageDictGetInheritableTag(pSrcPageDict, "Resources");
if (!pInheritable)
- return FALSE;
+ return false;
pCurPageDict->SetAt("Resources", pInheritable->Clone());
}
//3 CropBox //Optional
@@ -178,7 +178,7 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
++curpage;
}
- return TRUE;
+ return true;
}
CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag(
@@ -220,7 +220,7 @@ CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag(
return nullptr;
}
-FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
+bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
CPDF_Document* pDoc,
ObjectNumberMap* pObjNumberMap)
{
@@ -229,7 +229,7 @@ FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
CPDF_Reference* pReference = (CPDF_Reference*)pObj;
FX_DWORD newobjnum = GetNewObjId(pDoc, pObjNumberMap, pReference);
if (newobjnum == 0)
- return FALSE;
+ return false;
pReference->SetRef(pDoc, newobjnum);
break;
}
@@ -249,7 +249,7 @@ FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
if (!UpdateReference(pNextObj, pDoc, pObjNumberMap))
pDict->RemoveAt(key);
} else {
- return FALSE;
+ return false;
}
}
break;
@@ -260,9 +260,9 @@ FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
for (FX_DWORD i = 0; i < count; ++i) {
CPDF_Object* pNextObj = pArray->GetElement(i);
if (!pNextObj)
- return FALSE;
+ return false;
if (!UpdateReference(pNextObj, pDoc, pObjNumberMap))
- return FALSE;
+ return false;
}
break;
}
@@ -271,9 +271,9 @@ FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
CPDF_Dictionary* pDict = pStream->GetDict();
if (pDict) {
if (!UpdateReference(pDict, pDoc, pObjNumberMap))
- return FALSE;
+ return false;
} else {
- return FALSE;
+ return false;
}
break;
}
@@ -281,7 +281,7 @@ FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
break;
}
- return TRUE;
+ return true;
}
FX_DWORD CPDF_PageOrganizer::GetNewObjId(CPDF_Document* pDoc,
@@ -341,7 +341,7 @@ FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring,
CFX_ByteString cbCompareString("0123456789-,");
for (int i = 0; i < nLength; ++i) {
if (cbCompareString.Find(rangstring[i]) == -1)
- return FALSE;
+ return false;
}
CFX_ByteString cbMidRange;
int nStringFrom = 0;
@@ -355,23 +355,23 @@ FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring,
if (nMid == -1) {
long lPageNum = atol(cbMidRange);
if (lPageNum <= 0 || lPageNum > nCount)
- return FALSE;
+ return false;
pageArray->Add((FX_WORD)lPageNum);
} else {
int nStartPageNum = atol(cbMidRange.Mid(0, nMid));
if (nStartPageNum == 0)
- return FALSE;
+ return false;
++nMid;
int nEnd = cbMidRange.GetLength() - nMid;
if (nEnd == 0)
- return FALSE;
+ return false;
int nEndPageNum = atol(cbMidRange.Mid(nMid, nEnd));
if (nStartPageNum < 0 ||
nStartPageNum >nEndPageNum ||
nEndPageNum > nCount) {
- return FALSE;
+ return false;
}
for (int i = nStartPageNum; i <= nEndPageNum; ++i) {
pageArray->Add(i);
@@ -380,7 +380,7 @@ FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring,
nStringFrom = nStringTo + 1;
}
}
- return TRUE;
+ return true;
}
DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,
@@ -389,14 +389,14 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,
int index)
{
if (!dest_doc || !src_doc)
- return FALSE;
+ return false;
CFX_WordArray pageArray;
CPDF_Document* pSrcDoc = (CPDF_Document*)src_doc;
int nCount = pSrcDoc->GetPageCount();
if (pagerange) {
if (!ParserPageRangeString(pagerange,&pageArray,nCount))
- return FALSE;
+ return false;
} else {
for (int i = 1; i <= nCount; ++i) {
pageArray.Add(i);
@@ -421,12 +421,12 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc,
CPDF_Dictionary* pSrcDict = pSrcDoc->GetRoot();
pSrcDict = pSrcDict->GetDict(FX_BSTRC("ViewerPreferences"));;
if (!pSrcDict)
- return FALSE;
+ return false;
CPDF_Document* pDstDoc = (CPDF_Document*)dest_doc;
CPDF_Dictionary* pDstDict = pDstDoc->GetRoot();
if (!pDstDict)
- return FALSE;
- pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(TRUE));
- return TRUE;
+ return false;
+ pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(true));
+ return true;
}
diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp
index ddd6f6e90e..8e5e476ca2 100644
--- a/fpdfsdk/src/fpdfsave.cpp
+++ b/fpdfsdk/src/fpdfsave.cpp
@@ -19,8 +19,8 @@ class CFX_IFileWrite final : public IFX_StreamWrite
public:
CFX_IFileWrite();
- FX_BOOL Init( FPDF_FILEWRITE * pFileWriteStruct );
- virtual FX_BOOL WriteBlock(const void* pData, size_t size) override;
+ bool Init( FPDF_FILEWRITE * pFileWriteStruct );
+ virtual bool WriteBlock(const void* pData, size_t size) override;
virtual void Release() override {}
protected:
@@ -32,22 +32,22 @@ CFX_IFileWrite::CFX_IFileWrite()
m_pFileWriteStruct = NULL;
}
-FX_BOOL CFX_IFileWrite::Init( FPDF_FILEWRITE * pFileWriteStruct )
+bool CFX_IFileWrite::Init( FPDF_FILEWRITE * pFileWriteStruct )
{
if (!pFileWriteStruct)
- return FALSE;
+ return false;
m_pFileWriteStruct = pFileWriteStruct;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_IFileWrite::WriteBlock(const void* pData, size_t size)
+bool CFX_IFileWrite::WriteBlock(const void* pData, size_t size)
{
if (!m_pFileWriteStruct)
- return FALSE;
+ return false;
m_pFileWriteStruct->WriteBlock( m_pFileWriteStruct, pData, size );
- return TRUE;
+ return true;
}
FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,FPDF_DWORD flags, FPDF_BOOL bSetVersion,
@@ -71,7 +71,7 @@ FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,FPDF
FileMaker.RemoveSecurity();
}
CFX_IFileWrite* pStreamWrite = NULL;
- FX_BOOL bRet;
+ bool bRet;
pStreamWrite = new CFX_IFileWrite;
pStreamWrite->Init( pFileWrite );
bRet = FileMaker.Create(pStreamWrite, flags);
@@ -82,12 +82,12 @@ FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,FPDF
DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
FPDF_DWORD flags )
{
- return _FPDF_Doc_Save(document, pFileWrite, flags, FALSE , 0);
+ return _FPDF_Doc_Save(document, pFileWrite, flags, false , 0);
}
DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
FPDF_DWORD flags, int fileVersion)
{
- return _FPDF_Doc_Save(document, pFileWrite, flags, TRUE , fileVersion);
+ return _FPDF_Doc_Save(document, pFileWrite, flags, true , fileVersion);
}
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index 4a6571531c..4fecef4452 100644
--- a/fpdfsdk/src/fpdftext.cpp
+++ b/fpdfsdk/src/fpdftext.cpp
@@ -154,13 +154,13 @@ DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page,FPDF
}
DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle)
{
- if (!handle) return FALSE;
+ if (!handle) return false;
IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
return textpageFind->FindNext();
}
DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle)
{
- if (!handle) return FALSE;
+ if (!handle) return false;
IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
return textpageFind->FindPrev();
}
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 9edd5d90ec..5a72e8ff14 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -21,15 +21,15 @@ CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess)
m_FileAccess = *pFileAccess;
}
-FX_BOOL CPDF_CustomAccess::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+bool CPDF_CustomAccess::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
{
if (offset < 0) {
- return FALSE;
+ return false;
}
FX_SAFE_FILESIZE newPos = pdfium::base::checked_cast<FX_FILESIZE, size_t>(size);
newPos += offset;
if (!newPos.IsValid() || newPos.ValueOrDie() > m_FileAccess.m_FileLen) {
- return FALSE;
+ return false;
}
return m_FileAccess.m_GetBlock(m_FileAccess.m_Param, offset,(uint8_t*) buffer, size);
}
@@ -59,9 +59,9 @@ FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy)
switch(policy)
{
case FPDF_POLICY_MACHINETIME_ACCESS:
- return (foxit_sandbox_policy & 0x01) ? TRUE : FALSE;
+ return (foxit_sandbox_policy & 0x01) ? true : false;
default:
- return FALSE;
+ return false;
}
}
@@ -81,11 +81,11 @@ public:
virtual FT_Face FindSubstFont(
CPDF_Document* pDoc, // [IN] The PDF document
const CFX_ByteString& face_name, // [IN] Original name
- FX_BOOL bTrueType, // [IN] TrueType or Type1
+ bool bTrueType, // [IN] TrueType or Type1
FX_DWORD flags, // [IN] PDF font flags (see PDF Reference section 5.7.1)
int font_weight, // [IN] original font weight. 0 for not specified
int CharsetCP, // [IN] code page for charset (see Win32 GetACP())
- FX_BOOL bVertical,
+ bool bVertical,
CPDF_SubstFont* pSubstFont // [OUT] Subst font data
);
@@ -191,18 +191,18 @@ public:
virtual void Release() {delete this;}
virtual FX_FILESIZE GetSize() {return m_size;}
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+ virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
{
if (offset < 0) {
- return FALSE;
+ return false;
}
FX_SAFE_FILESIZE newPos = pdfium::base::checked_cast<FX_FILESIZE, size_t>(size);
newPos += offset;
if (!newPos.IsValid() || newPos.ValueOrDie() > (FX_DWORD)m_size) {
- return FALSE;
+ return false;
}
FXSYS_memcpy(buffer, m_pBuf+offset, size);
- return TRUE;
+ return true;
}
private:
uint8_t* m_pBuf;
@@ -244,14 +244,14 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAc
DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, int* fileVersion)
{
- if(!doc||!fileVersion) return FALSE;
+ if(!doc||!fileVersion) return false;
*fileVersion = 0;
CPDF_Document* pDoc = (CPDF_Document*)doc;
CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser();
if(!pParser)
- return FALSE;
+ return false;
*fileVersion = pParser->GetFileVersion();
- return TRUE;
+ return true;
}
// jabdelmalek: changed return type from FX_DWORD to build on Linux (and match header).
@@ -332,7 +332,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int
#ifndef _WIN32_WCE
CFX_DIBitmap* pBitmap = NULL;
- FX_BOOL bBackgroundAlphaNeeded=FALSE;
+ bool bBackgroundAlphaNeeded=false;
bBackgroundAlphaNeeded = pPage->BackgroundAlphaNeeded();
if (bBackgroundAlphaNeeded)
{
@@ -352,7 +352,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int
pContext->m_pDevice = new CFX_WindowsDevice(dc);
FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
- rotate, flags, TRUE, NULL);
+ rotate, flags, true, NULL);
if (bBackgroundAlphaNeeded)
{
@@ -366,7 +366,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int
int pitch = pBitmap->GetPitch();
pDst->Create(size_x, size_y, FXDIB_Rgb32);
FXSYS_memset(pDst->GetBuffer(), -1, pitch*size_y);
- pDst->CompositeBitmap(0, 0, size_x, size_y, pBitmap, 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, NULL);
+ pDst->CompositeBitmap(0, 0, size_x, size_y, pBitmap, 0, 0, FXDIB_BLEND_NORMAL, NULL, false, NULL);
WinDC.StretchDIBits(pDst,0,0,size_x,size_y);
delete pDst;
}
@@ -492,20 +492,20 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page,
pContext->m_pDevice = new CFX_SkiaDevice;
if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
+ ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,true);
else
((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
#else
pContext->m_pDevice = new CFX_FxgeDevice;
if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
+ ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,true);
else
((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
#endif
FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
- rotate, flags, TRUE, NULL);
+ rotate, flags, true, NULL);
delete pContext;
pPage->RemovePrivateData((void*)1);
@@ -653,7 +653,7 @@ DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap)
}
void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, int flags,FX_BOOL bNeedToRestore, IFSDK_PAUSE_Adapter * pause )
+ int rotate, int flags,bool bNeedToRestore, IFSDK_PAUSE_Adapter * pause )
{
CPDF_Page* pPage = (CPDF_Page*)page;
if (pPage == NULL) return;
@@ -705,8 +705,8 @@ void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, int start_
if (flags & FPDF_ANNOT) {
pContext->m_pAnnots = new CPDF_AnnotList(pPage);
- FX_BOOL bPrinting = pContext->m_pDevice->GetDeviceClass() != FXDC_DISPLAY;
- pContext->m_pAnnots->DisplayAnnots(pPage, pContext->m_pContext, bPrinting, &matrix, TRUE, NULL);
+ bool bPrinting = pContext->m_pDevice->GetDeviceClass() != FXDC_DISPLAY;
+ pContext->m_pAnnots->DisplayAnnots(pPage, pContext->m_pContext, bPrinting, &matrix, true, NULL);
}
pContext->m_pRenderer = new CPDF_ProgressiveRenderer(
@@ -720,23 +720,23 @@ DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_i
{
CPDF_Document* pDoc = (CPDF_Document*)document;
if(pDoc == NULL)
- return FALSE;
+ return false;
CPDF_Dictionary* pDict = pDoc->GetPage(page_index);
- if (pDict == NULL) return FALSE;
+ if (pDict == NULL) return false;
CPDF_Page page;
page.Load(pDoc, pDict);
*width = page.GetPageWidth();
*height = page.GetPageHeight();
- return TRUE;
+ return true;
}
DLLEXPORT FPDF_BOOL STDCALL FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document)
{
CPDF_Document* pDoc = (CPDF_Document*)document;
- if (!pDoc) return TRUE;
+ if (!pDoc) return true;
CPDF_ViewerPreferences viewRef(pDoc);
return viewRef.PrintScaling();
}
diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp
index 145559e057..7ba227f0c2 100644
--- a/fpdfsdk/src/fsdk_actionhandler.cpp
+++ b/fpdfsdk/src/fsdk_actionhandler.cpp
@@ -24,14 +24,14 @@ void CPDFSDK_ActionHandler::SetMediaActionHandler(CPDFSDK_MediaActionHandler* pH
}
//document open
-FX_BOOL CPDFSDK_ActionHandler::DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+bool CPDFSDK_ActionHandler::DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
CFX_PtrList list;
return ExecuteDocumentOpenAction(action, pDocument, list);
}
//document open
-FX_BOOL CPDFSDK_ActionHandler::DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName,
+bool CPDFSDK_ActionHandler::DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName,
CPDFSDK_Document* pDocument)
{
if (JsAction.GetType() == CPDF_Action::JavaScript)
@@ -40,14 +40,14 @@ FX_BOOL CPDFSDK_ActionHandler::DoAction_JavaScript(const CPDF_Action& JsAction,C
if (!swJS.IsEmpty())
{
RunDocumentOpenJavaScript(pDocument, csJSName, swJS);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_ActionHandler::DoAction_FieldJavaScript(const CPDF_Action& JsAction, CPDF_AAction::AActionType type,
+bool CPDFSDK_ActionHandler::DoAction_FieldJavaScript(const CPDF_Action& JsAction, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
PDFSDK_FieldAction& data)
{
@@ -59,48 +59,48 @@ FX_BOOL CPDFSDK_ActionHandler::DoAction_FieldJavaScript(const CPDF_Action& JsAct
if (!swJS.IsEmpty())
{
RunFieldJavaScript(pDocument, pFormField, type, data, swJS);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_ActionHandler::DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType,
+bool CPDFSDK_ActionHandler::DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType,
CPDFSDK_Document* pDocument)
{
CFX_PtrList list;
return ExecuteDocumentPageAction(action, eType, pDocument, list);
}
-FX_BOOL CPDFSDK_ActionHandler::DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType,
+bool CPDFSDK_ActionHandler::DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType,
CPDFSDK_Document* pDocument)
{
CFX_PtrList list;
return ExecuteDocumentPageAction(action, eType, pDocument, list);
}
-FX_BOOL CPDFSDK_ActionHandler::DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type,
+bool CPDFSDK_ActionHandler::DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument)
{
CFX_PtrList list;
return ExecuteBookMark(action, pDocument, pBookMark, list);
}
-FX_BOOL CPDFSDK_ActionHandler::DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type,
+bool CPDFSDK_ActionHandler::DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument, CPDFSDK_Annot* pScreen)
{
CFX_PtrList list;
return ExecuteScreenAction(action, type, pDocument, pScreen, list);
}
-FX_BOOL CPDFSDK_ActionHandler::DoAction_Link(const CPDF_Action& action,
+bool CPDFSDK_ActionHandler::DoAction_Link(const CPDF_Action& action,
CPDFSDK_Document* pDocument)
{
CFX_PtrList list;
return ExecuteLinkAction(action, pDocument, list);
}
-FX_BOOL CPDFSDK_ActionHandler::DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type,
+bool CPDFSDK_ActionHandler::DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument,
CPDF_FormField* pFormField, PDFSDK_FieldAction& data)
{
@@ -108,12 +108,12 @@ FX_BOOL CPDFSDK_ActionHandler::DoAction_Field(const CPDF_Action& action, CPDF_AA
return ExecuteFieldAction(action, type, pDocument, pFormField, data, list);
}
-FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument,
+bool CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument,
CFX_PtrList& list)
{
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
- return FALSE;
+ return false;
list.AddTail(pDict);
@@ -138,20 +138,20 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(const CPDF_Action& acti
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteDocumentOpenAction(subaction, pDocument, list)) return FALSE;
+ if (!ExecuteDocumentOpenAction(subaction, pDocument, list)) return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, CPDFSDK_Document* pDocument,
+bool CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, CPDFSDK_Document* pDocument,
CFX_PtrList& list)
{
ASSERT(pDocument != NULL);
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
- return FALSE;
+ return false;
list.AddTail(pDict);
@@ -175,7 +175,7 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, CPDF
pContext->OnLink_MouseUp(pDocument);
CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
+ bool bRet = pContext->RunScript(swJS, csInfo);
if (!bRet)
{
// FIXME: return error.
@@ -193,20 +193,20 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, CPDF
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteLinkAction(subaction, pDocument, list)) return FALSE;
+ if (!ExecuteLinkAction(subaction, pDocument, list)) return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentPageAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
+bool CPDFSDK_ActionHandler::ExecuteDocumentPageAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument, CFX_PtrList& list)
{
ASSERT(pDocument != NULL);
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
- return FALSE;
+ return false;
list.AddTail(pDict);
@@ -229,18 +229,18 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentPageAction(const CPDF_Action& acti
}
if (!IsValidDocView(pDocument))
- return FALSE;
+ return false;
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteDocumentPageAction(subaction, type, pDocument, list)) return FALSE;
+ if (!ExecuteDocumentPageAction(subaction, type, pDocument, list)) return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDFSDK_ActionHandler::IsValidField(CPDFSDK_Document* pDocument, CPDF_Dictionary* pFieldDict)
+bool CPDFSDK_ActionHandler::IsValidField(CPDFSDK_Document* pDocument, CPDF_Dictionary* pFieldDict)
{
ASSERT(pDocument != NULL);
ASSERT(pFieldDict != NULL);
@@ -254,7 +254,7 @@ FX_BOOL CPDFSDK_ActionHandler::IsValidField(CPDFSDK_Document* pDocument, CPDF_Di
return pPDFInterForm->GetFieldByDict(pFieldDict) != NULL;
}
-FX_BOOL CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
+bool CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
PDFSDK_FieldAction& data, CFX_PtrList& list)
{
@@ -262,7 +262,7 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPD
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
- return FALSE;
+ return false;
list.AddTail(pDict);
@@ -277,7 +277,7 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPD
{
RunFieldJavaScript(pDocument, pFormField, type, data, swJS);
if (!IsValidField(pDocument, pFormField->GetFieldDict()))
- return FALSE;
+ return false;
}
}
}
@@ -289,20 +289,20 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPD
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteFieldAction(subaction, type, pDocument, pFormField, data, list)) return FALSE;
+ if (!ExecuteFieldAction(subaction, type, pDocument, pFormField, data, list)) return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
+bool CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument, CPDFSDK_Annot* pScreen, CFX_PtrList& list)
{
ASSERT(pDocument != NULL);
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
- return FALSE;
+ return false;
list.AddTail(pDict);
@@ -356,12 +356,12 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CP
// pContext->OnScreen_OutView(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
// break;
// default:
- // ASSERT(FALSE);
+ // ASSERT(false);
// break;
// }
CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
+ bool bRet = pContext->RunScript(swJS, csInfo);
if (!bRet)
{
//CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
@@ -379,20 +379,20 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CP
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteScreenAction(subaction, type, pDocument, pScreen, list)) return FALSE;
+ if (!ExecuteScreenAction(subaction, type, pDocument, pScreen, list)) return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSDK_Document* pDocument,
+bool CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSDK_Document* pDocument,
CPDF_Bookmark* pBookmark, CFX_PtrList& list)
{
ASSERT(pDocument != NULL);
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
- return FALSE;
+ return false;
list.AddTail(pDict);
@@ -416,7 +416,7 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSD
pContext->OnBookmark_MouseUp(pBookmark);
CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
+ bool bRet = pContext->RunScript(swJS, csInfo);
if (!bRet)
{
//CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
@@ -434,10 +434,10 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSD
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteBookMark(subaction, pDocument, pBookmark, list)) return FALSE;
+ if (!ExecuteBookMark(subaction, pDocument, pBookmark, list)) return false;
}
- return TRUE;
+ return true;
}
void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Document* pDocument)
@@ -502,7 +502,7 @@ void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Doc
}
break;
case CPDF_Action::JavaScript:
- ASSERT(FALSE);
+ ASSERT(false);
break;
case CPDF_Action::SetOCGState:
DoAction_SetOCGState(pDocument, action);
@@ -522,10 +522,10 @@ void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Doc
}
}
-FX_BOOL CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument)
+bool CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
- return TRUE;
+ return true;
}
void CPDFSDK_ActionHandler::DoAction_GoTo(CPDFSDK_Document* pDocument,
@@ -639,12 +639,12 @@ void CPDFSDK_ActionHandler::RunFieldJavaScript(CPDFSDK_Document* pDocument, CPDF
data.bShift, pFormField, data.sValue, data.bRC);
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(script, csInfo);
+ bool bRet = pContext->RunScript(script, csInfo);
if (!bRet)
{
//CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
@@ -668,7 +668,7 @@ void CPDFSDK_ActionHandler::RunDocumentOpenJavaScript(CPDFSDK_Document* pDocumen
pContext->OnDoc_Open(pDocument, sScriptName);
CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(script, csInfo);
+ bool bRet = pContext->RunScript(script, csInfo);
if (!bRet)
{
//CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
@@ -719,12 +719,12 @@ void CPDFSDK_ActionHandler::RunDocumentPageJavaScript(CPDFSDK_Document* pDocumen
pContext->OnPage_OutView(pDocument);
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(script, csInfo);
+ bool bRet = pContext->RunScript(script, csInfo);
if (!bRet)
{
//CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
@@ -734,7 +734,7 @@ void CPDFSDK_ActionHandler::RunDocumentPageJavaScript(CPDFSDK_Document* pDocumen
}
-FX_BOOL CPDFSDK_FormActionHandler::DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+bool CPDFSDK_FormActionHandler::DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
@@ -744,13 +744,13 @@ FX_BOOL CPDFSDK_FormActionHandler::DoAction_Hide(const CPDF_Action& action, CPDF
if (pInterForm->DoAction_Hide(action))
{
pDocument->SetChangeMark();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_FormActionHandler::DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+bool CPDFSDK_FormActionHandler::DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
@@ -760,7 +760,7 @@ FX_BOOL CPDFSDK_FormActionHandler::DoAction_SubmitForm(const CPDF_Action& action
return pInterForm->DoAction_SubmitForm(action);
}
-FX_BOOL CPDFSDK_FormActionHandler::DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+bool CPDFSDK_FormActionHandler::DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
@@ -769,13 +769,13 @@ FX_BOOL CPDFSDK_FormActionHandler::DoAction_ResetForm(const CPDF_Action& action,
if (pInterForm->DoAction_ResetForm(action))
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_FormActionHandler::DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+bool CPDFSDK_FormActionHandler::DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
@@ -785,23 +785,23 @@ FX_BOOL CPDFSDK_FormActionHandler::DoAction_ImportData(const CPDF_Action& action
if (pInterForm->DoAction_ImportData(action))
{
pDocument->SetChangeMark();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+bool CPDFSDK_MediaActionHandler::DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+bool CPDFSDK_MediaActionHandler::DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+bool CPDFSDK_MediaActionHandler::DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
- return FALSE;
+ return false;
}
diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp
index 9b008cd762..6695fe0c89 100644
--- a/fpdfsdk/src/fsdk_annothandler.cpp
+++ b/fpdfsdk/src/fsdk_annothandler.cpp
@@ -144,7 +144,7 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -152,9 +152,9 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(CPDFSDK_PageView * pPageVie
{
return pAnnotHandler->OnLButtonDown(pPageView, pAnnot, nFlags, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -162,9 +162,9 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(CPDFSDK_PageView * pPageView,
{
return pAnnotHandler->OnLButtonUp(pPageView, pAnnot, nFlags, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -172,9 +172,9 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageV
{
return pAnnotHandler->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -182,9 +182,9 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(CPDFSDK_PageView * pPageView,
{
return pAnnotHandler->OnMouseMove(pPageView, pAnnot, nFlags, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -192,9 +192,9 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(CPDFSDK_PageView * pPageView
{
return pAnnotHandler->OnMouseWheel(pPageView, pAnnot,nFlags,zDelta, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -202,9 +202,9 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown(CPDFSDK_PageView * pPageVie
{
return pAnnotHandler->OnRButtonDown(pPageView, pAnnot, nFlags, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -212,7 +212,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView * pPageView,
{
return pAnnotHandler->OnRButtonUp(pPageView, pAnnot, nFlags, point);
}
- return FALSE;
+ return false;
}
void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
@@ -237,18 +237,18 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseExit(CPDFSDK_PageView * pPageView, CP
return;
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags)
{
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
{
return pAnnotHandler->OnChar(pAnnot,nChar, nFlags);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
{
if (!m_pApp->FFI_IsCTRLKeyDown(nFlag) && !m_pApp->FFI_IsALTKeyDown(nFlag))
@@ -263,7 +263,7 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot,
{
CPDFSDK_Document* pDocument = pPage->GetSDKDocument();
pDocument->SetFocusAnnot(pNext);
- return TRUE;
+ return true;
}
}
}
@@ -272,14 +272,14 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot,
{
return pAnnotHandler->OnKeyDown(pAnnot,nKeyCode, nFlag);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
{
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
{
ASSERT(pAnnot != NULL);
@@ -289,19 +289,19 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot,
{
CPDFSDK_PageView* pPage = pAnnot->GetPageView();
pPage->GetSDKDocument();
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
{
ASSERT(pAnnot);
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
return pAnnotHandler->OnKillFocus(pAnnot, nFlag);
- return FALSE;
+ return false;
}
CPDF_Rect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
@@ -313,7 +313,7 @@ CPDF_Rect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox(CPDFSDK_PageView *pPage
return pAnnot->GetRect();
}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point)
+bool CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point)
{
ASSERT(pAnnot);
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
@@ -321,31 +321,31 @@ FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView *pPageView, CP
if (pAnnotHandler->CanAnswer(pAnnot))
return pAnnotHandler->HitTest(pPageView, pAnnot, point);
}
- return FALSE;
+ return false;
}
-CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,FX_BOOL bNext)
+CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,bool bNext)
{
CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), "Widget", "");
return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot);
}
-FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot)
+bool CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot)
{
ASSERT(pAnnot->GetType() == "Widget");
if (pAnnot->GetSubType() == BFFT_SIGNATURE)
- return FALSE;
+ return false;
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (!pWidget->IsVisible())
- return FALSE;
+ return false;
int nFieldFlags = pWidget->GetFieldFlags();
if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY)
- return FALSE;
+ return false;
if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return TRUE;
+ return true;
CPDF_Page* pPage = pWidget->GetPDFPage();
CPDF_Document* pDocument = pPage->m_pDocument;
@@ -366,7 +366,7 @@ CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_Page
pInterForm->AddMap(pCtrl, pWidget);
CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
if (pPDFInterForm && pPDFInterForm->NeedConstructAP())
- pWidget->ResetAppearance(nullptr, FALSE);
+ pWidget->ResetAppearance(nullptr, false);
return pWidget;
}
@@ -439,7 +439,7 @@ void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_An
}
}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+bool CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -453,10 +453,10 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFS
return m_pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+bool CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -470,10 +470,10 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK
return m_pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+bool CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -487,10 +487,10 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPD
return m_pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+bool CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -504,12 +504,12 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK
return m_pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point)
+bool CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -523,10 +523,10 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSD
return m_pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta,point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+bool CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -540,9 +540,9 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFS
return m_pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+bool CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -556,10 +556,10 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK
return m_pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags)
+bool CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -573,10 +573,10 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX
return m_pFormFiller->OnChar(pAnnot,nChar, nFlags);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
+bool CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -590,13 +590,13 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, i
return m_pFormFiller->OnKeyDown(pAnnot,nKeyCode, nFlag);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
+bool CPDFSDK_BFAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
{
- return FALSE;
+ return false;
}
void CPDFSDK_BFAnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot)
{
@@ -626,16 +626,16 @@ void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot)
{
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (!pWidget->IsAppearanceValid())
- pWidget->ResetAppearance(NULL, FALSE);
+ pWidget->ResetAppearance(NULL, false);
int nFieldType = pWidget->GetFieldType();
if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX)
{
- FX_BOOL bFormated = FALSE;
+ bool bFormated = false;
CFX_WideString sValue = pWidget->OnFormat(bFormated);
if (bFormated && nFieldType == FIELDTYPE_COMBOBOX)
{
- pWidget->ResetAppearance(sValue.c_str(), FALSE);
+ pWidget->ResetAppearance(sValue.c_str(), false);
}
}
@@ -644,7 +644,7 @@ void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot)
}
}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+bool CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -658,9 +658,9 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag
return m_pFormFiller->OnSetFocus(pAnnot,nFlag);
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+bool CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -674,7 +674,7 @@ FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFla
return m_pFormFiller->OnKillFocus(pAnnot,nFlag);
}
- return TRUE;
+ return true;
}
CPDF_Rect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
@@ -695,7 +695,7 @@ CPDF_Rect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView *pPageView, CPDFS
return CPDF_Rect(0,0,0,0);
}
-FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point)
+bool CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point)
{
ASSERT(pPageView);
ASSERT(pAnnot);
@@ -706,9 +706,9 @@ FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Ann
//CReader_AnnotIteratorEx
-CPDFSDK_AnnotIterator::CPDFSDK_AnnotIterator(CPDFSDK_PageView * pPageView,FX_BOOL bReverse,
- FX_BOOL bIgnoreTopmost/*=FALSE*/,
- FX_BOOL bCircle/*=FALSE*/,
+CPDFSDK_AnnotIterator::CPDFSDK_AnnotIterator(CPDFSDK_PageView * pPageView,bool bReverse,
+ bool bIgnoreTopmost/*=false*/,
+ bool bCircle/*=false*/,
CFX_PtrArray *pList/*=NULL*/)
{
ASSERT(pPageView);
@@ -850,7 +850,7 @@ int LyOrderCompare(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2)
return 0;
}
-FX_BOOL CPDFSDK_AnnotIterator::InitIteratorAnnotList(CPDFSDK_PageView* pPageView,CFX_PtrArray * pAnnotList)
+bool CPDFSDK_AnnotIterator::InitIteratorAnnotList(CPDFSDK_PageView* pPageView,CFX_PtrArray * pAnnotList)
{
ASSERT(pPageView);
@@ -859,7 +859,7 @@ FX_BOOL CPDFSDK_AnnotIterator::InitIteratorAnnotList(CPDFSDK_PageView* pPageView
}
m_pIteratorAnnotList.RemoveAll();
- if(!pAnnotList) return FALSE;
+ if(!pAnnotList) return false;
CPDFSDK_Annot * pTopMostAnnot= (m_bIgnoreTopmost) ? NULL : pPageView->GetFocusAnnot();
@@ -888,5 +888,5 @@ FX_BOOL CPDFSDK_AnnotIterator::InitIteratorAnnotList(CPDFSDK_PageView* pPageView
}
}
- return TRUE;
+ return true;
}
diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp
index d0dc4ef738..bbdfc19323 100644
--- a/fpdfsdk/src/fsdk_baseannot.cpp
+++ b/fpdfsdk/src/fsdk_baseannot.cpp
@@ -17,14 +17,14 @@ int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, uint8_t tzminute)
return (int)tzhour * 3600 + (int)tzminute * (tzhour >= 0 ? 60 : -60);
}
-FX_BOOL _gAfxIsLeapYear(int16_t year)
+bool _gAfxIsLeapYear(int16_t year)
{
return ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0)));
}
FX_WORD _gAfxGetYearDays(int16_t year)
{
- return (_gAfxIsLeapYear(year) == TRUE ? 366 : 365);
+ return (_gAfxIsLeapYear(year) == true ? 366 : 365);
}
uint8_t _gAfxGetMonthDays(int16_t year, uint8_t month)
@@ -50,7 +50,7 @@ uint8_t _gAfxGetMonthDays(int16_t year, uint8_t month)
break;
case 2:
- if (_gAfxIsLeapYear(year) == TRUE)
+ if (_gAfxIsLeapYear(year) == true)
mDays = 29;
else
mDays = 28;
@@ -128,17 +128,17 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::operator = (const FX_SYSTEMTIME& st)
return *this;
}
-FX_BOOL CPDFSDK_DateTime::operator == (CPDFSDK_DateTime& datetime)
+bool CPDFSDK_DateTime::operator == (CPDFSDK_DateTime& datetime)
{
return (FXSYS_memcmp(&dt, &datetime.dt, sizeof(FX_DATETIME)) == 0);
}
-FX_BOOL CPDFSDK_DateTime::operator != (CPDFSDK_DateTime& datetime)
+bool CPDFSDK_DateTime::operator != (CPDFSDK_DateTime& datetime)
{
return (FXSYS_memcmp(&dt, &datetime.dt, sizeof(FX_DATETIME)) != 0);
}
-FX_BOOL CPDFSDK_DateTime::operator > (CPDFSDK_DateTime& datetime)
+bool CPDFSDK_DateTime::operator > (CPDFSDK_DateTime& datetime)
{
CPDFSDK_DateTime dt1 = ToGMT();
CPDFSDK_DateTime dt2 = datetime.ToGMT();
@@ -147,12 +147,12 @@ FX_BOOL CPDFSDK_DateTime::operator > (CPDFSDK_DateTime& datetime)
int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
- if (d1 > d3) return TRUE;
- if (d2 > d4) return TRUE;
- return FALSE;
+ if (d1 > d3) return true;
+ if (d2 > d4) return true;
+ return false;
}
-FX_BOOL CPDFSDK_DateTime::operator >= (CPDFSDK_DateTime& datetime)
+bool CPDFSDK_DateTime::operator >= (CPDFSDK_DateTime& datetime)
{
CPDFSDK_DateTime dt1 = ToGMT();
CPDFSDK_DateTime dt2 = datetime.ToGMT();
@@ -161,12 +161,12 @@ FX_BOOL CPDFSDK_DateTime::operator >= (CPDFSDK_DateTime& datetime)
int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
- if (d1 >= d3) return TRUE;
- if (d2 >= d4) return TRUE;
- return FALSE;
+ if (d1 >= d3) return true;
+ if (d2 >= d4) return true;
+ return false;
}
-FX_BOOL CPDFSDK_DateTime::operator < (CPDFSDK_DateTime& datetime)
+bool CPDFSDK_DateTime::operator < (CPDFSDK_DateTime& datetime)
{
CPDFSDK_DateTime dt1 = ToGMT();
CPDFSDK_DateTime dt2 = datetime.ToGMT();
@@ -175,12 +175,12 @@ FX_BOOL CPDFSDK_DateTime::operator < (CPDFSDK_DateTime& datetime)
int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
- if (d1 < d3) return TRUE;
- if (d2 < d4) return TRUE;
- return FALSE;
+ if (d1 < d3) return true;
+ if (d2 < d4) return true;
+ return false;
}
-FX_BOOL CPDFSDK_DateTime::operator <= (CPDFSDK_DateTime& datetime)
+bool CPDFSDK_DateTime::operator <= (CPDFSDK_DateTime& datetime)
{
CPDFSDK_DateTime dt1 = ToGMT();
CPDFSDK_DateTime dt2 = datetime.ToGMT();
@@ -189,9 +189,9 @@ FX_BOOL CPDFSDK_DateTime::operator <= (CPDFSDK_DateTime& datetime)
int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
- if (d1 <= d3) return TRUE;
- if (d2 <= d4) return TRUE;
- return FALSE;
+ if (d1 <= d3) return true;
+ if (d2 <= d4) return true;
+ return false;
}
CPDFSDK_DateTime::operator time_t()
@@ -506,7 +506,7 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::AddSeconds(int seconds)
CPDFSDK_Annot::CPDFSDK_Annot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView) :
m_pAnnot(pAnnot),
m_pPageView(pPageView),
-m_bSelected(FALSE),
+m_bSelected(false),
m_nTabOrder(-1)
{
}
@@ -539,12 +539,12 @@ CPDFSDK_PageView* CPDFSDK_Annot::GetPageView()
return m_pPageView;
}
-FX_BOOL CPDFSDK_Annot::IsSelected()
+bool CPDFSDK_Annot::IsSelected()
{
return m_bSelected;
}
-void CPDFSDK_Annot::SetSelected(FX_BOOL bSelected)
+void CPDFSDK_Annot::SetSelected(bool bSelected)
{
m_bSelected = bSelected;
}
@@ -606,15 +606,15 @@ void CPDFSDK_Annot::DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix*
m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device, mode, pOptions);
}
-FX_BOOL CPDFSDK_Annot::IsAppearanceValid()
+bool CPDFSDK_Annot::IsAppearanceValid()
{
return m_pAnnot->GetAnnotDict()->GetDict("AP") != NULL;
}
-FX_BOOL CPDFSDK_Annot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode)
+bool CPDFSDK_Annot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode)
{
CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDict("AP");
- if (pAP == NULL) return FALSE;
+ if (pAP == NULL) return false;
// Choose the right sub-ap
const FX_CHAR* ap_entry = "N";
@@ -627,9 +627,9 @@ FX_BOOL CPDFSDK_Annot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode)
// Get the AP stream or subdirectory
CPDF_Object* psub = pAP->GetElementValue(ap_entry);
- if (psub == NULL) return FALSE;
+ if (psub == NULL) return false;
- return TRUE;
+ return true;
}
void CPDFSDK_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
@@ -875,7 +875,7 @@ void CPDFSDK_Annot::RemoveColor()
m_pAnnot->GetAnnotDict()->RemoveAt("C");
}
-FX_BOOL CPDFSDK_Annot::GetColor(FX_COLORREF& color) const
+bool CPDFSDK_Annot::GetColor(FX_COLORREF& color) const
{
if (CPDF_Array* pEntry = m_pAnnot->GetAnnotDict()->GetArray("C"))
{
@@ -886,7 +886,7 @@ FX_BOOL CPDFSDK_Annot::GetColor(FX_COLORREF& color) const
color = FXSYS_RGB((int)g, (int)g, (int)g);
- return TRUE;
+ return true;
}
else if (nCount == 3)
{
@@ -896,7 +896,7 @@ FX_BOOL CPDFSDK_Annot::GetColor(FX_COLORREF& color) const
color = FXSYS_RGB((int)r, (int)g, (int)b);
- return TRUE;
+ return true;
}
else if (nCount == 4)
{
@@ -911,11 +911,11 @@ FX_BOOL CPDFSDK_Annot::GetColor(FX_COLORREF& color) const
color = FXSYS_RGB((int)(r * 255), (int)(g * 255), (int)(b * 255));
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
@@ -976,7 +976,7 @@ void CPDFSDK_Annot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Re
pStreamDict->SetAtRect("BBox", rcBBox);
}
- pStream->SetData((uint8_t*)sContents.c_str(), sContents.GetLength(), FALSE, FALSE);
+ pStream->SetData((uint8_t*)sContents.c_str(), sContents.GetLength(), false, false);
}
#define BA_ANNOT_MINWIDTH 1
@@ -992,11 +992,11 @@ FX_FLOAT CPDFSDK_Annot::GetMinHeight() const
return BA_ANNOT_MINHEIGHT;
}
-FX_BOOL CPDFSDK_Annot::CreateFormFiller()
+bool CPDFSDK_Annot::CreateFormFiller()
{
- return TRUE;
+ return true;
}
-FX_BOOL CPDFSDK_Annot::IsVisible() const
+bool CPDFSDK_Annot::IsVisible() const
{
int nFlags = GetFlags();
return !((nFlags & ANNOTFLAG_INVISIBLE) || (nFlags & ANNOTFLAG_HIDDEN) || (nFlags & ANNOTFLAG_NOVIEW));
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index ee16212f46..4933a05c24 100644
--- a/fpdfsdk/src/fsdk_baseform.cpp
+++ b/fpdfsdk/src/fsdk_baseform.cpp
@@ -37,10 +37,10 @@ CPDFSDK_Widget::~CPDFSDK_Widget()
}
-FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode)
+bool CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode)
{
CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDict("AP");
- if (pAP == NULL) return FALSE;
+ if (pAP == NULL) return false;
// Choose the right sub-ap
const FX_CHAR* ap_entry = "N";
@@ -53,7 +53,7 @@ FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode m
// Get the AP stream or subdirectory
CPDF_Object* psub = pAP->GetElementValue(ap_entry);
- if (psub == NULL) return FALSE;
+ if (psub == NULL) return false;
int nFieldType = GetFieldType();
switch (nFieldType)
@@ -70,10 +70,10 @@ FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode m
CPDF_Dictionary* pSubDict = (CPDF_Dictionary*)psub;
return pSubDict->GetStream(GetAppState()) != NULL;
}
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
int CPDFSDK_Widget::GetFieldType() const
@@ -141,7 +141,7 @@ int CPDFSDK_Widget::GetRotate() const
return pCtrl->GetRotation() % 360;
}
-FX_BOOL CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const
+bool CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const
{
CPDF_FormControl* pFormCtrl = GetFormControl();
ASSERT(pFormCtrl != NULL);
@@ -152,7 +152,7 @@ FX_BOOL CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const
return iColorType != COLORTYPE_TRANSPARENT;
}
-FX_BOOL CPDFSDK_Widget::GetBorderColor(FX_COLORREF& color) const
+bool CPDFSDK_Widget::GetBorderColor(FX_COLORREF& color) const
{
CPDF_FormControl* pFormCtrl = GetFormControl();
ASSERT(pFormCtrl != NULL);
@@ -163,7 +163,7 @@ FX_BOOL CPDFSDK_Widget::GetBorderColor(FX_COLORREF& color) const
return iColorType != COLORTYPE_TRANSPARENT;
}
-FX_BOOL CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const
+bool CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const
{
CPDF_FormControl* pFormCtrl = GetFormControl();
ASSERT(pFormCtrl != NULL);
@@ -179,7 +179,7 @@ FX_BOOL CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const
return iColorType != COLORTYPE_TRANSPARENT;
}
- return FALSE;
+ return false;
}
FX_FLOAT CPDFSDK_Widget::GetFontSize() const
@@ -235,7 +235,7 @@ int CPDFSDK_Widget::CountOptions() const
return pFormField->CountOptions();
}
-FX_BOOL CPDFSDK_Widget::IsOptionSelected(int nIndex) const
+bool CPDFSDK_Widget::IsOptionSelected(int nIndex) const
{
CPDF_FormField* pFormField = GetFormField();
ASSERT(pFormField != NULL);
@@ -251,7 +251,7 @@ int CPDFSDK_Widget::GetTopVisibleIndex() const
return pFormField->GetTopVisibleIndex();
}
-FX_BOOL CPDFSDK_Widget::IsChecked() const
+bool CPDFSDK_Widget::IsChecked() const
{
CPDF_FormControl* pFormCtrl = GetFormControl();
ASSERT(pFormCtrl != NULL);
@@ -275,7 +275,7 @@ int CPDFSDK_Widget::GetMaxLen() const
return pFormField->GetMaxLen();
}
-void CPDFSDK_Widget::SetCheck(FX_BOOL bChecked, FX_BOOL bNotify)
+void CPDFSDK_Widget::SetCheck(bool bChecked, bool bNotify)
{
CPDF_FormControl* pFormCtrl = GetFormControl();
ASSERT(pFormCtrl != NULL);
@@ -286,7 +286,7 @@ void CPDFSDK_Widget::SetCheck(FX_BOOL bChecked, FX_BOOL bNotify)
pFormField->CheckControl(pFormField->GetControlIndex(pFormCtrl), bChecked, bNotify);
}
-void CPDFSDK_Widget::SetValue(const CFX_WideString& sValue, FX_BOOL bNotify)
+void CPDFSDK_Widget::SetValue(const CFX_WideString& sValue, bool bNotify)
{
CPDF_FormField* pFormField = GetFormField();
ASSERT(pFormField != NULL);
@@ -297,7 +297,7 @@ void CPDFSDK_Widget::SetValue(const CFX_WideString& sValue, FX_BOOL bNotify)
void CPDFSDK_Widget::SetDefaultValue(const CFX_WideString& sValue)
{
}
-void CPDFSDK_Widget::SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify)
+void CPDFSDK_Widget::SetOptionSelection(int index, bool bSelected, bool bNotify)
{
CPDF_FormField* pFormField = GetFormField();
ASSERT(pFormField != NULL);
@@ -305,7 +305,7 @@ void CPDFSDK_Widget::SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bN
pFormField->SetItemSelection(index, bSelected, bNotify);
}
-void CPDFSDK_Widget::ClearSelection(FX_BOOL bNotify)
+void CPDFSDK_Widget::ClearSelection(bool bNotify)
{
CPDF_FormField* pFormField = GetFormField();
ASSERT(pFormField != NULL);
@@ -319,20 +319,20 @@ void CPDFSDK_Widget::SetTopVisibleIndex(int index)
void CPDFSDK_Widget::SetAppModified()
{
- m_bAppModified = TRUE;
+ m_bAppModified = true;
}
void CPDFSDK_Widget::ClearAppModified()
{
- m_bAppModified = FALSE;
+ m_bAppModified = false;
}
-FX_BOOL CPDFSDK_Widget::IsAppModified() const
+bool CPDFSDK_Widget::IsAppModified() const
{
return m_bAppModified;
}
-void CPDFSDK_Widget::ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChanged)
+void CPDFSDK_Widget::ResetAppearance(const FX_WCHAR* sValue, bool bValueChanged)
{
SetAppModified();
@@ -370,14 +370,14 @@ void CPDFSDK_Widget::ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChang
m_pAnnot->ClearCachedAP();
}
-CFX_WideString CPDFSDK_Widget::OnFormat(FX_BOOL& bFormated)
+CFX_WideString CPDFSDK_Widget::OnFormat(bool& bFormated)
{
CPDF_FormField* pFormField = GetFormField();
ASSERT(pFormField != NULL);
return m_pInterForm->OnFormat(pFormField, bFormated);
}
-void CPDFSDK_Widget::ResetFieldAppearance(FX_BOOL bValueChanged)
+void CPDFSDK_Widget::ResetFieldAppearance(bool bValueChanged)
{
CPDF_FormField* pFormField = GetFormField();
ASSERT(pFormField != NULL);
@@ -1017,7 +1017,7 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue)
if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
{
- pEdit->EnableRefresh(FALSE);
+ pEdit->EnableRefresh(false);
CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
ASSERT(pDoc != NULL);
@@ -1035,7 +1035,7 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue)
FX_FLOAT fFontSize = GetFontSize();
if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(TRUE);
+ pEdit->SetAutoFontSize(true);
else
pEdit->SetFontSize(fFontSize);
@@ -1093,7 +1093,7 @@ void CPDFSDK_Widget::ResetAppearance_ListBox()
if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
{
- pEdit->EnableRefresh(FALSE);
+ pEdit->EnableRefresh(false);
CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
ASSERT(pDoc != NULL);
@@ -1123,12 +1123,12 @@ void CPDFSDK_Widget::ResetAppearance_ListBox()
for (int32_t i=nTop; i<nCount; i++)
{
- FX_BOOL bSelected = FALSE;
+ bool bSelected = false;
for (int32_t j=0; j<nSelCount; j++)
{
if (pField->GetSelectedIndex(j) == i)
{
- bSelected = TRUE;
+ bSelected = true;
break;
}
}
@@ -1141,16 +1141,16 @@ void CPDFSDK_Widget::ResetAppearance_ListBox()
if (bSelected)
{
CPDF_Rect rcItem = CPDF_Rect(rcClient.left,fy-fItemHeight,rcClient.right,fy);
- sList << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,0,51.0f/255.0f,113.0f/255.0f),TRUE)
+ sList << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,0,51.0f/255.0f,113.0f/255.0f),true)
<< rcItem.left << " " << rcItem.bottom << " " << rcItem.Width() << " " << rcItem.Height() << " re f\n" << "Q\n";
- sList << "BT\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY,1),TRUE) <<
+ sList << "BT\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY,1),true) <<
CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,fy)) << "ET\n";
}
else
{
CPWL_Color crText = GetTextPWLColor();
- sList << "BT\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) <<
+ sList << "BT\n" << CPWL_Utils::GetColorAppStream(crText,true) <<
CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,fy)) << "ET\n";
}
@@ -1183,7 +1183,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue)
if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
{
- pEdit->EnableRefresh(FALSE);
+ pEdit->EnableRefresh(false);
CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
ASSERT(pDoc != NULL);
@@ -1198,12 +1198,12 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue)
pEdit->SetAlignmentH(pControl->GetControlAlignment());
FX_DWORD dwFieldFlags = pField->GetFieldFlags();
- FX_BOOL bMultiLine = (dwFieldFlags >> 12) & 1;
+ bool bMultiLine = (dwFieldFlags >> 12) & 1;
if (bMultiLine)
{
- pEdit->SetMultiLine(TRUE);
- pEdit->SetAutoReturn(TRUE);
+ pEdit->SetMultiLine(true);
+ pEdit->SetAutoReturn(true);
}
else
{
@@ -1218,7 +1218,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue)
}
int nMaxLen = pField->GetMaxLen();
- FX_BOOL bCharArray = (dwFieldFlags >> 24) & 1;
+ bool bCharArray = (dwFieldFlags >> 24) & 1;
FX_FLOAT fFontSize = GetFontSize();
if (nMaxLen > 0)
@@ -1241,7 +1241,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue)
}
if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(TRUE);
+ pEdit->SetAutoFontSize(true);
else
pEdit->SetFontSize(fFontSize);
@@ -1276,11 +1276,11 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue)
{
case BBS_SOLID:
{
- CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE);
+ CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),false);
if (sColor.GetLength() > 0)
{
sLines << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE) << " 2 J 0 j\n";
+ << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),false) << " 2 J 0 j\n";
for (int32_t i=1;i<nMaxLen;i++)
{
@@ -1296,13 +1296,13 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue)
break;
case BBS_DASH:
{
- CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE);
+ CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),false);
if (sColor.GetLength() > 0)
{
CPWL_Dash dsBorder = CPWL_Dash(3, 3, 0);
sLines << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE)
+ << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),false)
<< "[" << dsBorder.nDash << " "
<< dsBorder.nGap << "] "
<< dsBorder.nPhase << " d\n";
@@ -1549,7 +1549,7 @@ void CPDFSDK_Widget::RemoveAppearance(const CFX_ByteString& sAPType)
}
}
-FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAction& data, CPDFSDK_PageView* pPageView)
+bool CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAction& data, CPDFSDK_PageView* pPageView)
{
CPDF_Action action = GetAAction(type);
@@ -1567,7 +1567,7 @@ FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAc
return pActionHandler->DoAction_Field(action, type, pDocument, GetFormField(), data);
}
- return FALSE;
+ return false;
}
CPDF_Action CPDFSDK_Widget::GetAAction(CPDF_AAction::AActionType eAAT)
@@ -1624,37 +1624,37 @@ int32_t CPDFSDK_Widget::GetValueAge() const
}
-FX_BOOL CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY)
+bool CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY)
{
CPDF_Annot* pAnnot = GetPDFAnnot();
CFX_FloatRect annotRect;
pAnnot->GetRect(annotRect);
if(annotRect.Contains(pageX, pageY))
{
- if (!IsVisible()) return FALSE;
+ if (!IsVisible()) return false;
int nFieldFlags = GetFieldFlags();
if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
CPDFSDK_InterForm::CPDFSDK_InterForm(CPDFSDK_Document* pDocument)
:m_pDocument(pDocument),
m_pInterForm(NULL),
- m_bCalculate(TRUE),
- m_bBusy(FALSE)
+ m_bCalculate(true),
+ m_bBusy(false)
{
ASSERT(m_pDocument != NULL);
- m_pInterForm = new CPDF_InterForm(m_pDocument->GetDocument(), FALSE);
+ m_pInterForm = new CPDF_InterForm(m_pDocument->GetDocument(), false);
ASSERT(m_pInterForm != NULL);
m_pInterForm->SetFormNotify(this);
for(int i=0; i<6; i++)
- m_bNeedHightlight[i] = FALSE;
+ m_bNeedHightlight[i] = false;
m_iHighlightAlpha = 0;
}
@@ -1665,12 +1665,12 @@ CPDFSDK_InterForm::~CPDFSDK_InterForm()
m_Map.clear();
}
-FX_BOOL CPDFSDK_InterForm::HighlightWidgets()
+bool CPDFSDK_InterForm::HighlightWidgets()
{
- return FALSE;
+ return false;
}
-CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const
+CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget, bool bNext) const
{
nonstd::unique_ptr<CBA_AnnotIterator> pIterator(
new CBA_AnnotIterator(pWidget->GetPageView(), "Widget", ""));
@@ -1782,12 +1782,12 @@ void CPDFSDK_InterForm::RemoveMap(CPDF_FormControl* pControl)
m_Map.erase(pControl);
}
-void CPDFSDK_InterForm::EnableCalculate(FX_BOOL bEnabled)
+void CPDFSDK_InterForm::EnableCalculate(bool bEnabled)
{
m_bCalculate = bEnabled;
}
-FX_BOOL CPDFSDK_InterForm::IsCalculateEnabled() const
+bool CPDFSDK_InterForm::IsCalculateEnabled() const
{
return m_bCalculate;
}
@@ -1807,7 +1807,7 @@ CPDF_Stream* CPDFSDK_InterForm::LoadImageFromFile(const CFX_WideString& sFile)
int nHeight = pBmp->GetHeight();
CPDF_Image Image(pDocument);
- Image.SetImage(pBmp, FALSE);
+ Image.SetImage(pBmp, false);
CPDF_Stream* pImageStream = Image.GetStream();
if (pImageStream)
{
@@ -1867,7 +1867,7 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField)
if (m_bBusy) return;
- m_bBusy = TRUE;
+ m_bBusy = true;
if (IsCalculateEnabled())
{
@@ -1899,11 +1899,11 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField)
CFX_WideString sOldValue = pField->GetValue();
CFX_WideString sValue = sOldValue;
- FX_BOOL bRC = TRUE;
+ bool bRC = true;
pContext->OnField_Calculate(pFormField, pField, sValue, bRC);
CFX_WideString sInfo;
- FX_BOOL bRet = pContext->RunScript(csJS, sInfo);
+ bool bRet = pContext->RunScript(csJS, sInfo);
pRuntime->ReleaseContext(pContext);
if (bRet)
@@ -1911,7 +1911,7 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField)
if (bRC)
{
if (sValue.Compare(sOldValue) != 0)
- pField->SetValue(sValue, TRUE);
+ pField->SetValue(sValue, true);
}
}
}
@@ -1924,10 +1924,10 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField)
}
- m_bBusy = FALSE;
+ m_bBusy = false;
}
-CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, FX_BOOL& bFormated)
+CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, bool& bFormated)
{
ASSERT(m_pDocument != NULL);
ASSERT(pFormField != NULL);
@@ -1937,7 +1937,7 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, FX_BOOL&
ASSERT(pEnv);
if(!pEnv->IsJSInitiated())
{
- bFormated = FALSE;
+ bFormated = false;
return sValue;
}
@@ -1956,7 +1956,7 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, FX_BOOL&
}
}
- bFormated = FALSE;
+ bFormated = false;
CPDF_AAction aAction = pFormField->GetAdditionalAction();
if (aAction != NULL && aAction.ActionExist(CPDF_AAction::Format))
@@ -1972,16 +1972,16 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, FX_BOOL&
IFXJS_Context* pContext = pRuntime->NewContext();
ASSERT(pContext != NULL);
- pContext->OnField_Format(pFormField, Value, TRUE);
+ pContext->OnField_Format(pFormField, Value, true);
CFX_WideString sInfo;
- FX_BOOL bRet = pContext->RunScript(script, sInfo);
+ bool bRet = pContext->RunScript(script, sInfo);
pRuntime->ReleaseContext(pContext);
if (bRet)
{
sValue = Value;
- bFormated = TRUE;
+ bFormated = true;
}
}
}
@@ -1990,7 +1990,7 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, FX_BOOL&
return sValue;
}
-void CPDFSDK_InterForm::ResetFieldAppearance(CPDF_FormField* pFormField, const FX_WCHAR* sValue, FX_BOOL bValueChanged)
+void CPDFSDK_InterForm::ResetFieldAppearance(CPDF_FormField* pFormField, const FX_WCHAR* sValue, bool bValueChanged)
{
ASSERT(pFormField != NULL);
@@ -2020,7 +2020,7 @@ void CPDFSDK_InterForm::UpdateField(CPDF_FormField* pFormField)
CFFL_IFormFiller* pIFormFiller = pEnv->GetIFormFiller();
CPDF_Page * pPage = pWidget->GetPDFPage();
- CPDFSDK_PageView * pPageView = m_pDocument->GetPageView(pPage,FALSE);
+ CPDFSDK_PageView * pPageView = m_pDocument->GetPageView(pPage,false);
FX_RECT rcBBox = pIFormFiller->GetViewBBox(pPageView, pWidget);
@@ -2029,7 +2029,7 @@ void CPDFSDK_InterForm::UpdateField(CPDF_FormField* pFormField)
}
}
-void CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC)
+void CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideString& csValue, bool& bRC)
{
ASSERT(pFormField != NULL);
@@ -2058,7 +2058,7 @@ void CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideSt
}
}
-void CPDFSDK_InterForm::OnValidate(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC)
+void CPDFSDK_InterForm::OnValidate(CPDF_FormField* pFormField, CFX_WideString& csValue, bool& bRC)
{
ASSERT(pFormField != NULL);
@@ -2089,7 +2089,7 @@ void CPDFSDK_InterForm::OnValidate(CPDF_FormField* pFormField, CFX_WideString& c
/* ----------------------------- action ----------------------------- */
-FX_BOOL CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
+bool CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
{
ASSERT(action);
@@ -2100,9 +2100,9 @@ FX_BOOL CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
CFX_PtrArray fields;
GetFieldFromObjects(fieldObjects, fields);
- FX_BOOL bHide = action.GetHideStatus();
+ bool bHide = action.GetHideStatus();
- FX_BOOL bChanged = FALSE;
+ bool bChanged = false;
for (int i=0, sz=fields.GetSize(); i<sz; i++)
{
@@ -2137,7 +2137,7 @@ FX_BOOL CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
pPageView->UpdateView(pWidget);
- bChanged = TRUE;
+ bChanged = true;
}
}
}
@@ -2145,12 +2145,12 @@ FX_BOOL CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
return bChanged;
}
-FX_BOOL CPDFSDK_InterForm::DoAction_SubmitForm(const CPDF_Action& action)
+bool CPDFSDK_InterForm::DoAction_SubmitForm(const CPDF_Action& action)
{
ASSERT(m_pInterForm != NULL);
CFX_WideString sDestination = action.GetFilePath();
if (sDestination.IsEmpty())
- return FALSE;
+ return false;
CPDF_Dictionary* pActionDict = action.GetDict();
if (pActionDict->KeyExist("Fields"))
@@ -2164,21 +2164,21 @@ FX_BOOL CPDFSDK_InterForm::DoAction_SubmitForm(const CPDF_Action& action)
GetFieldFromObjects(fieldObjects, fields);
if (fields.GetSize() != 0)
{
- FX_BOOL bIncludeOrExclude = !(dwFlags & 0x01);
+ bool bIncludeOrExclude = !(dwFlags & 0x01);
if (m_pInterForm->CheckRequiredFields(&fields, bIncludeOrExclude))
- return FALSE;
+ return false;
- return SubmitFields(sDestination, fields, bIncludeOrExclude, FALSE);
+ return SubmitFields(sDestination, fields, bIncludeOrExclude, false);
}
}
if (m_pInterForm->CheckRequiredFields())
- return FALSE;
+ return false;
- return SubmitForm(sDestination, FALSE);
+ return SubmitForm(sDestination, false);
}
-FX_BOOL CPDFSDK_InterForm::SubmitFields(const CFX_WideString& csDestination, const CFX_PtrArray& fields,
- FX_BOOL bIncludeOrExclude, FX_BOOL bUrlEncoded)
+bool CPDFSDK_InterForm::SubmitFields(const CFX_WideString& csDestination, const CFX_PtrArray& fields,
+ bool bIncludeOrExclude, bool bUrlEncoded)
{
CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
ASSERT(pEnv != NULL);
@@ -2192,12 +2192,12 @@ FX_BOOL CPDFSDK_InterForm::SubmitFields(const CFX_WideString& csDestination, con
if (bUrlEncoded)
{
if(!FDFToURLEncodedData(pBuffer, nBufSize))
- return FALSE;
+ return false;
}
pEnv->JS_docSubmitForm(pBuffer, nBufSize, csDestination.c_str());
- return TRUE;
+ return true;
}
void CPDFSDK_InterForm::DoFDFBuffer(CFX_ByteString sBuffer)
@@ -2236,22 +2236,22 @@ void CPDFSDK_InterForm::DoFDFBuffer(CFX_ByteString sBuffer)
sBuffer.ReleaseBuffer();
}
-FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_WideString csTxtFile)
+bool CPDFSDK_InterForm::FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_WideString csTxtFile)
{
- return TRUE;
+ return true;
}
-FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize)
+bool CPDFSDK_InterForm::FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize)
{
CFDF_Document* pFDF = CFDF_Document::ParseMemory(pBuf, nBufSize);
if (pFDF)
{
CPDF_Dictionary* pMainDict = pFDF->GetRoot()->GetDict("FDF");
- if (pMainDict == NULL) return FALSE;
+ if (pMainDict == NULL) return false;
// Get fields
CPDF_Array* pFields = pMainDict->GetArray("Fields");
- if (pFields == NULL) return FALSE;
+ if (pFields == NULL) return false;
CFX_ByteTextBuf fdfEncodedData;
@@ -2279,17 +2279,17 @@ FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufS
pBuf = FX_Alloc(uint8_t, nBufSize);
FXSYS_memcpy(pBuf, fdfEncodedData.GetBuffer(), nBufSize);
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,FX_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf)
+bool CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,bool bIncludeOrExclude, CFX_ByteTextBuf& textBuf)
{
ASSERT(m_pDocument != NULL);
ASSERT(m_pInterForm != NULL);
CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath(),(CFX_PtrArray&)fields, bIncludeOrExclude);
- if (!pFDF) return FALSE;
- FX_BOOL bRet = pFDF->WriteBuf(textBuf); // = FALSE;//
+ if (!pFDF) return false;
+ bool bRet = pFDF->WriteBuf(textBuf); // = false;//
delete pFDF;
return bRet;
@@ -2301,24 +2301,24 @@ CFX_WideString CPDFSDK_InterForm::GetTemporaryFileName(const CFX_WideString& sFi
return L"";
}
-FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded)
+bool CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, bool bUrlEncoded)
{
- if (sDestination.IsEmpty()) return FALSE;
+ if (sDestination.IsEmpty()) return false;
CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
ASSERT(pEnv != NULL);
- if(NULL == m_pDocument) return FALSE;
+ if(NULL == m_pDocument) return false;
CFX_WideString wsPDFFilePath = m_pDocument->GetPath();
- if(NULL == m_pInterForm) return FALSE;
+ if(NULL == m_pInterForm) return false;
CFDF_Document* pFDFDoc = m_pInterForm->ExportToFDF(wsPDFFilePath);
- if (NULL == pFDFDoc) return FALSE;
+ if (NULL == pFDFDoc) return false;
CFX_ByteTextBuf FdfBuffer;
- FX_BOOL bRet = pFDFDoc->WriteBuf(FdfBuffer);
+ bool bRet = pFDFDoc->WriteBuf(FdfBuffer);
delete pFDFDoc;
- if (!bRet) return FALSE;
+ if (!bRet) return false;
uint8_t* pBuffer = FdfBuffer.GetBuffer();
FX_STRSIZE nBufSize = FdfBuffer.GetLength();
@@ -2326,7 +2326,7 @@ FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, FX_BOO
if (bUrlEncoded)
{
if(!FDFToURLEncodedData(pBuffer, nBufSize))
- return FALSE;
+ return false;
}
pEnv->JS_docSubmitForm(pBuffer, nBufSize, sDestination.c_str());
@@ -2337,26 +2337,26 @@ FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, FX_BOO
pBuffer = NULL;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPDFSDK_InterForm::ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf)
+bool CPDFSDK_InterForm::ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf)
{
ASSERT(m_pInterForm != NULL);
ASSERT(m_pDocument != NULL);
CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath());
- if (!pFDF) return FALSE;
+ if (!pFDF) return false;
- FX_BOOL bRet = pFDF->WriteBuf(textBuf);
+ bool bRet = pFDF->WriteBuf(textBuf);
delete pFDF;
return bRet;
}
-FX_BOOL CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action)
+bool CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action)
{
ASSERT(action);
@@ -2370,15 +2370,15 @@ FX_BOOL CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action)
af.GetAllFields(fieldObjects);
CFX_PtrArray fields;
GetFieldFromObjects(fieldObjects, fields);
- return m_pInterForm->ResetForm(fields, !(dwFlags & 0x01), TRUE);
+ return m_pInterForm->ResetForm(fields, !(dwFlags & 0x01), true);
}
- return m_pInterForm->ResetForm(TRUE);
+ return m_pInterForm->ResetForm(true);
}
-FX_BOOL CPDFSDK_InterForm::DoAction_ImportData(const CPDF_Action& action)
+bool CPDFSDK_InterForm::DoAction_ImportData(const CPDF_Action& action)
{
- return FALSE;
+ return false;
}
void CPDFSDK_InterForm::GetFieldFromObjects(const CFX_PtrArray& objects, CFX_PtrArray& fields)
@@ -2415,7 +2415,7 @@ int CPDFSDK_InterForm::BeforeValueChange(const CPDF_FormField* pField, CFX_WideS
int nType = pFormField->GetFieldType();
if (nType == FIELDTYPE_COMBOBOX || nType == FIELDTYPE_TEXTFIELD)
{
- FX_BOOL bRC = TRUE;
+ bool bRC = true;
OnKeyStrokeCommit(pFormField, csValue, bRC);
if (bRC)
{
@@ -2434,12 +2434,12 @@ int CPDFSDK_InterForm::AfterValueChange(const CPDF_FormField* pField)
if (nType == FIELDTYPE_COMBOBOX || nType == FIELDTYPE_TEXTFIELD)
{
OnCalculate(pFormField);
- FX_BOOL bFormated = FALSE;
+ bool bFormated = false;
CFX_WideString sValue = OnFormat(pFormField, bFormated);
if (bFormated)
- ResetFieldAppearance(pFormField, sValue.c_str(), TRUE);
+ ResetFieldAppearance(pFormField, sValue.c_str(), true);
else
- ResetFieldAppearance(pFormField, NULL, TRUE);
+ ResetFieldAppearance(pFormField, NULL, true);
UpdateField(pFormField);
}
return 0;
@@ -2451,7 +2451,7 @@ int CPDFSDK_InterForm::BeforeSelectionChange(const CPDF_FormField* pField, CFX_W
if (pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
return 0;
- FX_BOOL bRC = TRUE;
+ bool bRC = true;
OnKeyStrokeCommit(pFormField, csValue, bRC);
if (!bRC)
return -1;
@@ -2469,7 +2469,7 @@ int CPDFSDK_InterForm::AfterSelectionChange(const CPDF_FormField* pField)
if (pFormField->GetFieldType() == FIELDTYPE_LISTBOX)
{
OnCalculate(pFormField);
- ResetFieldAppearance(pFormField, NULL, TRUE);
+ ResetFieldAppearance(pFormField, NULL, true);
UpdateField(pFormField);
}
return 0;
@@ -2509,16 +2509,16 @@ int CPDFSDK_InterForm::AfterFormImportData(const CPDF_InterForm* pForm)
return 0;
}
-FX_BOOL CPDFSDK_InterForm::IsNeedHighLight(int nFieldType)
+bool CPDFSDK_InterForm::IsNeedHighLight(int nFieldType)
{
if(nFieldType <1 || nFieldType > 6)
- return FALSE;
+ return false;
return m_bNeedHightlight[nFieldType-1];
}
void CPDFSDK_InterForm::RemoveAllHighLight()
{
- memset((void*)m_bNeedHightlight, 0, 6*sizeof(FX_BOOL));
+ memset((void*)m_bNeedHightlight, 0, 6*sizeof(bool));
}
void CPDFSDK_InterForm::SetHighlightColor(FX_COLORREF clr, int nFieldType)
{
@@ -2530,14 +2530,14 @@ void CPDFSDK_InterForm::SetHighlightColor(FX_COLORREF clr, int nFieldType)
for(int i=0; i<6; i++)
{
m_aHighlightColor[i] = clr;
- m_bNeedHightlight[i] = TRUE;
+ m_bNeedHightlight[i] = true;
}
break;
}
default:
{
m_aHighlightColor[nFieldType-1] = clr;
- m_bNeedHightlight[nFieldType-1] = TRUE;
+ m_bNeedHightlight[nFieldType-1] = true;
break;
}
}
@@ -2783,7 +2783,7 @@ void CBA_AnnotIterator::GenerateResults()
if (sa.GetSize() > 0)
{
- sa.Sort(CBA_AnnotIterator::CompareByTop, FALSE);
+ sa.Sort(CBA_AnnotIterator::CompareByTop, false);
}
while (sa.GetSize() > 0)
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 05c1a3dd89..da405cd8ef 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -26,10 +26,10 @@ public:
virtual void InvalidateRect(FX_HWND hWnd, FX_RECT rect) ;
virtual void OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect);
- virtual FX_BOOL IsSelectionImplemented();
+ virtual bool IsSelectionImplemented();
virtual CFX_WideString GetClipboardText(FX_HWND hWnd){return L"";}
- virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) {return FALSE;}
+ virtual bool SetClipboardText(FX_HWND hWnd, CFX_WideString string) {return false;}
virtual void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) {}
virtual void ScreenToClient(FX_HWND hWnd, int32_t& x, int32_t& y) {}
@@ -45,23 +45,23 @@ public:
virtual void SetCursor(int32_t nCursorType);
virtual FX_HMENU CreatePopupMenu() {return NULL;}
- virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, int32_t nIDNewItem, CFX_WideString string) {return FALSE;}
- virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, int32_t nIDItem, FX_BOOL bEnabled) {return FALSE;}
+ virtual bool AppendMenuItem(FX_HMENU hMenu, int32_t nIDNewItem, CFX_WideString string) {return false;}
+ virtual bool EnableMenuItem(FX_HMENU hMenu, int32_t nIDItem, bool bEnabled) {return false;}
virtual int32_t TrackPopupMenu(FX_HMENU hMenu, int32_t x, int32_t y, FX_HWND hParent) {return -1;}
virtual void DestroyMenu(FX_HMENU hMenu) {}
virtual CFX_ByteString GetNativeTrueTypeFont(int32_t nCharset);
- virtual FX_BOOL FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName);
+ virtual bool FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName);
virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, uint8_t nCharset);
virtual int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) ;
virtual void KillTimer(int32_t nID) ;
- virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsSHIFTKeyDown(nFlag);}
- virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsCTRLKeyDown(nFlag);}
- virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsALTKeyDown(nFlag);}
- virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsINSERTKeyDown(nFlag);}
+ virtual bool IsSHIFTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsSHIFTKeyDown(nFlag);}
+ virtual bool IsCTRLKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsCTRLKeyDown(nFlag);}
+ virtual bool IsALTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsALTKeyDown(nFlag);}
+ virtual bool IsINSERTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsINSERTKeyDown(nFlag);}
virtual FX_SYSTEMTIME GetLocalTime();
@@ -122,15 +122,15 @@ void CFX_SystemHandler::OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect)
}
-FX_BOOL CFX_SystemHandler::IsSelectionImplemented()
+bool CFX_SystemHandler::IsSelectionImplemented()
{
if(m_pEnv)
{
FPDF_FORMFILLINFO* pInfo = m_pEnv->GetFormFillInfo();
if(pInfo && pInfo->FFI_OutputSelectedRect)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
CFX_ByteString CFX_SystemHandler::GetNativeTrueTypeFont(int32_t nCharset)
@@ -138,7 +138,7 @@ CFX_ByteString CFX_SystemHandler::GetNativeTrueTypeFont(int32_t nCharset)
return "";
}
-FX_BOOL CFX_SystemHandler::FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName)
+bool CFX_SystemHandler::FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName)
{
CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr();
if(pFontMgr)
@@ -156,13 +156,13 @@ FX_BOOL CFX_SystemHandler::FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteStri
for(int i=0; i<nSize; i++)
{
if(pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName))
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
static int CharSet2CP(int charset)
@@ -183,8 +183,8 @@ CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CF
if(pDoc)
{
CFX_Font* pFXFont = new CFX_Font();
- pFXFont->LoadSubst(sFontFaceName,TRUE,0,0,0,CharSet2CP(nCharset),FALSE);
- CPDF_Font* pFont = pDoc->AddFont(pFXFont,nCharset,FALSE);
+ pFXFont->LoadSubst(sFontFaceName,true,0,0,0,CharSet2CP(nCharset),false);
+ CPDF_Font* pFont = pDoc->AddFont(pFXFont,nCharset,false);
delete pFXFont;
return pFont;
}
@@ -409,7 +409,7 @@ CPDFSDK_Document::CPDFSDK_Document(CPDF_Document* pDoc,CPDFDoc_Environment* pEnv
m_pFocusAnnot(nullptr),
m_pEnv(pEnv),
m_pOccontent(nullptr),
- m_bChangeMask(FALSE)
+ m_bChangeMask(false)
{
}
@@ -426,7 +426,7 @@ CPDFSDK_Document::~CPDFSDK_Document()
m_pOccontent = nullptr;
}
-CPDFSDK_PageView* CPDFSDK_Document::GetPageView(CPDF_Page* pPDFPage, FX_BOOL ReNew)
+CPDFSDK_PageView* CPDFSDK_Document::GetPageView(CPDF_Page* pPDFPage, bool ReNew)
{
auto it = m_pageMap.find(pPDFPage);
if (it != m_pageMap.end())
@@ -445,7 +445,7 @@ CPDFSDK_PageView* CPDFSDK_Document::GetPageView(CPDF_Page* pPDFPage, FX_BOOL ReN
CPDFSDK_PageView* CPDFSDK_Document::GetCurrentView()
{
CPDF_Page* pPage = (CPDF_Page*)m_pEnv->FFI_GetCurrentPage(m_pDoc);
- return pPage ? GetPageView(pPage, TRUE) : nullptr;
+ return pPage ? GetPageView(pPage, true) : nullptr;
}
CPDFSDK_PageView* CPDFSDK_Document::GetPageView(int nIndex)
@@ -474,24 +474,24 @@ void CPDFSDK_Document:: ProcJavascriptFun()
}
-FX_BOOL CPDFSDK_Document::ProcOpenAction()
+bool CPDFSDK_Document::ProcOpenAction()
{
if(!m_pDoc)
- return FALSE;
+ return false;
CPDF_Dictionary* pRoot = m_pDoc->GetRoot();
if (!pRoot)
- return FALSE;
+ return false;
CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");
if(!pOpenAction)
pOpenAction = pRoot->GetArray("OpenAction");
if(!pOpenAction)
- return FALSE;
+ return false;
if(pOpenAction->GetType()==PDFOBJ_ARRAY)
- return TRUE;
+ return true;
if(pOpenAction->GetType()==PDFOBJ_DICTIONARY)
{
@@ -499,9 +499,9 @@ FX_BOOL CPDFSDK_Document::ProcOpenAction()
CPDF_Action action(pDict);
if(m_pEnv->GetActionHander())
m_pEnv->GetActionHander()->DoAction_DocOpen(action, this);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
CPDF_OCContext* CPDFSDK_Document::GetOCContext()
@@ -555,14 +555,14 @@ CPDFSDK_Annot* CPDFSDK_Document::GetFocusAnnot()
return m_pFocusAnnot;
}
-FX_BOOL CPDFSDK_Document::SetFocusAnnot(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
+bool CPDFSDK_Document::SetFocusAnnot(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
{
- if(m_pFocusAnnot==pAnnot) return TRUE;
+ if(m_pFocusAnnot==pAnnot) return true;
if(m_pFocusAnnot)
{
- if(!KillFocusAnnot(nFlag) ) return FALSE;
+ if(!KillFocusAnnot(nFlag) ) return false;
}
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
if(pAnnot && pPageView->IsValid())
@@ -572,18 +572,18 @@ FX_BOOL CPDFSDK_Document::SetFocusAnnot(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
if(pAnnotHandler&&!m_pFocusAnnot)
{
if (!pAnnotHandler->Annot_OnSetFocus(pAnnot,nFlag))
- return FALSE;
+ return false;
if(!m_pFocusAnnot)
{
m_pFocusAnnot=pAnnot;
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag)
+bool CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag)
{
if(m_pFocusAnnot)
{
@@ -600,11 +600,11 @@ FX_BOOL CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag)
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pFocusAnnot;
int nFieldType = pWidget->GetFieldType();
if(FIELDTYPE_TEXTFIELD == nFieldType || FIELDTYPE_COMBOBOX == nFieldType)
- m_pEnv->FFI_OnSetFieldInputFocus(NULL, NULL, 0, FALSE);
+ m_pEnv->FFI_OnSetFieldInputFocus(NULL, NULL, 0, false);
}
if(!m_pFocusAnnot)
- return TRUE;
+ return true;
}
else
{
@@ -612,7 +612,7 @@ FX_BOOL CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag)
}
}
}
- return FALSE;
+ return false;
}
void CPDFSDK_Document::OnCloseDocument()
@@ -620,7 +620,7 @@ void CPDFSDK_Document::OnCloseDocument()
KillFocusAnnot();
}
-FX_BOOL CPDFSDK_Document::GetPermissions(int nFlag)
+bool CPDFSDK_Document::GetPermissions(int nFlag)
{
FX_DWORD dwPermissions = m_pDoc->GetUserPermissions();
return dwPermissions&nFlag;
@@ -650,13 +650,13 @@ CPDFSDK_PageView::CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc,CPDF_Page* page):m_
m_page->SetPrivateData((void*)m_page, (void*)this, NULL);
m_fxAnnotArray.RemoveAll();
- m_bEnterWidget = FALSE;
- m_bExitWidget = FALSE;
- m_bOnWidget = FALSE;
+ m_bEnterWidget = false;
+ m_bExitWidget = false;
+ m_bOnWidget = false;
m_CaptureWidget = NULL;
- m_bValid = FALSE;
- m_bLocked = FALSE;
- m_bTakeOverPage = FALSE;
+ m_bValid = false;
+ m_bLocked = false;
+ m_bTakeOverPage = false;
}
CPDFSDK_PageView::~CPDFSDK_PageView()
@@ -690,7 +690,7 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* p
m_curMatrix = *pUser2Device;
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- CPDFSDK_AnnotIterator annotIterator(this, TRUE);
+ CPDFSDK_AnnotIterator annotIterator(this, true);
CPDFSDK_Annot* pSDKAnnot = nullptr;
int index = -1;
while ((pSDKAnnot = annotIterator.Next(index))) {
@@ -737,7 +737,7 @@ CPDF_Annot* CPDFSDK_PageView::GetPDFWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY
CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
{
- CPDFSDK_AnnotIterator annotIterator(this, FALSE);
+ CPDFSDK_AnnotIterator annotIterator(this, false);
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
CPDFSDK_Annot* pSDKAnnot = NULL;
@@ -755,7 +755,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT page
CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
{
- CPDFSDK_AnnotIterator annotIterator(this, FALSE);
+ CPDFSDK_AnnotIterator annotIterator(this, false);
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
CPDFSDK_Annot* pSDKAnnot = NULL;
@@ -775,12 +775,12 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pag
}
-FX_BOOL CPDFSDK_PageView::Annot_HasAppearance(CPDF_Annot* pAnnot)
+bool CPDFSDK_PageView::Annot_HasAppearance(CPDF_Annot* pAnnot)
{
CPDF_Dictionary* pAnnotDic = pAnnot->GetAnnotDict();
if(pAnnotDic)
return pAnnotDic->KeyExist("AS");
- return FALSE;
+ return false;
}
CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Annot * pPDFAnnot)
@@ -819,9 +819,9 @@ CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(const FX_CHAR* lpSubType,CPDF_Dictiona
return NULL;
}
-FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot)
+bool CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot)
{
- return FALSE;
+ return false;
}
CPDF_Document* CPDFSDK_PageView::GetPDFDocument()
@@ -861,7 +861,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByDict(CPDF_Dictionary * pDict)
return NULL;
}
-FX_BOOL CPDFSDK_PageView::OnLButtonDown(const CPDF_Point & point, FX_UINT nFlag)
+bool CPDFSDK_PageView::OnLButtonDown(const CPDF_Point & point, FX_UINT nFlag)
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
ASSERT(pEnv);
@@ -875,18 +875,18 @@ FX_BOOL CPDFSDK_PageView::OnLButtonDown(const CPDF_Point & point, FX_UINT nFlag)
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
ASSERT(pAnnotHandlerMgr);
- FX_BOOL bRet = pAnnotHandlerMgr->Annot_OnLButtonDown(this, pFXAnnot, nFlag,point);
+ bool bRet = pAnnotHandlerMgr->Annot_OnLButtonDown(this, pFXAnnot, nFlag,point);
if(bRet)
{
SetFocusAnnot(pFXAnnot);
}
return bRet;
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag)
+bool CPDFSDK_PageView::OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag)
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
ASSERT(pEnv);
@@ -894,7 +894,7 @@ FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag)
ASSERT(pAnnotHandlerMgr);
CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y);
CPDFSDK_Annot* pFocusAnnot = GetFocusAnnot();
- FX_BOOL bRet = FALSE;
+ bool bRet = false;
if(pFocusAnnot && pFocusAnnot != pFXAnnot)
{
//Last focus Annot gets a chance to handle the event.
@@ -908,7 +908,7 @@ FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag)
return bRet;
}
-FX_BOOL CPDFSDK_PageView::OnMouseMove(const CPDF_Point & point, int nFlag)
+bool CPDFSDK_PageView::OnMouseMove(const CPDF_Point & point, int nFlag)
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
@@ -918,36 +918,36 @@ FX_BOOL CPDFSDK_PageView::OnMouseMove(const CPDF_Point & point, int nFlag)
{
if(m_CaptureWidget && m_CaptureWidget != pFXAnnot)
{
- m_bExitWidget = TRUE;
- m_bEnterWidget = FALSE;
+ m_bExitWidget = true;
+ m_bEnterWidget = false;
pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
}
m_CaptureWidget = (CPDFSDK_Widget*)pFXAnnot;
- m_bOnWidget = TRUE;
+ m_bOnWidget = true;
if(!m_bEnterWidget)
{
- m_bEnterWidget = TRUE;
- m_bExitWidget = FALSE;
+ m_bEnterWidget = true;
+ m_bExitWidget = false;
pAnnotHandlerMgr->Annot_OnMouseEnter(this, pFXAnnot,nFlag);
}
pAnnotHandlerMgr->Annot_OnMouseMove(this, pFXAnnot, nFlag, point);
- return TRUE;
+ return true;
}
if(m_bOnWidget)
{
- m_bOnWidget = FALSE;
- m_bExitWidget = TRUE;
- m_bEnterWidget = FALSE;
+ m_bOnWidget = false;
+ m_bExitWidget = true;
+ m_bEnterWidget = false;
if(m_CaptureWidget)
{
pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
m_CaptureWidget = NULL;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_PageView::OnMouseWheel(double deltaX, double deltaY,const CPDF_Point& point, int nFlag)
+bool CPDFSDK_PageView::OnMouseWheel(double deltaX, double deltaY,const CPDF_Point& point, int nFlag)
{
if(CPDFSDK_Annot* pAnnot = GetFXWidgetAtPoint(point.x, point.y))
{
@@ -956,11 +956,11 @@ FX_BOOL CPDFSDK_PageView::OnMouseWheel(double deltaX, double deltaY,const CPDF_P
ASSERT(pAnnotHandlerMgr);
return pAnnotHandlerMgr->Annot_OnMouseWheel(this, pAnnot, nFlag, (int)deltaY, point);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_PageView::OnChar(int nChar, FX_UINT nFlag)
+bool CPDFSDK_PageView::OnChar(int nChar, FX_UINT nFlag)
{
if(CPDFSDK_Annot* pAnnot = GetFocusAnnot())
{
@@ -970,10 +970,10 @@ FX_BOOL CPDFSDK_PageView::OnChar(int nChar, FX_UINT nFlag)
return pAnnotHandlerMgr->Annot_OnChar(pAnnot, nChar, nFlag);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_PageView::OnKeyDown(int nKeyCode, int nFlag)
+bool CPDFSDK_PageView::OnKeyDown(int nKeyCode, int nFlag)
{
if(CPDFSDK_Annot* pAnnot = GetFocusAnnot())
{
@@ -982,17 +982,17 @@ FX_BOOL CPDFSDK_PageView::OnKeyDown(int nKeyCode, int nFlag)
ASSERT(pAnnotHandlerMgr);
return pAnnotHandlerMgr->Annot_OnKeyDown(pAnnot, nKeyCode, nFlag);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPDFSDK_PageView::OnKeyUp(int nKeyCode, int nFlag)
+bool CPDFSDK_PageView::OnKeyUp(int nKeyCode, int nFlag)
{
// if(CPDFSDK_Annot* pAnnot = GetFocusAnnot())
// {
// CFFL_IFormFiller* pIFormFiller = g_pFormFillApp->GetIFormFiller();
// return pIFormFiller->OnKeyUp(pAnnot, nKeyCode, nFlag);
// }
- return FALSE;
+ return false;
}
extern void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot);
@@ -1001,13 +1001,13 @@ void CPDFSDK_PageView::LoadFXAnnots()
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- FX_BOOL enableAPUpdate = CPDF_InterForm::UpdatingAPEnabled();
+ bool enableAPUpdate = CPDF_InterForm::UpdatingAPEnabled();
//Disable the default AP construction.
- CPDF_InterForm::EnableUpdateAP(FALSE);
+ CPDF_InterForm::EnableUpdateAP(false);
m_pAnnotList = new CPDF_AnnotList(m_page);
CPDF_InterForm::EnableUpdateAP(enableAPUpdate);
int nCount = m_pAnnotList->Count();
- SetLock(TRUE);
+ SetLock(true);
for(int i=0; i<nCount; i++)
{
CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i);
@@ -1029,7 +1029,7 @@ void CPDFSDK_PageView::LoadFXAnnots()
}
}
- SetLock(FALSE);
+ SetLock(false);
}
void CPDFSDK_PageView::UpdateRects(CFX_RectArray& rects)
@@ -1064,16 +1064,16 @@ int CPDFSDK_PageView::GetPageIndex()
return -1;
}
-FX_BOOL CPDFSDK_PageView::IsValidAnnot(void* p)
+bool CPDFSDK_PageView::IsValidAnnot(void* p)
{
- if (p == NULL) return FALSE;
+ if (p == NULL) return false;
int iCount = m_pAnnotList->Count();
for (int i = 0; i < iCount; i++)
{
if (m_pAnnotList->GetAt(i) == p)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
diff --git a/fpdfsdk/src/fsdk_rendercontext.cpp b/fpdfsdk/src/fsdk_rendercontext.cpp
index f96db94150..2bc3ea812b 100644
--- a/fpdfsdk/src/fsdk_rendercontext.cpp
+++ b/fpdfsdk/src/fsdk_rendercontext.cpp
@@ -38,10 +38,10 @@ IFSDK_PAUSE_Adapter::IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause )
m_IPause = IPause;
}
-FX_BOOL IFSDK_PAUSE_Adapter::NeedToPauseNow()
+bool IFSDK_PAUSE_Adapter::NeedToPauseNow()
{
if (m_IPause->NeedToPauseNow) {
return m_IPause->NeedToPauseNow(m_IPause);
}
- return FALSE;
+ return false;
}
diff --git a/fpdfsdk/src/fxedit/fxet_ap.cpp b/fpdfsdk/src/fxedit/fxet_ap.cpp
index 309a98f41e..7f2843cc29 100644
--- a/fpdfsdk/src/fxedit/fxet_ap.cpp
+++ b/fpdfsdk/src/fxedit/fxet_ap.cpp
@@ -66,7 +66,7 @@ static CFX_ByteString GetFontSetString(IFX_Edit_FontMap * pFontMap, int32_t nFon
}
CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
- const CPVT_WordRange * pRange /* = NULL*/, FX_BOOL bContinuous/* = TRUE*/, FX_WORD SubWord/* = 0*/)
+ const CPVT_WordRange * pRange /* = NULL*/, bool bContinuous/* = true*/, FX_WORD SubWord/* = 0*/)
{
CFX_ByteTextBuf sEditStream, sWords;
diff --git a/fpdfsdk/src/fxedit/fxet_edit.cpp b/fpdfsdk/src/fxedit/fxet_edit.cpp
index 63115c2626..b1ad59dedb 100644
--- a/fpdfsdk/src/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/src/fxedit/fxet_edit.cpp
@@ -21,70 +21,70 @@ CFX_Edit_Iterator::~CFX_Edit_Iterator()
{
}
-FX_BOOL CFX_Edit_Iterator::NextWord()
+bool CFX_Edit_Iterator::NextWord()
{
return m_pVTIterator->NextWord();
}
-FX_BOOL CFX_Edit_Iterator::NextLine()
+bool CFX_Edit_Iterator::NextLine()
{
return m_pVTIterator->NextLine();
}
-FX_BOOL CFX_Edit_Iterator::NextSection()
+bool CFX_Edit_Iterator::NextSection()
{
return m_pVTIterator->NextSection();
}
-FX_BOOL CFX_Edit_Iterator::PrevWord()
+bool CFX_Edit_Iterator::PrevWord()
{
return m_pVTIterator->PrevWord();
}
-FX_BOOL CFX_Edit_Iterator::PrevLine()
+bool CFX_Edit_Iterator::PrevLine()
{
return m_pVTIterator->PrevLine();
}
-FX_BOOL CFX_Edit_Iterator::PrevSection()
+bool CFX_Edit_Iterator::PrevSection()
{
return m_pVTIterator->PrevSection();
}
-FX_BOOL CFX_Edit_Iterator::GetWord(CPVT_Word & word) const
+bool CFX_Edit_Iterator::GetWord(CPVT_Word & word) const
{
ASSERT(m_pEdit);
if (m_pVTIterator->GetWord(word))
{
word.ptWord = m_pEdit->VTToEdit(word.ptWord);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_Edit_Iterator::GetLine(CPVT_Line & line) const
+bool CFX_Edit_Iterator::GetLine(CPVT_Line & line) const
{
ASSERT(m_pEdit);
if (m_pVTIterator->GetLine(line))
{
line.ptLine = m_pEdit->VTToEdit(line.ptLine);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_Edit_Iterator::GetSection(CPVT_Section & section) const
+bool CFX_Edit_Iterator::GetSection(CPVT_Section & section) const
{
ASSERT(m_pEdit);
if (m_pVTIterator->GetSection(section))
{
section.rcSection = m_pEdit->VTToEdit(section.rcSection);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CFX_Edit_Iterator::SetAt(int32_t nWordIndex)
@@ -167,7 +167,7 @@ int32_t CFX_Edit_Provider::GetDefaultFontIndex()
return 0;
}
-FX_BOOL CFX_Edit_Provider::IsLatinWord(FX_WORD word)
+bool CFX_Edit_Provider::IsLatinWord(FX_WORD word)
{
return FX_EDIT_ISLATINWORD(word);
}
@@ -210,7 +210,7 @@ void CFX_Edit_Refresh::NoAnalyse()
void CFX_Edit_Refresh::Analyse(int32_t nAlignment)
{
- FX_BOOL bLineTopChanged = FALSE;
+ bool bLineTopChanged = false;
CPDF_Rect rcResult;
FX_FLOAT fWidthDiff;
@@ -238,7 +238,7 @@ void CFX_Edit_Refresh::Analyse(int32_t nAlignment)
{
if (!pNewRect->IsSameTop(*pOldRect) || !pNewRect->IsSameHeight(*pOldRect))
{
- bLineTopChanged = TRUE;
+ bLineTopChanged = true;
continue;
}
@@ -324,9 +324,9 @@ void CFX_Edit_Refresh::EndRefresh()
CFX_Edit_Undo::CFX_Edit_Undo(int32_t nBufsize) : m_nCurUndoPos(0),
m_nBufSize(nBufsize),
- m_bModified(FALSE),
- m_bVirgin(TRUE),
- m_bWorking(FALSE)
+ m_bModified(false),
+ m_bVirgin(true),
+ m_bWorking(false)
{
}
@@ -335,14 +335,14 @@ CFX_Edit_Undo::~CFX_Edit_Undo()
Reset();
}
-FX_BOOL CFX_Edit_Undo::CanUndo() const
+bool CFX_Edit_Undo::CanUndo() const
{
return m_nCurUndoPos > 0;
}
void CFX_Edit_Undo::Undo()
{
- m_bWorking = TRUE;
+ m_bWorking = true;
if (m_nCurUndoPos > 0)
{
@@ -355,17 +355,17 @@ void CFX_Edit_Undo::Undo()
m_bModified = (m_nCurUndoPos != 0);
}
- m_bWorking = FALSE;
+ m_bWorking = false;
}
-FX_BOOL CFX_Edit_Undo::CanRedo() const
+bool CFX_Edit_Undo::CanRedo() const
{
return m_nCurUndoPos < m_UndoItemStack.GetSize();
}
void CFX_Edit_Undo::Redo()
{
- m_bWorking = TRUE;
+ m_bWorking = true;
int32_t nStackSize = m_UndoItemStack.GetSize();
@@ -380,10 +380,10 @@ void CFX_Edit_Undo::Redo()
m_bModified = (m_nCurUndoPos != 0);
}
- m_bWorking = FALSE;
+ m_bWorking = false;
}
-FX_BOOL CFX_Edit_Undo::IsWorking() const
+bool CFX_Edit_Undo::IsWorking() const
{
return m_bWorking;
}
@@ -400,7 +400,7 @@ void CFX_Edit_Undo::AddItem(IFX_Edit_UndoItem* pItem)
if (m_UndoItemStack.GetSize() >= m_nBufSize)
{
RemoveHeads();
- m_bVirgin = FALSE;
+ m_bVirgin = false;
}
m_UndoItemStack.Add(pItem);
@@ -409,9 +409,9 @@ void CFX_Edit_Undo::AddItem(IFX_Edit_UndoItem* pItem)
m_bModified = (m_nCurUndoPos != 0);
}
-FX_BOOL CFX_Edit_Undo::IsModified() const
+bool CFX_Edit_Undo::IsModified() const
{
- return m_bVirgin ? m_bModified : TRUE;
+ return m_bVirgin ? m_bModified : true;
}
IFX_Edit_UndoItem* CFX_Edit_Undo::GetItem(int32_t nIndex)
@@ -469,8 +469,8 @@ void CFX_Edit_GroupUndoItem::AddUndoItem(CFX_Edit_UndoItem* pUndoItem)
{
ASSERT(pUndoItem != NULL);
- pUndoItem->SetFirst(FALSE);
- pUndoItem->SetLast(FALSE);
+ pUndoItem->SetFirst(false);
+ pUndoItem->SetLast(false);
m_Items.Add(pUndoItem);
@@ -484,11 +484,11 @@ void CFX_Edit_GroupUndoItem::UpdateItems()
{
CFX_Edit_UndoItem* pFirstItem = m_Items[0];
ASSERT(pFirstItem != NULL);
- pFirstItem->SetFirst(TRUE);
+ pFirstItem->SetFirst(true);
CFX_Edit_UndoItem* pLastItem = m_Items[m_Items.GetSize() - 1];
ASSERT(pLastItem != NULL);
- pLastItem->SetLast(TRUE);
+ pLastItem->SetLast(true);
}
}
@@ -539,7 +539,7 @@ void CFXEU_InsertWord::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpOld);
- m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE);
+ m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,false,true);
}
}
@@ -549,7 +549,7 @@ void CFXEU_InsertWord::Undo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpNew);
- m_pEdit->Backspace(FALSE,TRUE);
+ m_pEdit->Backspace(false,true);
}
}
@@ -579,7 +579,7 @@ void CFXEU_InsertReturn::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpOld);
- m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,TRUE);
+ m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,false,true);
}
}
@@ -589,7 +589,7 @@ void CFXEU_InsertReturn::Undo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpNew);
- m_pEdit->Backspace(FALSE,TRUE);
+ m_pEdit->Backspace(false,true);
}
}
@@ -619,7 +619,7 @@ void CFXEU_Backspace::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpOld);
- m_pEdit->Backspace(FALSE,TRUE);
+ m_pEdit->Backspace(false,true);
}
}
@@ -631,11 +631,11 @@ void CFXEU_Backspace::Undo()
m_pEdit->SetCaret(m_wpNew);
if (m_wpNew.SecCmp(m_wpOld) != 0)
{
- m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,TRUE);
+ m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,false,true);
}
else
{
- m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE);
+ m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,false,true);
}
}
}
@@ -645,7 +645,7 @@ void CFXEU_Backspace::Undo()
CFXEU_Delete::CFXEU_Delete(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
FX_WORD word, int32_t charset,
- const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, FX_BOOL bSecEnd) :
+ const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, bool bSecEnd) :
m_pEdit(pEdit),
m_wpOld(wpOldPlace),
m_wpNew(wpNewPlace),
@@ -667,7 +667,7 @@ void CFXEU_Delete::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpOld);
- m_pEdit->Delete(FALSE,TRUE);
+ m_pEdit->Delete(false,true);
}
}
@@ -679,11 +679,11 @@ void CFXEU_Delete::Undo()
m_pEdit->SetCaret(m_wpNew);
if (m_bSecEnd)
{
- m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,TRUE);
+ m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,false,true);
}
else
{
- m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE);
+ m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,false,true);
}
}
}
@@ -708,7 +708,7 @@ void CFXEU_Clear::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
- m_pEdit->Clear(FALSE,TRUE);
+ m_pEdit->Clear(false,true);
}
}
@@ -718,7 +718,7 @@ void CFXEU_Clear::Undo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wrSel.BeginPos);
- m_pEdit->InsertText(m_swText.c_str(), DEFAULT_CHARSET, NULL, NULL, FALSE, TRUE);
+ m_pEdit->InsertText(m_swText.c_str(), DEFAULT_CHARSET, NULL, NULL, false, true);
m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
}
}
@@ -750,7 +750,7 @@ void CFXEU_ClearRich::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
- m_pEdit->Clear(FALSE,TRUE);
+ m_pEdit->Clear(false,true);
}
}
@@ -762,11 +762,11 @@ void CFXEU_ClearRich::Undo()
m_pEdit->SetCaret(m_wpOld);
if (m_wpNew.SecCmp(m_wpOld) != 0)
{
- m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,FALSE);
+ m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,false,false);
}
else
{
- m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,FALSE);
+ m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,false,false);
}
if (IsFirst())
@@ -806,7 +806,7 @@ void CFXEU_InsertText::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpOld);
- m_pEdit->InsertText(m_swText.c_str(), m_nCharset, &m_SecProps, &m_WordProps, FALSE, TRUE);
+ m_pEdit->InsertText(m_swText.c_str(), m_nCharset, &m_SecProps, &m_WordProps, false, true);
}
}
@@ -816,7 +816,7 @@ void CFXEU_InsertText::Undo()
{
m_pEdit->SelectNone();
m_pEdit->SetSel(m_wpOld,m_wpNew);
- m_pEdit->Clear(FALSE,TRUE);
+ m_pEdit->Clear(false,true);
}
}
@@ -844,7 +844,7 @@ void CFXEU_SetSecProps::Redo()
{
if (m_pEdit)
{
- m_pEdit->SetSecProps(m_eProps,m_wpPlace,&m_NewSecProps,&m_NewWordProps,m_wrPlace,FALSE);
+ m_pEdit->SetSecProps(m_eProps,m_wpPlace,&m_NewSecProps,&m_NewWordProps,m_wrPlace,false);
if (IsLast())
{
m_pEdit->SelectNone();
@@ -858,7 +858,7 @@ void CFXEU_SetSecProps::Undo()
{
if (m_pEdit)
{
- m_pEdit->SetSecProps(m_eProps,m_wpPlace,&m_OldSecProps,&m_OldWordProps,m_wrPlace,FALSE);
+ m_pEdit->SetSecProps(m_eProps,m_wpPlace,&m_OldSecProps,&m_OldWordProps,m_wrPlace,false);
if (IsFirst())
{
m_pEdit->SelectNone();
@@ -889,7 +889,7 @@ void CFXEU_SetWordProps::Redo()
{
if (m_pEdit)
{
- m_pEdit->SetWordProps(m_eProps,m_wpPlace,&m_NewWordProps,m_wrPlace,FALSE);
+ m_pEdit->SetWordProps(m_eProps,m_wpPlace,&m_NewWordProps,m_wrPlace,false);
if (IsLast())
{
m_pEdit->SelectNone();
@@ -903,7 +903,7 @@ void CFXEU_SetWordProps::Undo()
{
if (m_pEdit)
{
- m_pEdit->SetWordProps(m_eProps,m_wpPlace,&m_OldWordProps,m_wrPlace,FALSE);
+ m_pEdit->SetWordProps(m_eProps,m_wpPlace,&m_OldWordProps,m_wrPlace,false);
if (IsFirst())
{
m_pEdit->SelectNone();
@@ -925,18 +925,18 @@ CFX_Edit::CFX_Edit(IPDF_VariableText * pVT) :
m_SelState(),
m_ptScrollPos(0,0),
m_ptRefreshScrollPos(0,0),
- m_bEnableScroll(FALSE),
+ m_bEnableScroll(false),
m_pIterator(NULL),
m_ptCaret(0.0f,0.0f),
m_Undo(FX_EDIT_UNDO_MAXITEM),
m_nAlignment(0),
- m_bNotifyFlag(FALSE),
- m_bEnableOverflow(FALSE),
- m_bEnableRefresh(TRUE),
+ m_bNotifyFlag(false),
+ m_bEnableOverflow(false),
+ m_bEnableRefresh(true),
m_rcOldContent(0.0f,0.0f,0.0f,0.0f),
- m_bEnableUndo(TRUE),
- m_bNotify(TRUE),
- m_bOprNotify(FALSE),
+ m_bEnableUndo(true),
+ m_bNotify(true),
+ m_bOprNotify(false),
m_pGroupUndoItem(NULL)
{
ASSERT(pVT != NULL);
@@ -1002,92 +1002,92 @@ IFX_Edit_FontMap* CFX_Edit::GetFontMap()
return NULL;
}
-void CFX_Edit::SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetPlateRect(const CPDF_Rect & rect, bool bPaint/* = true*/)
{
m_pVT->SetPlateRect(rect);
m_ptScrollPos = CPDF_Point(rect.left,rect.top);
if (bPaint) Paint();
}
-void CFX_Edit::SetAlignmentH(int32_t nFormat/* =0 */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetAlignmentH(int32_t nFormat/* =0 */, bool bPaint/* = true*/)
{
m_pVT->SetAlignment(nFormat);
if (bPaint) Paint();
}
-void CFX_Edit::SetAlignmentV(int32_t nFormat/* =0 */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetAlignmentV(int32_t nFormat/* =0 */, bool bPaint/* = true*/)
{
m_nAlignment = nFormat;
if (bPaint) Paint();
}
-void CFX_Edit::SetPasswordChar(FX_WORD wSubWord/* ='*' */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetPasswordChar(FX_WORD wSubWord/* ='*' */, bool bPaint/* = true*/)
{
m_pVT->SetPasswordChar(wSubWord);
if (bPaint) Paint();
}
-void CFX_Edit::SetLimitChar(int32_t nLimitChar/* =0 */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetLimitChar(int32_t nLimitChar/* =0 */, bool bPaint/* = true*/)
{
m_pVT->SetLimitChar(nLimitChar);
if (bPaint) Paint();
}
-void CFX_Edit::SetCharArray(int32_t nCharArray/* =0 */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetCharArray(int32_t nCharArray/* =0 */, bool bPaint/* = true*/)
{
m_pVT->SetCharArray(nCharArray);
if (bPaint) Paint();
}
-void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace/* =0.0f */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace/* =0.0f */, bool bPaint/* = true*/)
{
m_pVT->SetCharSpace(fCharSpace);
if (bPaint) Paint();
}
-void CFX_Edit::SetHorzScale(int32_t nHorzScale/* =100 */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetHorzScale(int32_t nHorzScale/* =100 */, bool bPaint/* = true*/)
{
m_pVT->SetHorzScale(nHorzScale);
if (bPaint) Paint();
}
-void CFX_Edit::SetMultiLine(FX_BOOL bMultiLine/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetMultiLine(bool bMultiLine/* =true */, bool bPaint/* = true*/)
{
m_pVT->SetMultiLine(bMultiLine);
if (bPaint) Paint();
}
-void CFX_Edit::SetAutoReturn(FX_BOOL bAuto/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetAutoReturn(bool bAuto/* =true */, bool bPaint/* = true*/)
{
m_pVT->SetAutoReturn(bAuto);
if (bPaint) Paint();
}
-void CFX_Edit::SetLineLeading(FX_FLOAT fLineLeading/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetLineLeading(FX_FLOAT fLineLeading/* =true */, bool bPaint/* = true*/)
{
m_pVT->SetLineLeading(fLineLeading);
if (bPaint) Paint();
}
-void CFX_Edit::SetAutoFontSize(FX_BOOL bAuto/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetAutoFontSize(bool bAuto/* =true */, bool bPaint/* = true*/)
{
m_pVT->SetAutoFontSize(bAuto);
if (bPaint) Paint();
}
-void CFX_Edit::SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetFontSize(FX_FLOAT fFontSize, bool bPaint/* = true*/)
{
m_pVT->SetFontSize(fFontSize);
if (bPaint) Paint();
}
-void CFX_Edit::SetAutoScroll(FX_BOOL bAuto/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetAutoScroll(bool bAuto/* =true */, bool bPaint/* = true*/)
{
m_bEnableScroll = bAuto;
if (bPaint) Paint();
}
-void CFX_Edit::SetTextOverflow(FX_BOOL bAllowed /*= FALSE*/, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetTextOverflow(bool bAllowed /*= false*/, bool bPaint/* = true*/)
{
m_bEnableOverflow = bAllowed;
if (bPaint) Paint();
@@ -1193,7 +1193,7 @@ CFX_WideString CFX_Edit::GetText() const
{
if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
{
- FX_BOOL bRich = m_pVT->IsRichText();
+ bool bRich = m_pVT->IsRichText();
pIterator->SetAt(0);
@@ -1235,7 +1235,7 @@ CFX_WideString CFX_Edit::GetRangeText(const CPVT_WordRange & range) const
if (m_pVT->IsValid())
{
- FX_BOOL bRich = m_pVT->IsRichText();
+ bool bRich = m_pVT->IsRichText();
if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
{
@@ -1331,46 +1331,46 @@ CPVT_WordRange CFX_Edit::CombineWordRange(const CPVT_WordRange & wr1, const CPVT
return wrRet;
}
-FX_BOOL CFX_Edit::IsRichText() const
+bool CFX_Edit::IsRichText() const
{
return m_pVT->IsRichText();
}
-void CFX_Edit::SetRichText(FX_BOOL bRichText/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
+void CFX_Edit::SetRichText(bool bRichText/* =true */, bool bPaint/* = true*/)
{
m_pVT->SetRichText(bRichText);
if (bPaint) Paint();
}
-FX_BOOL CFX_Edit::SetRichFontIndex(int32_t nFontIndex)
+bool CFX_Edit::SetRichFontIndex(int32_t nFontIndex)
{
CPVT_WordProps WordProps;
WordProps.nFontIndex = nFontIndex;
return SetRichTextProps(EP_FONTINDEX,NULL,&WordProps);
}
-FX_BOOL CFX_Edit::SetRichFontSize(FX_FLOAT fFontSize)
+bool CFX_Edit::SetRichFontSize(FX_FLOAT fFontSize)
{
CPVT_WordProps WordProps;
WordProps.fFontSize = fFontSize;
return SetRichTextProps(EP_FONTSIZE,NULL,&WordProps);
}
-FX_BOOL CFX_Edit::SetRichTextColor(FX_COLORREF dwColor)
+bool CFX_Edit::SetRichTextColor(FX_COLORREF dwColor)
{
CPVT_WordProps WordProps;
WordProps.dwWordColor = dwColor;
return SetRichTextProps(EP_WORDCOLOR,NULL,&WordProps);
}
-FX_BOOL CFX_Edit::SetRichTextScript(int32_t nScriptType)
+bool CFX_Edit::SetRichTextScript(int32_t nScriptType)
{
CPVT_WordProps WordProps;
WordProps.nScriptType = nScriptType;
return SetRichTextProps(EP_SCRIPTTYPE,NULL,&WordProps);
}
-FX_BOOL CFX_Edit::SetRichTextBold(FX_BOOL bBold)
+bool CFX_Edit::SetRichTextBold(bool bBold)
{
CPVT_WordProps WordProps;
if (bBold)
@@ -1378,7 +1378,7 @@ FX_BOOL CFX_Edit::SetRichTextBold(FX_BOOL bBold)
return SetRichTextProps(EP_BOLD,NULL,&WordProps);
}
-FX_BOOL CFX_Edit::SetRichTextItalic(FX_BOOL bItalic)
+bool CFX_Edit::SetRichTextItalic(bool bItalic)
{
CPVT_WordProps WordProps;
if (bItalic)
@@ -1386,7 +1386,7 @@ FX_BOOL CFX_Edit::SetRichTextItalic(FX_BOOL bItalic)
return SetRichTextProps(EP_ITALIC,NULL,&WordProps);
}
-FX_BOOL CFX_Edit::SetRichTextUnderline(FX_BOOL bUnderline)
+bool CFX_Edit::SetRichTextUnderline(bool bUnderline)
{
CPVT_WordProps WordProps;
if (bUnderline)
@@ -1394,7 +1394,7 @@ FX_BOOL CFX_Edit::SetRichTextUnderline(FX_BOOL bUnderline)
return SetRichTextProps(EP_UNDERLINE,NULL,&WordProps);
}
-FX_BOOL CFX_Edit::SetRichTextCrossout(FX_BOOL bCrossout)
+bool CFX_Edit::SetRichTextCrossout(bool bCrossout)
{
CPVT_WordProps WordProps;
if (bCrossout)
@@ -1402,45 +1402,45 @@ FX_BOOL CFX_Edit::SetRichTextCrossout(FX_BOOL bCrossout)
return SetRichTextProps(EP_CROSSOUT,NULL,&WordProps);
}
-FX_BOOL CFX_Edit::SetRichTextCharSpace(FX_FLOAT fCharSpace)
+bool CFX_Edit::SetRichTextCharSpace(FX_FLOAT fCharSpace)
{
CPVT_WordProps WordProps;
WordProps.fCharSpace = fCharSpace;
return SetRichTextProps(EP_CHARSPACE,NULL,&WordProps);
}
-FX_BOOL CFX_Edit::SetRichTextHorzScale(int32_t nHorzScale /*= 100*/)
+bool CFX_Edit::SetRichTextHorzScale(int32_t nHorzScale /*= 100*/)
{
CPVT_WordProps WordProps;
WordProps.nHorzScale = nHorzScale;
return SetRichTextProps(EP_HORZSCALE,NULL,&WordProps);
}
-FX_BOOL CFX_Edit::SetRichTextLineLeading(FX_FLOAT fLineLeading)
+bool CFX_Edit::SetRichTextLineLeading(FX_FLOAT fLineLeading)
{
CPVT_SecProps SecProps;
SecProps.fLineLeading = fLineLeading;
return SetRichTextProps(EP_LINELEADING,&SecProps,NULL);
}
-FX_BOOL CFX_Edit::SetRichTextLineIndent(FX_FLOAT fLineIndent)
+bool CFX_Edit::SetRichTextLineIndent(FX_FLOAT fLineIndent)
{
CPVT_SecProps SecProps;
SecProps.fLineIndent = fLineIndent;
return SetRichTextProps(EP_LINEINDENT,&SecProps,NULL);
}
-FX_BOOL CFX_Edit::SetRichTextAlignment(int32_t nAlignment)
+bool CFX_Edit::SetRichTextAlignment(int32_t nAlignment)
{
CPVT_SecProps SecProps;
SecProps.nAlignment = nAlignment;
return SetRichTextProps(EP_ALIGNMENT,&SecProps,NULL);
}
-FX_BOOL CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps)
+bool CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps)
{
- FX_BOOL bSet = FALSE;
- FX_BOOL bSet1,bSet2;
+ bool bSet = false;
+ bool bSet1,bSet2;
if (m_pVT->IsValid() && m_pVT->IsRichText())
{
if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
@@ -1453,14 +1453,14 @@ FX_BOOL CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pS
BeginGroupUndo(L"");;
- bSet = SetSecProps(eProps,wrTemp.BeginPos,pSecProps,pWordProps,wrTemp,TRUE);
+ bSet = SetSecProps(eProps,wrTemp.BeginPos,pSecProps,pWordProps,wrTemp,true);
while (pIterator->NextWord())
{
CPVT_WordPlace place = pIterator->GetAt();
if (place.WordCmp(wrTemp.EndPos) > 0) break;
- bSet1 = SetSecProps(eProps,place,pSecProps,pWordProps,wrTemp,TRUE);
- bSet2 = SetWordProps(eProps,place,pWordProps,wrTemp,TRUE);
+ bSet1 = SetSecProps(eProps,place,pSecProps,pWordProps,wrTemp,true);
+ bSet2 = SetWordProps(eProps,place,pWordProps,wrTemp,true);
if (!bSet)
bSet = (bSet1 || bSet2);
@@ -1516,15 +1516,15 @@ void CFX_Edit::PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr)
}
}
-FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
+bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps,
- const CPVT_WordRange & wr, FX_BOOL bAddUndo)
+ const CPVT_WordRange & wr, bool bAddUndo)
{
if (m_pVT->IsValid() && m_pVT->IsRichText())
{
if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
{
- FX_BOOL bSet = FALSE;
+ bool bSet = false;
CPVT_Section secinfo;
CPVT_Section OldSecinfo;
@@ -1545,21 +1545,21 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if (!FX_EDIT_IsFloatEqual(secinfo.SecProps.fLineLeading,pSecProps->fLineLeading))
{
secinfo.SecProps.fLineLeading = pSecProps->fLineLeading;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_LINEINDENT:
if (!FX_EDIT_IsFloatEqual(secinfo.SecProps.fLineIndent,pSecProps->fLineIndent))
{
secinfo.SecProps.fLineIndent = pSecProps->fLineIndent;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_ALIGNMENT:
if (secinfo.SecProps.nAlignment != pSecProps->nAlignment)
{
secinfo.SecProps.nAlignment = pSecProps->nAlignment;
- bSet = TRUE;
+ bSet = true;
}
break;
default:
@@ -1583,42 +1583,42 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if (secinfo.WordProps.nFontIndex != pWordProps->nFontIndex)
{
secinfo.WordProps.nFontIndex = pWordProps->nFontIndex;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_FONTSIZE:
if (!FX_EDIT_IsFloatEqual(secinfo.WordProps.fFontSize,pWordProps->fFontSize))
{
secinfo.WordProps.fFontSize = pWordProps->fFontSize;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_WORDCOLOR:
if (secinfo.WordProps.dwWordColor != pWordProps->dwWordColor)
{
secinfo.WordProps.dwWordColor = pWordProps->dwWordColor;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_SCRIPTTYPE:
if (secinfo.WordProps.nScriptType != pWordProps->nScriptType)
{
secinfo.WordProps.nScriptType = pWordProps->nScriptType;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_CHARSPACE:
if (!FX_EDIT_IsFloatEqual(secinfo.WordProps.fCharSpace,pWordProps->fCharSpace))
{
secinfo.WordProps.fCharSpace = pWordProps->fCharSpace;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_HORZSCALE:
if (secinfo.WordProps.nHorzScale != pWordProps->nHorzScale)
{
secinfo.WordProps.nHorzScale = pWordProps->nHorzScale;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_UNDERLINE:
@@ -1627,7 +1627,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) == 0)
{
secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE;
- bSet = TRUE;
+ bSet = true;
}
}
else
@@ -1635,7 +1635,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) != 0)
{
secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_UNDERLINE;
- bSet = TRUE;
+ bSet = true;
}
}
break;
@@ -1645,7 +1645,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) == 0)
{
secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT;
- bSet = TRUE;
+ bSet = true;
}
}
else
@@ -1653,7 +1653,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) != 0)
{
secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_CROSSOUT;
- bSet = TRUE;
+ bSet = true;
}
}
break;
@@ -1663,7 +1663,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) == 0)
{
secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_BOLD;
- bSet = TRUE;
+ bSet = true;
}
}
else
@@ -1671,7 +1671,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) != 0)
{
secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_BOLD;
- bSet = TRUE;
+ bSet = true;
}
}
break;
@@ -1681,7 +1681,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) == 0)
{
secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC;
- bSet = TRUE;
+ bSet = true;
}
}
else
@@ -1689,7 +1689,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) != 0)
{
secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_ITALIC;
- bSet = TRUE;
+ bSet = true;
}
}
break;
@@ -1717,17 +1717,17 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
- const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo)
+bool CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
+ const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, bool bAddUndo)
{
if (m_pVT->IsValid() && m_pVT->IsRichText())
{
if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
{
- FX_BOOL bSet = FALSE;
+ bool bSet = false;
CPVT_Word wordinfo;
CPVT_Word OldWordinfo;
@@ -1749,42 +1749,42 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place
{
wordinfo.WordProps.nFontIndex = pFontMap->GetWordFontIndex(wordinfo.Word,wordinfo.nCharset,pWordProps->nFontIndex);
}
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_FONTSIZE:
if (!FX_EDIT_IsFloatEqual(wordinfo.WordProps.fFontSize,pWordProps->fFontSize))
{
wordinfo.WordProps.fFontSize = pWordProps->fFontSize;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_WORDCOLOR:
if (wordinfo.WordProps.dwWordColor != pWordProps->dwWordColor)
{
wordinfo.WordProps.dwWordColor = pWordProps->dwWordColor;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_SCRIPTTYPE:
if (wordinfo.WordProps.nScriptType != pWordProps->nScriptType)
{
wordinfo.WordProps.nScriptType = pWordProps->nScriptType;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_CHARSPACE:
if (!FX_EDIT_IsFloatEqual(wordinfo.WordProps.fCharSpace,pWordProps->fCharSpace))
{
wordinfo.WordProps.fCharSpace = pWordProps->fCharSpace;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_HORZSCALE:
if (wordinfo.WordProps.nHorzScale != pWordProps->nHorzScale)
{
wordinfo.WordProps.nHorzScale = pWordProps->nHorzScale;
- bSet = TRUE;
+ bSet = true;
}
break;
case EP_UNDERLINE:
@@ -1793,7 +1793,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) == 0)
{
wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE;
- bSet = TRUE;
+ bSet = true;
}
}
else
@@ -1801,7 +1801,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) != 0)
{
wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_UNDERLINE;
- bSet = TRUE;
+ bSet = true;
}
}
break;
@@ -1811,7 +1811,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) == 0)
{
wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT;
- bSet = TRUE;
+ bSet = true;
}
}
else
@@ -1819,7 +1819,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) != 0)
{
wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_CROSSOUT;
- bSet = TRUE;
+ bSet = true;
}
}
break;
@@ -1829,7 +1829,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) == 0)
{
wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_BOLD;
- bSet = TRUE;
+ bSet = true;
}
}
else
@@ -1837,7 +1837,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) != 0)
{
wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_BOLD;
- bSet = TRUE;
+ bSet = true;
}
}
break;
@@ -1847,7 +1847,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) == 0)
{
wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC;
- bSet = TRUE;
+ bSet = true;
}
}
else
@@ -1855,7 +1855,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) != 0)
{
wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_ITALIC;
- bSet = TRUE;
+ bSet = true;
}
}
break;
@@ -1881,44 +1881,44 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place
}
}
- return FALSE;
+ return false;
}
void CFX_Edit::SetText(const FX_WCHAR* text,int32_t charset /*= DEFAULT_CHARSET*/,
const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
{
- SetText(text,charset,pSecProps,pWordProps,TRUE,TRUE);
+ SetText(text,charset,pSecProps,pWordProps,true,true);
}
-FX_BOOL CFX_Edit::InsertWord(FX_WORD word, int32_t charset /*= DEFAULT_CHARSET*/, const CPVT_WordProps * pWordProps /*= NULL*/)
+bool CFX_Edit::InsertWord(FX_WORD word, int32_t charset /*= DEFAULT_CHARSET*/, const CPVT_WordProps * pWordProps /*= NULL*/)
{
- return InsertWord(word,charset,pWordProps,TRUE,TRUE);
+ return InsertWord(word,charset,pWordProps,true,true);
}
-FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
+bool CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
{
- return InsertReturn(pSecProps,pWordProps,TRUE,TRUE);
+ return InsertReturn(pSecProps,pWordProps,true,true);
}
-FX_BOOL CFX_Edit::Backspace()
+bool CFX_Edit::Backspace()
{
- return Backspace(TRUE,TRUE);
+ return Backspace(true,true);
}
-FX_BOOL CFX_Edit::Delete()
+bool CFX_Edit::Delete()
{
- return Delete(TRUE,TRUE);
+ return Delete(true,true);
}
-FX_BOOL CFX_Edit::Clear()
+bool CFX_Edit::Clear()
{
- return Clear(TRUE,TRUE);
+ return Clear(true,true);
}
-FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset /*= DEFAULT_CHARSET*/,
+bool CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset /*= DEFAULT_CHARSET*/,
const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
{
- return InsertText(text,charset,pSecProps,pWordProps,TRUE,TRUE);
+ return InsertText(text,charset,pSecProps,pWordProps,true,true);
}
FX_FLOAT CFX_Edit::GetFontSize() const
@@ -2039,9 +2039,9 @@ void CFX_Edit::SetContentChanged()
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
m_pNotify->IOnContentChange(rcContent);
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
m_rcOldContent = rcContent;
}
@@ -2075,7 +2075,7 @@ void CFX_Edit::SelectNone()
}
}
-FX_BOOL CFX_Edit::IsSelected() const
+bool CFX_Edit::IsSelected() const
{
return m_SelState.IsExist();
}
@@ -2153,13 +2153,13 @@ void CFX_Edit::SetScrollInfo()
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
m_pNotify->IOnSetScrollInfoX(rcPlate.left, rcPlate.right,
rcContent.left, rcContent.right, rcPlate.Width() / 3, rcPlate.Width());
m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top,
rcContent.bottom, rcContent.top, rcPlate.Height() / 3, rcPlate.Height());
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
}
}
@@ -2179,9 +2179,9 @@ void CFX_Edit::SetScrollPosX(FX_FLOAT fx)
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
m_pNotify->IOnSetScrollPosX(fx);
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
}
}
@@ -2203,9 +2203,9 @@ void CFX_Edit::SetScrollPosY(FX_FLOAT fy)
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
m_pNotify->IOnSetScrollPosY(fy);
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
}
}
@@ -2373,13 +2373,13 @@ void CFX_Edit::Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1,const
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
if (const CFX_Edit_RectArray * pRects = m_Refresh.GetRefreshRects())
{
for (int32_t i = 0, sz = pRects->GetSize(); i < sz; i++)
m_pNotify->IOnInvalidateRect(pRects->GetAt(i));
}
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
}
@@ -2499,10 +2499,10 @@ void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr)
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
CPDF_Rect rcRefresh = VTToEdit(rcWord);
m_pNotify->IOnInvalidateRect(&rcRefresh);
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
}
}
@@ -2517,10 +2517,10 @@ void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr)
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
CPDF_Rect rcRefresh = VTToEdit(rcLine);
m_pNotify->IOnInvalidateRect(&rcRefresh);
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
}
@@ -2565,9 +2565,9 @@ void CFX_Edit::SetCaretInfo()
}
}
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
m_pNotify->IOnSetCaret(!m_SelState.IsExist(),VTToEdit(ptHead),VTToEdit(ptFoot), m_wpCaret);
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
}
@@ -2603,9 +2603,9 @@ void CFX_Edit::SetCaretChange()
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
m_pNotify->IOnCaretChange(SecProps,WordProps);
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
}
}
@@ -2624,7 +2624,7 @@ void CFX_Edit::SetCaret(int32_t nPos)
}
}
-void CFX_Edit::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_Edit::OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2638,7 +2638,7 @@ void CFX_Edit::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl
}
}
-void CFX_Edit::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_Edit::OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2657,7 +2657,7 @@ void CFX_Edit::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl
}
}
-void CFX_Edit::OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_Edit::OnVK_UP(bool bShift,bool bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2688,7 +2688,7 @@ void CFX_Edit::OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl)
}
}
-void CFX_Edit::OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_Edit::OnVK_DOWN(bool bShift,bool bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2719,7 +2719,7 @@ void CFX_Edit::OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl)
}
}
-void CFX_Edit::OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_Edit::OnVK_LEFT(bool bShift,bool bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2773,7 +2773,7 @@ void CFX_Edit::OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl)
}
}
-void CFX_Edit::OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_Edit::OnVK_RIGHT(bool bShift,bool bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2827,7 +2827,7 @@ void CFX_Edit::OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl)
}
}
-void CFX_Edit::OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_Edit::OnVK_HOME(bool bShift,bool bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2876,7 +2876,7 @@ void CFX_Edit::OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl)
}
}
-void CFX_Edit::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_Edit::OnVK_END(bool bShift,bool bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2926,7 +2926,7 @@ void CFX_Edit::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl)
}
void CFX_Edit::SetText(const FX_WCHAR* text,int32_t charset,
- const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint)
+ const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps, bool bAddUndo, bool bPaint)
{
Empty();
DoInsertText(CPVT_WordPlace(0,0,-1), text, charset, pSecProps, pWordProps);
@@ -2936,9 +2936,9 @@ void CFX_Edit::SetText(const FX_WCHAR* text,int32_t charset,
//if (bAddUndo)
}
-FX_BOOL CFX_Edit::InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint)
+bool CFX_Edit::InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps, bool bAddUndo, bool bPaint)
{
- if (IsTextOverflow()) return FALSE;
+ if (IsTextOverflow()) return false;
if (m_pVT->IsValid())
{
@@ -2960,17 +2960,17 @@ FX_BOOL CFX_Edit::InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnInsertWord(m_wpCaret, m_wpOldCaret);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,
- FX_BOOL bAddUndo, FX_BOOL bPaint)
+bool CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,
+ bool bAddUndo, bool bPaint)
{
- if (IsTextOverflow()) return FALSE;
+ if (IsTextOverflow()) return false;
if (m_pVT->IsValid())
{
@@ -2998,18 +2998,18 @@ FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordPr
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnInsertReturn(m_wpCaret, m_wpOldCaret);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_Edit::Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint)
+bool CFX_Edit::Backspace(bool bAddUndo, bool bPaint)
{
if (m_pVT->IsValid())
{
- if (m_wpCaret == m_pVT->GetBeginWordPlace()) return FALSE;
+ if (m_wpCaret == m_pVT->GetBeginWordPlace()) return false;
CPVT_Section section;
CPVT_Word word;
@@ -3062,18 +3062,18 @@ FX_BOOL CFX_Edit::Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint)
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnBackSpace(m_wpCaret, m_wpOldCaret);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_Edit::Delete(FX_BOOL bAddUndo, FX_BOOL bPaint)
+bool CFX_Edit::Delete(bool bAddUndo, bool bPaint)
{
if (m_pVT->IsValid())
{
- if (m_wpCaret == m_pVT->GetEndWordPlace()) return FALSE;
+ if (m_wpCaret == m_pVT->GetEndWordPlace()) return false;
CPVT_Section section;
CPVT_Word word;
@@ -3089,7 +3089,7 @@ FX_BOOL CFX_Edit::Delete(FX_BOOL bAddUndo, FX_BOOL bPaint)
}
m_pVT->UpdateWordPlace(m_wpCaret);
- FX_BOOL bSecEnd = (m_wpCaret == m_pVT->GetSectionEndPlace(m_wpCaret));
+ bool bSecEnd = (m_wpCaret == m_pVT->GetSectionEndPlace(m_wpCaret));
SetCaret(m_pVT->DeleteWord(m_wpCaret));
m_SelState.Set(m_wpCaret,m_wpCaret);
@@ -3126,26 +3126,26 @@ FX_BOOL CFX_Edit::Delete(FX_BOOL bAddUndo, FX_BOOL bPaint)
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnDelete(m_wpCaret, m_wpOldCaret);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_Edit::Empty()
+bool CFX_Edit::Empty()
{
if (m_pVT->IsValid())
{
m_pVT->DeleteWords(GetWholeWordRange());
SetCaret(m_pVT->GetBeginWordPlace());
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint)
+bool CFX_Edit::Clear(bool bAddUndo, bool bPaint)
{
if (m_pVT->IsValid())
{
@@ -3184,8 +3184,8 @@ FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint)
{
if (pIterator->GetWord(wordinfo))
{
- oldplace = m_pVT->AjustLineHeader(oldplace,TRUE);
- place = m_pVT->AjustLineHeader(place,TRUE);
+ oldplace = m_pVT->AjustLineHeader(oldplace,true);
+ place = m_pVT->AjustLineHeader(place,true);
AddEditUndoItem(new CFXEU_ClearRich(this,oldplace,place,range,wordinfo.Word,
wordinfo.nCharset,secinfo.SecProps,wordinfo.WordProps));
@@ -3220,17 +3220,17 @@ FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint)
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnClear(m_wpCaret, m_wpOldCaret);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint)
+bool CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, bool bAddUndo, bool bPaint)
{
- if (IsTextOverflow()) return FALSE;
+ if (IsTextOverflow()) return false;
m_pVT->UpdateWordPlace(m_wpCaret);
SetCaret(DoInsertText(m_wpCaret, text, charset, pSecProps, pWordProps));
@@ -3249,9 +3249,9 @@ FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset,
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnInsertText(m_wpCaret, m_wpOldCaret);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CFX_Edit::PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlace & wpNew)
@@ -3272,32 +3272,32 @@ void CFX_Edit::PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlac
}
}
-FX_BOOL CFX_Edit::Redo()
+bool CFX_Edit::Redo()
{
if (m_bEnableUndo)
{
if (m_Undo.CanRedo())
{
m_Undo.Redo();
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_Edit::Undo()
+bool CFX_Edit::Undo()
{
if (m_bEnableUndo)
{
if (m_Undo.CanUndo())
{
m_Undo.Undo();
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void CFX_Edit::SetCaretOrigin()
@@ -3339,7 +3339,7 @@ CPVT_WordPlace CFX_Edit::WordIndexToWordPlace(int32_t index) const
return CPVT_WordPlace();
}
-FX_BOOL CFX_Edit::IsTextFull() const
+bool CFX_Edit::IsTextFull() const
{
int32_t nTotalWords = m_pVT->GetTotalWords();
int32_t nLimitChar = m_pVT->GetLimitChar();
@@ -3349,7 +3349,7 @@ FX_BOOL CFX_Edit::IsTextFull() const
|| (nCharArray>0 && nTotalWords >= nCharArray);
}
-FX_BOOL CFX_Edit::IsTextOverflow() const
+bool CFX_Edit::IsTextOverflow() const
{
if (!m_bEnableScroll && !m_bEnableOverflow)
{
@@ -3358,13 +3358,13 @@ FX_BOOL CFX_Edit::IsTextOverflow() const
if (m_pVT->IsMultiLine() && GetTotalLines() > 1)
{
- if (FX_EDIT_IsFloatBigger(rcContent.Height(),rcPlate.Height())) return TRUE;
+ if (FX_EDIT_IsFloatBigger(rcContent.Height(),rcPlate.Height())) return true;
}
- if (FX_EDIT_IsFloatBigger(rcContent.Width(),rcPlate.Width())) return TRUE;
+ if (FX_EDIT_IsFloatBigger(rcContent.Width(),rcPlate.Width())) return true;
}
- return FALSE;
+ return false;
}
CPVT_WordPlace CFX_Edit::GetLineBeginPlace(const CPVT_WordPlace & place) const
@@ -3387,52 +3387,52 @@ CPVT_WordPlace CFX_Edit::GetSectionEndPlace(const CPVT_WordPlace & place) const
return m_pVT->GetSectionEndPlace(place);
}
-FX_BOOL CFX_Edit::CanUndo() const
+bool CFX_Edit::CanUndo() const
{
if (m_bEnableUndo)
{
return m_Undo.CanUndo();
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_Edit::CanRedo() const
+bool CFX_Edit::CanRedo() const
{
if (m_bEnableUndo)
{
return m_Undo.CanRedo();
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_Edit::IsModified() const
+bool CFX_Edit::IsModified() const
{
if (m_bEnableUndo)
{
return m_Undo.IsModified();
}
- return FALSE;
+ return false;
}
-void CFX_Edit::EnableRefresh(FX_BOOL bRefresh)
+void CFX_Edit::EnableRefresh(bool bRefresh)
{
m_bEnableRefresh = bRefresh;
}
-void CFX_Edit::EnableUndo(FX_BOOL bUndo)
+void CFX_Edit::EnableUndo(bool bUndo)
{
m_bEnableUndo = bUndo;
}
-void CFX_Edit::EnableNotify(FX_BOOL bNotify)
+void CFX_Edit::EnableNotify(bool bNotify)
{
m_bNotify = bNotify;
}
-void CFX_Edit::EnableOprNotify(FX_BOOL bNotify)
+void CFX_Edit::EnableOprNotify(bool bNotify)
{
m_bOprNotify = bNotify;
}
diff --git a/fpdfsdk/src/fxedit/fxet_list.cpp b/fpdfsdk/src/fxedit/fxet_list.cpp
index d94cc16c86..c84db4d029 100644
--- a/fpdfsdk/src/fxedit/fxet_list.cpp
+++ b/fpdfsdk/src/fxedit/fxet_list.cpp
@@ -11,8 +11,8 @@
/* ------------------------------- CFX_ListItem ---------------------------------- */
CFX_ListItem::CFX_ListItem() : m_pEdit(NULL),
- m_bSelected(FALSE),
- m_bCaret(FALSE),
+ m_bSelected(false),
+ m_bCaret(false),
m_rcListItem(0.0f,0.0f,0.0f,0.0f)
{
m_pEdit = IFX_Edit::NewEdit();
@@ -56,22 +56,22 @@ CLST_Rect CFX_ListItem::GetRect() const
return m_rcListItem;
}
-FX_BOOL CFX_ListItem::IsSelected() const
+bool CFX_ListItem::IsSelected() const
{
return m_bSelected;
}
-void CFX_ListItem::SetSelect(FX_BOOL bSelected)
+void CFX_ListItem::SetSelect(bool bSelected)
{
m_bSelected = bSelected;
}
-FX_BOOL CFX_ListItem::IsCaret() const
+bool CFX_ListItem::IsCaret() const
{
return m_bCaret;
}
-void CFX_ListItem::SetCaret(FX_BOOL bCaret)
+void CFX_ListItem::SetCaret(bool bCaret)
{
m_bCaret = bCaret;
}
@@ -119,7 +119,7 @@ CFX_WideString CFX_ListItem::GetText() const
/* ------------------------------------ CFX_List --------------------------------- */
-CFX_List::CFX_List() : m_fFontSize(0.0f), m_pFontMap(NULL), m_bMultiple(FALSE)
+CFX_List::CFX_List() : m_fFontSize(0.0f), m_pFontMap(NULL), m_bMultiple(false)
{
}
@@ -211,8 +211,8 @@ int32_t CFX_List::GetItemIndex(const CPDF_Point & point) const
{
CPDF_Point pt = OuterToInner(point);
- FX_BOOL bFirst = TRUE;
- FX_BOOL bLast = TRUE;
+ bool bFirst = true;
+ bool bLast = true;
for (int32_t i=0,sz=m_aListItems.GetSize(); i<sz; i++)
{
@@ -222,12 +222,12 @@ int32_t CFX_List::GetItemIndex(const CPDF_Point & point) const
if (FX_EDIT_IsFloatBigger(pt.y, rcListItem.top))
{
- bFirst = FALSE;
+ bFirst = false;
}
if (FX_EDIT_IsFloatSmaller(pt.y, rcListItem.bottom))
{
- bLast = FALSE;
+ bLast = false;
}
if (pt.y >= rcListItem.top && pt.y < rcListItem.bottom)
@@ -318,17 +318,17 @@ CPDF_Rect CFX_List::GetItemRect(int32_t nIndex) const
return CPDF_Rect();
}
-FX_BOOL CFX_List::IsItemSelected(int32_t nIndex) const
+bool CFX_List::IsItemSelected(int32_t nIndex) const
{
if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex))
{
return pListItem->IsSelected();
}
- return FALSE;
+ return false;
}
-void CFX_List::SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected)
+void CFX_List::SetItemSelect(int32_t nItemIndex, bool bSelected)
{
if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex))
{
@@ -336,7 +336,7 @@ void CFX_List::SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected)
}
}
-void CFX_List::SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret)
+void CFX_List::SetItemCaret(int32_t nItemIndex, bool bCaret)
{
if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex))
{
@@ -344,17 +344,17 @@ void CFX_List::SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret)
}
}
-void CFX_List::SetMultipleSel(FX_BOOL bMultiple)
+void CFX_List::SetMultipleSel(bool bMultiple)
{
m_bMultiple = bMultiple;
}
-FX_BOOL CFX_List::IsMultipleSel() const
+bool CFX_List::IsMultipleSel() const
{
return m_bMultiple;
}
-FX_BOOL CFX_List::IsValid(int32_t nItemIndex) const
+bool CFX_List::IsValid(int32_t nItemIndex) const
{
return nItemIndex >= 0 && nItemIndex < m_aListItems.GetSize();
}
@@ -446,7 +446,7 @@ int32_t CPLST_Select::Find(int32_t nItemIndex) const
return -1;
}
-FX_BOOL CPLST_Select::IsExist(int32_t nItemIndex) const
+bool CPLST_Select::IsExist(int32_t nItemIndex) const
{
return Find(nItemIndex) >= 0;
}
@@ -507,11 +507,11 @@ void CPLST_Select::Done()
/* ------------------------------------ CFX_ListCtrl --------------------------------- */
CFX_ListCtrl::CFX_ListCtrl() : m_pNotify(NULL),
- m_bNotifyFlag(FALSE),
+ m_bNotifyFlag(false),
m_ptScrollPos(0.0f,0.0f),
m_nSelItem(-1),
m_nFootIndex(-1),
- m_bCtrlSel(FALSE),
+ m_bCtrlSel(false),
m_nCaretIndex(-1)
{
}
@@ -557,7 +557,7 @@ CPDF_Rect CFX_ListCtrl::OutToIn(const CPDF_Rect & rect) const
return CPDF_Rect(ptLeftBottom.x,ptLeftBottom.y,ptRightTop.x,ptRightTop.y);
}
-void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl)
{
int32_t nHitIndex = GetItemIndex(point);
@@ -569,13 +569,13 @@ void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL b
{
m_aSelItems.Sub(nHitIndex);
SelectItems();
- m_bCtrlSel = FALSE;
+ m_bCtrlSel = false;
}
else
{
m_aSelItems.Add(nHitIndex);
SelectItems();
- m_bCtrlSel = TRUE;
+ m_bCtrlSel = true;
}
m_nFootIndex = nHitIndex;
@@ -606,7 +606,7 @@ void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL b
ScrollToListItem(nHitIndex);
}
-void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl)
{
int32_t nHitIndex = GetItemIndex(point);
@@ -639,7 +639,7 @@ void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL b
ScrollToListItem(nHitIndex);
}
-void CFX_ListCtrl::OnVK(int32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_ListCtrl::OnVK(int32_t nItemIndex,bool bShift,bool bCtrl)
{
if (IsMultipleSel())
{
@@ -674,37 +674,37 @@ void CFX_ListCtrl::OnVK(int32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl)
ScrollToListItem(nItemIndex);
}
-void CFX_ListCtrl::OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_ListCtrl::OnVK_UP(bool bShift,bool bCtrl)
{
OnVK(IsMultipleSel() ? GetCaret()-1 : GetSelect()-1, bShift, bCtrl);
}
-void CFX_ListCtrl::OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_ListCtrl::OnVK_DOWN(bool bShift,bool bCtrl)
{
OnVK(IsMultipleSel() ? GetCaret()+1 : GetSelect()+1, bShift, bCtrl);
}
-void CFX_ListCtrl::OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_ListCtrl::OnVK_LEFT(bool bShift,bool bCtrl)
{
OnVK(0, bShift, bCtrl);
}
-void CFX_ListCtrl::OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_ListCtrl::OnVK_RIGHT(bool bShift,bool bCtrl)
{
OnVK(GetCount()-1, bShift, bCtrl);
}
-void CFX_ListCtrl::OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_ListCtrl::OnVK_HOME(bool bShift,bool bCtrl)
{
OnVK(0, bShift, bCtrl);
}
-void CFX_ListCtrl::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl)
+void CFX_ListCtrl::OnVK_END(bool bShift,bool bCtrl)
{
OnVK(GetCount()-1, bShift, bCtrl);
}
-FX_BOOL CFX_ListCtrl::OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl)
+bool CFX_ListCtrl::OnChar(FX_WORD nChar,bool bShift,bool bCtrl)
{
int32_t nIndex = GetLastSelected();
int32_t nFindIndex = FindNext(nIndex,nChar);
@@ -712,9 +712,9 @@ FX_BOOL CFX_ListCtrl::OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl)
if (nFindIndex != nIndex)
{
OnVK(nFindIndex, bShift, bCtrl);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/* -------- inner methods ------- */
@@ -739,7 +739,7 @@ void CFX_ListCtrl::AddString(const FX_WCHAR* string)
ReArrange(GetCount() - 1);
}
-void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected)
+void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, bool bSelected)
{
if (!IsValid(nItemIndex)) return;
@@ -747,12 +747,12 @@ void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected)
{
if (bSelected)
{
- SetItemSelect(nItemIndex,TRUE);
+ SetItemSelect(nItemIndex,true);
InvalidateItem(nItemIndex);
}
else
{
- SetItemSelect(nItemIndex,FALSE);
+ SetItemSelect(nItemIndex,false);
InvalidateItem(nItemIndex);
}
}
@@ -766,11 +766,11 @@ void CFX_ListCtrl::SetSingleSelect(int32_t nItemIndex)
{
if (m_nSelItem >= 0)
{
- SetItemSelect(m_nSelItem,FALSE);
+ SetItemSelect(m_nSelItem,false);
InvalidateItem(m_nSelItem);
}
- SetItemSelect(nItemIndex,TRUE);
+ SetItemSelect(nItemIndex,true);
InvalidateItem(nItemIndex);
m_nSelItem = nItemIndex;
}
@@ -788,8 +788,8 @@ void CFX_ListCtrl::SetCaret(int32_t nItemIndex)
{
m_nCaretIndex = nItemIndex;
- SetItemCaret(nOldIndex, FALSE);
- SetItemCaret(nItemIndex,TRUE);
+ SetItemCaret(nOldIndex, false);
+ SetItemCaret(nItemIndex,true);
InvalidateItem(nOldIndex);
InvalidateItem(nItemIndex);
@@ -805,17 +805,17 @@ void CFX_ListCtrl::InvalidateItem(int32_t nItemIndex)
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
CPDF_Rect rcRefresh = GetPlateRect();
m_pNotify->IOnInvalidateRect(&rcRefresh);
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
}
else
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
CPDF_Rect rcRefresh = GetItemRect(nItemIndex);
rcRefresh.left -= 1.0f;
rcRefresh.right += 1.0f;
@@ -823,7 +823,7 @@ void CFX_ListCtrl::InvalidateItem(int32_t nItemIndex)
rcRefresh.top += 1.0f;
m_pNotify->IOnInvalidateRect(&rcRefresh);
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
}
}
@@ -839,10 +839,10 @@ void CFX_ListCtrl::SelectItems()
switch(nState)
{
case 1:
- SetMultipleSelect(nItemIndex, TRUE);
+ SetMultipleSelect(nItemIndex, true);
break;
case -1:
- SetMultipleSelect(nItemIndex, FALSE);
+ SetMultipleSelect(nItemIndex, false);
break;
}
}
@@ -863,7 +863,7 @@ void CFX_ListCtrl::Select(int32_t nItemIndex)
SetSingleSelect(nItemIndex);
}
-FX_BOOL CFX_ListCtrl::IsItemVisible(int32_t nItemIndex) const
+bool CFX_ListCtrl::IsItemVisible(int32_t nItemIndex) const
{
CPDF_Rect rcPlate = GetPlateRect();
CPDF_Rect rcItem = GetItemRect(nItemIndex);
@@ -904,10 +904,10 @@ void CFX_ListCtrl::SetScrollInfo()
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top,
rcContent.bottom, rcContent.top, GetFirstHeight(), rcPlate.Height());
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
}
}
@@ -947,9 +947,9 @@ void CFX_ListCtrl::SetScrollPosY(FX_FLOAT fy)
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = TRUE;
+ m_bNotifyFlag = true;
m_pNotify->IOnSetScrollPosY(fy);
- m_bNotifyFlag = FALSE;
+ m_bNotifyFlag = false;
}
}
}
diff --git a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
index 1c0269b682..04809a46f1 100644
--- a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
+++ b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
@@ -132,9 +132,9 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF
const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData)
{
- FX_BOOL bContinuous = pEdit->GetCharArray() == 0;
+ bool bContinuous = pEdit->GetCharArray() == 0;
if (pEdit->GetCharSpace() > 0.0f)
- bContinuous = FALSE;
+ bContinuous = false;
FX_WORD SubWord = pEdit->GetPasswordChar();
FX_FLOAT fFontSize = pEdit->GetFontSize();
@@ -144,7 +144,7 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF
FX_COLORREF crCurFill = crTextFill;
FX_COLORREF crOldFill = crCurFill;
- FX_BOOL bSelect = FALSE;
+ bool bSelect = false;
const FX_COLORREF crWhite = ArgbEncode(255,255,255,255);
const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113);
@@ -278,7 +278,7 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device
FX_COLORREF crCurText = ArgbEncode(255, 0,0,0);
FX_COLORREF crOld = crCurText;
- FX_BOOL bSelect = FALSE;
+ bool bSelect = false;
const FX_COLORREF crWhite = ArgbEncode(255,255,255,255);
const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113);
@@ -410,7 +410,7 @@ static void AddRectToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crFill
pPathObj->m_ColorState.SetFillColor(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
pPathObj->m_FillType = FXFILL_ALTERNATE;
- pPathObj->m_bStroke = FALSE;
+ pPathObj->m_bStroke = false;
pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pPathObj);
}
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index fc453b0fc8..916af6ef9d 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -45,14 +45,14 @@ IMPLEMENT_JS_CLASS(CJS_PrintParamsObj, PrintParamsObj)
PrintParamsObj::PrintParamsObj(CJS_Object* pJSObject)
: CJS_EmbedObj(pJSObject)
{
- bUI = TRUE;
+ bUI = true;
nStart = 0;
nEnd = 0;
- bSilent = FALSE;
- bShrinkToFit = FALSE;
- bPrintAsImage = FALSE;
- bReverse = FALSE;
- bAnnotations = TRUE;
+ bSilent = false;
+ bShrinkToFit = false;
+ bPrintAsImage = false;
+ bReverse = false;
+ bAnnotations = true;
}
/* ---------------------- Document ---------------------- */
@@ -142,7 +142,7 @@ END_JS_STATIC_METHOD()
IMPLEMENT_JS_CLASS(CJS_Document, Document)
-FX_BOOL CJS_Document::InitInstance(IFXJS_Context* cc)
+bool CJS_Document::InitInstance(IFXJS_Context* cc)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -152,7 +152,7 @@ FX_BOOL CJS_Document::InitInstance(IFXJS_Context* cc)
pDoc->AttachDoc(pContext->GetReaderDocument());
pDoc->SetIsolate(pContext->GetJSRuntime()->GetIsolate());
- return TRUE;
+ return true;
};
/* --------------------------------- Document --------------------------------- */
@@ -162,7 +162,7 @@ Document::Document(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject),
m_pIconTree(NULL),
m_pDocument(NULL),
m_cwBaseURL(L""),
- m_bDelay(FALSE)
+ m_bDelay(false)
{
}
@@ -190,20 +190,20 @@ Document::~Document()
}
//the total number of fileds in document.
-FX_BOOL Document::numFields(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::numFields(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
- return FALSE;
+ return false;
}
CPDFSDK_InterForm *pInterForm = m_pDocument->GetInterForm();
CPDF_InterForm *pPDFForm = pInterForm->GetInterForm();
vp << (int)pPDFForm->CountFields();
- return TRUE;
+ return true;
}
-FX_BOOL Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -226,10 +226,10 @@ FX_BOOL Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
m_pDocument->ClearChangeMark();
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -241,10 +241,10 @@ FX_BOOL Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
{
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -276,55 +276,55 @@ FX_BOOL Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
}
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj)
+bool Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj)
{
// Not supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Not supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Not supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
//Maps a field object in PDF document to a JavaScript variable
//comment:
//note: the paremter cName, this is clue how to treat if the cName is not a valiable filed name in this document
-FX_BOOL Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
if (params.size() < 1) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
CFX_WideString wideName = params[0].ToCFXWideString();
@@ -334,7 +334,7 @@ FX_BOOL Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
if (pPDFForm->CountFields(wideName) <= 0)
{
vRet.SetNull();
- return TRUE;
+ return true;
}
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
@@ -346,66 +346,66 @@ FX_BOOL Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
pField->AttachField(this, wideName);
vRet = pJSField;
- return TRUE;
+ return true;
}
//Gets the name of the nth field in the document
-FX_BOOL Document::getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
if (params.size() != 1) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
int nIndex = params[0].ToInt();
if (nIndex < 0) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSVALUEERROR);
- return FALSE;
+ return false;
}
CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
CPDF_FormField* pField = pPDFForm->GetField(nIndex);
if (!pField)
- return FALSE;
+ return false;
vRet = pField->GetFullName().c_str();
- return TRUE;
+ return true;
}
-FX_BOOL Document::importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::importTextData(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::importTextData(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
//exports the form data and mails the resulting fdf file as an attachment to all recipients.
//comment: need reader supports
//note:
-//int CPDFSDK_Document::mailForm(FX_BOOL bUI,String cto,string ccc,string cbcc,string cSubject,string cms);
+//int CPDFSDK_Document::mailForm(bool bUI,String cto,string ccc,string cbcc,string cSubject,string cms);
-FX_BOOL Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return false;
int iLength = params.size();
- FX_BOOL bUI = iLength > 0 ? params[0].ToBool() : TRUE;
+ bool bUI = iLength > 0 ? params[0].ToBool() : true;
CFX_WideString cTo = iLength > 1 ? params[1].ToCFXWideString() : L"";
CFX_WideString cCc = iLength > 2 ? params[2].ToCFXWideString() : L"";
CFX_WideString cBcc = iLength > 3 ? params[3].ToCFXWideString() : L"";
@@ -417,7 +417,7 @@ FX_BOOL Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
CFX_ByteTextBuf textBuf;
if (!pInterForm->ExportFormToFDFTextBuf(textBuf))
- return FALSE;
+ return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -429,24 +429,24 @@ FX_BOOL Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
pRuntime->BeginBlock();
pEnv->JS_docmailForm(textBuf.GetBuffer(), textBuf.GetLength(), bUI, cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str());
pRuntime->EndBlock();
- return TRUE;
+ return true;
}
-FX_BOOL Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
ASSERT(pRuntime != NULL);
- FX_BOOL bUI = TRUE;
+ bool bUI = true;
int nStart = 0;
int nEnd = 0;
- FX_BOOL bSilent = FALSE;
- FX_BOOL bShrinkToFit = FALSE;
- FX_BOOL bPrintAsImage = FALSE;
- FX_BOOL bReverse = FALSE;
- FX_BOOL bAnnotations = FALSE;
+ bool bSilent = false;
+ bool bShrinkToFit = false;
+ bool bPrintAsImage = false;
+ bool bReverse = false;
+ bool bAnnotations = false;
int nlength = params.size();
if(nlength ==9)
@@ -500,26 +500,26 @@ FX_BOOL Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
if (CPDFDoc_Environment* pEnv = m_pDocument->GetEnv())
{
pEnv->JS_docprint(bUI, nStart, nEnd, bSilent, bShrinkToFit, bPrintAsImage, bReverse, bAnnotations);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
//removes the specified field from the document.
//comment:
//note: if the filed name is not retional, adobe is dumb for it.
-FX_BOOL Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
- m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM))) return FALSE;
+ m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM))) return false;
CJS_Context* pContext = (CJS_Context*)cc;
if (params.size() != 1) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
CFX_WideString sFieldName = params[0].ToCFXWideString();
@@ -558,20 +558,20 @@ FX_BOOL Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, C
m_pDocument->SetChangeMark();
}
- return TRUE;
+ return true;
}
//reset filed values within a document.
//comment:
//note: if the fields names r not rational, aodbe is dumb for it.
-FX_BOOL Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
- m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
+ m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return false;
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
ASSERT(pInterForm != NULL);
@@ -610,42 +610,42 @@ FX_BOOL Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS
if (aFields.GetSize() > 0)
{
- pPDFForm->ResetForm(aFields, TRUE, TRUE);
+ pPDFForm->ResetForm(aFields, true, true);
m_pDocument->SetChangeMark();
}
}
else
{
- pPDFForm->ResetForm(TRUE);
+ pPDFForm->ResetForm(true);
m_pDocument->SetChangeMark();
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CJS_Context* pContext = (CJS_Context*)cc;
int nSize = params.size();
if (nSize < 1) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
CFX_WideString strURL;
- FX_BOOL bFDF = TRUE;
- FX_BOOL bEmpty = FALSE;
+ bool bFDF = true;
+ bool bEmpty = false;
v8::Isolate* isolate = GetIsolate(cc);
CJS_Array aFields(isolate);
@@ -677,16 +677,16 @@ FX_BOOL Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJ
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
- FX_BOOL bAll = (aFields.GetLength() == 0);
+ bool bAll = (aFields.GetLength() == 0);
if (bAll && bEmpty)
{
if (pPDFInterForm->CheckRequiredFields())
{
pRuntime->BeginBlock();
- pInterForm->SubmitForm(strURL, FALSE);
+ pInterForm->SubmitForm(strURL, false);
pRuntime->EndBlock();
}
- return TRUE;
+ return true;
}
CFX_PtrArray fieldObjects;
@@ -707,13 +707,13 @@ FX_BOOL Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJ
}
}
- if (pPDFInterForm->CheckRequiredFields(&fieldObjects, TRUE))
+ if (pPDFInterForm->CheckRequiredFields(&fieldObjects, true))
{
pRuntime->BeginBlock();
- pInterForm->SubmitFields(strURL, fieldObjects, TRUE, !bFDF);
+ pInterForm->SubmitFields(strURL, fieldObjects, true, !bFDF);
pRuntime->EndBlock();
}
- return TRUE;
+ return true;
}
//////////////////////////////////////////////////////////////////////////////////////////////
@@ -728,26 +728,26 @@ CPDFSDK_Document * Document::GetReaderDoc()
return m_pDocument;
}
-FX_BOOL Document::ExtractFileName(CPDFSDK_Document *pDoc,CFX_ByteString &strFileName)
+bool Document::ExtractFileName(CPDFSDK_Document *pDoc,CFX_ByteString &strFileName)
{
- return FALSE;
+ return false;
}
-FX_BOOL Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFolderName)
+bool Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFolderName)
{
- return FALSE;
+ return false;
}
-FX_BOOL Document::bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- FX_BOOL bUI = TRUE;
+ bool bUI = true;
CFX_WideString cTo = L"";
CFX_WideString cCc = L"";
CFX_WideString cBcc = L"";
@@ -803,40 +803,40 @@ FX_BOOL Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
pEnv->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str());
pRuntime->EndBlock();
- return TRUE;
+ return true;
}
-FX_BOOL Document::author(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::author(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
- if (!pDictionary)return FALSE;
+ if (!pDictionary)return false;
if (vp.IsGetting())
{
vp << pDictionary->GetUnicodeText("Author");
- return TRUE;
+ return true;
}
else
{
- if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
+ if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return false;
CFX_WideString csAuthor;
vp >> csAuthor;
pDictionary->SetAtString("Author", PDF_EncodeText(csAuthor));
m_pDocument->SetChangeMark();
- return TRUE;
+ return true;
}
}
-FX_BOOL Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return FALSE;
+ return false;
CFX_WideString cwAuthor = pDictionary->GetUnicodeText("Author");
CFX_WideString cwTitle = pDictionary->GetUnicodeText("Title");
@@ -880,14 +880,14 @@ FX_BOOL Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
}
vp << pObj;
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return FALSE;
+ return false;
if (vp.IsGetting())
{
@@ -896,21 +896,21 @@ FX_BOOL Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return FALSE;
+ return false;
CFX_WideString csCreationDate;
vp >> csCreationDate;
pDictionary->SetAtString("CreationDate", PDF_EncodeText(csCreationDate));
m_pDocument->SetChangeMark();
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return FALSE;
+ return false;
if (vp.IsGetting())
{
@@ -919,17 +919,17 @@ FX_BOOL Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return FALSE;
+ return false;
CFX_WideString csCreator;
vp >> csCreator;
pDictionary->SetAtString("Creator", PDF_EncodeText(csCreator));
m_pDocument->SetChangeMark();
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
@@ -938,7 +938,7 @@ FX_BOOL Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return FALSE;
+ return false;
bool b;
vp >> b;
@@ -971,14 +971,14 @@ FX_BOOL Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
}
}
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return FALSE;
+ return false;
if (vp.IsGetting())
{
@@ -987,21 +987,21 @@ FX_BOOL Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return FALSE;
+ return false;
CFX_WideString csKeywords;
vp >> csKeywords;
pDictionary->SetAtString("Keywords", PDF_EncodeText(csKeywords));
m_pDocument->SetChangeMark();
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return FALSE;
+ return false;
if (vp.IsGetting())
{
@@ -1010,21 +1010,21 @@ FX_BOOL Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return FALSE;
+ return false;
CFX_WideString csmodDate;
vp >> csmodDate;
pDictionary->SetAtString("ModDate", PDF_EncodeText(csmodDate));
m_pDocument->SetChangeMark();
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return FALSE;
+ return false;
if (vp.IsGetting())
{
@@ -1033,21 +1033,21 @@ FX_BOOL Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return FALSE;
+ return false;
CFX_WideString csproducer;
vp >> csproducer;
pDictionary->SetAtString("Producer", PDF_EncodeText(csproducer));
m_pDocument->SetChangeMark();
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return FALSE;
+ return false;
if (vp.IsGetting())
{
@@ -1056,24 +1056,24 @@ FX_BOOL Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return FALSE;
+ return false;
CFX_WideString cssubject;
vp >> cssubject;
pDictionary->SetAtString("Subject", PDF_EncodeText(cssubject));
m_pDocument->SetChangeMark();
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (m_pDocument == NULL || m_pDocument->GetDocument() == NULL)
- return FALSE;
+ return false;
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return FALSE;
+ return false;
if (vp.IsGetting())
{
@@ -1082,58 +1082,58 @@ FX_BOOL Document::title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return FALSE;
+ return false;
CFX_WideString cstitle;
vp >> cstitle;
pDictionary->SetAtString("Title", PDF_EncodeText(cstitle));
m_pDocument->SetChangeMark();
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::numPages(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::numPages(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
- return FALSE;
+ return false;
}
vp << m_pDocument->GetPageCount();
- return TRUE;
+ return true;
}
-FX_BOOL Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
//In Chrome case,should always return true.
if (vp.IsGetting()) {
- vp << TRUE;
+ vp << true;
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
- return FALSE;
+ return false;
}
vp << 0;
- return TRUE;
+ return true;
}
-FX_BOOL Document::mouseX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::mouseX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Document::mouseY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::mouseY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
@@ -1143,10 +1143,10 @@ FX_BOOL Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
{
vp >> m_cwBaseURL;
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -1168,15 +1168,15 @@ FX_BOOL Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
pInterForm->EnableCalculate(bCalculate);
}
- return TRUE;
+ return true;
}
-FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
- return FALSE;
+ return false;
}
CFX_WideString wsFilePath = m_pDocument->GetPath();
int32_t i = wsFilePath.GetLength() - 1;
@@ -1191,7 +1191,7 @@ FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid
}else{
vp << L"";
}
- return TRUE;
+ return true;
}
CFX_WideString Document::ReversalStr(CFX_WideString cbFrom)
@@ -1241,74 +1241,74 @@ CFX_WideString Document::CutString(CFX_WideString cbFrom)
return cbRet;
}
-FX_BOOL Document::path(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::path(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
- return FALSE;
+ return false;
}
vp << app::SysPathToPDFPath(m_pDocument->GetPath());
- return TRUE;
+ return true;
}
-FX_BOOL Document::pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Document::layout(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::layout(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Document::addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Document::closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- return TRUE;
+ return true;
}
-FX_BOOL Document::getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Document::getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Document::getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
vRet.SetNull();
- return TRUE;
+ return true;
}
-FX_BOOL Document::getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
vRet.SetNull();
- return TRUE;
+ return true;
}
-FX_BOOL Document::getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
vRet = VT_undefined;
- return TRUE;
+ return true;
}
-FX_BOOL Document::getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Document::getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
bool Document::IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect)
@@ -1372,12 +1372,12 @@ IconElement* IconTree::operator [](int iIndex)
return NULL;
}
-FX_BOOL Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
if (params.size() != 2) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
CFX_WideString swIconName = params[0].ToCFXWideString();
@@ -1386,13 +1386,13 @@ FX_BOOL Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
if (JS_GetObjDefnID(pJSIcon) != JS_GetObjDefnID(*pRuntime, L"Icon")) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSTYPEERROR);
- return FALSE;
+ return false;
}
CJS_EmbedObj* pEmbedObj = params[1].ToCJSObject()->GetEmbedObject();
if (!pEmbedObj) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSTYPEERROR);
- return FALSE;
+ return false;
}
Icon* pIcon = (Icon*)pEmbedObj;
@@ -1404,21 +1404,21 @@ FX_BOOL Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
pNewIcon->NextIcon = NULL;
pNewIcon->IconStream = pIcon;
m_pIconTree->InsertIconElement(pNewIcon);
- return TRUE;
+ return true;
}
-FX_BOOL Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
- return FALSE;
+ return false;
}
if (!m_pIconTree)
{
vp.SetNull();
- return TRUE;
+ return true;
}
CJS_Array Icons(m_isolate);
@@ -1433,13 +1433,13 @@ FX_BOOL Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
pIconElement = (*m_pIconTree)[i];
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
- if (pObj.IsEmpty()) return FALSE;
+ if (pObj.IsEmpty()) return false;
CJS_Icon * pJS_Icon = (CJS_Icon *)JS_GetPrivate(pObj);
- if (!pJS_Icon) return FALSE;
+ if (!pJS_Icon) return false;
Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
- if (!pIcon)return FALSE;
+ if (!pIcon)return false;
pIcon->SetStream(pIconElement->IconStream->GetStream());
pIcon->SetIconName(pIconElement->IconName);
@@ -1447,19 +1447,19 @@ FX_BOOL Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
}
vp << Icons;
- return TRUE;
+ return true;
}
-FX_BOOL Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
if (params.size() != 1) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
if(!m_pIconTree)
- return FALSE;
+ return false;
CFX_WideString swIconName = params[0].ToCFXWideString();
int iIconCounts = m_pIconTree->GetLength();
@@ -1472,82 +1472,82 @@ FX_BOOL Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
Icon* pRetIcon = (*m_pIconTree)[i]->IconStream;
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
- if (pObj.IsEmpty()) return FALSE;
+ if (pObj.IsEmpty()) return false;
CJS_Icon * pJS_Icon = (CJS_Icon *)JS_GetPrivate(pObj);
- if (!pJS_Icon) return FALSE;
+ if (!pJS_Icon) return false;
Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
- if (!pIcon)return FALSE;
+ if (!pIcon)return false;
pIcon->SetIconName(swIconName);
pIcon->SetStream(pRetIcon->GetStream());
vRet = pJS_Icon;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL Document::removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, no supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not implemented.
- return TRUE;
+ return true;
}
-FX_BOOL Document::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Document::calculateNow(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::calculateNow(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
- m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
+ m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return false;
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
ASSERT(pInterForm != NULL);
pInterForm->OnCalculate();
- return TRUE;
+ return true;
}
-FX_BOOL Document::Collab(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::Collab(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return false;
int nPageNo = params.GetSize() > 0 ? params[0].ToInt() : 0;
int nWordNo = params.GetSize() > 1 ? params[1].ToInt() : 0;
bool bStrip = params.GetSize() > 2 ? params[2].ToBool() : true;
CPDF_Document* pDocument = m_pDocument->GetDocument();
- if (!pDocument) return FALSE;
+ if (!pDocument) return false;
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount())
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSVALUEERROR);
- return FALSE;
+ return false;
}
CPDF_Dictionary* pPageDict = pDocument->GetPage(nPageNo);
- if (!pPageDict) return FALSE;
+ if (!pPageDict) return false;
CPDF_Page page;
page.Load(pDocument, pPageDict);
@@ -1586,23 +1586,23 @@ FX_BOOL Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params
}
vRet = swRet.c_str();
- return TRUE;
+ return true;
}
-FX_BOOL Document::getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return false;
- return FALSE;
+ return false;
}
-FX_BOOL Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return false;
int nPageNo = params.GetSize() > 0 ? params[0].ToInt() : 0;
@@ -1613,11 +1613,11 @@ FX_BOOL Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& param
if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount())
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSVALUEERROR);
- return FALSE;
+ return false;
}
CPDF_Dictionary* pPageDict = pDocument->GetPage(nPageNo);
- if (!pPageDict) return FALSE;
+ if (!pPageDict) return false;
CPDF_Page page;
page.Load(pDocument, pPageDict);
@@ -1642,10 +1642,10 @@ FX_BOOL Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& param
vRet = nWords;
- return TRUE;
+ return true;
}
-FX_BOOL Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
@@ -1654,7 +1654,7 @@ FX_BOOL Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params
// Not implemented yet.
vRet = pRetObj;
- return TRUE;
+ return true;
}
#define ISLATINWORD(u) (u != 0x20 && u <= 0x28FF)
@@ -1668,7 +1668,7 @@ int Document::CountWords(CPDF_TextObject* pTextObj)
CPDF_Font* pFont = pTextObj->GetFont();
if (!pFont) return 0;
- FX_BOOL bIsLatin = FALSE;
+ bool bIsLatin = false;
for (int i=0, sz=pTextObj->CountChars(); i<sz; i++)
{
@@ -1703,7 +1703,7 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex
if (!pFont) return L"";
int nWords = 0;
- FX_BOOL bIsLatin = FALSE;
+ bool bIsLatin = false;
for (int i=0, sz=pTextObj->CountChars(); i<sz; i++)
{
@@ -1734,10 +1734,10 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex
return swRet;
}
-FX_BOOL Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
/**
@@ -1750,39 +1750,39 @@ FX_BOOL Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
(refW, ReflowWidth)
*/
-FX_BOOL Document::zoomType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Document::zoomType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Document::deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, no supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
-FX_BOOL Document::getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Document::getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
void Document::AddDelayData(CJS_DelayData* pData)
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index 614843426e..ca16c90c01 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -110,7 +110,7 @@ END_JS_STATIC_METHOD()
IMPLEMENT_JS_CLASS(CJS_Field, Field)
-FX_BOOL CJS_Field::InitInstance(IFXJS_Context* cc)
+bool CJS_Field::InitInstance(IFXJS_Context* cc)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -120,15 +120,15 @@ FX_BOOL CJS_Field::InitInstance(IFXJS_Context* cc)
pField->SetIsolate(pContext->GetJSRuntime()->GetIsolate());
- return TRUE;
+ return true;
};
Field::Field(CJS_Object* pJSObject): CJS_EmbedObj(pJSObject),
m_pJSDoc(NULL),
m_pDocument(NULL),
m_nFormControlIndex(-1),
- m_bCanSet(FALSE),
- m_bDelay(FALSE),
+ m_bCanSet(false),
+ m_bDelay(false),
m_isolate(NULL)
{
}
@@ -168,7 +168,7 @@ void Field::ParseFieldName(const std::wstring &strFieldNameParsed,std::wstring &
strFieldName = strFieldNameParsed.substr(0,iStart);
}
-FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName)
+bool Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName)
{
ASSERT(pDocument != NULL);
m_pJSDoc = pDocument;
@@ -194,17 +194,17 @@ FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldNam
std::wstring strFieldName;
int iControlNo = -1;
ParseFieldName(swFieldNameTemp.c_str(), strFieldName, iControlNo);
- if (iControlNo == -1) return FALSE;
+ if (iControlNo == -1) return false;
m_FieldName = strFieldName.c_str();
m_nFormControlIndex = iControlNo;
- return TRUE;
+ return true;
}
m_FieldName = swFieldNameTemp;
m_nFormControlIndex = -1;
- return TRUE;
+ return true;
}
void Field::GetFormFields(CPDFSDK_Document* pDocument, const CFX_WideString& csFieldName, CFX_PtrArray& FieldArray)
@@ -234,7 +234,7 @@ void Field::GetFormFields(const CFX_WideString& csFieldName, CFX_PtrArray& Field
}
void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
- FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh)
+ bool bChangeMark, bool bResetAP, bool bRefresh)
{
ASSERT(pDocument != NULL);
ASSERT(pFormField != NULL);
@@ -255,12 +255,12 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormFi
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i);
ASSERT(pWidget != NULL);
- FX_BOOL bFormated = FALSE;
+ bool bFormated = false;
CFX_WideString sValue = pWidget->OnFormat(bFormated);
if (bFormated)
- pWidget->ResetAppearance(sValue.c_str(), FALSE);
+ pWidget->ResetAppearance(sValue.c_str(), false);
else
- pWidget->ResetAppearance(NULL, FALSE);
+ pWidget->ResetAppearance(NULL, false);
}
}
else
@@ -270,7 +270,7 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormFi
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i);
ASSERT(pWidget != NULL);
- pWidget->ResetAppearance(NULL, FALSE);
+ pWidget->ResetAppearance(NULL, false);
}
}
}
@@ -295,7 +295,7 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormFi
}
void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl,
- FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh)
+ bool bChangeMark, bool bResetAP, bool bRefresh)
{
ASSERT(pDocument != NULL);
ASSERT(pFormControl != NULL);
@@ -312,16 +312,16 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFo
int nFieldType = pWidget->GetFieldType();
if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD)
{
- FX_BOOL bFormated = FALSE;
+ bool bFormated = false;
CFX_WideString sValue = pWidget->OnFormat(bFormated);
if (bFormated)
- pWidget->ResetAppearance(sValue.c_str(), FALSE);
+ pWidget->ResetAppearance(sValue.c_str(), false);
else
- pWidget->ResetAppearance(NULL, FALSE);
+ pWidget->ResetAppearance(NULL, false);
}
else
{
- pWidget->ResetAppearance(NULL, FALSE);
+ pWidget->ResetAppearance(NULL, false);
}
}
@@ -350,17 +350,17 @@ CPDFSDK_Widget* Field::GetWidget(CPDFSDK_Document* pDocument, CPDF_FormControl*
return pInterForm->GetWidget(pFormControl);
}
-FX_BOOL Field::ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel)
+bool Field::ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel)
{
ASSERT(pFormField != NULL);
for (int i=0,sz = pFormField->CountOptions(); i < sz; i++)
{
if (csOptLabel.Compare(pFormField->GetOptionLabel(i)) == 0)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
CPDF_FormControl* Field::GetSmartFieldControl(CPDF_FormField* pFormField)
@@ -376,13 +376,13 @@ CPDF_FormControl* Field::GetSmartFieldControl(CPDF_FormField* pFormField)
/* ---------------------------------------- property ---------------------------------------- */
-FX_BOOL Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
CFX_ByteString alignStr;
vp >> alignStr;
@@ -400,16 +400,16 @@ FX_BOOL Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
+ return false;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
switch (pFormControl->GetControlAlignment())
{
@@ -427,7 +427,7 @@ FX_BOOL Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
}
}
- return TRUE;
+ return true;
}
void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
@@ -436,13 +436,13 @@ void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-FX_BOOL Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
CFX_ByteString strType = "";
vp >> strType;
@@ -460,13 +460,13 @@ FX_BOOL Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- if (!pFormField) return FALSE;
+ if (!pFormField) return false;
CPDFSDK_Widget* pWidget = GetWidget(m_pDocument, GetSmartFieldControl(pFormField));
- if (!pWidget) return FALSE;
+ if (!pWidget) return false;
int nBorderstyle = pWidget->GetBorderStyle();
@@ -493,7 +493,7 @@ FX_BOOL Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
}
}
- return TRUE;
+ return true;
}
void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
@@ -525,7 +525,7 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw
if (nControlIndex < 0)
{
- FX_BOOL bSet = FALSE;
+ bool bSet = false;
for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
{
if (CPDFSDK_Widget* pWidget = GetWidget(pDocument, pFormField->GetControl(j)))
@@ -533,11 +533,11 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw
if (pWidget->GetBorderStyle() != nBorderStyle)
{
pWidget->SetBorderStyle(nBorderStyle);
- bSet = TRUE;
+ bSet = true;
}
}
}
- if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
+ if (bSet) UpdateFormField(pDocument, pFormField, true, true, true);
}
else
{
@@ -549,7 +549,7 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw
if (pWidget->GetBorderStyle() != nBorderStyle)
{
pWidget->SetBorderStyle(nBorderStyle);
- UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
+ UpdateFormControl(pDocument, pFormControl, true, true, true);
}
}
}
@@ -557,13 +557,13 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw
}
}
-FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int nVP;
vp >> nVP;
@@ -581,16 +581,16 @@ FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
+ return false;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
@@ -600,7 +600,7 @@ FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
vp << (int32_t)fLeft;
}
- return TRUE;
+ return true;
}
void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -608,13 +608,13 @@ void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& s
//Not supported.
}
-FX_BOOL Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int nVP;
vp >> nVP;
@@ -632,16 +632,16 @@ FX_BOOL Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
+ return false;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
@@ -651,7 +651,7 @@ FX_BOOL Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
vp << (int32_t)fBottom;
}
- return TRUE;
+ return true;
}
void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -659,13 +659,13 @@ void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& s
//Not supported.
}
-FX_BOOL Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -683,22 +683,22 @@ FX_BOOL Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
+ return false;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
vp << IconFit.GetFittingBounds();
}
- return TRUE;
+ return true;
}
void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -706,13 +706,13 @@ void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument, const CFX_WideString
//Not supported.
}
-FX_BOOL Field::buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int nVP;
vp >> nVP;
@@ -730,20 +730,20 @@ FX_BOOL Field::buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
+ return false;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
vp << pFormControl->GetTextPosition();
}
- return TRUE;
+ return true;
}
void Field::SetButtonPosition(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -751,13 +751,13 @@ void Field::SetButtonPosition(CPDFSDK_Document* pDocument, const CFX_WideString&
//Not supported.
}
-FX_BOOL Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int nVP;
vp >> nVP;
@@ -775,16 +775,16 @@ FX_BOOL Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
+ return false;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
if (IconFit.IsProportionalScale())
@@ -793,7 +793,7 @@ FX_BOOL Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
vp << (int32_t)1;
}
- return TRUE;
+ return true;
}
void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -801,13 +801,13 @@ void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString&
//Not supported.
}
-FX_BOOL Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int nVP;
vp >> nVP;
@@ -825,16 +825,16 @@ FX_BOOL Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*) FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
+ return false;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl) return FALSE;
+ if (!pFormControl) return false;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
int ScaleM = IconFit.GetScaleMethod();
@@ -855,7 +855,7 @@ FX_BOOL Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr
}
}
- return TRUE;
+ return true;
}
void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -863,13 +863,13 @@ void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString
//Not supported.
}
-FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int nVP;
vp >> nVP;
@@ -887,13 +887,13 @@ FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
+ return false;
CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
ASSERT(pRDInterForm != NULL);
@@ -904,7 +904,7 @@ FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
vp << (int32_t)pInterForm->FindFieldInCalculationOrder(pFormField);
}
- return TRUE;
+ return true;
}
void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -912,13 +912,13 @@ void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString&
//Not supported.
}
-FX_BOOL Field::charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int nVP;
vp >> nVP;
@@ -936,17 +936,17 @@ FX_BOOL Field::charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
+ return false;
vp << (int32_t)pFormField->GetMaxLen();
}
- return TRUE;
+ return true;
}
void Field::SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -954,13 +954,13 @@ void Field::SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-FX_BOOL Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -978,13 +978,13 @@ FX_BOOL Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
+ return false;
if (pFormField->GetFieldFlags() & FIELDFLAG_COMB)
vp << true;
@@ -992,7 +992,7 @@ FX_BOOL Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
vp << false;
}
- return TRUE;
+ return true;
}
void Field::SetComb(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -1000,13 +1000,13 @@ void Field::SetComb(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa
//Not supported.
}
-FX_BOOL Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -1024,13 +1024,13 @@ FX_BOOL Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideS
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
- return FALSE;
+ return false;
if (pFormField->GetFieldFlags() & FIELDFLAG_COMMITONSELCHANGE)
vp << true;
@@ -1038,7 +1038,7 @@ FX_BOOL Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideS
vp << false;
}
- return TRUE;
+ return true;
}
void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -1046,13 +1046,13 @@ void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument, const CFX_WideStri
//Not supported.
}
-FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
CFX_DWordArray array;
@@ -1089,13 +1089,13 @@ FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
- return FALSE;
+ return false;
if (pFormField->CountSelectedItems() == 1)
vp << pFormField->GetSelectedIndex(0);
@@ -1112,7 +1112,7 @@ FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid
vp << -1;
}
- return TRUE;
+ return true;
}
void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
@@ -1132,7 +1132,7 @@ void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideSt
if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_LISTBOX)
{
FX_DWORD dwFieldFlags = pFormField->GetFieldFlags();
- pFormField->ClearSelection(TRUE);
+ pFormField->ClearSelection(true);
for (int i=0,sz=array.GetSize(); i<sz; i++)
{
@@ -1143,22 +1143,22 @@ void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideSt
int iSelecting = (int32_t)array.GetAt(i);
if (iSelecting < pFormField->CountOptions() && !pFormField->IsItemSelected(iSelecting))
- pFormField->SetItemSelection(iSelecting, TRUE);
+ pFormField->SetItemSelection(iSelecting, true);
}
- UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
+ UpdateFormField(pDocument, pFormField, true, true, true);
}
}
}
-FX_BOOL Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
// MQG sError = JSGetStringFromID(IDS_STRING_NOTSUPPORT);
- return FALSE;
+ return false;
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
;
}
@@ -1166,7 +1166,7 @@ FX_BOOL Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
{
;
}
- return TRUE;
+ return true;
}
void Field::SetDefaultStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex)
@@ -1174,13 +1174,13 @@ void Field::SetDefaultStyle(CPDFSDK_Document* pDocument, const CFX_WideString& s
//Not supported.
}
-FX_BOOL Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
CFX_WideString WideStr;
vp >> WideStr;
@@ -1198,18 +1198,18 @@ FX_BOOL Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON ||
pFormField->GetFieldType() == FIELDTYPE_SIGNATURE)
- return FALSE;
+ return false;
vp << pFormField->GetDefaultValue();
}
- return TRUE;
+ return true;
}
void Field::SetDefaultValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
@@ -1218,13 +1218,13 @@ void Field::SetDefaultValue(CPDFSDK_Document* pDocument, const CFX_WideString& s
//Not supported.
}
-FX_BOOL Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -1242,13 +1242,13 @@ FX_BOOL Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
+ return false;
if (pFormField->GetFieldFlags() & FIELDFLAG_DONOTSCROLL)
vp << true;
@@ -1256,7 +1256,7 @@ FX_BOOL Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
vp << false;
}
- return TRUE;
+ return true;
}
void Field::SetDoNotScroll(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -1264,13 +1264,13 @@ void Field::SetDoNotScroll(CPDFSDK_Document* pDocument, const CFX_WideString& sw
//Not supported.
}
-FX_BOOL Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -1279,14 +1279,14 @@ FX_BOOL Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD &&
pFormField->GetFieldType() != FIELDTYPE_COMBOBOX)
- return FALSE;
+ return false;
if (pFormField->GetFieldFlags() & FIELDFLAG_DONOTSPELLCHECK)
vp << true;
@@ -1294,10 +1294,10 @@ FX_BOOL Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr
vp << false;
}
- return TRUE;
+ return true;
}
-void Field::SetDelay(FX_BOOL bDelay)
+void Field::SetDelay(bool bDelay)
{
m_bDelay = bDelay;
@@ -1308,11 +1308,11 @@ void Field::SetDelay(FX_BOOL bDelay)
}
}
-FX_BOOL Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -1323,16 +1323,16 @@ FX_BOOL Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
vp << m_bDelay;
}
- return TRUE;
+ return true;
}
-FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int nVP;
vp >> nVP;
@@ -1350,7 +1350,7 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -1359,7 +1359,7 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
ASSERT(pInterForm != NULL);
CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
- if (!pWidget)return FALSE;
+ if (!pWidget)return false;
FX_DWORD dwFlag = pWidget->GetFlags();
@@ -1387,7 +1387,7 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
}
}
- return TRUE;
+ return true;
}
void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -1407,7 +1407,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
if (nControlIndex < 0)
{
- FX_BOOL bSet = FALSE;
+ bool bSet = false;
for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
{
CPDF_FormControl* pFormControl = pFormField->GetControl(j);
@@ -1445,12 +1445,12 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
if (dwFlag != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlag);
- bSet = TRUE;
+ bSet = true;
}
}
}
- if (bSet) UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
+ if (bSet) UpdateFormField(pDocument, pFormField, true, false, true);
}
else
{
@@ -1489,7 +1489,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
if (dwFlag != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlag);
- UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
+ UpdateFormControl(pDocument, pFormControl, true, false, true);
}
}
}
@@ -1497,21 +1497,21 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
}
}
-FX_BOOL Field::doc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::doc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (!vp.IsGetting()) {
- return FALSE;
+ return false;
}
vp << m_pJSDoc->GetCJSDoc();
- return TRUE;
+ return true;
}
-FX_BOOL Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -1520,13 +1520,13 @@ FX_BOOL Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX)
- return FALSE;
+ return false;
if (pFormField->GetFieldFlags() & FIELDFLAG_EDIT)
vp << true;
@@ -1534,30 +1534,30 @@ FX_BOOL Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
vp << false;
}
- return TRUE;
+ return true;
}
-FX_BOOL Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
if (FieldArray.GetSize() <= 0)
- return FALSE;
+ return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX &&
pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
- return FALSE;
+ return false;
if (vp.IsSetting())
{
if (!m_bCanSet)
- return FALSE;
+ return false;
if (!vp.IsArrayObject())
- return FALSE;
+ return false;
}
else
{
@@ -1573,36 +1573,36 @@ FX_BOOL Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
else
{
if (m_nFormControlIndex >= pFormField->CountControls())
- return FALSE;
+ return false;
CPDF_FormControl* pFormControl = pFormField->GetControl(m_nFormControlIndex);
if (!pFormControl)
- return FALSE;
+ return false;
ExportValusArray.SetElement(0, CJS_Value(m_isolate,pFormControl->GetExportValue().c_str()));
}
vp << ExportValusArray;
}
- return TRUE;
+ return true;
}
-FX_BOOL Field::fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
if (FieldArray.GetSize() <= 0)
- return FALSE;
+ return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
+ return false;
if (vp.IsSetting())
{
if (!m_bCanSet)
- return FALSE;
+ return false;
bool bVP;
vp >> bVP;
@@ -1614,10 +1614,10 @@ FX_BOOL Field::fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
else
vp << false;
}
- return TRUE;
+ return true;
}
-FX_BOOL Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -1626,15 +1626,15 @@ FX_BOOL Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
if (FieldArray.GetSize() <= 0)
- return FALSE;
+ return false;
if (vp.IsSetting())
{
if (!m_bCanSet)
- return FALSE;
+ return false;
if (!vp.IsArrayObject())
- return FALSE;
+ return false;
vp >> crArray;
@@ -1656,7 +1656,7 @@ FX_BOOL Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
if (!pFormControl)
- return FALSE;
+ return false;
int iColorType;
pFormControl->GetBackgroundColor(iColorType);
@@ -1684,13 +1684,13 @@ FX_BOOL Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
pFormControl->GetOriginalBackgroundColor(3));
}
else
- return FALSE;
+ return false;
color::ConvertPWLColorToArray(color, crArray);
vp << crArray;
}
- return TRUE;
+ return true;
}
void Field::SetFillColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color)
@@ -1698,13 +1698,13 @@ void Field::SetFillColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-FX_BOOL Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -1722,7 +1722,7 @@ FX_BOOL Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -1731,7 +1731,7 @@ FX_BOOL Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
ASSERT(pInterForm != NULL);
CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
- if (!pWidget) return FALSE;
+ if (!pWidget) return false;
FX_DWORD dwFlags = pWidget->GetFlags();
@@ -1743,7 +1743,7 @@ FX_BOOL Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
vp << false;
}
- return TRUE;
+ return true;
}
void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -1763,7 +1763,7 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField
if (nControlIndex < 0)
{
- FX_BOOL bSet = FALSE;
+ bool bSet = false;
for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
{
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(j)))
@@ -1787,13 +1787,13 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField
if (dwFlags != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlags);
- bSet = TRUE;
+ bSet = true;
}
}
}
if (bSet)
- UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
+ UpdateFormField(pDocument, pFormField, true, false, true);
}
else
{
@@ -1821,7 +1821,7 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField
if (dwFlags != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlags);
- UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
+ UpdateFormControl(pDocument, pFormControl, true, false, true);
}
}
}
@@ -1829,13 +1829,13 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField
}
}
-FX_BOOL Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
CFX_ByteString strMode;
vp >> strMode;
@@ -1853,16 +1853,16 @@ FX_BOOL Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
+ return false;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl) return FALSE;
+ if (!pFormControl) return false;
int eHM = pFormControl->GetHighlightingMode();
switch (eHM)
@@ -1885,7 +1885,7 @@ FX_BOOL Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
}
}
- return TRUE;
+ return true;
}
void Field::SetHighlight(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string)
@@ -1893,13 +1893,13 @@ void Field::SetHighlight(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-FX_BOOL Field::lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int iWidth;
vp >> iWidth;
@@ -1917,26 +1917,26 @@ FX_BOOL Field::lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl) return FALSE;
+ if (!pFormControl) return false;
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
ASSERT(pInterForm != NULL);
- if(!pFormField->CountControls()) return FALSE;
+ if(!pFormField->CountControls()) return false;
CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(0));
- if (!pWidget) return FALSE;
+ if (!pWidget) return false;
vp << (int32_t)pWidget->GetBorderWidth();
}
- return TRUE;
+ return true;
}
void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -1956,7 +1956,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
if (nControlIndex < 0)
{
- FX_BOOL bSet = FALSE;
+ bool bSet = false;
for (int j=0,jsz=pFormField->CountControls(); j<jsz; j++)
{
CPDF_FormControl* pFormControl = pFormField->GetControl(j);
@@ -1967,11 +1967,11 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
if (number != pWidget->GetBorderWidth())
{
pWidget->SetBorderWidth(number);
- bSet = TRUE;
+ bSet = true;
}
}
}
- if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
+ if (bSet) UpdateFormField(pDocument, pFormField, true, true, true);
}
else
{
@@ -1983,7 +1983,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
if (number != pWidget->GetBorderWidth())
{
pWidget->SetBorderWidth(number);
- UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
+ UpdateFormControl(pDocument, pFormControl, true, true, true);
}
}
}
@@ -1991,13 +1991,13 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
}
}
-FX_BOOL Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -2015,13 +2015,13 @@ FX_BOOL Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
+ return false;
if (pFormField->GetFieldFlags() & FIELDFLAG_MULTILINE)
vp << true;
@@ -2029,7 +2029,7 @@ FX_BOOL Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
vp << false;
}
- return TRUE;
+ return true;
}
void Field::SetMultiline(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -2037,13 +2037,13 @@ void Field::SetMultiline(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-FX_BOOL Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -2061,13 +2061,13 @@ FX_BOOL Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideS
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
- return FALSE;
+ return false;
if (pFormField->GetFieldFlags() & FIELDFLAG_MULTISELECT)
vp << true;
@@ -2075,7 +2075,7 @@ FX_BOOL Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideS
vp << false;
}
- return TRUE;
+ return true;
}
void Field::SetMultipleSelection(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -2083,49 +2083,49 @@ void Field::SetMultipleSelection(CPDFSDK_Document* pDocument, const CFX_WideStri
//Not supported.
}
-FX_BOOL Field::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting()) return FALSE;
+ if (!vp.IsGetting()) return false;
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
vp << m_FieldName;
- return TRUE;
+ return true;
}
-FX_BOOL Field::numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX &&
pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
- return FALSE;
+ return false;
- if (!vp.IsGetting()) return FALSE;
+ if (!vp.IsGetting()) return false;
vp << (int32_t)pFormField->CountOptions();
- return TRUE;
+ return true;
}
-FX_BOOL Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting()) return FALSE;
+ if (!vp.IsGetting()) return false;
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- if (!pFormField) return FALSE;
+ if (!pFormField) return false;
ASSERT(m_pDocument != NULL);
@@ -2146,7 +2146,7 @@ FX_BOOL Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
CPDFSDK_PageView* pPageView = pWidget->GetPageView();
if(!pPageView)
- return FALSE;
+ return false;
PageArray.SetElement(i, CJS_Value(m_isolate,(int32_t)pPageView->GetPageIndex()));
}
@@ -2158,16 +2158,16 @@ FX_BOOL Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
vp << (int32_t) -1;
}
- return TRUE;
+ return true;
}
-FX_BOOL Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -2185,13 +2185,13 @@ FX_BOOL Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
+ return false;
if (pFormField->GetFieldFlags() & FIELDFLAG_PASSWORD)
vp << true;
@@ -2199,7 +2199,7 @@ FX_BOOL Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
vp << false;
}
- return TRUE;
+ return true;
}
void Field::SetPassword(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -2207,7 +2207,7 @@ void Field::SetPassword(CPDFSDK_Document* pDocument, const CFX_WideString& swFie
//Not supported.
}
-FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -2216,11 +2216,11 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -2232,7 +2232,7 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
if (m_nFormControlIndex < 0)
{
- FX_BOOL bSet = FALSE;
+ bool bSet = false;
for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
{
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(j)))
@@ -2246,17 +2246,17 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
if (dwFlags != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlags);
- bSet = TRUE;
+ bSet = true;
}
}
}
if (bSet)
- UpdateFormField(m_pDocument, pFormField, TRUE, FALSE, TRUE);
+ UpdateFormField(m_pDocument, pFormField, true, false, true);
}
else
{
- if(m_nFormControlIndex >= pFormField->CountControls()) return FALSE;
+ if(m_nFormControlIndex >= pFormField->CountControls()) return false;
if (CPDF_FormControl* pFormControl = pFormField->GetControl(m_nFormControlIndex))
{
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
@@ -2270,7 +2270,7 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
if (dwFlags != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlags);
- UpdateFormControl(m_pDocument, pFormField->GetControl(m_nFormControlIndex), TRUE, FALSE, TRUE);
+ UpdateFormControl(m_pDocument, pFormField->GetControl(m_nFormControlIndex), true, false, true);
}
}
}
@@ -2283,7 +2283,7 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
ASSERT(pFormField != NULL);
CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
- if (!pWidget) return FALSE;
+ if (!pWidget) return false;
if (pWidget->GetFlags() & ANNOTFLAG_PRINT)
vp << true;
@@ -2291,20 +2291,20 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << false;
}
- return TRUE;
+ return true;
}
-FX_BOOL Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -2316,7 +2316,7 @@ FX_BOOL Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
- return FALSE;
+ return false;
if (pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON)
vp << true;
@@ -2324,20 +2324,20 @@ FX_BOOL Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
vp << false;
}
- return TRUE;
+ return true;
}
-FX_BOOL Field::readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -2354,17 +2354,17 @@ FX_BOOL Field::readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
vp << false;
}
- return TRUE;
+ return true;
}
-FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
- if (!vp.IsArrayObject())return FALSE;
+ if (!m_bCanSet) return false;
+ if (!vp.IsArrayObject())return false;
CJS_Array rcArray(m_isolate);
vp >> rcArray;
@@ -2395,7 +2395,7 @@ FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -2404,7 +2404,7 @@ FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
ASSERT(pInterForm != NULL);
CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
- if (!pWidget) return FALSE;
+ if (!pWidget) return false;
CFX_FloatRect crRect = pWidget->GetRect();
CJS_Value Upper_Leftx(m_isolate),Upper_Lefty(m_isolate),Lower_Rightx(m_isolate),Lower_Righty(m_isolate);
@@ -2422,7 +2422,7 @@ FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
vp << rcArray;
}
- return TRUE;
+ return true;
}
void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPDF_Rect& rect)
@@ -2442,7 +2442,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa
if (nControlIndex < 0)
{
- FX_BOOL bSet = FALSE;
+ bool bSet = false;
for (int i=0, sz=pFormField->CountControls(); i<sz; i++)
{
CPDF_FormControl* pFormControl = pFormField->GetControl(i);
@@ -2469,13 +2469,13 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa
crRect.bottom != rcOld.bottom)
{
pWidget->SetRect(crRect);
- bSet = TRUE;
+ bSet = true;
}
}
}
}
- if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
+ if (bSet) UpdateFormField(pDocument, pFormField, true, true, true);
}
else
{
@@ -2503,7 +2503,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa
crRect.bottom != rcOld.bottom)
{
pWidget->SetRect(crRect);
- UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
+ UpdateFormControl(pDocument, pFormControl, true, true, true);
}
}
}
@@ -2512,17 +2512,17 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa
}
}
-FX_BOOL Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
@@ -2535,7 +2535,7 @@ FX_BOOL Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return FALSE;
+ return false;
if (pFormField->GetFieldFlags() & FIELDFLAG_REQUIRED)
vp << true;
@@ -2543,16 +2543,16 @@ FX_BOOL Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
vp << false;
}
- return TRUE;
+ return true;
}
-FX_BOOL Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
bool bVP;
vp >> bVP;
@@ -2570,13 +2570,13 @@ FX_BOOL Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
+ return false;
if (pFormField->GetFieldFlags() & FIELDFLAG_RICHTEXT)
vp << true;
@@ -2584,7 +2584,7 @@ FX_BOOL Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
vp << false;
}
- return TRUE;
+ return true;
}
void Field::SetRichText(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -2592,19 +2592,19 @@ void Field::SetRichText(CPDFSDK_Document* pDocument, const CFX_WideString& swFie
//Not supported.
}
-FX_BOOL Field::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
;
}
else
{
;
}
- return TRUE;
+ return true;
}
void Field::SetRichValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex)
@@ -2612,13 +2612,13 @@ void Field::SetRichValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-FX_BOOL Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int nVP;
vp >> nVP;
@@ -2636,18 +2636,18 @@ FX_BOOL Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
vp << (int32_t)pFormControl->GetRotation();
}
- return TRUE;
+ return true;
}
void Field::SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -2655,15 +2655,15 @@ void Field::SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFie
//Not supported.
}
-FX_BOOL Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
- if (!vp.IsArrayObject())return FALSE;
+ if (!vp.IsArrayObject())return false;
CJS_Array crArray(m_isolate);
vp >> crArray;
@@ -2684,13 +2684,13 @@ FX_BOOL Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
int iColorType;
pFormControl->GetBorderColor(iColorType);
@@ -2719,14 +2719,14 @@ FX_BOOL Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
pFormControl->GetOriginalBorderColor(3));
}
else
- return FALSE;
+ return false;
CJS_Array crArray(m_isolate);
color::ConvertPWLColorToArray(color, crArray);
vp << crArray;
}
- return TRUE;
+ return true;
}
void Field::SetStrokeColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color)
@@ -2734,13 +2734,13 @@ void Field::SetStrokeColor(CPDFSDK_Document* pDocument, const CFX_WideString& sw
//Not supported.
}
-FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
CFX_ByteString csBCaption;
vp >> csBCaption;
@@ -2758,17 +2758,17 @@ FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON &&
pFormField->GetFieldType() != FIELDTYPE_CHECKBOX)
- return FALSE;
+ return false;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl) return FALSE;
+ if (!pFormControl) return false;
CFX_WideString csWCaption = pFormControl->GetNormalCaption();
CFX_ByteString csBCaption;
@@ -2797,7 +2797,7 @@ FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << csBCaption;
}
- return TRUE;
+ return true;
}
void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
@@ -2806,21 +2806,21 @@ void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
//Not supported.
}
-FX_BOOL Field::submitName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::submitName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
CJS_Array crArray(m_isolate);
- if (!vp.IsArrayObject())return FALSE;
+ if (!vp.IsArrayObject())return false;
vp >> crArray;
CPWL_Color color;
@@ -2839,13 +2839,13 @@ FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
int iColorType;
FX_ARGB color;
@@ -2866,7 +2866,7 @@ FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
vp << crArray;
}
- return TRUE;
+ return true;
}
void Field::SetTextColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color)
@@ -2874,17 +2874,17 @@ void Field::SetTextColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-FX_BOOL Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
CFX_ByteString csFontName;
vp >> csFontName;
- if (csFontName.IsEmpty()) return FALSE;
+ if (csFontName.IsEmpty()) return false;
if (m_bDelay)
{
@@ -2899,13 +2899,13 @@ FX_BOOL Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
int nFieldType = pFormField->GetFieldType();
@@ -2915,15 +2915,15 @@ FX_BOOL Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
nFieldType == FIELDTYPE_TEXTFIELD)
{
CPDF_Font * pFont = pFormControl->GetDefaultControlFont();
- if (!pFont) return FALSE;
+ if (!pFont) return false;
vp << pFont->GetBaseFont();
}
else
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
void Field::SetTextFont(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string)
@@ -2931,13 +2931,13 @@ void Field::SetTextFont(CPDFSDK_Document* pDocument, const CFX_WideString& swFie
//Not supported.
}
-FX_BOOL Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int nVP;
vp >> nVP;
@@ -2955,13 +2955,13 @@ FX_BOOL Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance();
@@ -2972,7 +2972,7 @@ FX_BOOL Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
vp << (int)fFontSize;
}
- return TRUE;
+ return true;
}
void Field::SetTextSize(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -2980,15 +2980,15 @@ void Field::SetTextSize(CPDFSDK_Document* pDocument, const CFX_WideString& swFie
//Not supported.
}
-FX_BOOL Field::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!vp.IsGetting()) return FALSE;
+ if (!vp.IsGetting()) return false;
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -3024,16 +3024,16 @@ FX_BOOL Field::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
break;
}
- return TRUE;
+ return true;
}
-FX_BOOL Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
CFX_WideString swName;
vp >> swName;
@@ -3051,7 +3051,7 @@ FX_BOOL Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -3059,7 +3059,7 @@ FX_BOOL Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
vp << (CFX_WideString)pFormField->GetAlternateName();
}
- return TRUE;
+ return true;
}
void Field::SetUserName(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_WideString& string)
@@ -3067,13 +3067,13 @@ void Field::SetUserName(CPDFSDK_Document* pDocument, const CFX_WideString& swFie
//Not supported.
}
-FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
CJS_WideStringArray strArray;
@@ -3109,7 +3109,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -3119,14 +3119,14 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
switch (pFormField->GetFieldType())
{
case FIELDTYPE_PUSHBUTTON:
- return FALSE;
+ return false;
case FIELDTYPE_COMBOBOX:
case FIELDTYPE_TEXTFIELD:
{
CFX_WideString swValue = pFormField->GetValue();
double dRet;
- FX_BOOL bDot;
+ bool bDot;
if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
{
if (bDot)
@@ -3160,7 +3160,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
CFX_WideString swValue = pFormField->GetValue();
double dRet;
- FX_BOOL bDot;
+ bool bDot;
if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
{
if (bDot)
@@ -3176,14 +3176,14 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
case FIELDTYPE_CHECKBOX:
case FIELDTYPE_RADIOBUTTON:
{
- FX_BOOL bFind = FALSE;
+ bool bFind = false;
for (int i = 0 , sz = pFormField->CountControls(); i < sz; i++)
{
if (pFormField->GetControl(i)->IsChecked())
{
CFX_WideString swValue = pFormField->GetControl(i)->GetExportValue();
double dRet;
- FX_BOOL bDot;
+ bool bDot;
if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
{
if (bDot)
@@ -3194,7 +3194,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
else
vp << swValue;
- bFind = TRUE;
+ bFind = true;
break;
}
else
@@ -3210,7 +3210,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
}
}
- return TRUE;
+ return true;
}
void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName,
@@ -3238,8 +3238,8 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
if (pFormField->GetValue() != strArray.GetAt(0))
{
CFX_WideString WideString = strArray.GetAt(0);
- pFormField->SetValue(strArray.GetAt(0), TRUE);
- UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
+ pFormField->SetValue(strArray.GetAt(0), true);
+ UpdateFormField(pDocument, pFormField, true, false, true);
}
break;
case FIELDTYPE_CHECKBOX: //mantis: 0004493
@@ -3247,14 +3247,14 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
{
if (pFormField->GetValue() != strArray.GetAt(0))
{
- pFormField->SetValue(strArray.GetAt(0), TRUE);
- UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
+ pFormField->SetValue(strArray.GetAt(0), true);
+ UpdateFormField(pDocument, pFormField, true, false, true);
}
}
break;
case FIELDTYPE_LISTBOX:
{
- FX_BOOL bModified = FALSE;
+ bool bModified = false;
for (int i=0,sz=strArray.GetSize(); i<sz; i++)
{
@@ -3262,21 +3262,21 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
if (!pFormField->IsItemSelected(iIndex))
{
- bModified = TRUE;
+ bModified = true;
break;
}
}
if (bModified)
{
- pFormField->ClearSelection(TRUE);
+ pFormField->ClearSelection(true);
for (int i=0,sz=strArray.GetSize(); i<sz; i++)
{
int iIndex = pFormField->FindOption(strArray.GetAt(i));
- pFormField->SetItemSelection(iIndex, TRUE, TRUE);
+ pFormField->SetItemSelection(iIndex, true, true);
}
- UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
+ UpdateFormField(pDocument, pFormField, true, false, true);
}
}
break;
@@ -3286,25 +3286,25 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
}
}
-FX_BOOL Field::valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!vp.IsGetting()) return FALSE;
+ if (!vp.IsGetting()) return false;
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return FALSE;
+ return false;
if (pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
{
- if(!pFormField->CountControls()) return FALSE;
+ if(!pFormField->CountControls()) return false;
if (pFormField->GetControl(0)->IsChecked())
vp << L"Yes";
@@ -3331,18 +3331,18 @@ FX_BOOL Field::valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStrin
else
vp << pFormField->GetValue().c_str();
- return TRUE;
+ return true;
}
/* --------------------------------- methods --------------------------------- */
-FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -3357,17 +3357,17 @@ FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& pa
if(!wsFileName.IsEmpty())
{
pFormField->SetValue(wsFileName);
- UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE);
+ UpdateFormField(m_pDocument, pFormField, true, true, true);
}
}
else
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
-FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3378,16 +3378,16 @@ FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params,
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
+ return false;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
if (nface == 0)
vRet = pFormControl->GetNormalCaption().c_str();
@@ -3396,14 +3396,14 @@ FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params,
else if (nface == 2)
vRet = pFormControl->GetRolloverCaption().c_str();
else
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
//#pragma warning(disable: 4800)
-FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3414,16 +3414,16 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
+ return false;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -3432,7 +3432,7 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
ASSERT(pRuntime != NULL);
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
- ASSERT(pObj.IsEmpty() == FALSE);
+ ASSERT(pObj.IsEmpty() == false);
CJS_Icon* pJS_Icon = (CJS_Icon*)JS_GetPrivate(pObj);
ASSERT(pJS_Icon != NULL);
@@ -3448,27 +3448,27 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
else if (nface == 2)
pIconStream = pFormControl->GetRolloverIcon();
else
- return FALSE;
+ return false;
pIcon->SetStream(pIconStream);
vRet = pJS_Icon;
- return TRUE;
+ return true;
}
//#pragma warning(default: 4800)
-FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
#if 0
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- if (!pFormField)return FALSE;
+ if (!pFormField)return false;
CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
ASSERT(pEnv);
@@ -3477,7 +3477,7 @@ FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params,
if (sIconFileName.IsEmpty())
{
vRet = 1;
- return TRUE;
+ return true;
}
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
@@ -3487,110 +3487,110 @@ FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params,
if (!pStream)
{
vRet = -1;
- return TRUE;
+ return true;
}
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
+ if (!pFormControl)return false;
pFormControl->SetNormalIcon(pStream);
- UpdateFormControl(m_pDocument, pFormControl, TRUE, TRUE, TRUE);
+ UpdateFormControl(m_pDocument, pFormControl, true, true, true);
vRet = 0;
#endif // 0
- return TRUE;
+ return true;
}
-FX_BOOL Field::buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL Field::buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL Field::checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int iSize = params.size();
if (iSize < 1)
- return FALSE;
+ return false;
int nWidget = params[0].ToInt();
- FX_BOOL bCheckit = TRUE;
+ bool bCheckit = true;
if (iSize >= 2)
bCheckit = params[1].ToBool();
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX && pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
- return FALSE;
+ return false;
if(nWidget <0 || nWidget >= pFormField->CountControls())
- return FALSE;
+ return false;
if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON)
- pFormField->CheckControl(nWidget, bCheckit, TRUE);
+ pFormField->CheckControl(nWidget, bCheckit, true);
else
- pFormField->CheckControl(nWidget, bCheckit, TRUE);
+ pFormField->CheckControl(nWidget, bCheckit, true);
- UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE);
- return TRUE;
+ UpdateFormField(m_pDocument, pFormField, true, true, true);
+ return true;
}
-FX_BOOL Field::clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Field::defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!m_bCanSet) return FALSE;
+ if (!m_bCanSet) return false;
int iSize = params.size();
if (iSize < 1)
- return FALSE;
+ return false;
int nWidget = params[0].ToInt();
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if(nWidget <0 || nWidget >= pFormField->CountControls())
{
- vRet = FALSE;
- return FALSE;
+ vRet = false;
+ return false;
}
if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
|| (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON))
{
- vRet = TRUE;
+ vRet = true;
}
else
- vRet = FALSE;
+ vRet = false;
- return TRUE;
+ return true;
}
-FX_BOOL Field::deleteItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::deleteItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2)
@@ -3602,13 +3602,13 @@ int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2)
}
-FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CGW_ArrayTemplate<CFX_WideString*> swSort;
@@ -3633,7 +3633,7 @@ FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
CFX_WideString* pStr = swSort.GetAt(j);
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Field"));
- ASSERT(pObj.IsEmpty() == FALSE);
+ ASSERT(pObj.IsEmpty() == false);
CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pObj);
ASSERT(pJSField != NULL);
@@ -3652,10 +3652,10 @@ FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
vRet = FormFieldArray;
swSort.RemoveAll();
- return TRUE;
+ return true;
}
-FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
int iSize = params.size();
@@ -3664,13 +3664,13 @@ FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
if (iSize >= 1)
nIdx = params[0].ToInt();
- FX_BOOL bExport = TRUE;
+ bool bExport = true;
if (iSize >= 2)
bExport = params[1].ToBool();
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -3692,22 +3692,22 @@ FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
vRet = pFormField->GetOptionLabel(nIdx).c_str();
}
else
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
-FX_BOOL Field::getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL Field::insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3717,32 +3717,32 @@ FX_BOOL Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if(nIndex <0 || nIndex >= pFormField->CountControls())
{
- vRet = FALSE;
- return FALSE;
+ vRet = false;
+ return false;
}
if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
|| (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON))
{
if (pFormField->GetControl(nIndex)->IsChecked() !=0 )
- vRet = TRUE;
+ vRet = true;
else
- vRet = FALSE;
+ vRet = false;
}
else
- vRet = FALSE;
+ vRet = false;
- return TRUE;
+ return true;
}
-FX_BOOL Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3752,49 +3752,49 @@ FX_BOOL Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params,
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if(nIndex <0 || nIndex >= pFormField->CountControls())
{
- vRet = FALSE;
- return FALSE;
+ vRet = false;
+ return false;
}
if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
|| (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON))
{
if (pFormField->GetControl(nIndex)->IsDefaultChecked() != 0)
- vRet = TRUE;
+ vRet = true;
else
- vRet = FALSE;
+ vRet = false;
}
else
- vRet = FALSE;
+ vRet = false;
- return TRUE;
+ return true;
}
-FX_BOOL Field::setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
+ if (FieldArray.GetSize() <= 0) return false;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
int32_t nCount = pFormField->CountControls();
- if (nCount < 1) return FALSE;
+ if (nCount < 1) return false;
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
ASSERT(pInterForm != NULL);
@@ -3810,7 +3810,7 @@ FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
ASSERT(pEnv);
CPDF_Page* pPage = (CPDF_Page*)pEnv->FFI_GetCurrentPage(m_pDocument->GetDocument());
if(!pPage)
- return FALSE;
+ return false;
if (CPDFSDK_PageView* pCurPageView = m_pDocument->GetPageView(pPage))
{
for (int32_t i=0; i<nCount; i++)
@@ -3832,57 +3832,57 @@ FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
m_pDocument->SetFocusAnnot(pWidget);
}
- return TRUE;
+ return true;
}
-FX_BOOL Field::setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL Field::setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL Field::signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL Field::signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL Field::signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL Field::signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL Field::signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL Field::signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Field::signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL Field::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Field::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << (CJS_Object*)NULL;
}
- return TRUE;
+ return true;
}
/////////////////////////////////////////// delay /////////////////////////////////////////////
diff --git a/fpdfsdk/src/javascript/Icon.cpp b/fpdfsdk/src/javascript/Icon.cpp
index 6b3e02e1ec..27a9773235 100644
--- a/fpdfsdk/src/javascript/Icon.cpp
+++ b/fpdfsdk/src/javascript/Icon.cpp
@@ -57,11 +57,11 @@ CFX_WideString Icon::GetIconName()
return m_swIconName;
}
-FX_BOOL Icon::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool Icon::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if(!vp.IsGetting())return FALSE;
+ if(!vp.IsGetting())return false;
vp << m_swIconName;
- return TRUE;
+ return true;
}
diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp
index 72be34d751..0edbf0d0e5 100644
--- a/fpdfsdk/src/javascript/JS_Context.cpp
+++ b/fpdfsdk/src/javascript/JS_Context.cpp
@@ -16,8 +16,8 @@
CJS_Context::CJS_Context(CJS_Runtime* pRuntime) :
m_pRuntime(pRuntime),
- m_bBusy(FALSE),
- m_bMsgBoxEnable(TRUE)
+ m_bBusy(false),
+ m_bMsgBoxEnable(true)
{
m_pEventHandler = new CJS_EventHandler(this);
}
@@ -41,15 +41,15 @@ CPDFDoc_Environment* CJS_Context::GetReaderApp()
return m_pRuntime->GetReaderApp();
}
-FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info)
+bool CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info)
{
if (m_bBusy)
{
info = JSGetStringFromID(this, IDS_STRING_JSBUSY);
- return FALSE;
+ return false;
}
- m_bBusy = TRUE;
+ m_bBusy = true;
ASSERT(m_pRuntime != NULL);
ASSERT(m_pEventHandler != NULL);
@@ -58,7 +58,7 @@ FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideStri
if (!m_pRuntime->AddEventToLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType()))
{
info = JSGetStringFromID(this, IDS_STRING_JSEVENT);
- return FALSE;
+ return false;
}
FXJSErr error ={NULL,NULL, 0};
@@ -95,12 +95,12 @@ FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideStri
m_pRuntime->RemoveEventInLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType());
m_pEventHandler->Destroy();
- m_bBusy = FALSE;
+ m_bBusy = false;
return nRet >= 0;
}
-FX_BOOL CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& info)
+bool CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& info)
{
v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate());
v8::HandleScope handle_scope(m_pRuntime->GetIsolate());
@@ -110,7 +110,7 @@ FX_BOOL CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& inf
return DoJob(0, script, info);
}
-FX_BOOL CJS_Context::Compile(const CFX_WideString& script, CFX_WideString& info)
+bool CJS_Context::Compile(const CFX_WideString& script, CFX_WideString& info)
{
v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate());
v8::HandleScope handle_scope(m_pRuntime->GetIsolate());
@@ -186,58 +186,58 @@ void CJS_Context::OnPage_OutView(CPDFSDK_Document* pTarget)
m_pEventHandler->OnPage_OutView(pTarget);
}
-void CJS_Context::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseDown(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseEnter(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseExit(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseUp(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
+void CJS_Context::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Focus(bModifier, bShift, pTarget, Value);
}
-void CJS_Context::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
+void CJS_Context::OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Blur(bModifier, bShift, pTarget, Value);
}
-void CJS_Context::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc)
+void CJS_Context::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Calculate(pSource, pTarget, Value, bRc);
}
-void CJS_Context::OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit)
+void CJS_Context::OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit)
{
m_pEventHandler->OnField_Format(pTarget, Value, bWillCommit);
}
void CJS_Context::OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- FX_BOOL bKeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart,
- FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value,
- FX_BOOL bWillCommit, FX_BOOL bFieldFull, FX_BOOL& bRc)
+ bool bKeyDown, bool bModifier, int &nSelEnd,int &nSelStart,
+ bool bShift, CPDF_FormField* pTarget, CFX_WideString& Value,
+ bool bWillCommit, bool bFieldFull, bool& bRc)
{
m_pEventHandler->OnField_Keystroke(
strChange, strChangeEx, bKeyDown, bModifier, nSelEnd, nSelStart,
@@ -245,68 +245,68 @@ void CJS_Context::OnField_Keystroke(CFX_WideString& strChange, const CFX_WideStr
}
void CJS_Context::OnField_Validate(CFX_WideString& strChange,const CFX_WideString& strChangeEx,
- FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
- CFX_WideString& Value, FX_BOOL& bRc)
+ bool bKeyDown, bool bModifier, bool bShift, CPDF_FormField* pTarget,
+ CFX_WideString& Value, bool& bRc)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Validate(strChange, strChangeEx, bKeyDown, bModifier, bShift, pTarget, Value, bRc);
}
-void CJS_Context::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Focus(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Blur(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Open(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Close(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseDown(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseUp(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseEnter(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseExit(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_InView(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_OutView(bModifier, bShift, pScreen);
diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp
index 1769e3053f..1056c446f4 100644
--- a/fpdfsdk/src/javascript/JS_EventHandler.cpp
+++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp
@@ -20,21 +20,21 @@
CJS_EventHandler::CJS_EventHandler(CJS_Context * pContext) :
m_pJSContext(pContext),
m_eEventType(JET_UNKNOWN),
- m_bValid(FALSE),
+ m_bValid(false),
m_pWideStrChange(NULL),
m_nCommitKey(-1),
- m_bKeyDown(FALSE),
- m_bModifier(FALSE),
- m_bShift(FALSE),
+ m_bKeyDown(false),
+ m_bModifier(false),
+ m_bShift(false),
m_pISelEnd(NULL),
m_nSelEndDu(0),
m_pISelStart(NULL),
m_nSelStartDu(0),
- m_bWillCommit(FALSE),
+ m_bWillCommit(false),
m_pValue(NULL),
- m_bFieldFull(FALSE),
+ m_bFieldFull(false),
m_pbRc(NULL),
- m_bRcDu(FALSE),
+ m_bRcDu(false),
m_pSourceDoc(NULL),
m_pTargetBookMark(NULL),
m_pTargetDoc(NULL),
@@ -121,7 +121,7 @@ void CJS_EventHandler::OnPage_OutView(CPDFSDK_Document* pDoc)
m_pTargetDoc = pDoc;
}
-void CJS_EventHandler::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEENTER);
@@ -132,7 +132,7 @@ void CJS_EventHandler::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPD
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEEXIT);
@@ -142,7 +142,7 @@ void CJS_EventHandler::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEDOWN);
m_eEventType = JET_FIELD_MOUSEDOWN;
@@ -153,7 +153,7 @@ void CJS_EventHandler::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEUP);
@@ -163,7 +163,7 @@ void CJS_EventHandler::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_F
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
+void CJS_EventHandler::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget,
const CFX_WideString& Value)
{
Initial(JET_FIELD_FOCUS);
@@ -175,7 +175,7 @@ void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_For
m_pValue = (CFX_WideString*)&Value;
}
-void CJS_EventHandler::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
+void CJS_EventHandler::OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget,
const CFX_WideString& Value)
{
Initial(JET_FIELD_BLUR);
@@ -188,11 +188,11 @@ void CJS_EventHandler::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_Form
}
void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange,
- const CFX_WideString& strChangeEx, FX_BOOL KeyDown,
- FX_BOOL bModifier, int& nSelEnd, int& nSelStart,
- FX_BOOL bShift, CPDF_FormField* pTarget,
- CFX_WideString& Value, FX_BOOL bWillCommit,
- FX_BOOL bFieldFull, FX_BOOL& bRc)
+ const CFX_WideString& strChangeEx, bool KeyDown,
+ bool bModifier, int& nSelEnd, int& nSelStart,
+ bool bShift, CPDF_FormField* pTarget,
+ CFX_WideString& Value, bool bWillCommit,
+ bool bFieldFull, bool& bRc)
{
Initial(JET_FIELD_KEYSTROKE);
@@ -213,8 +213,8 @@ void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange,
}
void CJS_EventHandler::OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift,
- CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc)
+ bool bKeyDown, bool bModifier, bool bShift,
+ CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc)
{
Initial(JET_FIELD_VALIDATE);
@@ -230,7 +230,7 @@ void CJS_EventHandler::OnField_Validate(CFX_WideString& strChange, const CFX_Wid
}
void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget,
- CFX_WideString& Value, FX_BOOL& bRc)
+ CFX_WideString& Value, bool& bRc)
{
Initial(JET_FIELD_CALCULATE);
@@ -244,7 +244,7 @@ void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField
void CJS_EventHandler::OnField_Format(CPDF_FormField* pTarget,
CFX_WideString& Value,
- FX_BOOL bWillCommit)
+ bool bWillCommit)
{
Initial(JET_FIELD_FORMAT);
@@ -255,7 +255,7 @@ void CJS_EventHandler::OnField_Format(CPDF_FormField* pTarget,
m_bWillCommit = bWillCommit;
}
-void CJS_EventHandler::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_FOCUS);
@@ -264,7 +264,7 @@ void CJS_EventHandler::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_BLUR);
@@ -273,7 +273,7 @@ void CJS_EventHandler::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_OPEN);
@@ -282,7 +282,7 @@ void CJS_EventHandler::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_CLOSE);
@@ -291,7 +291,7 @@ void CJS_EventHandler::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEDOWN);
@@ -300,7 +300,7 @@ void CJS_EventHandler::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPD
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEUP);
@@ -309,7 +309,7 @@ void CJS_EventHandler::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFS
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEENTER);
@@ -318,7 +318,7 @@ void CJS_EventHandler::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CP
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEEXIT);
@@ -327,7 +327,7 @@ void CJS_EventHandler::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPD
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_INVIEW);
@@ -336,7 +336,7 @@ void CJS_EventHandler::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSD
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_OUTVIEW);
@@ -395,33 +395,33 @@ void CJS_EventHandler::Initial(JS_EVENT_T type)
m_WideStrChangeDu = L"";
m_WideStrChangeEx = L"";
m_nCommitKey = -1;
- m_bKeyDown = FALSE;
- m_bModifier = FALSE;
- m_bShift = FALSE;
+ m_bKeyDown = false;
+ m_bModifier = false;
+ m_bShift = false;
m_pISelEnd = NULL;
m_nSelEndDu = 0;
m_pISelStart = NULL;
m_nSelStartDu = 0;
- m_bWillCommit = FALSE;
+ m_bWillCommit = false;
m_pValue = NULL;
- m_bFieldFull = FALSE;
+ m_bFieldFull = false;
m_pbRc = NULL;
- m_bRcDu = FALSE;
+ m_bRcDu = false;
m_pSourceDoc = NULL;
m_pTargetBookMark = NULL;
m_pTargetDoc = NULL;
m_pTargetAnnot = NULL;
- m_bValid = TRUE;
+ m_bValid = true;
}
void CJS_EventHandler::Destroy()
{
- m_bValid = FALSE;
+ m_bValid = false;
}
-FX_BOOL CJS_EventHandler::IsValid()
+bool CJS_EventHandler::IsValid()
{
return m_bValid;
}
@@ -444,17 +444,17 @@ int CJS_EventHandler::CommitKey()
return m_nCommitKey;
}
-FX_BOOL CJS_EventHandler::FieldFull()
+bool CJS_EventHandler::FieldFull()
{
return m_bFieldFull;
}
-FX_BOOL CJS_EventHandler::KeyDown()
+bool CJS_EventHandler::KeyDown()
{
return m_bKeyDown;
}
-FX_BOOL CJS_EventHandler::Modifier()
+bool CJS_EventHandler::Modifier()
{
return m_bModifier;
}
@@ -555,7 +555,7 @@ const FX_WCHAR* CJS_EventHandler::Type()
return L"";
}
-FX_BOOL& CJS_EventHandler::Rc()
+bool& CJS_EventHandler::Rc()
{
if (m_pbRc) {
return *m_pbRc;
@@ -579,7 +579,7 @@ int & CJS_EventHandler::SelStart()
return m_nSelStartDu;
}
-FX_BOOL CJS_EventHandler::Shift()
+bool CJS_EventHandler::Shift()
{
return m_bShift;
}
@@ -591,9 +591,9 @@ Field* CJS_EventHandler::Source()
CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
JSFXObject pDocObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Document"));
- ASSERT(pDocObj.IsEmpty() == FALSE);
+ ASSERT(pDocObj.IsEmpty() == false);
JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Field"));
- ASSERT(pFieldObj.IsEmpty() == FALSE);
+ ASSERT(pFieldObj.IsEmpty() == false);
CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj);
ASSERT(pJSDocument != NULL);
@@ -625,9 +625,9 @@ Field* CJS_EventHandler::Target_Field()
CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
JSFXObject pDocObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Document"));
- ASSERT(pDocObj.IsEmpty() == FALSE);
+ ASSERT(pDocObj.IsEmpty() == false);
JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Field"));
- ASSERT(pFieldObj.IsEmpty() == FALSE);
+ ASSERT(pFieldObj.IsEmpty() == false);
CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj);
ASSERT(pJSDocument != NULL);
@@ -653,7 +653,7 @@ CFX_WideString& CJS_EventHandler::Value()
return *m_pValue;
}
-FX_BOOL CJS_EventHandler::WillCommit()
+bool CJS_EventHandler::WillCommit()
{
return m_bWillCommit;
}
diff --git a/fpdfsdk/src/javascript/JS_GlobalData.cpp b/fpdfsdk/src/javascript/JS_GlobalData.cpp
index 8c7bd7150e..71e3a50a60 100644
--- a/fpdfsdk/src/javascript/JS_GlobalData.cpp
+++ b/fpdfsdk/src/javascript/JS_GlobalData.cpp
@@ -296,7 +296,7 @@ void CJS_GlobalData::SetGlobalVariableNull(const FX_CHAR* propname)
}
}
-FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, FX_BOOL bPersistent)
+bool CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, bool bPersistent)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -304,18 +304,18 @@ FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, FX_
sPropName.TrimLeft();
sPropName.TrimRight();
- if (sPropName.GetLength() == 0) return FALSE;
+ if (sPropName.GetLength() == 0) return false;
if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
{
pData->bPersistent = bPersistent;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname)
+bool CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -323,7 +323,7 @@ FX_BOOL CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname)
sPropName.TrimLeft();
sPropName.TrimRight();
- if (sPropName.GetLength() == 0) return FALSE;
+ if (sPropName.GetLength() == 0) return false;
int nFind = FindGlobalVariable(sPropName);
@@ -331,10 +331,10 @@ FX_BOOL CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname)
{
delete m_arrayGlobalData.GetAt(nFind);
m_arrayGlobalData.RemoveAt(nFind);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
int32_t CJS_GlobalData::GetSize() const
@@ -417,7 +417,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables()
break;
}
SetGlobalVariableNumber(sEntry, dData);
- SetGlobalVariablePersistent(sEntry, TRUE);
+ SetGlobalVariablePersistent(sEntry, true);
}
break;
case JS_GLOBALDATA_TYPE_BOOLEAN:
@@ -425,7 +425,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables()
FX_WORD wData = *((FX_WORD*)p);
p += sizeof(FX_WORD);
SetGlobalVariableBoolean(sEntry, (bool)(wData == 1));
- SetGlobalVariablePersistent(sEntry, TRUE);
+ SetGlobalVariablePersistent(sEntry, true);
}
break;
case JS_GLOBALDATA_TYPE_STRING:
@@ -437,14 +437,14 @@ void CJS_GlobalData::LoadGlobalPersistentVariables()
break;
SetGlobalVariableString(sEntry, CFX_ByteString(p, dwLength));
- SetGlobalVariablePersistent(sEntry, TRUE);
+ SetGlobalVariablePersistent(sEntry, true);
p += sizeof(char) * dwLength;
}
break;
case JS_GLOBALDATA_TYPE_NULL:
{
SetGlobalVariableNull(sEntry);
- SetGlobalVariablePersistent(sEntry, TRUE);
+ SetGlobalVariablePersistent(sEntry, true);
}
}
}
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 485cd27813..7333e88cd2 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -40,7 +40,7 @@ IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime(CPDFDoc_Environ
embedderDataSlot = pApp->GetFormFillInfo()->m_pJsPlatform->m_v8EmbedderSlot;
}
JS_Initial(embedderDataSlot);
- m_bInit = TRUE;
+ m_bInit = true;
}
return new CJS_Runtime(pApp);
}
@@ -58,7 +58,7 @@ void CJS_RuntimeFactory::Release()
{
JS_Release();
ReleaseGlobalData();
- m_bInit = FALSE;
+ m_bInit = false;
}
}
}
@@ -108,7 +108,7 @@ void CJS_ArrayBufferAllocator::Free(void* data, size_t length) {
CJS_Runtime::CJS_Runtime(CPDFDoc_Environment * pApp) :
m_pApp(pApp),
m_pDocument(NULL),
- m_bBlocking(FALSE),
+ m_bBlocking(false),
m_pFieldEventPath(NULL),
m_isolate(NULL)
{
@@ -150,46 +150,46 @@ CJS_Runtime::~CJS_Runtime()
m_isolate->Dispose();
}
-FX_BOOL CJS_Runtime::InitJSObjects()
+bool CJS_Runtime::InitJSObjects()
{
v8::Isolate::Scope isolate_scope(GetIsolate());
v8::HandleScope handle_scope(GetIsolate());
v8::Local<v8::Context> context = v8::Context::New(GetIsolate());
v8::Context::Scope context_scope(context);
//0 - 8
- if (CJS_Border::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Display::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Font::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Highlight::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Position::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Style::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Border::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Display::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Font::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Highlight::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Position::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Style::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return false;
//9 - 11
- if (CJS_App::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Color::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Console::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_App::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Color::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Console::Init(*this, JS_STATIC) < 0) return false;
//12 - 14
- if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return FALSE;
- if (CJS_Event::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+ if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return false;
+ if (CJS_Event::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return false;
//15 - 17
- if (CJS_Global::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Icon::Init(*this, JS_DYNAMIC) < 0) return FALSE;
- if (CJS_Util::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Global::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Icon::Init(*this, JS_DYNAMIC) < 0) return false;
+ if (CJS_Util::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_PublicMethods::Init(*this) < 0) return FALSE;
- if (CJS_GlobalConsts::Init(*this) < 0) return FALSE;
- if (CJS_GlobalArrays::Init(*this) < 0) return FALSE;
+ if (CJS_PublicMethods::Init(*this) < 0) return false;
+ if (CJS_GlobalConsts::Init(*this) < 0) return false;
+ if (CJS_GlobalArrays::Init(*this) < 0) return false;
- if (CJS_TimerObj::Init(*this, JS_DYNAMIC) < 0) return FALSE;
- if (CJS_PrintParamsObj::Init(*this, JS_DYNAMIC) <0) return FALSE;
+ if (CJS_TimerObj::Init(*this, JS_DYNAMIC) < 0) return false;
+ if (CJS_PrintParamsObj::Init(*this, JS_DYNAMIC) <0) return false;
- return TRUE;
+ return true;
}
IFXJS_Context* CJS_Runtime::NewContext()
@@ -255,7 +255,7 @@ void CJS_Runtime::SetReaderDocument(CPDFSDK_Document* pReaderDoc)
}
}
-FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
+bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
{
if (m_pFieldEventPath == NULL)
{
@@ -264,7 +264,7 @@ FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_
m_pFieldEventPath->eEventType = eEventType;
m_pFieldEventPath->pNext = NULL;
- return TRUE;
+ return true;
}
//to search
@@ -273,7 +273,7 @@ FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_
while (p)
{
if (p->eEventType == eEventType && p->sTargetName == sTargetName)
- return FALSE;
+ return false;
pLast = p;
p = p->pNext;
@@ -287,12 +287,12 @@ FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_
pLast->pNext = pNew;
- return TRUE;
+ return true;
}
void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
{
- FX_BOOL bFind = FALSE;
+ bool bFind = false;
CJS_FieldEvent* p = m_pFieldEventPath;
CJS_FieldEvent* pLast = NULL;
@@ -300,7 +300,7 @@ void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_
{
if (p->eEventType == eEventType && p->sTargetName == sTargetName)
{
- bFind = TRUE;
+ bFind = true;
break;
}
diff --git a/fpdfsdk/src/javascript/JS_Value.cpp b/fpdfsdk/src/javascript/JS_Value.cpp
index 058f2eaf45..611b1112a0 100644
--- a/fpdfsdk/src/javascript/JS_Value.cpp
+++ b/fpdfsdk/src/javascript/JS_Value.cpp
@@ -256,45 +256,45 @@ FXJSVALUETYPE CJS_Value::GetType() const
return VT_unknown;
}
-FX_BOOL CJS_Value::IsArrayObject() const
+bool CJS_Value::IsArrayObject() const
{
- if(m_pValue.IsEmpty()) return FALSE;
+ if(m_pValue.IsEmpty()) return false;
return m_pValue->IsArray();
}
-FX_BOOL CJS_Value::IsDateObject() const
+bool CJS_Value::IsDateObject() const
{
- if(m_pValue.IsEmpty()) return FALSE;
+ if(m_pValue.IsEmpty()) return false;
return m_pValue->IsDate();
}
//CJS_Value::operator CJS_Array()
-FX_BOOL CJS_Value::ConvertToArray(CJS_Array &array) const
+bool CJS_Value::ConvertToArray(CJS_Array &array) const
{
if (IsArrayObject())
{
array.Attach(JS_ToArray(m_isolate, m_pValue));
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CJS_Value::ConvertToDate(CJS_Date &date) const
+bool CJS_Value::ConvertToDate(CJS_Date &date) const
{
// if (GetType() == VT_date)
// {
// date = (double)(*this);
-// return TRUE;
+// return true;
// }
if (IsDateObject())
{
date.Attach(m_pValue);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/* ---------------------------- CJS_PropValue ---------------------------- */
@@ -314,12 +314,12 @@ CJS_PropValue::~CJS_PropValue()
{
}
-FX_BOOL CJS_PropValue::IsSetting()
+bool CJS_PropValue::IsSetting()
{
return m_bIsSetting;
}
-FX_BOOL CJS_PropValue::IsGetting()
+bool CJS_PropValue::IsGetting()
{
return !m_bIsSetting;
}
@@ -480,9 +480,9 @@ void CJS_Array::Attach(v8::Local<v8::Array> pArray)
m_pArray = pArray;
}
-FX_BOOL CJS_Array::IsAttached()
+bool CJS_Array::IsAttached()
{
- return FALSE;
+ return false;
}
void CJS_Array::GetElement(unsigned index,CJS_Value &value)
@@ -543,9 +543,9 @@ CJS_Date::~CJS_Date()
{
}
-FX_BOOL CJS_Date::IsValidDate()
+bool CJS_Date::IsValidDate()
{
- if(m_pDate.IsEmpty()) return FALSE;
+ if(m_pDate.IsEmpty()) return false;
return !JS_PortIsNan(JS_ToNumber(m_isolate, m_pDate));
}
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index daecdbec89..0aa23d16a9 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -72,76 +72,76 @@ static const FX_WCHAR* fullmonths[] =
L"January", L"February", L"March", L"April", L"May", L"June", L"July", L"August", L"September", L"October", L"November", L"December"
};
-FX_BOOL CJS_PublicMethods::IsNumber(const FX_WCHAR* string)
+bool CJS_PublicMethods::IsNumber(const FX_WCHAR* string)
{
CFX_WideString sTrim = StrTrim(string);
const FX_WCHAR* pTrim = sTrim.c_str();
const FX_WCHAR* p = pTrim;
- FX_BOOL bDot = FALSE;
- FX_BOOL bKXJS = FALSE;
+ bool bDot = false;
+ bool bKXJS = false;
wchar_t c;
while ((c = *p))
{
if (c == '.' || c == ',')
{
- if (bDot) return FALSE;
- bDot = TRUE;
+ if (bDot) return false;
+ bDot = true;
}
else if (c == '-' || c == '+')
{
if (p != pTrim)
- return FALSE;
+ return false;
}
else if (c == 'e' || c == 'E')
{
if (bKXJS)
- return FALSE;
+ return false;
p++;
c = *p;
if (c == '+' || c == '-')
{
- bKXJS = TRUE;
+ bKXJS = true;
}
else
{
- return FALSE;
+ return false;
}
}
else if (!IsDigit(c))
{
- return FALSE;
+ return false;
}
p++;
}
- return TRUE;
+ return true;
}
-FX_BOOL CJS_PublicMethods::IsDigit(wchar_t ch)
+bool CJS_PublicMethods::IsDigit(wchar_t ch)
{
return (ch >= L'0' && ch <= L'9');
}
-FX_BOOL CJS_PublicMethods::IsDigit(char ch)
+bool CJS_PublicMethods::IsDigit(char ch)
{
return (ch >= '0' && ch <= '9');
}
-FX_BOOL CJS_PublicMethods::IsAlphabetic(wchar_t ch)
+bool CJS_PublicMethods::IsAlphabetic(wchar_t ch)
{
return ((ch >= L'a' && ch <= L'z') || (ch >= L'A' && ch <= L'Z'));
}
-FX_BOOL CJS_PublicMethods::IsAlphaNumeric(wchar_t ch)
+bool CJS_PublicMethods::IsAlphaNumeric(wchar_t ch)
{
return (IsDigit(ch) || IsAlphabetic(ch));
}
-FX_BOOL CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask)
+bool CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask)
{
switch (c_Mask)
{
@@ -152,13 +152,13 @@ FX_BOOL CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask)
case L'O':
return IsAlphaNumeric(c_Change);
case L'X':
- return TRUE;
+ return true;
default:
return (c_Change == c_Mask);
}
}
-FX_BOOL CJS_PublicMethods::isReservedMaskChar(wchar_t ch)
+bool CJS_PublicMethods::isReservedMaskChar(wchar_t ch)
{
return ch == L'9' || ch == L'A' || ch == L'O' || ch == L'X';
}
@@ -226,13 +226,13 @@ CFX_ByteString CJS_PublicMethods::StrTrim(const FX_CHAR* pStr)
return StrRTrim(StrLTrim(pStr));
}
-double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS)
+double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits, bool& bDot, bool& bSign, bool& bKXJS)
{
- bDot = FALSE;
- bSign = FALSE;
- bKXJS = FALSE;
+ bDot = false;
+ bSign = false;
+ bKXJS = false;
- FX_BOOL bDigitExist = FALSE;
+ bool bDigitExist = false;
const FX_WCHAR* p = swSource;
wchar_t c;
@@ -253,7 +253,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig
if (!pStart)
{
- bAllDigits = FALSE;
+ bAllDigits = false;
return 0;
}
@@ -267,7 +267,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig
double dRet = 0;
p = pStart;
- bAllDigits = TRUE;
+ bAllDigits = true;
CFX_WideString swDigits;
while (p <= pEnd)
@@ -277,14 +277,14 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig
if (IsDigit(c))
{
swDigits += c;
- bDigitExist = TRUE;
+ bDigitExist = true;
}
else
{
switch (c)
{
case L' ':
- bAllDigits = FALSE;
+ bAllDigits = false;
break;
case L'.':
case L',':
@@ -298,10 +298,10 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig
{
swDigits += L'0';
swDigits += L'.';
- bDigitExist = TRUE;
+ bDigitExist = true;
}
- bDot = TRUE;
+ bDot = true;
break;
}
case 'e':
@@ -312,7 +312,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig
c = *p;
if (c == '+' || c == '-')
{
- bKXJS = TRUE;
+ bKXJS = true;
swDigits += 'e';
swDigits += c;
}
@@ -322,21 +322,21 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig
if (!bDigitExist && !bSign)
{
swDigits += c;
- bSign = TRUE;
+ bSign = true;
break;
}
default:
- bAllDigits = FALSE;
+ bAllDigits = false;
if (p != pStart && !bDot && bDigitExist)
{
swDigits += L'.';
- bDot = TRUE;
+ bDot = true;
}
else
{
- bDot = FALSE;
- bDigitExist = FALSE;
+ bDot = false;
+ bDigitExist = false;
swDigits = L"";
}
break;
@@ -374,19 +374,19 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig
double CJS_PublicMethods::ParseStringToNumber(const FX_WCHAR* swSource)
{
- FX_BOOL bAllDigits = FALSE;
- FX_BOOL bDot = FALSE;
- FX_BOOL bSign = FALSE;
- FX_BOOL bKXJS = FALSE;
+ bool bAllDigits = false;
+ bool bDot = false;
+ bool bSign = false;
+ bool bKXJS = false;
return ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS);
}
-FX_BOOL CJS_PublicMethods::ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, FX_BOOL & bDot)
+bool CJS_PublicMethods::ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, bool & bDot)
{
- FX_BOOL bAllDigits = FALSE;
- FX_BOOL bSign = FALSE;
- FX_BOOL bKXJS = FALSE;
+ bool bAllDigits = false;
+ bool bSign = false;
+ bool bKXJS = false;
dRet = ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS);
@@ -477,7 +477,7 @@ CFX_WideString CJS_PublicMethods::ParseStringString(const CFX_WideString& string
return swRet;
}
-double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL& bWrongFormat)
+double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, bool& bWrongFormat)
{
double dt = JS_GetDateTime();
@@ -525,7 +525,7 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL&
nMonth = number[1];
}
- bWrongFormat = FALSE;
+ bWrongFormat = false;
}
else if (nIndex == 3)
{
@@ -552,11 +552,11 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL&
nYear = number[2];
}
- bWrongFormat = FALSE;
+ bWrongFormat = false;
}
else
{
- bWrongFormat = TRUE;
+ bWrongFormat = true;
return dt;
}
@@ -565,7 +565,7 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL&
return JS_DateParse(swTemp.c_str());
}
-double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CFX_WideString & format, FX_BOOL& bWrongFormat)
+double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CFX_WideString & format, bool& bWrongFormat)
{
double dt = JS_GetDateTime();
@@ -581,9 +581,9 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
int nYearSub = 99; //nYear - 2000;
- FX_BOOL bPm = FALSE;
- FX_BOOL bExit = FALSE;
- bWrongFormat = FALSE;
+ bool bPm = false;
+ bool bExit = false;
+ bWrongFormat = false;
int i=0;
int j=0;
@@ -715,7 +715,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
case 'm':
{
CFX_WideString sMonth = ParseStringString(value, j, nSkip);
- FX_BOOL bFind = FALSE;
+ bool bFind = false;
for (int m = 0; m < 12; m++)
{
if (sMonth.CompareNoCase(months[m]) == 0)
@@ -723,7 +723,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
nMonth = m + 1;
i+=3;
j+=nSkip;
- bFind = TRUE;
+ bFind = true;
break;
}
}
@@ -757,7 +757,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
break;
case 'm':
{
- FX_BOOL bFind = FALSE;
+ bool bFind = false;
CFX_WideString sMonth = ParseStringString(value, j, nSkip);
sMonth.MakeLower();
@@ -772,7 +772,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
nMonth = m + 1;
i += 4;
j += nSkip;
- bFind = TRUE;
+ bFind = true;
break;
}
}
@@ -795,8 +795,8 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
{
if (j >= value.GetLength() || format.GetAt(i) != value.GetAt(j))
{
- bWrongFormat = TRUE;
- bExit = TRUE;
+ bWrongFormat = true;
+ bExit = true;
}
i++;
j++;
@@ -804,8 +804,8 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
if (oldj == j)
{
- bWrongFormat = TRUE;
- bExit = TRUE;
+ bWrongFormat = true;
+ bExit = true;
}
}
@@ -813,12 +813,12 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
default:
if (value.GetLength() <= j)
{
- bExit = TRUE;
+ bExit = true;
}
else if (format.GetAt(i) != value.GetAt(j))
{
- bWrongFormat = TRUE;
- bExit = TRUE;
+ bWrongFormat = true;
+ bExit = true;
}
i++;
@@ -833,19 +833,19 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
nYear += 2000;
if (nMonth < 1 || nMonth > 12)
- bWrongFormat = TRUE;
+ bWrongFormat = true;
if (nDay < 1 || nDay > 31)
- bWrongFormat = TRUE;
+ bWrongFormat = true;
if (nHour < 0 || nHour > 24)
- bWrongFormat = TRUE;
+ bWrongFormat = true;
if (nMin < 0 || nMin > 60)
- bWrongFormat = TRUE;
+ bWrongFormat = true;
if (nSec < 0 || nSec > 60)
- bWrongFormat = TRUE;
+ bWrongFormat = true;
double dRet = 0;
@@ -1021,7 +1021,7 @@ CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate, const CFX_WideStr
/* -------------------------------------------------------------------------- */
//function AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend)
-FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
#if _FX_OS_ != _FX_ANDROID_
v8::Isolate* isolate = ::GetIsolate(cc);
@@ -1033,21 +1033,21 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete
if (params.size() != 6)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
if(!pEvent->m_pValue)
- return FALSE;
+ return false;
CFX_WideString& Value = pEvent->Value();
CFX_ByteString strValue = StrTrim(CFX_ByteString::FromUnicode(Value));
- if (strValue.IsEmpty()) return TRUE;
+ if (strValue.IsEmpty()) return true;
int iDec = params[0].ToInt();
int iSepStyle = params[1].ToInt();
int iNegStyle = params[2].ToInt();
// params[3] is iCurrStyle, it's not used.
std::wstring wstrCurrency(params[4].ToCFXWideString().c_str());
- FX_BOOL bCurrencyPrepend = params[5].ToBool();
+ bool bCurrencyPrepend = params[5].ToBool();
if (iDec < 0) iDec = -iDec;
@@ -1224,11 +1224,11 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete
}
Value = strValue2.c_str();
#endif
- return TRUE;
+ return true;
}
//function AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend)
-FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1236,13 +1236,13 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param
ASSERT(pEvent != NULL);
if(params.size() < 2)
- return FALSE;
+ return false;
int iSepStyle = params[1].ToInt();
if (iSepStyle < 0 || iSepStyle > 3)
iSepStyle = 0;
if(!pEvent->m_pValue)
- return FALSE;
+ return false;
CFX_WideString & val = pEvent->Value();
CFX_WideString & w_strChange = pEvent->Change();
CFX_WideString w_strValue = val;
@@ -1252,18 +1252,18 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param
CFX_WideString wstrChange = w_strChange;
CFX_WideString wstrValue = StrLTrim(w_strValue.c_str());
if (wstrValue.IsEmpty())
- return TRUE;
+ return true;
CFX_WideString swTemp = wstrValue;
swTemp.Replace(L",", L".");
if (!IsNumber(swTemp.c_str()))
{
- pEvent->Rc() = FALSE;
+ pEvent->Rc() = false;
sError = JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE);
Alert(pContext, sError.c_str());
- return TRUE;
+ return true;
}
- return TRUE; // it happens after the last keystroke and before validating,
+ return true; // it happens after the last keystroke and before validating,
}
std::wstring w_strValue2 = w_strValue.c_str();
@@ -1271,15 +1271,15 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param
std::wstring w_strSelected;
if(-1 != pEvent->SelStart())
w_strSelected = w_strValue2.substr(pEvent->SelStart(),(pEvent->SelEnd() - pEvent->SelStart()));
- FX_BOOL bHasSign = (w_strValue2.find('-') != -1) && (w_strSelected.find('-') == -1);
+ bool bHasSign = (w_strValue2.find('-') != -1) && (w_strSelected.find('-') == -1);
if (bHasSign)
{
//can't insert "change" in front to sign postion.
if (pEvent->SelStart() == 0)
{
- FX_BOOL &bRc = pEvent->Rc();
- bRc = FALSE;
- return TRUE;
+ bool &bRc = pEvent->Rc();
+ bRc = false;
+ return true;
}
}
@@ -1297,49 +1297,49 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param
break;
}
- FX_BOOL bHasSep = (w_strValue2.find(cSep) != -1);
+ bool bHasSep = (w_strValue2.find(cSep) != -1);
for (std::wstring::iterator it = w_strChange2.begin(); it != w_strChange2.end(); it++)
{
if (*it == cSep)
{
if (bHasSep)
{
- FX_BOOL &bRc = pEvent->Rc();
- bRc = FALSE;
- return TRUE;
+ bool &bRc = pEvent->Rc();
+ bRc = false;
+ return true;
}
- bHasSep = TRUE;
+ bHasSep = true;
continue;
}
if (*it == L'-')
{
if (bHasSign)
{
- FX_BOOL &bRc = pEvent->Rc();
- bRc = FALSE;
- return TRUE;
+ bool &bRc = pEvent->Rc();
+ bRc = false;
+ return true;
}
if (it != w_strChange2.begin()) //sign's position is not correct
{
- FX_BOOL &bRc = pEvent->Rc();
- bRc = FALSE;
- return TRUE;
+ bool &bRc = pEvent->Rc();
+ bRc = false;
+ return true;
}
if (pEvent->SelStart() != 0)
{
- FX_BOOL &bRc = pEvent->Rc();
- bRc = FALSE;
- return TRUE;
+ bool &bRc = pEvent->Rc();
+ bRc = false;
+ return true;
}
- bHasSign = TRUE;
+ bHasSign = true;
continue;
}
if (!IsDigit(*it))
{
- FX_BOOL &bRc = pEvent->Rc();
- bRc = FALSE;
- return TRUE;
+ bool &bRc = pEvent->Rc();
+ bRc = false;
+ return true;
}
}
@@ -1351,12 +1351,12 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param
w_strValue2 = w_prefix + w_strChange2 + w_postfix;
w_strValue = w_strValue2.c_str();
val = w_strValue;
- return TRUE;
+ return true;
}
//function AFPercent_Format(nDec, sepStyle)
-FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
#if _FX_OS_ != _FX_ANDROID_
CJS_Context* pContext = (CJS_Context *)cc;
@@ -1367,15 +1367,15 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Paramet
if (params.size() != 2)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
if(!pEvent->m_pValue)
- return FALSE;
+ return false;
CFX_WideString& Value = pEvent->Value();
CFX_ByteString strValue = StrTrim(CFX_ByteString::FromUnicode(Value));
if (strValue.IsEmpty())
- return TRUE;
+ return true;
int iDec = params[0].ToInt();
if (iDec < 0)
@@ -1461,16 +1461,16 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Paramet
strValue += "%";
Value = CFX_WideString::FromLocal(strValue);
#endif
- return TRUE;
+ return true;
}
//AFPercent_Keystroke(nDec, sepStyle)
-FX_BOOL CJS_PublicMethods::AFPercent_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFPercent_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
return AFNumber_Keystroke(cc,params,vRet,sError);
}
//function AFDate_FormatEx(cFormat)
-FX_BOOL CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1480,18 +1480,18 @@ FX_BOOL CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Paramete
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
if(!pEvent->m_pValue)
- return FALSE;
+ return false;
CFX_WideString& val = pEvent->Value();
CFX_WideString strValue = val;
if (strValue.IsEmpty())
- return TRUE;
+ return true;
CFX_WideString sFormat = params[0].ToCFXWideString();
- FX_BOOL bWrongFormat = FALSE;
+ bool bWrongFormat = false;
double dDate = 0.0f;
if(strValue.Find(L"GMT") != -1)
@@ -1510,11 +1510,11 @@ FX_BOOL CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Paramete
CFX_WideString swMsg;
swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE).c_str(), sFormat.c_str());
Alert(pContext, swMsg.c_str());
- return FALSE;
+ return false;
}
val = MakeFormatDate(dDate,sFormat);
- return TRUE;
+ return true;
}
double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue)
@@ -1578,7 +1578,7 @@ double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue)
}
//AFDate_KeystrokeEx(cFormat)
-FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1588,33 +1588,33 @@ FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Param
if (params.size() != 1)
{
sError = L"AFDate_KeystrokeEx's parameters' size r not correct";
- return FALSE;
+ return false;
}
if (pEvent->WillCommit())
{
if(!pEvent->m_pValue)
- return FALSE;
+ return false;
CFX_WideString strValue = pEvent->Value();
if (strValue.IsEmpty())
- return TRUE;
+ return true;
CFX_WideString sFormat = params[0].ToCFXWideString();
- FX_BOOL bWrongFormat = FALSE;
+ bool bWrongFormat = false;
double dRet = MakeRegularDate(strValue,sFormat,bWrongFormat);
if (bWrongFormat || JS_PortIsNan(dRet))
{
CFX_WideString swMsg;
swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE).c_str(), sFormat.c_str());
Alert(pContext, swMsg.c_str());
- pEvent->Rc() = FALSE;
- return TRUE;
+ pEvent->Rc() = false;
+ return true;
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
@@ -1624,7 +1624,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
int iIndex = params[0].ToInt();
@@ -1645,7 +1645,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters
}
//AFDate_KeystrokeEx(cFormat)
-FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
@@ -1655,7 +1655,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Paramet
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
int iIndex = params[0].ToInt();
@@ -1676,7 +1676,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Paramet
}
//function AFTime_Format(ptf)
-FX_BOOL CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
@@ -1685,7 +1685,7 @@ FX_BOOL CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
int iIndex = params[0].ToInt();
@@ -1703,7 +1703,7 @@ FX_BOOL CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters
return AFDate_FormatEx(cc,newParams,vRet,sError);
}
-FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
if (params.size() != 1)
@@ -1711,7 +1711,7 @@ FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Paramet
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
int iIndex = params[0].ToInt();
@@ -1729,18 +1729,18 @@ FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Paramet
return AFDate_KeystrokeEx(cc,newParams,vRet,sError);
}
-FX_BOOL CJS_PublicMethods::AFTime_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFTime_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
return AFDate_FormatEx(cc,params,vRet,sError);
}
-FX_BOOL CJS_PublicMethods::AFTime_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFTime_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
return AFDate_KeystrokeEx(cc,params,vRet,sError);
}
//function AFSpecial_Format(psf)
-FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1748,7 +1748,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Paramet
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
std::string cFormat;
@@ -1758,7 +1758,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Paramet
ASSERT(pEvent != NULL);
if(!pEvent->m_pValue)
- return FALSE;
+ return false;
CFX_WideString& Value = pEvent->Value();
std::string strSrc = CFX_ByteString::FromUnicode(Value).c_str();
@@ -1788,12 +1788,12 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Paramet
std::string strDes;
util::printx(cFormat,strSrc,strDes);
Value = CFX_WideString::FromLocal(strDes.c_str());
- return TRUE;
+ return true;
}
//function AFSpecial_KeystrokeEx(mask)
-FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1804,23 +1804,23 @@ FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Pa
if (params.size() < 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
if(!pEvent->m_pValue)
- return FALSE;
+ return false;
CFX_WideString& valEvent = pEvent->Value();
CFX_WideString wstrMask = params[0].ToCFXWideString();
if (wstrMask.IsEmpty())
- return TRUE;
+ return true;
std::wstring wstrValue = valEvent.c_str();
if (pEvent->WillCommit())
{
if (wstrValue.empty())
- return TRUE;
+ return true;
int iIndexMask = 0;
for (std::wstring::iterator it = wstrValue.begin(); it != wstrValue.end(); it++)
{
@@ -1833,30 +1833,30 @@ FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Pa
if (iIndexMask != wstrMask.GetLength() || (iIndexMask != wstrValue.size() && wstrMask.GetLength() != 0))
{
Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE).c_str());
- pEvent->Rc() = FALSE;
+ pEvent->Rc() = false;
}
- return TRUE;
+ return true;
}
CFX_WideString &wideChange = pEvent->Change();
std::wstring wChange = wideChange.c_str();
if (wChange.empty())
- return TRUE;
+ return true;
int iIndexMask = pEvent->SelStart();
if (wstrValue.length() - (pEvent->SelEnd()-pEvent->SelStart()) + wChange.length() > (FX_DWORD)wstrMask.GetLength())
{
Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG).c_str());
- pEvent->Rc() = FALSE;
- return TRUE;
+ pEvent->Rc() = false;
+ return true;
}
if (iIndexMask >= wstrMask.GetLength() && (!wChange.empty()))
{
Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG).c_str());
- pEvent->Rc() = FALSE;
- return TRUE;
+ pEvent->Rc() = false;
+ return true;
}
for (std::wstring::iterator it = wChange.begin(); it != wChange.end(); it++)
@@ -1864,8 +1864,8 @@ FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Pa
if (iIndexMask >= wstrMask.GetLength())
{
Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG).c_str());
- pEvent->Rc() = FALSE;
- return TRUE;
+ pEvent->Rc() = false;
+ return true;
}
wchar_t w_Mask = wstrMask[iIndexMask];
if (!isReservedMaskChar(w_Mask))
@@ -1875,19 +1875,19 @@ FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Pa
wchar_t w_Change = *it;
if (!maskSatisfied(w_Change,w_Mask))
{
- pEvent->Rc() = FALSE;
- return TRUE;
+ pEvent->Rc() = false;
+ return true;
}
iIndexMask++;
}
wideChange = wChange.c_str();
- return TRUE;
+ return true;
}
//function AFSpecial_Keystroke(psf)
-FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
@@ -1899,14 +1899,14 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Para
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
std::string cFormat;
int iIndex = params[0].ToInt();
if(!pEvent->m_pValue)
- return FALSE;
+ return false;
//CJS_Value val = pEvent->Value();
CFX_WideString& val = pEvent->Value();
std::string strSrc = CFX_ByteString::FromUnicode(val).c_str();
@@ -1946,7 +1946,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Para
return AFSpecial_KeystrokeEx(cc,params2,vRet,sError);
}
-FX_BOOL CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1956,7 +1956,7 @@ FX_BOOL CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
CFX_WideString swValue;
@@ -1966,7 +1966,7 @@ FX_BOOL CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters
if (pEventHandler->WillCommit())
{
vRet = swValue.c_str();
- return TRUE;
+ return true;
}
CFX_WideString prefix,postfix;
@@ -1983,10 +1983,10 @@ FX_BOOL CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters
vRet = (prefix + pEventHandler->Change() + postfix).c_str();
- return TRUE;
+ return true;
}
-FX_BOOL CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1994,13 +1994,13 @@ FX_BOOL CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters
if (params.size() != 2)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
CFX_WideString sValue = params[0].ToCFXWideString();
CFX_WideString sFormat = params[1].ToCFXWideString();
- FX_BOOL bWrongFormat = FALSE;
+ bool bWrongFormat = false;
double dDate = MakeRegularDate(sValue,sFormat,bWrongFormat);
if (JS_PortIsNan(dDate))
@@ -2008,14 +2008,14 @@ FX_BOOL CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters
CFX_WideString swMsg;
swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE).c_str(), sFormat.c_str());
Alert((CJS_Context *)cc, swMsg.c_str());
- return FALSE;
+ return false;
}
vRet = dDate;
- return TRUE;
+ return true;
}
-FX_BOOL CJS_PublicMethods::AFSimple(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFSimple(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
if (params.size() != 3)
{
@@ -2023,14 +2023,14 @@ FX_BOOL CJS_PublicMethods::AFSimple(IFXJS_Context* cc, const CJS_Parameters& par
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
vRet = (double)AF_Simple(params[0].ToCFXWideString().c_str(), params[1].ToDouble(), params[2].ToDouble());
- return TRUE;
+ return true;
}
-FX_BOOL CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
if (params.size() != 1)
{
@@ -2038,13 +2038,13 @@ FX_BOOL CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters&
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
vRet = ParseStringToNumber(params[0].ToCFXWideString().c_str());
- return TRUE;
+ return true;
}
-FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
@@ -2054,7 +2054,7 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Param
if (params.size() != 2)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
CJS_Value params1 = params[1];
@@ -2062,7 +2062,7 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Param
if (!params1.IsArrayObject() && params1.GetType() != VT_string)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
CPDFSDK_Document* pReaderDoc = pContext->GetReaderDocument();
@@ -2162,13 +2162,13 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Param
if((CJS_EventHandler*)pContext->GetEventHandler()->m_pValue)
((CJS_EventHandler*)pContext->GetEventHandler())->Value() = jsValue.ToCFXWideString();
- return TRUE;
+ return true;
}
/* This function validates the current event to ensure that its value is
** within the specified range. */
-FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -2178,17 +2178,17 @@ FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Paramet
if (params.size() != 4)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
if(!pEvent->m_pValue)
- return FALSE;
+ return false;
if (pEvent->Value().IsEmpty() )
- return TRUE;
+ return true;
double dEentValue = atof(CFX_ByteString::FromUnicode(pEvent->Value()));
- FX_BOOL bGreaterThan = params[0].ToBool();
+ bool bGreaterThan = params[0].ToBool();
double dGreaterThan = params[1].ToDouble();
- FX_BOOL bLessThan = params[2].ToBool();
+ bool bLessThan = params[2].ToBool();
double dLessThan = params[3].ToDouble();
CFX_WideString swMsg;
@@ -2215,12 +2215,12 @@ FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Paramet
if (!swMsg.IsEmpty())
{
Alert(pContext, swMsg.c_str());
- pEvent->Rc() = FALSE;
+ pEvent->Rc() = false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
CJS_Context* pContext = (CJS_Context*)cc;
@@ -2229,7 +2229,7 @@ FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
CJS_Array nums(isolate);
@@ -2269,5 +2269,5 @@ FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters
else
vRet.SetNull();
- return TRUE;
+ return true;
}
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp
index af329655fd..0f35297485 100644
--- a/fpdfsdk/src/javascript/app.cpp
+++ b/fpdfsdk/src/javascript/app.cpp
@@ -134,10 +134,10 @@ app::~app(void)
m_aTimer.RemoveAll();
}
-FX_BOOL app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (!vp.IsGetting())
- return FALSE;
+ return false;
CJS_Context* pContext = (CJS_Context *)cc;
CPDFDoc_Environment* pApp = pContext->GetReaderApp();
@@ -166,120 +166,120 @@ FX_BOOL app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
else
vp.SetNull();
- return TRUE;
+ return true;
}
-FX_BOOL app::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool app::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
bool bVP;
vp >> bVP;
- m_bCalculate = (FX_BOOL)bVP;
+ m_bCalculate = (bool)bVP;
CJS_Context* pContext = (CJS_Context*)cc;
CPDFDoc_Environment* pApp = pContext->GetReaderApp();
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CJS_Array aDocs(pRuntime->GetIsolate());
if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument())
- pDoc->GetInterForm()->EnableCalculate((FX_BOOL)m_bCalculate);
+ pDoc->GetInterForm()->EnableCalculate((bool)m_bCalculate);
}
else
{
vp << (bool)m_bCalculate;
}
- return TRUE;
+ return true;
}
-FX_BOOL app::formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool app::formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << JS_NUM_FORMSVERSION;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL app::viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool app::viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << L"unknown";
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL app::viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool app::viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << JS_STR_VIEWERVARIATION;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL app::viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool app::viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << JS_STR_VIEWERVERSION;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL app::platform(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool app::platform(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << JS_STR_PLATFORM;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL app::language(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool app::language(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << JS_STR_LANGUANGE;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
//creates a new fdf object that contains no data
//comment: need reader support
//note:
//CFDF_Document * CPDFDoc_Environment::NewFDF();
-FX_BOOL app::newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
//opens a specified pdf document and returns its document object
//comment:need reader support
//note: as defined in js reference, the proto of this function's fourth parmeters, how old an fdf document while do not show it.
//CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv);
-FX_BOOL app::openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
int iSize = params.size();
if (iSize < 1)
- return FALSE;
+ return false;
CFX_WideString swMsg = L"";
CFX_WideString swTitle = L"";
@@ -336,7 +336,7 @@ FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v
}
else if (params[0].GetType() == VT_boolean)
{
- FX_BOOL bGet = params[0].ToBool();
+ bool bGet = params[0].ToBool();
if (bGet)
swMsg = L"true";
else
@@ -354,7 +354,7 @@ FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v
{
if (params[0].GetType() == VT_boolean)
{
- FX_BOOL bGet = params[0].ToBool();
+ bool bGet = params[0].ToBool();
if (bGet)
swMsg = L"true";
else
@@ -386,11 +386,11 @@ FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v
vRet = MsgBox(pRuntime->GetReaderApp(), JSGetPageView(cc), swMsg.c_str(), swTitle.c_str(), iType, iIcon);
pRuntime->EndBlock();
- return TRUE;
+ return true;
}
-FX_BOOL app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
if (params.size() == 1)
{
@@ -398,42 +398,42 @@ FX_BOOL app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CPDFDoc_Environment * pEnv = pRuntime->GetReaderApp();
pEnv->JS_appBeep(params[0].ToInt());
- return TRUE;
+ return true;
}
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
-FX_BOOL app::findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL app::popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL app::fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool app::fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
if (params.size() > 2 || params.size() == 0)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
CFX_WideString script = params.size() > 0 ? params[0].ToCFXWideString() : L"";
if (script.IsEmpty())
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE);
- return TRUE;
+ return true;
}
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
@@ -463,15 +463,15 @@ FX_BOOL app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
vRet = pRetObj;
- return TRUE;
+ return true;
}
-FX_BOOL app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
if (params.size() > 2 || params.size() == 0)
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
CJS_Context* pContext = (CJS_Context*)cc;
@@ -483,7 +483,7 @@ FX_BOOL app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
if (script.IsEmpty())
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE);
- return TRUE;
+ return true;
}
FX_DWORD dwTimeOut = params.size() > 1 ? params[1].ToInt() : 1000;
@@ -512,10 +512,10 @@ FX_BOOL app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
vRet = pRetObj;
- return TRUE;
+ return true;
}
-FX_BOOL app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -525,7 +525,7 @@ FX_BOOL app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
if (params.size() != 1)
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
if (params[0].GetType() == VT_fxobject)
@@ -560,10 +560,10 @@ FX_BOOL app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
}
}
- return TRUE;
+ return true;
}
-FX_BOOL app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -573,7 +573,7 @@ FX_BOOL app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
if (params.size() != 1)
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
if (params[0].GetType() == VT_fxobject)
@@ -608,12 +608,12 @@ FX_BOOL app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
}
}
- return TRUE;
+ return true;
}
-FX_BOOL app::execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
void app::TimerProc(CJS_Timer* pTimer)
@@ -651,24 +651,24 @@ void app::RunJsScript(CJS_Runtime* pRuntime,const CFX_WideString& wsScript)
}
}
-FX_BOOL app::goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Not supported.
- return TRUE;
+ return true;
}
-FX_BOOL app::goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Not supported.
- return TRUE;
+ return true;
}
-FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
v8::Isolate* isolate = GetIsolate(cc);
- FX_BOOL bUI = TRUE;
+ bool bUI = true;
CFX_WideString cTo = L"";
CFX_WideString cCc = L"";
CFX_WideString cBcc = L"";
@@ -676,7 +676,7 @@ FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
CFX_WideString cMsg = L"";
if (params.size() < 1)
- return FALSE;
+ return false;
if (params[0].GetType() == VT_object)
{
@@ -701,7 +701,7 @@ FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
cMsg = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWideString();
} else {
if (params.size() < 2)
- return FALSE;
+ return false;
bUI = params[0].ToBool();
cTo = params[1].ToCFXWideString();
@@ -726,16 +726,16 @@ FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
pApp->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str());
pRuntime->EndBlock();
- return FALSE;
+ return false;
}
-FX_BOOL app::launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
-FX_BOOL app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
@@ -746,24 +746,24 @@ FX_BOOL app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
vp<<m_bRuntimeHighLight;
}
- return TRUE;
+ return true;
}
-FX_BOOL app::fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool app::fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL app::popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL app::browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath)
@@ -792,17 +792,17 @@ CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath)
return sRet;
}
-FX_BOOL app::newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL app::openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CFX_WideString swQuestion = L"";
CFX_WideString swLabel = L"";
@@ -873,7 +873,7 @@ FX_BOOL app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value
MAX_INPUT_BYTES);
if (nLengthBytes <= 0) {
vRet.SetNull();
- return FALSE;
+ return false;
}
nLengthBytes = std::min(nLengthBytes, MAX_INPUT_BYTES);
@@ -881,15 +881,15 @@ FX_BOOL app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value
CFX_WideString::FromUTF16LE((unsigned short*)pBuff.get(),
nLengthBytes / sizeof(unsigned short));
vRet = ret_string.c_str();
- return TRUE;
+ return true;
}
-FX_BOOL app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return FALSE;
+ return false;
}
-FX_BOOL app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
diff --git a/fpdfsdk/src/javascript/color.cpp b/fpdfsdk/src/javascript/color.cpp
index a2bbadcd51..7c3c1374b2 100644
--- a/fpdfsdk/src/javascript/color.cpp
+++ b/fpdfsdk/src/javascript/color.cpp
@@ -155,7 +155,7 @@ void color::ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color)
}
#define JS_IMPLEMENT_COLORPROP(prop, var)\
-FX_BOOL color::prop(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)\
+bool color::prop(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)\
{\
CJS_Context* pContext = (CJS_Context*)cc;\
v8::Isolate* isolate = pContext->GetJSRuntime()->GetIsolate();\
@@ -168,10 +168,10 @@ FX_BOOL color::prop(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
else\
{\
CJS_Array array(isolate);\
- if (!vp.ConvertToArray(array)) return FALSE;\
+ if (!vp.ConvertToArray(array)) return false;\
ConvertArrayToPWLColor(array, var);\
}\
- return TRUE;\
+ return true;\
}
JS_IMPLEMENT_COLORPROP(transparent, m_crTransparent)
@@ -187,13 +187,13 @@ JS_IMPLEMENT_COLORPROP(dkGray, m_crDKGray)
JS_IMPLEMENT_COLORPROP(gray, m_crGray)
JS_IMPLEMENT_COLORPROP(ltGray, m_crLTGray)
-FX_BOOL color::convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool color::convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = GetIsolate(cc);
int iSize = params.size();
- if (iSize < 2) return FALSE;
+ if (iSize < 2) return false;
CJS_Array aSource(isolate);
- if (!params[0].ConvertToArray(aSource)) return FALSE;
+ if (!params[0].ConvertToArray(aSource)) return false;
CPWL_Color crSource;
ConvertArrayToPWLColor(aSource, crSource);
@@ -224,18 +224,18 @@ FX_BOOL color::convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
ConvertPWLColorToArray(crDest, aDest);
vRet = aDest;
- return TRUE;
+ return true;
}
-FX_BOOL color::equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool color::equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = GetIsolate(cc);
- if (params.size() < 2) return FALSE;
+ if (params.size() < 2) return false;
CJS_Array array1(isolate), array2(isolate);
- if (!params[0].ConvertToArray(array1)) return FALSE;
- if (!params[1].ConvertToArray(array2)) return FALSE;
+ if (!params[0].ConvertToArray(array1)) return false;
+ if (!params[1].ConvertToArray(array2)) return false;
CPWL_Color color1;
CPWL_Color color2;
@@ -246,6 +246,6 @@ FX_BOOL color::equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
color1.ConvertColorType(color2.nColorType);
vRet = color1 == color2;
- return TRUE;
+ return true;
}
diff --git a/fpdfsdk/src/javascript/console.cpp b/fpdfsdk/src/javascript/console.cpp
index ed9b1fbc56..4d8067110a 100644
--- a/fpdfsdk/src/javascript/console.cpp
+++ b/fpdfsdk/src/javascript/console.cpp
@@ -38,28 +38,28 @@ console::~console()
{
}
-FX_BOOL console::clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool console::clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL console::hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool console::hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
-FX_BOOL console::println(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool console::println(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
if (params.size() < 1)
{
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL console::show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool console::show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return TRUE;
+ return true;
}
diff --git a/fpdfsdk/src/javascript/event.cpp b/fpdfsdk/src/javascript/event.cpp
index f57b1fb607..ee73e42311 100644
--- a/fpdfsdk/src/javascript/event.cpp
+++ b/fpdfsdk/src/javascript/event.cpp
@@ -56,7 +56,7 @@ event::~event(void)
{
}
-FX_BOOL event::change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -73,12 +73,12 @@ FX_BOOL event::change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
{
vp << wChange;
}
- return TRUE;
+ return true;
}
-FX_BOOL event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return FALSE;
+ if (!vp.IsGetting())return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -86,12 +86,12 @@ FX_BOOL event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
ASSERT(pEvent != NULL);
vp << pEvent->ChangeEx();
- return TRUE;
+ return true;
}
-FX_BOOL event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return FALSE;
+ if (!vp.IsGetting())return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -99,10 +99,10 @@ FX_BOOL event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
ASSERT(pEvent != NULL);
vp << pEvent->CommitKey();
- return TRUE;
+ return true;
}
-FX_BOOL event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -110,18 +110,18 @@ FX_BOOL event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
ASSERT(pEvent != NULL);
if (!vp.IsGetting() && wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
- return FALSE;
+ return false;
if (pEvent->FieldFull())
- vp << TRUE;
+ vp << true;
else
- vp << FALSE;
- return TRUE;
+ vp << false;
+ return true;
}
-FX_BOOL event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return FALSE;
+ if (!vp.IsGetting())return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -129,15 +129,15 @@ FX_BOOL event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
ASSERT(pEvent != NULL);
if (pEvent->KeyDown())
- vp << TRUE;
+ vp << true;
else
- vp << FALSE;
- return TRUE;
+ vp << false;
+ return true;
}
-FX_BOOL event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return FALSE;
+ if (!vp.IsGetting())return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -145,15 +145,15 @@ FX_BOOL event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
ASSERT(pEvent != NULL);
if (pEvent->Modifier())
- vp << TRUE;
+ vp << true;
else
- vp << FALSE;
- return TRUE;
+ vp << false;
+ return true;
}
-FX_BOOL event::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return FALSE;
+ if (!vp.IsGetting())return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -161,17 +161,17 @@ FX_BOOL event::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
ASSERT(pEvent != NULL);
vp << pEvent->Name();
- return TRUE;
+ return true;
}
-FX_BOOL event::rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
CJS_EventHandler* pEvent = pContext->GetEventHandler();
ASSERT(pEvent != NULL);
- FX_BOOL &bRc = pEvent->Rc();
+ bool &bRc = pEvent->Rc();
if (vp.IsSetting())
{
vp>>bRc;
@@ -180,12 +180,12 @@ FX_BOOL event::rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
vp<<bRc;
}
- return TRUE;
+ return true;
}
-FX_BOOL event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
if (vp.IsSetting())
{
}
@@ -193,12 +193,12 @@ FX_BOOL event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
{
;
}
- return TRUE;
+ return true;
}
-FX_BOOL event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
if (vp.IsSetting())
{
}
@@ -206,13 +206,13 @@ FX_BOOL event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
{
;
}
- return TRUE;
+ return true;
}
-FX_BOOL event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return TRUE;
+ return true;
if (vp.IsSetting())
{
}
@@ -220,10 +220,10 @@ FX_BOOL event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
;
}
- return TRUE;
+ return true;
}
-FX_BOOL event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -232,7 +232,7 @@ FX_BOOL event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
{
- return TRUE;
+ return true;
}
int &iSelEnd = pEvent->SelEnd();
@@ -244,10 +244,10 @@ FX_BOOL event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
{
vp << iSelEnd;
}
- return TRUE;
+ return true;
}
-FX_BOOL event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -256,7 +256,7 @@ FX_BOOL event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
{
- return TRUE;
+ return true;
}
int &iSelStart = pEvent->SelStart();
if (vp.IsSetting())
@@ -267,12 +267,12 @@ FX_BOOL event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
{
vp << iSelStart;
}
- return TRUE;
+ return true;
}
-FX_BOOL event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return FALSE;
+ if (!vp.IsGetting())return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -280,15 +280,15 @@ FX_BOOL event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
ASSERT(pEvent != NULL);
if (pEvent->Shift())
- vp << TRUE;
+ vp << true;
else
- vp << FALSE;
- return TRUE;
+ vp << false;
+ return true;
}
-FX_BOOL event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return FALSE;
+ if (!vp.IsGetting())return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -296,12 +296,12 @@ FX_BOOL event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
ASSERT(pEvent != NULL);
vp << pEvent->Source()->GetJSObject();
- return TRUE;
+ return true;
}
-FX_BOOL event::target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return FALSE;
+ if (!vp.IsGetting())return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -309,12 +309,12 @@ FX_BOOL event::target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
ASSERT(pEvent != NULL);
vp<<pEvent->Target_Field()->GetJSObject();
- return TRUE;
+ return true;
}
-FX_BOOL event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return FALSE;
+ if (!vp.IsGetting())return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -322,12 +322,12 @@ FX_BOOL event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
ASSERT(pEvent != NULL);
vp << pEvent->TargetName();
- return TRUE;
+ return true;
}
-FX_BOOL event::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return FALSE;
+ if (!vp.IsGetting())return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -335,10 +335,10 @@ FX_BOOL event::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
ASSERT(pEvent != NULL);
vp << pEvent->Type();
- return TRUE;
+ return true;
}
-FX_BOOL event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -346,9 +346,9 @@ FX_BOOL event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
ASSERT(pEvent != NULL);
if (wcscmp((const wchar_t*)pEvent->Type(),L"Field") != 0)
- return FALSE;
+ return false;
if(!pEvent->m_pValue)
- return FALSE;
+ return false;
CFX_WideString & val = pEvent->Value();
if (vp.IsSetting())
{
@@ -358,12 +358,12 @@ FX_BOOL event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
vp << val;
}
- return TRUE;
+ return true;
}
-FX_BOOL event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+bool event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return FALSE;
+ if (!vp.IsGetting())return false;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -371,9 +371,9 @@ FX_BOOL event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
ASSERT(pEvent != NULL);
if (pEvent->WillCommit())
- vp << TRUE;
+ vp << true;
else
- vp << FALSE;
- return TRUE;
+ vp << false;
+ return true;
}
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp
index 6965c8c884..98a3cd6cb5 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -96,7 +96,7 @@ END_JS_STATIC_METHOD()
IMPLEMENT_SPECIAL_JS_CLASS(CJS_Global, global_alternate, global);
-FX_BOOL CJS_Global::InitInstance(IFXJS_Context* cc)
+bool CJS_Global::InitInstance(IFXJS_Context* cc)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -106,7 +106,7 @@ FX_BOOL CJS_Global::InitInstance(IFXJS_Context* cc)
pGlobal->Initial(pContext->GetReaderApp());
- return TRUE;
+ return true;
};
global_alternate::global_alternate(CJS_Object* pJSObject)
@@ -128,26 +128,26 @@ void global_alternate::Initial(CPDFDoc_Environment* pApp)
UpdateGlobalPersistentVariables();
}
-FX_BOOL global_alternate::QueryProperty(const FX_WCHAR* propname)
+bool global_alternate::QueryProperty(const FX_WCHAR* propname)
{
return CFX_WideString(propname) != L"setPersistent";
}
-FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString& sError)
+bool global_alternate::DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString& sError)
{
js_global_data* pData = NULL;
CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
if (m_mapGlobal.Lookup(sPropName, (void*&)pData))
{
- pData->bDeleted = TRUE;
- return TRUE;
+ pData->bDeleted = true;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError)
+bool global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
@@ -158,34 +158,34 @@ FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname
{
double dData;
vp >> dData;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Local<v8::Object>(), FALSE);
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Local<v8::Object>(), false);
}
case VT_boolean:
{
bool bData;
vp >> bData;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, bData, "", v8::Local<v8::Object>(), FALSE);
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, bData, "", v8::Local<v8::Object>(), false);
}
case VT_string:
{
CFX_ByteString sData;
vp >> sData;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Local<v8::Object>(), FALSE);
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Local<v8::Object>(), false);
}
case VT_object:
{
JSObject pData;
vp >> pData;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE);
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, false);
}
case VT_null:
{
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Local<v8::Object>(), FALSE);
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Local<v8::Object>(), false);
}
case VT_undefined:
{
DelProperty(cc, propname, sError);
- return TRUE;
+ return true;
}
default:
break;
@@ -197,51 +197,51 @@ FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname
if (!m_mapGlobal.Lookup(CFX_ByteString::FromUnicode(propname), pVoid))
{
vp.SetNull();
- return TRUE;
+ return true;
}
if (!pVoid)
{
vp.SetNull();
- return TRUE;
+ return true;
}
js_global_data* pData = (js_global_data*)pVoid;
if (pData->bDeleted)
- return TRUE;
+ return true;
switch (pData->nType)
{
case JS_GLOBALDATA_TYPE_NUMBER:
vp << pData->dData;
- return TRUE;
+ return true;
case JS_GLOBALDATA_TYPE_BOOLEAN:
vp << pData->bData;
- return TRUE;
+ return true;
case JS_GLOBALDATA_TYPE_STRING:
vp << pData->sData;
- return TRUE;
+ return true;
case JS_GLOBALDATA_TYPE_OBJECT:
{
v8::Local<v8::Object> obj = v8::Local<v8::Object>::New(vp.GetIsolate(),pData->pData);
vp << obj;
- return TRUE;
+ return true;
}
case JS_GLOBALDATA_TYPE_NULL:
vp.SetNull();
- return TRUE;
+ return true;
default:
break;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
if (params.size() != 2)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
+ return false;
}
CFX_ByteString sName = params[0].ToCFXByteString();
@@ -252,12 +252,12 @@ FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters&
if (pData && !pData->bDeleted)
{
pData->bPersistent = params[1].ToBool();
- return TRUE;
+ return true;
}
}
sError = JSGetStringFromID(pContext, IDS_STRING_JSNOGLOBAL);
- return FALSE;
+ return false;
}
void global_alternate::UpdateGlobalPersistentVariables()
@@ -480,10 +480,10 @@ void global_alternate::DestroyGlobalPersisitentVariables()
}
-FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
+bool global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent)
{
- if (propname == NULL) return FALSE;
+ if (propname == NULL) return false;
js_global_data* pTemp = NULL;
m_mapGlobal.Lookup(propname, (void*&)pTemp);
@@ -498,7 +498,7 @@ FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
pTemp->nType = nType;
}
- pTemp->bDeleted = FALSE;
+ pTemp->bDeleted = false;
switch (nType)
{
@@ -525,10 +525,10 @@ FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
case JS_GLOBALDATA_TYPE_NULL:
break;
default:
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
js_global_data* pNewData = NULL;
@@ -575,12 +575,12 @@ FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
}
break;
default:
- return FALSE;
+ return false;
}
m_mapGlobal.SetAt(propname, (void*)pNewData);
- return TRUE;
+ return true;
}
FXJSVALUETYPE GET_VALUE_TYPE(v8::Local<v8::Value> p)
diff --git a/fpdfsdk/src/javascript/report.cpp b/fpdfsdk/src/javascript/report.cpp
index 1478feb1fa..820e7301d3 100644
--- a/fpdfsdk/src/javascript/report.cpp
+++ b/fpdfsdk/src/javascript/report.cpp
@@ -36,14 +36,14 @@ Report::~Report()
}
-FX_BOOL Report::writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Report::writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
-FX_BOOL Report::save(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool Report::save(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return TRUE;
+ return true;
}
diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp
index 4083ed58da..21a7cb83ff 100644
--- a/fpdfsdk/src/javascript/util.cpp
+++ b/fpdfsdk/src/javascript/util.cpp
@@ -98,7 +98,7 @@ const stru_TbConvert fcTable[] = {
int util::ParstDataType(std::wstring* sFormat)
{
- bool bPercent = FALSE;
+ bool bPercent = false;
for (size_t i = 0; i < sFormat->length(); ++i)
{
wchar_t c = (*sFormat)[i];
@@ -136,11 +136,11 @@ int util::ParstDataType(std::wstring* sFormat)
return -1;
}
-FX_BOOL util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
int iSize = params.size();
if (iSize < 1)
- return FALSE;
+ return false;
std::wstring c_ConvChar(params[0].ToCFXWideString().c_str());
std::vector<std::wstring> c_strConvers;
int iOffset = 0;
@@ -198,16 +198,16 @@ FX_BOOL util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
c_strResult.erase(c_strResult.begin());
vRet = c_strResult.c_str();
- return TRUE;
+ return true;
}
-FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = GetIsolate(cc);
int iSize = params.size();
if (iSize < 2)
- return FALSE;
+ return false;
CJS_Value p1(isolate);
p1 = params[0];
@@ -217,13 +217,13 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
if (!p2.ConvertToDate(jsDate))
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT1);
- return FALSE;
+ return false;
}
if (!jsDate.IsValidDate())
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT2);
- return FALSE;
+ return false;
}
if (p1.GetType() == VT_number)
@@ -261,11 +261,11 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
jsDate.GetSeconds());
break;
default:
- return FALSE;
+ return false;
}
vRet = swResult.c_str();
- return TRUE;
+ return true;
}
if (p1.GetType() == VT_string)
{
@@ -279,7 +279,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
if (bXFAPicture)
{
- return FALSE; //currently, it doesn't support XFAPicture.
+ return false; //currently, it doesn't support XFAPicture.
}
int iIndex;
@@ -355,9 +355,9 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
strFormat = wcsftime(buf, 64, cFormat.c_str(), &time);
cFormat = buf;
vRet = cFormat.c_str();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPicture, std::wstring &cPurpose)
@@ -450,11 +450,11 @@ void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPictur
cPurpose = cFormat;
}
-FX_BOOL util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
int iSize = params.size();
if (iSize<2)
- return FALSE;
+ return false;
CFX_WideString sFormat = params[0].ToCFXWideString();
CFX_WideString sSource = params[1].ToCFXWideString();
std::string cFormat = CFX_ByteString::FromUnicode(sFormat).c_str();
@@ -462,7 +462,7 @@ FX_BOOL util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
std::string cDest;
printx(cFormat,cSource,cDest);
vRet = cDest.c_str();
- return TRUE;
+ return true;
}
void util::printx(const std::string &cFormat,const std::string &cSource2,std::string &cPurpose)
@@ -564,19 +564,19 @@ void util::printx(const std::string &cFormat,const std::string &cSource2,std::st
}
}
-FX_BOOL util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = GetIsolate(cc);
int iSize = params.size();
if (iSize < 2)
- return FALSE;
+ return false;
CFX_WideString sFormat = params[0].ToCFXWideString();
CFX_WideString sDate = params[1].ToCFXWideString();
double dDate = JS_GetDateTime();
if (sDate.GetLength() > 0)
{
- FX_BOOL bWrongFormat = FALSE;
+ bool bWrongFormat = false;
dDate = CJS_PublicMethods::MakeRegularDate(sDate,sFormat,bWrongFormat);
}
@@ -590,7 +590,7 @@ FX_BOOL util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet.SetNull();
}
- return TRUE;
+ return true;
}
int64_t FX_atoi64(const char *nptr)
@@ -618,15 +618,15 @@ int64_t FX_atoi64(const char *nptr)
return sign == '-' ? -total : total;
}
-FX_BOOL util::byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+bool util::byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
int iSize = params.size();
if (iSize == 0)
- return FALSE;
+ return false;
int nByte = params[0].ToInt();
unsigned char cByte = (unsigned char)nByte;
CFX_WideString csValue;
csValue.Format(L"%c", cByte);
vRet = csValue.c_str();
- return TRUE;
+ return true;
}
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp
index c4811bf096..e1232803e8 100644
--- a/fpdfsdk/src/jsapi/fxjs_v8.cpp
+++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp
@@ -42,7 +42,7 @@ class CJS_ObjDefintion
{
public:
CJS_ObjDefintion(v8::Isolate* isolate, const wchar_t* sObjName, FXJSOBJTYPE eObjType, LP_CONSTRUCTOR pConstructor, LP_DESTRUCTOR pDestructor):
- objName(sObjName), objType(eObjType), m_pConstructor(pConstructor), m_pDestructor(pDestructor),m_bSetAsGlobalObject(FALSE)
+ objName(sObjName), objType(eObjType), m_pConstructor(pConstructor), m_pDestructor(pDestructor),m_bSetAsGlobalObject(false)
{
v8::Isolate::Scope isolate_scope(isolate);
v8::HandleScope handle_scope(isolate);
@@ -54,7 +54,7 @@ public:
//Document as the global object.
if(FXSYS_wcscmp(sObjName, L"Document") == 0)
{
- m_bSetAsGlobalObject = TRUE;
+ m_bSetAsGlobalObject = true;
}
}
@@ -68,7 +68,7 @@ public:
FXJSOBJTYPE objType;
LP_CONSTRUCTOR m_pConstructor;
LP_DESTRUCTOR m_pDestructor;
- FX_BOOL m_bSetAsGlobalObject;
+ bool m_bSetAsGlobalObject;
v8::Global<v8::ObjectTemplate> m_objTemplate;
v8::Global<v8::Object> m_StaticObj;
diff --git a/fpdfsdk/src/pdfwindow/PWL_Button.cpp b/fpdfsdk/src/pdfwindow/PWL_Button.cpp
index 84962285c4..1712bd24fc 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Button.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Button.cpp
@@ -12,7 +12,7 @@
/* ------------------------------- CPWL_Button ---------------------------------- */
CPWL_Button::CPWL_Button() :
- m_bMouseDown(FALSE)
+ m_bMouseDown(false)
{
}
@@ -31,23 +31,23 @@ void CPWL_Button::OnCreate(PWL_CREATEPARAM & cp)
cp.eCursorType = FXCT_HAND;
}
-FX_BOOL CPWL_Button::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Button::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point, nFlag);
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
SetCapture();
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_Button::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Button::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point, nFlag);
ReleaseCapture();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
- return TRUE;
+ return true;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
index 84a8b3d186..deccf06449 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
@@ -16,7 +16,7 @@
//////////////////////////////////////////////////////////////////////
CPWL_Caret::CPWL_Caret() :
- m_bFlash(FALSE),
+ m_bFlash(false),
m_ptHead(0,0),
m_ptFoot(0,0),
m_fWidth(0.4f),
@@ -135,7 +135,7 @@ CPDF_Rect CPWL_Caret::GetCaretRect() const
m_ptHead.y);
}
-void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
+void CPWL_Caret::SetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
{
if (bVisible)
{
@@ -147,9 +147,9 @@ void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPD
m_ptHead = ptHead;
m_ptFoot = ptFoot;
- m_bFlash = TRUE;
- //Move(GetCaretRect(),FALSE,TRUE);
- Move(m_rcInvalid, FALSE, TRUE);
+ m_bFlash = true;
+ //Move(GetCaretRect(),false,true);
+ Move(m_rcInvalid, false, true);
}
}
else
@@ -160,11 +160,11 @@ void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPD
EndTimer();
BeginTimer(PWL_CARET_FLASHINTERVAL);
- CPWL_Wnd::SetVisible(TRUE);
- m_bFlash = TRUE;
+ CPWL_Wnd::SetVisible(true);
+ m_bFlash = true;
- //Move(GetCaretRect(),FALSE,TRUE);
- Move(m_rcInvalid, FALSE, TRUE);
+ //Move(GetCaretRect(),false,true);
+ Move(m_rcInvalid, false, true);
}
}
else
@@ -172,11 +172,11 @@ void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPD
m_ptHead = CPDF_Point(0, 0);
m_ptFoot = CPDF_Point(0, 0);
- m_bFlash = FALSE;
+ m_bFlash = false;
if (IsVisible())
{
EndTimer();
- CPWL_Wnd::SetVisible(FALSE);
+ CPWL_Wnd::SetVisible(false);
}
}
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
index f5c8a815d4..6c5dd5516e 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
@@ -22,14 +22,14 @@
/* ---------------------------- CPWL_CBListBox ---------------------------- */
-FX_BOOL CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
if (m_bMouseDown)
{
ReleaseCapture();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
if (ClientHitTest(point))
{
@@ -38,23 +38,23 @@ FX_BOOL CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
pParent->OnNotify(this,PNM_LBUTTONUP,0,PWL_MAKEDWORD(point.x,point.y));
}
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(FALSE,bExit, nFlag);
- if (bExit) return FALSE;
+ bool bExit = false;
+ OnNotifySelChanged(false,bExit, nFlag);
+ if (bExit) return false;
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
+bool CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, bool & bExit, FX_DWORD nFlag)
{
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
switch (nChar)
{
default:
- return FALSE;
+ return false;
case FWL_VKEY_Up:
case FWL_VKEY_Down:
case FWL_VKEY_Home:
@@ -88,25 +88,25 @@ FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWO
break;
}
- OnNotifySelChanged(TRUE,bExit, nFlag);
+ OnNotifySelChanged(true,bExit, nFlag);
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_CBListBox::OnCharWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
+bool CPWL_CBListBox::OnCharWithExit(FX_WORD nChar, bool & bExit, FX_DWORD nFlag)
{
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
- if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return FALSE;
+ if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return false;
if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow())
{
pComboBox->SetSelectText();
}
- OnNotifySelChanged(TRUE,bExit,nFlag);
+ OnNotifySelChanged(true,bExit,nFlag);
- return TRUE;
+ return true;
}
/* ---------------------------- CPWL_CBButton ---------------------------- */
@@ -177,7 +177,7 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p
}
}
-FX_BOOL CPWL_CBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_CBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
@@ -188,16 +188,16 @@ FX_BOOL CPWL_CBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
pParent->OnNotify(this,PNM_LBUTTONDOWN,0,PWL_MAKEDWORD(point.x,point.y));
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_CBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_CBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point, nFlag);
ReleaseCapture();
- return TRUE;
+ return true;
}
/* ---------------------------- CPWL_ComboBox ---------------------------- */
@@ -205,7 +205,7 @@ FX_BOOL CPWL_CBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
CPWL_ComboBox::CPWL_ComboBox() : m_pEdit(NULL),
m_pButton(NULL),
m_pList(NULL),
- m_bPopup(FALSE),
+ m_bPopup(false),
m_nPopupWhere(0),
m_nSelectItem(-1),
m_pFillerNotify(NULL)
@@ -231,7 +231,7 @@ void CPWL_ComboBox::SetFocus()
void CPWL_ComboBox::KillFocus()
{
- SetPopup(FALSE);
+ SetPopup(false);
CPWL_Wnd::KillFocus();
}
@@ -439,15 +439,15 @@ void CPWL_ComboBox::RePosChildWnd()
}
if (m_pButton)
- m_pButton->Move(rcButton,TRUE,FALSE);
+ m_pButton->Move(rcButton,true,false);
if (m_pEdit)
- m_pEdit->Move(rcEdit,TRUE,FALSE);
+ m_pEdit->Move(rcEdit,true,false);
if (m_pList)
{
- m_pList->SetVisible(TRUE);
- m_pList->Move(rcList,TRUE,FALSE);
+ m_pList->SetVisible(true);
+ m_pList->Move(rcList,true,false);
m_pList->ScrollToListItem(m_nSelectItem);
}
}
@@ -461,7 +461,7 @@ void CPWL_ComboBox::RePosChildWnd()
rcButton.left = rcClient.left;
if (m_pButton)
- m_pButton->Move(rcButton,TRUE,FALSE);
+ m_pButton->Move(rcButton,true,false);
CPDF_Rect rcEdit = rcClient;
rcEdit.right = rcButton.left - 1.0f;
@@ -473,10 +473,10 @@ void CPWL_ComboBox::RePosChildWnd()
rcEdit.right = rcEdit.left;
if (m_pEdit)
- m_pEdit->Move(rcEdit,TRUE,FALSE);
+ m_pEdit->Move(rcEdit,true,false);
if (m_pList)
- m_pList->SetVisible(FALSE);
+ m_pList->SetVisible(false);
}
}
@@ -491,7 +491,7 @@ CPDF_Rect CPWL_ComboBox::GetFocusRect() const
return CPDF_Rect();
}
-void CPWL_ComboBox::SetPopup(FX_BOOL bPopup)
+void CPWL_ComboBox::SetPopup(bool bPopup)
{
if (!m_pList) return;
if (bPopup == m_bPopup) return;
@@ -528,21 +528,21 @@ void CPWL_ComboBox::SetPopup(FX_BOOL bPopup)
}
m_nPopupWhere = nWhere;
- Move(rcWindow, TRUE, TRUE);
+ Move(rcWindow, true, true);
}
}
}
else
{
m_bPopup = bPopup;
- Move(m_rcOldWindow, TRUE, TRUE);
+ Move(m_rcOldWindow, true, true);
}
}
-FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
- if (!m_pList) return FALSE;
- if (!m_pEdit) return FALSE;
+ if (!m_pList) return false;
+ if (!m_pEdit) return false;
m_nSelectItem = -1;
@@ -551,47 +551,47 @@ FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
case FWL_VKEY_Up:
if (m_pList->GetCurSel() > 0)
{
- FX_BOOL bExit = FALSE;
+ bool bExit = false;
if (m_pList->OnKeyDownWithExit(nChar,bExit,nFlag))
{
- if (bExit) return FALSE;
+ if (bExit) return false;
SetSelectText();
}
}
- return TRUE;
+ return true;
case FWL_VKEY_Down:
if (m_pList->GetCurSel() < m_pList->GetCount() - 1)
{
- FX_BOOL bExit = FALSE;
+ bool bExit = false;
if (m_pList->OnKeyDownWithExit(nChar,bExit,nFlag))
{
- if (bExit) return FALSE;
+ if (bExit) return false;
SetSelectText();
}
}
- return TRUE;
+ return true;
}
if (HasFlag(PCBS_ALLOWCUSTOMTEXT))
return m_pEdit->OnKeyDown(nChar,nFlag);
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
if (!m_pList)
- return FALSE;
+ return false;
if (!m_pEdit)
- return FALSE;
+ return false;
m_nSelectItem = -1;
if (HasFlag(PCBS_ALLOWCUSTOMTEXT))
return m_pEdit->OnChar(nChar,nFlag);
- FX_BOOL bExit = FALSE;
- return m_pList->OnCharWithExit(nChar,bExit,nFlag) ? bExit : FALSE;
+ bool bExit = false;
+ return m_pList->OnCharWithExit(nChar,bExit,nFlag) ? bExit : false;
}
void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -613,7 +613,7 @@ void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
SetSelectText();
SelectAll();
m_pEdit->SetFocus();
- SetPopup(FALSE);
+ SetPopup(false);
return;
}
}
@@ -622,7 +622,7 @@ void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam);
}
-FX_BOOL CPWL_ComboBox::IsPopup() const
+bool CPWL_ComboBox::IsPopup() const
{
return m_bPopup;
}
@@ -637,7 +637,7 @@ void CPWL_ComboBox::SetSelectText()
m_nSelectItem = m_pList->GetCurSel();
}
-FX_BOOL CPWL_ComboBox::IsModified() const
+bool CPWL_ComboBox::IsModified() const
{
return m_pEdit->IsModified();
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
index 58d8a79da1..303ae963f4 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
@@ -19,14 +19,14 @@
CPWL_Edit::CPWL_Edit() : m_pFillerNotify(NULL),
m_pSpellCheck(NULL),
- m_bFocus(FALSE)
+ m_bFocus(false)
{
m_pFormFiller = NULL;
}
CPWL_Edit::~CPWL_Edit()
{
- ASSERT(m_bFocus == FALSE);
+ ASSERT(m_bFocus == false);
}
CFX_ByteString CPWL_Edit::GetClassName() const
@@ -49,7 +49,7 @@ void CPWL_Edit::SetText(const FX_WCHAR* csText)
if (CXML_Element * pXML = CXML_Element::Parse(sValue.c_str(), sValue.GetLength()))
{
int32_t nCount = pXML->CountChildren();
- FX_BOOL bFirst = TRUE;
+ bool bFirst = true;
swText.Empty();
@@ -67,7 +67,7 @@ void CPWL_Edit::SetText(const FX_WCHAR* csText)
swSection += pSubElement->GetContent(j);
}
- if (bFirst)bFirst = FALSE;
+ if (bFirst)bFirst = false;
else
swText += FWL_VKEY_Return;
swText += swSection;
@@ -90,7 +90,7 @@ void CPWL_Edit::RePosChildWnd()
rcWindow.bottom,
rcWindow.right + PWL_SCROLLBAR_WIDTH,
rcWindow.top);
- pVSB->Move(rcVScroll, TRUE, FALSE);
+ pVSB->Move(rcVScroll, true, false);
}
if (m_pEditCaret && !HasFlag(PES_TEXTOVERFLOW))
@@ -114,39 +114,39 @@ CPDF_Rect CPWL_Edit::GetClientRect() const
return rcClient;
}
-void CPWL_Edit::SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat, FX_BOOL bPaint/* = TRUE*/)
+void CPWL_Edit::SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat, bool bPaint/* = true*/)
{
m_pEdit->SetAlignmentH((int32_t)nFormat, bPaint);
}
-void CPWL_Edit::SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat, FX_BOOL bPaint/* = TRUE*/)
+void CPWL_Edit::SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat, bool bPaint/* = true*/)
{
m_pEdit->SetAlignmentV((int32_t)nFormat, bPaint);
}
-FX_BOOL CPWL_Edit::CanSelectAll() const
+bool CPWL_Edit::CanSelectAll() const
{
return GetSelectWordRange() != m_pEdit->GetWholeWordRange();
}
-FX_BOOL CPWL_Edit::CanClear() const
+bool CPWL_Edit::CanClear() const
{
return !IsReadOnly() && m_pEdit->IsSelected();
}
-FX_BOOL CPWL_Edit::CanCopy() const
+bool CPWL_Edit::CanCopy() const
{
return !HasFlag(PES_PASSWORD) && !HasFlag(PES_NOREAD) && m_pEdit->IsSelected();
}
-FX_BOOL CPWL_Edit::CanCut() const
+bool CPWL_Edit::CanCut() const
{
return CanCopy() && !IsReadOnly();
}
-FX_BOOL CPWL_Edit::CanPaste() const
+bool CPWL_Edit::CanPaste() const
{
- if (IsReadOnly()) return FALSE;
+ if (IsReadOnly()) return false;
CFX_WideString swClipboard;
if (IFX_SystemHandler* pSH = GetSystemHandler())
@@ -175,13 +175,13 @@ void CPWL_Edit::PasteText()
if (m_pFillerNotify)
{
- FX_BOOL bRC = TRUE;
- FX_BOOL bExit = FALSE;
+ bool bRC = true;
+ bool bExit = false;
CFX_WideString strChangeEx;
int nSelStart = 0;
int nSelEnd = 0;
GetSel(nSelStart, nSelEnd);
- m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), 0 , swClipboard, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, 0);
+ m_pFillerNotify->OnBeforeKeyStroke(true, GetAttachedData(), 0 , swClipboard, strChangeEx, nSelStart, nSelEnd, true, bRC, bExit, 0);
if (!bRC) return;
if (bExit) return;
}
@@ -194,8 +194,8 @@ void CPWL_Edit::PasteText()
if (m_pFillerNotify)
{
- FX_BOOL bExit = FALSE;
- m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,0);
+ bool bExit = false;
+ m_pFillerNotify->OnAfterKeyStroke(true, GetAttachedData(), bExit,0);
if (bExit) return;
}
}
@@ -227,52 +227,52 @@ void CPWL_Edit::OnCreated()
m_rcOldWindow = GetWindowRect();
m_pEdit->SetOprNotify(this);
- m_pEdit->EnableOprNotify(TRUE);
+ m_pEdit->EnableOprNotify(true);
}
void CPWL_Edit::SetParamByFlag()
{
if (HasFlag(PES_RIGHT))
{
- m_pEdit->SetAlignmentH(2, FALSE);
+ m_pEdit->SetAlignmentH(2, false);
}
else if (HasFlag(PES_MIDDLE))
{
- m_pEdit->SetAlignmentH(1, FALSE);
+ m_pEdit->SetAlignmentH(1, false);
}
else
{
- m_pEdit->SetAlignmentH(0, FALSE);
+ m_pEdit->SetAlignmentH(0, false);
}
if (HasFlag(PES_BOTTOM))
{
- m_pEdit->SetAlignmentV(2, FALSE);
+ m_pEdit->SetAlignmentV(2, false);
}
else if (HasFlag(PES_CENTER))
{
- m_pEdit->SetAlignmentV(1, FALSE);
+ m_pEdit->SetAlignmentV(1, false);
}
else
{
- m_pEdit->SetAlignmentV(0, FALSE);
+ m_pEdit->SetAlignmentV(0, false);
}
if (HasFlag(PES_PASSWORD))
{
- m_pEdit->SetPasswordChar('*', FALSE);
+ m_pEdit->SetPasswordChar('*', false);
}
- m_pEdit->SetMultiLine(HasFlag(PES_MULTILINE), FALSE);
- m_pEdit->SetAutoReturn(HasFlag(PES_AUTORETURN), FALSE);
- m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE), FALSE);
- m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL), FALSE);
+ m_pEdit->SetMultiLine(HasFlag(PES_MULTILINE), false);
+ m_pEdit->SetAutoReturn(HasFlag(PES_AUTORETURN), false);
+ m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE), false);
+ m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL), false);
m_pEdit->EnableUndo(HasFlag(PES_UNDO));
if (HasFlag(PES_TEXTOVERFLOW))
{
SetClipRect(CPDF_Rect(0.0f,0.0f,0.0f,0.0f));
- m_pEdit->SetTextOverflow(TRUE, FALSE);
+ m_pEdit->SetTextOverflow(true, false);
}
else
{
@@ -304,7 +304,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
case PBS_SOLID:
{
sLine << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n";
+ << CPWL_Utils::GetColorAppStream(GetBorderColor(),false) << " 2 J 0 j\n";
for (int32_t i=1;i<nCharArray;i++)
{
@@ -320,7 +320,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
case PBS_DASH:
{
sLine << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n"
+ << CPWL_Utils::GetColorAppStream(GetBorderColor(),false) << " 2 J 0 j\n"
<< "[" << GetBorderDash().nDash << " "
<< GetBorderDash().nGap << "] "
<< GetBorderDash().nPhase << " d\n";
@@ -383,7 +383,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
{
CFX_ByteString sSpellCheck = CPWL_Utils::GetSpellCheckAppStream(m_pEdit, m_pSpellCheck, ptOffset, &wrVisible);
if (sSpellCheck.GetLength() > 0)
- sText << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,1,0,0),FALSE) << sSpellCheck;
+ sText << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,1,0,0),false) << sSpellCheck;
}
if (sText.GetLength() > 0)
@@ -487,7 +487,7 @@ IFX_SystemHandler* pSysHandler = GetSystemHandler();
}
}
-FX_BOOL CPWL_Edit::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Edit::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
@@ -496,16 +496,16 @@ FX_BOOL CPWL_Edit::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
if (m_bMouseDown)
InvalidateRect();
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
SetCapture();
m_pEdit->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDblClk(point, nFlag);
@@ -514,7 +514,7 @@ FX_BOOL CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
m_pEdit->SelectAll();
}
- return TRUE;
+ return true;
}
#define WM_PWLEDIT_UNDO 0x01
@@ -526,16 +526,16 @@ FX_BOOL CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
#define WM_PWLEDIT_SELECTALL 0x07
#define WM_PWLEDIT_SUGGEST 0x08
-FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- if (m_bMouseDown) return FALSE;
+ if (m_bMouseDown) return false;
CPWL_Wnd::OnRButtonUp(point, nFlag);
- if (!HasFlag(PES_TEXTOVERFLOW) && !ClientHitTest(point)) return TRUE;
+ if (!HasFlag(PES_TEXTOVERFLOW) && !ClientHitTest(point)) return true;
IFX_SystemHandler* pSH = GetSystemHandler();
- if (!pSH) return FALSE;
+ if (!pSH) return false;
SetFocus();
@@ -543,7 +543,7 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
CFX_WideString swLatin = m_pEdit->GetRangeText(wrLatin);
FX_HMENU hPopup = pSH->CreatePopupMenu();
- if (!hPopup) return FALSE;
+ if (!hPopup) return false;
CFX_ByteStringArray sSuggestWords;
CPDF_Point ptPopup = point;
@@ -587,9 +587,9 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
pSH->AppendMenuItem(hPopup, 0, L"");
if (!m_pEdit->CanUndo())
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_UNDO, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_UNDO, false);
if (!m_pEdit->CanRedo())
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_REDO, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_REDO, false);
}
pSH->AppendMenuItem(hPopup, WM_PWLEDIT_CUT,
@@ -603,32 +603,32 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
CFX_WideString swText = pSH->GetClipboardText(GetAttachedHWnd());
if (swText.IsEmpty())
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, false);
if (!m_pEdit->IsSelected())
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, false);
}
if (IsReadOnly())
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, false);
}
if (HasFlag(PES_PASSWORD))
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, false);
}
if (HasFlag(PES_NOREAD))
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, false);
}
pSH->AppendMenuItem(hPopup, 0, L"");
@@ -637,7 +637,7 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
if (m_pEdit->GetTotalWords() == 0)
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_SELECTALL, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_SELECTALL, false);
}
int32_t x, y;
@@ -699,12 +699,12 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
pSH->DestroyMenu(hPopup);
- return TRUE;
+ return true;
}
void CPWL_Edit::OnSetFocus()
{
- SetEditCaret(TRUE);
+ SetEditCaret(true);
if (!IsReadOnly())
{
@@ -712,15 +712,15 @@ void CPWL_Edit::OnSetFocus()
pFocusHandler->OnSetFocus(this);
}
- m_bFocus = TRUE;
+ m_bFocus = true;
}
void CPWL_Edit::OnKillFocus()
{
- ShowVScrollBar(FALSE);
+ ShowVScrollBar(false);
m_pEdit->SelectNone();
- SetCaret(FALSE, CPDF_Point(0.0f,0.0f), CPDF_Point(0.0f,0.0f));
+ SetCaret(false, CPDF_Point(0.0f,0.0f), CPDF_Point(0.0f,0.0f));
SetCharSet(0);
@@ -730,20 +730,20 @@ void CPWL_Edit::OnKillFocus()
pFocusHandler->OnKillFocus(this);
}
- m_bFocus = FALSE;
+ m_bFocus = false;
}
-void CPWL_Edit::SetHorzScale(int32_t nHorzScale, FX_BOOL bPaint/* = TRUE*/)
+void CPWL_Edit::SetHorzScale(int32_t nHorzScale, bool bPaint/* = true*/)
{
m_pEdit->SetHorzScale(nHorzScale, bPaint);
}
-void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint/* = TRUE*/)
+void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace, bool bPaint/* = true*/)
{
m_pEdit->SetCharSpace(fCharSpace, bPaint);
}
-void CPWL_Edit::SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint/* = TRUE*/)
+void CPWL_Edit::SetLineLeading(FX_FLOAT fLineLeading, bool bPaint/* = true*/)
{
m_pEdit->SetLineLeading(fLineLeading, bPaint);
}
@@ -813,7 +813,7 @@ CPDF_Point CPWL_Edit::GetWordRightBottomPoint(const CPVT_WordPlace& wpWord)
return pt;
}
-FX_BOOL CPWL_Edit::IsTextFull() const
+bool CPWL_Edit::IsTextFull() const
{
return m_pEdit->IsTextFull();
}
@@ -840,7 +840,7 @@ void CPWL_Edit::SetCharArray(int32_t nCharArray)
if (HasFlag(PES_CHARARRAY) && nCharArray > 0)
{
m_pEdit->SetCharArray(nCharArray);
- m_pEdit->SetTextOverflow(TRUE);
+ m_pEdit->SetTextOverflow(true);
if (HasFlag(PWS_AUTOFONTSIZE))
{
@@ -849,7 +849,7 @@ void CPWL_Edit::SetCharArray(int32_t nCharArray)
FX_FLOAT fFontSize = GetCharArrayAutoFontSize(pFontMap->GetPDFFont(0), GetClientRect(), nCharArray);
if (fFontSize > 0.0f)
{
- m_pEdit->SetAutoFontSize(FALSE);
+ m_pEdit->SetAutoFontSize(false);
m_pEdit->SetFontSize(fFontSize);
}
}
@@ -873,7 +873,7 @@ CPDF_Rect CPWL_Edit::GetFocusRect() const
return CPDF_Rect();
}
-void CPWL_Edit::ShowVScrollBar(FX_BOOL bShow)
+void CPWL_Edit::ShowVScrollBar(bool bShow)
{
if (CPWL_ScrollBar * pScroll = GetVScrollBar())
{
@@ -881,35 +881,35 @@ void CPWL_Edit::ShowVScrollBar(FX_BOOL bShow)
{
if (!pScroll->IsVisible())
{
- pScroll->SetVisible(TRUE);
+ pScroll->SetVisible(true);
CPDF_Rect rcWindow = GetWindowRect();
m_rcOldWindow = rcWindow;
rcWindow.right += PWL_SCROLLBAR_WIDTH;
- Move(rcWindow, TRUE, TRUE);
+ Move(rcWindow, true, true);
}
}
else
{
if (pScroll->IsVisible())
{
- pScroll->SetVisible(FALSE);
- Move(m_rcOldWindow, TRUE, TRUE);
+ pScroll->SetVisible(false);
+ Move(m_rcOldWindow, true, true);
}
}
}
}
-FX_BOOL CPWL_Edit::IsVScrollBarVisible() const
+bool CPWL_Edit::IsVScrollBarVisible() const
{
if (CPWL_ScrollBar * pScroll = GetVScrollBar())
{
return pScroll->IsVisible();
}
- return FALSE;
+ return false;
}
-void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled)
+void CPWL_Edit::EnableSpellCheck(bool bEnabled)
{
if (bEnabled)
AddFlag(PES_SPELLCHECK);
@@ -917,16 +917,16 @@ void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled)
RemoveFlag(PES_SPELLCHECK);
}
-FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
- if (m_bMouseDown) return TRUE;
+ if (m_bMouseDown) return true;
if (nChar == FWL_VKEY_Delete)
{
if (m_pFillerNotify)
{
- FX_BOOL bRC = TRUE;
- FX_BOOL bExit = FALSE;
+ bool bRC = true;
+ bool bExit = false;
CFX_WideString strChange;
CFX_WideString strChangeEx;
@@ -936,27 +936,27 @@ FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
if (nSelStart == nSelEnd)
nSelEnd = nSelStart + 1;
- m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), FWL_VKEY_Delete, strChange, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, nFlag);
- if (!bRC) return FALSE;
- if (bExit) return FALSE;
+ m_pFillerNotify->OnBeforeKeyStroke(true, GetAttachedData(), FWL_VKEY_Delete, strChange, strChangeEx, nSelStart, nSelEnd, true, bRC, bExit, nFlag);
+ if (!bRC) return false;
+ if (bExit) return false;
}
}
- FX_BOOL bRet = CPWL_EditCtrl::OnKeyDown(nChar, nFlag);
+ bool bRet = CPWL_EditCtrl::OnKeyDown(nChar, nFlag);
if (nChar == FWL_VKEY_Delete)
{
if (m_pFillerNotify)
{
- FX_BOOL bExit = FALSE;
- m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,nFlag);
- if (bExit) return FALSE;
+ bool bExit = false;
+ m_pFillerNotify->OnAfterKeyStroke(true, GetAttachedData(), bExit,nFlag);
+ if (bExit) return false;
}
}
//In case of implementation swallow the OnKeyDown event.
if(IsProceedtoOnChar(nChar, nFlag))
- return TRUE;
+ return true;
return bRet;
}
@@ -965,11 +965,11 @@ FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
*In case of implementation swallow the OnKeyDown event.
*If the event is swallowed, implementation may do other unexpected things, which is not the control means to do.
*/
-FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
+bool CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
{
- FX_BOOL bCtrl = IsCTRLpressed(nFlag);
- FX_BOOL bAlt = IsALTpressed(nFlag);
+ bool bCtrl = IsCTRLpressed(nFlag);
+ bool bAlt = IsALTpressed(nFlag);
if(bCtrl && !bAlt)
{
//hot keys for edit control.
@@ -980,7 +980,7 @@ FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
case 'X':
case 'A':
case 'Z':
- return TRUE;
+ return true;
default:
break;
}
@@ -992,22 +992,22 @@ FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
case FWL_VKEY_Back:
case FWL_VKEY_Return:
case FWL_VKEY_Space:
- return TRUE;
+ return true;
default:
break;
}
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
- if (m_bMouseDown) return TRUE;
+ if (m_bMouseDown) return true;
- FX_BOOL bRC = TRUE;
- FX_BOOL bExit = FALSE;
+ bool bRC = true;
+ bool bExit = false;
- FX_BOOL bCtrl = IsCTRLpressed(nFlag);
+ bool bCtrl = IsCTRLpressed(nFlag);
if (!bCtrl)
{
if (m_pFillerNotify)
@@ -1036,12 +1036,12 @@ FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
}
CFX_WideString strChangeEx;
- m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), nKeyCode, swChange, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, nFlag);
+ m_pFillerNotify->OnBeforeKeyStroke(true, GetAttachedData(), nKeyCode, swChange, strChangeEx, nSelStart, nSelEnd, true, bRC, bExit, nFlag);
}
}
- if (!bRC) return TRUE;
- if (bExit) return FALSE;
+ if (!bRC) return true;
+ if (bExit) return false;
if (IFX_Edit_FontMap * pFontMap = GetFontMap())
{
@@ -1052,21 +1052,21 @@ FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
SetCharSet(nNewCharSet);
}
}
- FX_BOOL bRet = CPWL_EditCtrl::OnChar(nChar,nFlag);
+ bool bRet = CPWL_EditCtrl::OnChar(nChar,nFlag);
if (!bCtrl)
{
if (m_pFillerNotify)
{
- m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,nFlag);
- if (bExit) return FALSE;
+ m_pFillerNotify->OnAfterKeyStroke(true, GetAttachedData(), bExit,nFlag);
+ if (bExit) return false;
}
}
return bRet;
}
-FX_BOOL CPWL_Edit::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Edit::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
if (HasFlag(PES_MULTILINE))
{
@@ -1082,10 +1082,10 @@ FX_BOOL CPWL_Edit::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD
}
SetScrollPos(ptScroll);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CPWL_Edit::OnInsertReturn(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
@@ -1205,22 +1205,22 @@ CPVT_WordRange CPWL_Edit::CombineWordRange(const CPVT_WordRange& wr1, const CPVT
CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CPDF_Point& point) const
{
- return GetSameWordsRange(m_pEdit->SearchWordPlace(point), TRUE, FALSE);
+ return GetSameWordsRange(m_pEdit->SearchWordPlace(point), true, false);
}
CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CPVT_WordPlace & place) const
{
- return GetSameWordsRange(place, TRUE, FALSE);
+ return GetSameWordsRange(place, true, false);
}
CPVT_WordRange CPWL_Edit::GetArabicWordsRange(const CPVT_WordPlace & place) const
{
- return GetSameWordsRange(place, FALSE, TRUE);
+ return GetSameWordsRange(place, false, true);
}
#define PWL_ISARABICWORD(word) ((word >= 0x0600 && word <= 0x06FF) || (word >= 0xFB50 && word <= 0xFEFC))
-CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, FX_BOOL bLatin, FX_BOOL bArabic) const
+CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, bool bLatin, bool bArabic) const
{
CPVT_WordRange range;
diff --git a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
index 0d14587f66..11e1fe7d37 100644
--- a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
@@ -22,7 +22,7 @@
CPWL_EditCtrl::CPWL_EditCtrl() :
m_pEdit(NULL),
m_pEditCaret(NULL),
- m_bMouseDown(FALSE),
+ m_bMouseDown(false),
m_pEditNotify(NULL),
m_nCharSet(DEFAULT_CHARSET),
m_nCodePage(0)
@@ -50,7 +50,7 @@ void CPWL_EditCtrl::OnCreated()
m_pEdit->Initialize();
}
-FX_BOOL CPWL_EditCtrl::IsWndHorV()
+bool CPWL_EditCtrl::IsWndHorV()
{
CPDF_Matrix mt = GetWindowMatrix();
CPDF_Point point1(0,1);
@@ -167,17 +167,17 @@ FX_FLOAT CPWL_EditCtrl::GetFontSize() const
return m_pEdit->GetFontSize();
}
-FX_BOOL CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
- if (m_bMouseDown) return TRUE;
+ if (m_bMouseDown) return true;
- FX_BOOL bRet = CPWL_Wnd::OnKeyDown(nChar,nFlag);
+ bool bRet = CPWL_Wnd::OnKeyDown(nChar,nFlag);
//FILTER
switch (nChar)
{
default:
- return FALSE;
+ return false;
case FWL_VKEY_Delete:
case FWL_VKEY_Up:
case FWL_VKEY_Down:
@@ -209,35 +209,35 @@ FX_BOOL CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
case FWL_VKEY_Delete:
Delete();
- return TRUE;
+ return true;
case FWL_VKEY_Insert:
if (IsSHIFTpressed(nFlag))
PasteText();
- return TRUE;
+ return true;
case FWL_VKEY_Up:
- m_pEdit->OnVK_UP(IsSHIFTpressed(nFlag),FALSE);
- return TRUE;
+ m_pEdit->OnVK_UP(IsSHIFTpressed(nFlag),false);
+ return true;
case FWL_VKEY_Down:
- m_pEdit->OnVK_DOWN(IsSHIFTpressed(nFlag),FALSE);
- return TRUE;
+ m_pEdit->OnVK_DOWN(IsSHIFTpressed(nFlag),false);
+ return true;
case FWL_VKEY_Left:
- m_pEdit->OnVK_LEFT(IsSHIFTpressed(nFlag),FALSE);
- return TRUE;
+ m_pEdit->OnVK_LEFT(IsSHIFTpressed(nFlag),false);
+ return true;
case FWL_VKEY_Right:
- m_pEdit->OnVK_RIGHT(IsSHIFTpressed(nFlag),FALSE);
- return TRUE;
+ m_pEdit->OnVK_RIGHT(IsSHIFTpressed(nFlag),false);
+ return true;
case FWL_VKEY_Home:
m_pEdit->OnVK_HOME(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- return TRUE;
+ return true;
case FWL_VKEY_End:
m_pEdit->OnVK_END(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- return TRUE;
+ return true;
case FWL_VKEY_Unknown:
if (!IsSHIFTpressed(nFlag))
Clear();
else
CutText();
- return TRUE;
+ return true;
default:
break;
}
@@ -245,9 +245,9 @@ FX_BOOL CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
return bRet;
}
-FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
- if (m_bMouseDown) return TRUE;
+ if (m_bMouseDown) return true;
CPWL_Wnd::OnChar(nChar,nFlag);
@@ -256,14 +256,14 @@ FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
case 0x0A:
case 0x1B:
- return FALSE;
+ return false;
default:
break;
}
- FX_BOOL bCtrl = IsCTRLpressed(nFlag);
- FX_BOOL bAlt = IsALTpressed(nFlag);
- FX_BOOL bShift = IsSHIFTpressed(nFlag);
+ bool bCtrl = IsCTRLpressed(nFlag);
+ bool bAlt = IsALTpressed(nFlag);
+ bool bShift = IsSHIFTpressed(nFlag);
FX_WORD word = nChar;
@@ -273,29 +273,29 @@ FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
case 'C' - 'A' + 1:
CopyText();
- return TRUE;
+ return true;
case 'V' - 'A' + 1:
PasteText();
- return TRUE;
+ return true;
case 'X' - 'A' + 1:
CutText();
- return TRUE;
+ return true;
case 'A' - 'A' + 1:
SelectAll();
- return TRUE;
+ return true;
case 'Z' - 'A' + 1:
if (bShift)
Redo();
else
Undo();
- return TRUE;
+ return true;
default:
if (nChar < 32)
- return FALSE;
+ return false;
}
}
- if (IsReadOnly()) return TRUE;
+ if (IsReadOnly()) return true;
if (m_pEdit->IsSelected() && word == FWL_VKEY_Back)
word = FWL_VKEY_Unknown;
@@ -319,10 +319,10 @@ FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
break;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_EditCtrl::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
@@ -331,16 +331,16 @@ FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
if (m_bMouseDown)
InvalidateRect();
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
SetCapture();
m_pEdit->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_EditCtrl::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
@@ -351,20 +351,20 @@ FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
SetFocus();
ReleaseCapture();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_EditCtrl::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_EditCtrl::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnMouseMove(point,nFlag);
if (m_bMouseDown)
- m_pEdit->OnMouseMove(point,FALSE,FALSE);
+ m_pEdit->OnMouseMove(point,false,false);
- return TRUE;
+ return true;
}
CPDF_Rect CPWL_EditCtrl::GetContentRect() const
@@ -372,7 +372,7 @@ CPDF_Rect CPWL_EditCtrl::GetContentRect() const
return m_pEdit->GetContentRect();
}
-void CPWL_EditCtrl::SetEditCaret(FX_BOOL bVisible)
+void CPWL_EditCtrl::SetEditCaret(bool bVisible)
{
CPDF_Point ptHead(0,0),ptFoot(0,0);
@@ -418,18 +418,18 @@ void CPWL_EditCtrl::GetCaretPos(int32_t& x, int32_t& y) const
PWLtoWnd(ptHead, x, y);
}
-void CPWL_EditCtrl::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
+void CPWL_EditCtrl::SetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
{
if (m_pEditCaret)
{
if (!IsFocused() || m_pEdit->IsSelected())
- bVisible = FALSE;
+ bVisible = false;
m_pEditCaret->SetCaret(bVisible, ptHead, ptFoot);
}
}
-FX_BOOL CPWL_EditCtrl::IsModified() const
+bool CPWL_EditCtrl::IsModified() const
{
return m_pEdit->IsModified();
}
@@ -466,7 +466,7 @@ void CPWL_EditCtrl::Paint()
m_pEdit->Paint();
}
-void CPWL_EditCtrl::EnableRefresh(FX_BOOL bRefresh)
+void CPWL_EditCtrl::EnableRefresh(bool bRefresh)
{
if (m_pEdit)
m_pEdit->EnableRefresh(bRefresh);
@@ -578,7 +578,7 @@ void CPWL_EditCtrl::CutText()
{
}
-void CPWL_EditCtrl::ShowVScrollBar(FX_BOOL bShow)
+void CPWL_EditCtrl::ShowVScrollBar(bool bShow)
{
}
@@ -612,12 +612,12 @@ void CPWL_EditCtrl::Backspace()
m_pEdit->Backspace();
}
-FX_BOOL CPWL_EditCtrl::CanUndo() const
+bool CPWL_EditCtrl::CanUndo() const
{
return !IsReadOnly() && m_pEdit->CanUndo();
}
-FX_BOOL CPWL_EditCtrl::CanRedo() const
+bool CPWL_EditCtrl::CanRedo() const
{
return !IsReadOnly() && m_pEdit->CanRedo();
}
@@ -651,11 +651,11 @@ void CPWL_EditCtrl::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
if (IsFloatBigger(Info.fPlateWidth,Info.fContentMax-Info.fContentMin)
|| IsFloatEqual(Info.fPlateWidth,Info.fContentMax-Info.fContentMin))
{
- ShowVScrollBar(FALSE);
+ ShowVScrollBar(false);
}
else
{
- ShowVScrollBar(TRUE);
+ ShowVScrollBar(true);
}
}
@@ -664,7 +664,7 @@ void CPWL_EditCtrl::IOnSetScrollPosY(FX_FLOAT fy)
OnNotify(this, PNM_SETSCROLLPOS,SBT_VSCROLL, (intptr_t)&fy);
}
-void CPWL_EditCtrl::IOnSetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot, const CPVT_WordPlace& place)
+void CPWL_EditCtrl::IOnSetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot, const CPVT_WordPlace& place)
{
PWL_CARET_INFO cInfo;
cInfo.bVisible = bVisible;
@@ -717,6 +717,6 @@ void CPWL_EditCtrl::SetReadyToInput()
if (m_bMouseDown)
{
ReleaseCapture();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
}
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
index 50b321dfac..2f02973f82 100644
--- a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
@@ -72,7 +72,7 @@ CFX_ByteString CPWL_FontMap::GetPDFFontAlias(int32_t nFontIndex)
return "";
}
-FX_BOOL CPWL_FontMap::KnowWord(int32_t nFontIndex, FX_WORD word)
+bool CPWL_FontMap::KnowWord(int32_t nFontIndex, FX_WORD word)
{
if (nFontIndex >=0 && nFontIndex < m_aData.GetSize())
{
@@ -82,7 +82,7 @@ FX_BOOL CPWL_FontMap::KnowWord(int32_t nFontIndex, FX_WORD word)
}
}
- return FALSE;
+ return false;
}
int32_t CPWL_FontMap::GetWordFontIndex(FX_WORD word, int32_t nCharset, int32_t nFontIndex)
@@ -106,13 +106,13 @@ int32_t CPWL_FontMap::GetWordFontIndex(FX_WORD word, int32_t nCharset, int32_t n
}
}
- int32_t nNewFontIndex = GetFontIndex(GetNativeFontName(nCharset), nCharset, TRUE);
+ int32_t nNewFontIndex = GetFontIndex(GetNativeFontName(nCharset), nCharset, true);
if (nNewFontIndex >= 0)
{
if (KnowWord(nNewFontIndex, word))
return nNewFontIndex;
}
- nNewFontIndex = GetFontIndex("Arial Unicode MS", DEFAULT_CHARSET, FALSE);
+ nNewFontIndex = GetFontIndex("Arial Unicode MS", DEFAULT_CHARSET, false);
if (nNewFontIndex >= 0)
{
if (KnowWord(nNewFontIndex, word))
@@ -189,7 +189,7 @@ void CPWL_FontMap::Initial(const FX_CHAR* fontname)
if (sFontName.IsEmpty())
sFontName = DEFAULT_FONT_NAME;
- GetFontIndex(sFontName, ANSI_CHARSET, FALSE);
+ GetFontIndex(sFontName, ANSI_CHARSET, false);
}
@@ -206,15 +206,15 @@ const char* g_sDEStandardFontName[] = {"Courier", "Courier-Bold", "Courier-BoldO
"Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic",
"Symbol", "ZapfDingbats"};
-FX_BOOL CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName)
+bool CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName)
{
for (int32_t i=0; i<14; i++)
{
if (sFontName == g_sDEStandardFontName[i])
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
int32_t CPWL_FontMap::FindFont(const CFX_ByteString& sFontName, int32_t nCharset)
@@ -234,7 +234,7 @@ int32_t CPWL_FontMap::FindFont(const CFX_ByteString& sFontName, int32_t nCharset
return -1;
}
-int32_t CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName, int32_t nCharset, FX_BOOL bFind)
+int32_t CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName, int32_t nCharset, bool bFind)
{
int32_t nFontIndex = FindFont(EncodeFontAlias(sFontName, nCharset), nCharset);
if (nFontIndex >= 0)
diff --git a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
index 71174dfb0a..85c4bc06c9 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
@@ -145,12 +145,12 @@ int32_t CPWL_Icon::GetScaleMethod()
return 0;
}
-FX_BOOL CPWL_Icon::IsProportionalScale()
+bool CPWL_Icon::IsProportionalScale()
{
if (m_pIconFit)
return m_pIconFit->IsProportionalScale();
- return FALSE;
+ return false;
}
void CPWL_Icon::GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom)
@@ -175,12 +175,12 @@ void CPWL_Icon::GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom)
}
}
-FX_BOOL CPWL_Icon::GetFittingBounds()
+bool CPWL_Icon::GetFittingBounds()
{
if (m_pIconFit)
return m_pIconFit->GetFittingBounds();
- return FALSE;
+ return false;
}
void CPWL_Icon::GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale)
diff --git a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
index 157eba633d..ecbb0fd3c0 100644
--- a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
@@ -22,7 +22,7 @@
CPWL_IconList_Item::CPWL_IconList_Item() :
m_nIconIndex(-1),
m_pData(NULL),
- m_bSelected(FALSE),
+ m_bSelected(false),
m_pText(NULL)
{
}
@@ -67,7 +67,7 @@ void CPWL_IconList_Item::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matr
m_crIcon, m_pText->GetTextColor(), GetTransparency());
}
-void CPWL_IconList_Item::SetSelect(FX_BOOL bSelected)
+void CPWL_IconList_Item::SetSelect(bool bSelected)
{
m_bSelected = bSelected;
@@ -78,7 +78,7 @@ void CPWL_IconList_Item::SetSelect(FX_BOOL bSelected)
}
-FX_BOOL CPWL_IconList_Item::IsSelected() const
+bool CPWL_IconList_Item::IsSelected() const
{
return m_bSelected;
}
@@ -121,7 +121,7 @@ void CPWL_IconList_Item::RePosChildWnd()
rcClient.left += (PWL_IconList_ITEM_ICON_LEFTMARGIN + PWL_IconList_ITEM_WIDTH + PWL_IconList_ITEM_ICON_LEFTMARGIN);
- m_pText->Move(rcClient, TRUE, FALSE);
+ m_pText->Move(rcClient, true, false);
}
void CPWL_IconList_Item::SetIconFillColor(const CPWL_Color& color)
@@ -151,8 +151,8 @@ void CPWL_IconList_Item::OnDisabled()
CPWL_IconList_Content::CPWL_IconList_Content(int32_t nListCount) :
m_nSelectIndex(-1),
m_pNotify(NULL),
- m_bEnableNotify(TRUE),
- m_bMouseDown(FALSE),
+ m_bEnableNotify(true),
+ m_bMouseDown(false),
m_nListCount(nListCount)
{
}
@@ -192,29 +192,29 @@ void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM & cp)
}
}
-FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
SetFocus();
SetCapture();
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
int32_t nItemIndex = FindItemIndex(point);
SetSelect(nItemIndex);
ScrollToItem(nItemIndex);
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
ReleaseCapture();
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
if (m_bMouseDown)
{
@@ -223,10 +223,10 @@ FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nF
ScrollToItem(nItemIndex);
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
switch (nChar)
{
@@ -237,7 +237,7 @@ FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
SetSelect(nItemIndex);
ScrollToItem(nItemIndex);
}
- return TRUE;
+ return true;
case FWL_VKEY_Down:
if (m_nSelectIndex < m_nListCount-1)
{
@@ -245,10 +245,10 @@ FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
SetSelect(nItemIndex);
ScrollToItem(nItemIndex);
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
int32_t CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point)
@@ -307,8 +307,8 @@ void CPWL_IconList_Content::SetSelect(int32_t nIndex)
{
if (m_nSelectIndex != nIndex)
{
- SelectItem(m_nSelectIndex, FALSE);
- SelectItem(nIndex, TRUE);
+ SelectItem(m_nSelectIndex, false);
+ SelectItem(nIndex, true);
m_nSelectIndex = nIndex;
if (IPWL_IconList_Notify* pNotify = GetNotify())
@@ -333,12 +333,12 @@ void CPWL_IconList_Content::SetNotify(IPWL_IconList_Notify* pNotify)
m_pNotify = pNotify;
}
-void CPWL_IconList_Content::EnableNotify(FX_BOOL bNotify)
+void CPWL_IconList_Content::EnableNotify(bool bNotify)
{
m_bEnableNotify = bNotify;
}
-void CPWL_IconList_Content::SelectItem(int32_t nItemIndex, FX_BOOL bSelect)
+void CPWL_IconList_Content::SelectItem(int32_t nItemIndex, bool bSelect)
{
if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
{
@@ -423,7 +423,7 @@ void CPWL_IconList::RePosChildWnd()
CPWL_Wnd::RePosChildWnd();
if (m_pListContent)
- m_pListContent->Move(GetClientRect(), TRUE, FALSE);
+ m_pListContent->Move(GetClientRect(), true, false);
}
void CPWL_IconList::CreateChildWnd(const PWL_CREATEPARAM & cp)
@@ -442,7 +442,7 @@ void CPWL_IconList::OnCreated()
{
pScrollBar->RemoveFlag(PWS_AUTOTRANSPARENT);
pScrollBar->SetTransparency(255);
- pScrollBar->SetNotifyForever(TRUE);
+ pScrollBar->SetNotifyForever(true);
}
}
@@ -463,7 +463,7 @@ void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
{
if (!pScrollBar->IsVisible())
{
- pScrollBar->SetVisible(TRUE);
+ pScrollBar->SetVisible(true);
RePosChildWnd();
}
else
@@ -474,7 +474,7 @@ void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
{
if (pScrollBar->IsVisible())
{
- pScrollBar->SetVisible(FALSE);
+ pScrollBar->SetVisible(false);
RePosChildWnd();
}
@@ -522,7 +522,7 @@ void CPWL_IconList::SetNotify(IPWL_IconList_Notify* pNotify)
m_pListContent->SetNotify(pNotify);
}
-void CPWL_IconList::EnableNotify(FX_BOOL bNotify)
+void CPWL_IconList::EnableNotify(bool bNotify)
{
m_pListContent->EnableNotify(bNotify);
}
@@ -552,7 +552,7 @@ void CPWL_IconList::SetIconFillColor(const CPWL_Color& color)
m_pListContent->SetIconFillColor(color);
}
-FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
CPDF_Point ptScroll = m_pListContent->GetScrollPos();
CPDF_Rect rcScroll = m_pListContent->GetScrollArea();
@@ -583,10 +583,10 @@ FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_D
if (CPWL_ScrollBar* pScrollBar = GetVScrollBar())
pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptNew.y);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Label.cpp b/fpdfsdk/src/pdfwindow/PWL_Label.cpp
index e1780c69a8..3e231d5244 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Label.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Label.cpp
@@ -39,7 +39,7 @@ void CPWL_Label::OnCreated()
if (HasFlag(PES_TEXTOVERFLOW))
{
SetClipRect(CPDF_Rect(0.0f,0.0f,0.0f,0.0f));
- m_pEdit->SetTextOverflow(TRUE);
+ m_pEdit->SetTextOverflow(true);
}
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
index 48fb409b7b..d0e9cc6dfd 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
@@ -49,7 +49,7 @@ void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
{
if (pScroll->IsVisible())
{
- pScroll->SetVisible(FALSE);
+ pScroll->SetVisible(false);
m_pList->RePosChildWnd();
}
}
@@ -57,7 +57,7 @@ void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
{
if (!pScroll->IsVisible())
{
- pScroll->SetVisible(TRUE);
+ pScroll->SetVisible(true);
m_pList->RePosChildWnd();
}
}
@@ -79,8 +79,8 @@ void CPWL_List_Notify::IOnInvalidateRect(CPDF_Rect * pRect)
CPWL_ListBox::CPWL_ListBox() :
m_pList(NULL),
m_pListNotify(NULL),
- m_bMouseDown(FALSE),
- m_bHoverSel(FALSE),
+ m_bMouseDown(false),
+ m_bHoverSel(false),
m_pFillerNotify(NULL)
{
m_pList = IFX_List::NewList();
@@ -229,16 +229,16 @@ void CPWL_ListBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pU
}
}
-FX_BOOL CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
CPWL_Wnd::OnKeyDown(nChar, nFlag);
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
switch (nChar)
{
default:
- return FALSE;
+ return false;
case FWL_VKEY_Up:
case FWL_VKEY_Down:
case FWL_VKEY_Home:
@@ -272,33 +272,33 @@ FX_BOOL CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
break;
}
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(TRUE,bExit,nFlag);
+ bool bExit = false;
+ OnNotifySelChanged(true,bExit,nFlag);
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
CPWL_Wnd::OnChar(nChar,nFlag);
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
- if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return FALSE;
+ if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return false;
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(TRUE,bExit, nFlag);
+ bool bExit = false;
+ OnNotifySelChanged(true,bExit, nFlag);
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
if (ClientHitTest(point))
{
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
SetFocus();
SetCapture();
@@ -306,31 +306,31 @@ FX_BOOL CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
m_pList->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_ListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
if (m_bMouseDown)
{
ReleaseCapture();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
}
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(FALSE,bExit,nFlag);
+ bool bExit = false;
+ OnNotifySelChanged(false,bExit,nFlag);
- return TRUE;
+ return true;
}
-void CPWL_ListBox::SetHoverSel(FX_BOOL bHoverSel)
+void CPWL_ListBox::SetHoverSel(bool bHoverSel)
{
m_bHoverSel = bHoverSel;
}
-FX_BOOL CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnMouseMove(point, nFlag);
@@ -346,7 +346,7 @@ FX_BOOL CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
m_pList->OnMouseMove(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return TRUE;
+ return true;
}
void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -405,19 +405,19 @@ void CPWL_ListBox::RePosChildWnd()
m_pList->SetPlateRect(GetListRect());
}
-void CPWL_ListBox::OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL & bExit, FX_DWORD nFlag)
+void CPWL_ListBox::OnNotifySelChanged(bool bKeyDown, bool & bExit, FX_DWORD nFlag)
{
if (m_pFillerNotify)
{
- FX_BOOL bRC = TRUE;
+ bool bRC = true;
CFX_WideString swChange = GetText();
CFX_WideString strChangeEx;
int nSelStart = 0;
int nSelEnd = swChange.GetLength();
- m_pFillerNotify->OnBeforeKeyStroke(FALSE, GetAttachedData(), 0, swChange, strChangeEx, nSelStart, nSelEnd, bKeyDown, bRC, bExit, nFlag);
+ m_pFillerNotify->OnBeforeKeyStroke(false, GetAttachedData(), 0, swChange, strChangeEx, nSelStart, nSelEnd, bKeyDown, bRC, bExit, nFlag);
if (bExit) return;
- m_pFillerNotify->OnAfterKeyStroke(FALSE, GetAttachedData(), bExit,nFlag);
+ m_pFillerNotify->OnAfterKeyStroke(false, GetAttachedData(), bExit,nFlag);
}
}
@@ -498,12 +498,12 @@ void CPWL_ListBox::Reset()
m_pList->Cancel();
}
-FX_BOOL CPWL_ListBox::IsMultipleSel() const
+bool CPWL_ListBox::IsMultipleSel() const
{
if (m_pList)
return m_pList->IsMultipleSel();
- return FALSE;
+ return false;
}
int32_t CPWL_ListBox::GetCaretIndex() const
@@ -522,12 +522,12 @@ int32_t CPWL_ListBox::GetCurSel() const
return -1;
}
-FX_BOOL CPWL_ListBox::IsItemSelected(int32_t nItemIndex) const
+bool CPWL_ListBox::IsItemSelected(int32_t nItemIndex) const
{
if (m_pList)
return m_pList->IsItemSelected(nItemIndex);
- return FALSE;
+ return false;
}
int32_t CPWL_ListBox::GetTopVisibleIndex() const
@@ -578,9 +578,9 @@ CPDF_Rect CPWL_ListBox::GetListRect() const
return CPWL_Utils::DeflateRect(GetWindowRect(),(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
}
-FX_BOOL CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
if (zDelta < 0)
{
@@ -591,8 +591,8 @@ FX_BOOL CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DW
m_pList->OnVK_UP(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(FALSE,bExit, nFlag);
- return TRUE;
+ bool bExit = false;
+ OnNotifySelChanged(false,bExit, nFlag);
+ return true;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
index 3077e6293f..d2deacb4d2 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
@@ -52,7 +52,7 @@ CPDF_Rect CPWL_ListCtrl::GetScrollArea() const
void CPWL_ListCtrl::ResetFace()
{
- ResetAll(FALSE, 0);
+ ResetAll(false, 0);
}
void CPWL_ListCtrl::ResetContent(int32_t nStart)
@@ -60,7 +60,7 @@ void CPWL_ListCtrl::ResetContent(int32_t nStart)
if (nStart < 0)
nStart = 0;
if (nStart >= 0 && nStart < m_aChildren.GetSize())
- ResetAll(TRUE, nStart);
+ ResetAll(true, nStart);
}
FX_FLOAT CPWL_ListCtrl::GetContentsHeight(FX_FLOAT fLimitWidth)
@@ -91,7 +91,7 @@ FX_FLOAT CPWL_ListCtrl::GetContentsHeight(FX_FLOAT fLimitWidth)
return fRet;
}
-void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, int32_t nStart)
+void CPWL_ListCtrl::ResetAll(bool bMove, int32_t nStart)
{
CPDF_Rect rcClient = GetClientRect();
@@ -119,7 +119,7 @@ void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, int32_t nStart)
if (bMove)
{
FX_FLOAT fItemHeight = pChild->GetItemHeight(fWidth - fLeft - fRight);
- pChild->Move(CPDF_Rect(fLeft, fy-fItemHeight, fWidth - fRight, fy), TRUE, FALSE);
+ pChild->Move(CPDF_Rect(fLeft, fy-fItemHeight, fWidth - fRight, fy), true, false);
fy -= fItemHeight;
fy -= m_fItemSpace;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Note.cpp b/fpdfsdk/src/pdfwindow/PWL_Note.cpp
index 7ed1115a82..f3c5816c8d 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Note.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Note.cpp
@@ -60,13 +60,13 @@ void CPWL_Note_Options::RePosChildWnd()
if (rcClient.Width() > 15.0f)
{
rcClient.right -= 15.0f;
- m_pText->Move(rcClient, TRUE, FALSE);
- m_pText->SetVisible(TRUE);
+ m_pText->Move(rcClient, true, false);
+ m_pText->SetVisible(true);
}
else
{
- m_pText->Move(CPDF_Rect(0,0,0,0), TRUE, FALSE);
- m_pText->SetVisible(FALSE);
+ m_pText->Move(CPDF_Rect(0,0,0,0), true, false);
+ m_pText->SetVisible(false);
}
}
}
@@ -122,9 +122,9 @@ CPDF_Rect CPWL_Note_Options::GetContentRect() const
/* ------------------------------- CPWL_Note_Edit ------------------------------ */
-CPWL_Note_Edit::CPWL_Note_Edit() : m_bEnableNotify(TRUE),
+CPWL_Note_Edit::CPWL_Note_Edit() : m_bEnableNotify(true),
m_fOldItemHeight(0.0f),
- m_bSizeChanged(FALSE),
+ m_bSizeChanged(false),
m_fOldMin(0.0f),
m_fOldMax(0.0f)
{
@@ -136,33 +136,33 @@ CPWL_Note_Edit::~CPWL_Note_Edit()
void CPWL_Note_Edit::RePosChildWnd()
{
- m_bEnableNotify = FALSE;
+ m_bEnableNotify = false;
CPWL_Edit::RePosChildWnd();
- m_bEnableNotify = TRUE;
+ m_bEnableNotify = true;
m_fOldItemHeight = GetContentRect().Height();
}
void CPWL_Note_Edit::SetText(const FX_WCHAR* csText)
{
- m_bEnableNotify = FALSE;
+ m_bEnableNotify = false;
CPWL_Edit::SetText(csText);
- m_bEnableNotify = TRUE;
+ m_bEnableNotify = true;
m_fOldItemHeight = GetContentRect().Height();
}
void CPWL_Note_Edit::OnSetFocus()
{
- m_bEnableNotify = FALSE;
+ m_bEnableNotify = false;
CPWL_Edit::OnSetFocus();
- m_bEnableNotify = TRUE;
+ m_bEnableNotify = true;
- EnableSpellCheck(TRUE);
+ EnableSpellCheck(true);
}
void CPWL_Note_Edit::OnKillFocus()
{
- EnableSpellCheck(FALSE);
+ EnableSpellCheck(false);
if (CPWL_Wnd* pParent = GetParentWindow())
{
@@ -193,7 +193,7 @@ void CPWL_Note_Edit::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, int
if (!IsFloatEqual(pInfo->fContentMax, m_fOldMax) ||
!IsFloatEqual(pInfo->fContentMin, m_fOldMin))
{
- m_bSizeChanged = TRUE;
+ m_bSizeChanged = true;
if (CPWL_Wnd * pParent = GetParentWindow())
{
pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
@@ -218,7 +218,7 @@ void CPWL_Note_Edit::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, int
if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
{
PWL_CARET_INFO newInfo = *pInfo;
- newInfo.bVisible = TRUE;
+ newInfo.bVisible = true;
newInfo.ptHead = ChildToParent(pInfo->ptHead);
newInfo.ptFoot = ChildToParent(pInfo->ptFoot);
@@ -239,18 +239,18 @@ FX_FLOAT CPWL_Note_Edit::GetItemHeight(FX_FLOAT fLimitWidth)
if (!m_bSizeChanged)
return m_fOldItemHeight;
- m_bSizeChanged = FALSE;
+ m_bSizeChanged = false;
- EnableNotify(FALSE);
- EnableRefresh(FALSE);
- m_pEdit->EnableNotify(FALSE);
+ EnableNotify(false);
+ EnableRefresh(false);
+ m_pEdit->EnableNotify(false);
- Move(CPDF_Rect(0,0,fLimitWidth,0), TRUE, FALSE);
+ Move(CPDF_Rect(0,0,fLimitWidth,0), true, false);
FX_FLOAT fRet = GetContentRect().Height();
- m_pEdit->EnableNotify(TRUE);
- EnableNotify(TRUE);
- EnableRefresh(TRUE);
+ m_pEdit->EnableNotify(true);
+ EnableNotify(true);
+ EnableRefresh(true);
return fRet;
}
@@ -349,7 +349,7 @@ void CPWL_Note_Icon::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix*
/* --------------------------------- CPWL_Note_CloseBox ---------------------------------- */
-CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(FALSE)
+CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(false)
{
}
@@ -387,19 +387,19 @@ void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matr
0, CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), FXFILL_ALTERNATE);
}
-FX_BOOL CPWL_Note_CloseBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Note_CloseBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
SetBorderStyle(PBS_INSET);
InvalidateRect(NULL);
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
return CPWL_Button::OnLButtonDown(point,nFlag);
}
-FX_BOOL CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
SetBorderStyle(PBS_BEVELED);
InvalidateRect(NULL);
@@ -429,18 +429,18 @@ void CPWL_Note_Contents::CreateChildWnd(const PWL_CREATEPARAM & cp)
ecp.pParentWnd = this;
ecp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_MULTILINE | PES_AUTORETURN | PES_TEXTOVERFLOW | PES_UNDO | PES_SPELLCHECK;
- m_pEdit->EnableNotify(FALSE);
+ m_pEdit->EnableNotify(false);
m_pEdit->Create(ecp);
- m_pEdit->EnableNotify(TRUE);
+ m_pEdit->EnableNotify(true);
}
void CPWL_Note_Contents::SetText(const CFX_WideString& sText)
{
if (m_pEdit)
{
- m_pEdit->EnableNotify(FALSE);
+ m_pEdit->EnableNotify(false);
m_pEdit->SetText(sText.c_str());
- m_pEdit->EnableNotify(TRUE);
+ m_pEdit->EnableNotify(true);
OnNotify(m_pEdit, PNM_NOTEEDITCHANGED, 0, 0);
}
}
@@ -551,9 +551,9 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
int32_t nIndex = GetItemIndex(pWnd);
if (nIndex < 0) nIndex = 0;
- m_pEdit->EnableNotify(FALSE);
+ m_pEdit->EnableNotify(false);
ResetContent(nIndex);
- m_pEdit->EnableNotify(TRUE);
+ m_pEdit->EnableNotify(true);
for (int32_t i=nIndex+1, sz=m_aChildren.GetSize(); i<sz; i++)
{
@@ -576,7 +576,7 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
{
PWL_CARET_INFO newInfo = *pInfo;
- newInfo.bVisible = TRUE;
+ newInfo.bVisible = true;
newInfo.ptHead = ChildToParent(pInfo->ptHead);
newInfo.ptFoot = ChildToParent(pInfo->ptFoot);
@@ -588,9 +588,9 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
return;
case PNM_NOTERESET:
{
- m_pEdit->EnableNotify(FALSE);
+ m_pEdit->EnableNotify(false);
ResetContent(0);
- m_pEdit->EnableNotify(TRUE);
+ m_pEdit->EnableNotify(true);
for (int32_t i=1, sz=m_aChildren.GetSize(); i<sz; i++)
{
@@ -598,9 +598,9 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
pChild->OnNotify(this, PNM_NOTERESET, 0, 0);
}
- m_pEdit->EnableNotify(FALSE);
+ m_pEdit->EnableNotify(false);
ResetContent(0);
- m_pEdit->EnableNotify(TRUE);
+ m_pEdit->EnableNotify(true);
}
return;
}
@@ -608,19 +608,19 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
}
-FX_BOOL CPWL_Note_Contents::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Note_Contents::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
- if (CPWL_Wnd::OnLButtonDown(point,nFlag)) return TRUE;
+ if (CPWL_Wnd::OnLButtonDown(point,nFlag)) return true;
if (!m_pEdit->IsFocused())
{
m_pEdit->SetFocus();
}
- return TRUE;
+ return true;
}
-void CPWL_Note_Contents::SetEditFocus(FX_BOOL bLast)
+void CPWL_Note_Contents::SetEditFocus(bool bLast)
{
if (!m_pEdit->IsFocused())
{
@@ -634,7 +634,7 @@ CPWL_Edit* CPWL_Note_Contents::GetEdit() const
return m_pEdit;
}
-void CPWL_Note_Contents::EnableModify(FX_BOOL bEnabled)
+void CPWL_Note_Contents::EnableModify(bool bEnabled)
{
if (!bEnabled)
m_pEdit->AddFlag(PWS_READONLY);
@@ -654,7 +654,7 @@ void CPWL_Note_Contents::EnableModify(FX_BOOL bEnabled)
}
}
-void CPWL_Note_Contents::EnableRead(FX_BOOL bEnabled)
+void CPWL_Note_Contents::EnableRead(bool bEnabled)
{
if (!bEnabled)
m_pEdit->AddFlag(PES_NOREAD);
@@ -683,8 +683,8 @@ CPWL_NoteItem::CPWL_NoteItem() :
m_pPrivateData(NULL),
m_sAuthor(L""),
m_fOldItemHeight(0.0f),
- m_bSizeChanged(FALSE),
- m_bAllowModify(TRUE)
+ m_bSizeChanged(false),
+ m_bAllowModify(true)
{
}
@@ -748,7 +748,7 @@ void CPWL_NoteItem::RePosChildWnd()
rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetContentRect().Width() + 1.0f, rcClient.right);
rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().Height();
rcSubject.Normalize();
- m_pSubject->Move(rcSubject, TRUE, FALSE);
+ m_pSubject->Move(rcSubject, true, false);
m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubject));
CPDF_Rect rcDate = rcClient;
@@ -756,7 +756,7 @@ void CPWL_NoteItem::RePosChildWnd()
rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect().Width() - 1.0f, rcSubject.right);
rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Height();
rcDate.Normalize();
- m_pDateTime->Move(rcDate, TRUE, FALSE);
+ m_pDateTime->Move(rcDate, true, false);
m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDate));
CPDF_Rect rcContents = rcClient;
@@ -765,7 +765,7 @@ void CPWL_NoteItem::RePosChildWnd()
rcContents.top = rcDate.bottom - POPUP_ITEM_HEAD_BOTTOM;
rcContents.bottom += POPUP_ITEM_BOTTOMWIDTH;
rcContents.Normalize();
- m_pContents->Move(rcContents, TRUE, FALSE);
+ m_pContents->Move(rcContents, true, false);
m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcContents));
}
@@ -1038,7 +1038,7 @@ FX_FLOAT CPWL_NoteItem::GetItemHeight(FX_FLOAT fLimitWidth)
if (!m_bSizeChanged)
return m_fOldItemHeight;
- m_bSizeChanged = FALSE;
+ m_bSizeChanged = false;
ASSERT(m_pSubject != NULL);
ASSERT(m_pDateTime != NULL);
@@ -1066,26 +1066,26 @@ FX_FLOAT CPWL_NoteItem::GetItemRightMargin()
return POPUP_ITEM_SIDEMARGIN;
}
-FX_BOOL CPWL_NoteItem::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
+bool CPWL_NoteItem::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
{
if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point)))
{
- SetNoteFocus(FALSE);
+ SetNoteFocus(false);
}
CPWL_Wnd::OnLButtonDown(point,nFlag);
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_NoteItem::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_NoteItem::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point)))
{
- SetNoteFocus(FALSE);
+ SetNoteFocus(false);
PopupNoteItemMenu(point);
- return TRUE;
+ return true;
}
return CPWL_Wnd::OnRButtonUp(point,nFlag);
@@ -1096,7 +1096,7 @@ void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
switch (msg)
{
case PNM_NOTEEDITCHANGED:
- m_bSizeChanged = TRUE;
+ m_bSizeChanged = true;
if (CPWL_Wnd* pParent = GetParentWindow())
{
@@ -1107,7 +1107,7 @@ void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
{
PWL_CARET_INFO newInfo = *pInfo;
- newInfo.bVisible = TRUE;
+ newInfo.bVisible = true;
newInfo.ptHead = ChildToParent(pInfo->ptHead);
newInfo.ptFoot = ChildToParent(pInfo->ptFoot);
@@ -1118,7 +1118,7 @@ void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
}
return;
case PNM_NOTERESET:
- m_bSizeChanged = TRUE;
+ m_bSizeChanged = true;
m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
return;
@@ -1178,18 +1178,18 @@ void CPWL_NoteItem::OnContentsValidate()
}
}
-void CPWL_NoteItem::SetNoteFocus(FX_BOOL bLast)
+void CPWL_NoteItem::SetNoteFocus(bool bLast)
{
m_pContents->SetEditFocus(bLast);
}
-void CPWL_NoteItem::EnableModify(FX_BOOL bEnabled)
+void CPWL_NoteItem::EnableModify(bool bEnabled)
{
m_pContents->EnableModify(bEnabled);
m_bAllowModify = bEnabled;
}
-void CPWL_NoteItem::EnableRead(FX_BOOL bEnabled)
+void CPWL_NoteItem::EnableRead(bool bEnabled)
{
m_pContents->EnableRead(bEnabled);
}
@@ -1205,9 +1205,9 @@ CPWL_Note::CPWL_Note(IPopup_Note* pPopupNote, IPWL_NoteNotify* pNoteNotify, IPWL
m_pContentsBar(NULL),
m_pOptions(NULL),
m_pNoteNotify(pNoteNotify),
- m_bResizing(FALSE),
+ m_bResizing(false),
m_rcCaption(0,0,0,0),
- m_bEnalbleNotify(TRUE),
+ m_bEnalbleNotify(true),
m_pPopupNote(pPopupNote)
{
}
@@ -1221,7 +1221,7 @@ IPWL_NoteItem* CPWL_Note::Reply()
return CreateNoteItem();
}
-void CPWL_Note::EnableNotify(FX_BOOL bEnabled)
+void CPWL_Note::EnableNotify(bool bEnabled)
{
m_bEnalbleNotify = bEnabled;
}
@@ -1243,19 +1243,19 @@ void CPWL_Note::RePosChildWnd()
}
}
-FX_BOOL CPWL_Note::ResetScrollBar()
+bool CPWL_Note::ResetScrollBar()
{
- FX_BOOL bScrollChanged = FALSE;
+ bool bScrollChanged = false;
if (ScrollBarShouldVisible())
{
if (!m_pContentsBar->IsVisible())
{
- m_pContentsBar->SetVisible(TRUE);
+ m_pContentsBar->SetVisible(true);
if (m_pContentsBar->IsVisible())
{
m_pContentsBar->InvalidateRect(NULL);
- bScrollChanged = TRUE;
+ bScrollChanged = true;
}
}
}
@@ -1263,10 +1263,10 @@ FX_BOOL CPWL_Note::ResetScrollBar()
{
if (m_pContentsBar->IsVisible())
{
- m_pContentsBar->SetVisible(FALSE);
+ m_pContentsBar->SetVisible(false);
m_pContentsBar->InvalidateRect(NULL);
- bScrollChanged = TRUE;
+ bScrollChanged = true;
}
}
@@ -1277,7 +1277,7 @@ FX_BOOL CPWL_Note::ResetScrollBar()
rcContents.right = rcNote.right - 3.0f;
if (m_pContentsBar->IsVisible())
rcContents.right -= PWL_SCROLLBAR_WIDTH;
- m_pContents->Move(rcContents, TRUE, TRUE);
+ m_pContents->Move(rcContents, true, true);
m_pContents->SetScrollPos(CPDF_Point(0.0f,0.0f));
m_pContents->InvalidateRect(NULL);
}
@@ -1285,7 +1285,7 @@ FX_BOOL CPWL_Note::ResetScrollBar()
return bScrollChanged;
}
-FX_BOOL CPWL_Note::ScrollBarShouldVisible()
+bool CPWL_Note::ScrollBarShouldVisible()
{
CPDF_Rect rcContentsFact = m_pContents->GetScrollArea();
CPDF_Rect rcContentsClient = m_pContents->GetClientRect();
@@ -1305,7 +1305,7 @@ void CPWL_Note::RePosNoteChildren()
{
if (m_bResizing) return;
- m_bResizing = TRUE;
+ m_bResizing = true;
if (IsValid())
{
@@ -1327,7 +1327,7 @@ void CPWL_Note::RePosNoteChildren()
rcIcon.right = rcIcon.left + 14.0f;
rcIcon.bottom = rcIcon.top - 14.0f;
rcIcon.Normalize();
- m_pIcon->Move(rcIcon, TRUE, FALSE);
+ m_pIcon->Move(rcIcon, true, false);
m_pIcon->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcIcon));
CPDF_Rect rcCloseBox = rcClient;
@@ -1336,7 +1336,7 @@ void CPWL_Note::RePosNoteChildren()
rcCloseBox.left = rcCloseBox.right - 14.0f;
rcCloseBox.bottom = rcCloseBox.top - 14.0f;
rcCloseBox.Normalize();
- m_pCloseBox->Move(rcCloseBox, TRUE, FALSE);
+ m_pCloseBox->Move(rcCloseBox, true, false);
m_pCloseBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcCloseBox));
CPDF_Rect rcDate = rcClient;
@@ -1345,7 +1345,7 @@ void CPWL_Note::RePosNoteChildren()
rcDate.top = rcClient.top - 2.0f;
rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Height();
rcDate.Normalize();
- m_pDateTime->Move(rcDate, TRUE, FALSE);
+ m_pDateTime->Move(rcDate, true, false);
m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDate));
CPDF_Rect rcSubject = rcClient;
@@ -1354,7 +1354,7 @@ void CPWL_Note::RePosNoteChildren()
rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetContentRect().Width() + 1.0f, rcDate.left - 1.0f);
rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().Height();
rcSubject.Normalize();
- m_pSubject->Move(rcSubject, TRUE, FALSE);
+ m_pSubject->Move(rcSubject, true, false);
m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubject));
CPDF_Rect rcOptions = rcClient;
@@ -1362,7 +1362,7 @@ void CPWL_Note::RePosNoteChildren()
rcOptions.top = rcSubject.bottom - 4.0f;
rcOptions.bottom = rcOptions.top - m_pOptions->GetContentRect().Height();
rcOptions.Normalize();
- m_pOptions->Move(rcOptions, TRUE, FALSE);
+ m_pOptions->Move(rcOptions, true, false);
m_pOptions->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcOptions));
CPDF_Rect rcAuthor = rcClient;
@@ -1371,21 +1371,21 @@ void CPWL_Note::RePosNoteChildren()
rcAuthor.right = PWL_MIN(rcSubject.left + m_pAuthor->GetContentRect().Width() + 1.0f, rcOptions.left - 1.0f);
rcAuthor.bottom = rcAuthor.top - m_pAuthor->GetContentRect().Height();
rcAuthor.Normalize();
- m_pAuthor->Move(rcAuthor, TRUE, FALSE);
+ m_pAuthor->Move(rcAuthor, true, false);
m_pAuthor->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcAuthor));
CPDF_Rect rcLBBox = rcClient;
rcLBBox.top = rcLBBox.bottom + 7.0f;
rcLBBox.right = rcLBBox.left + 7.0f;
rcLBBox.Normalize();
- m_pLBBox->Move(rcLBBox, TRUE, FALSE);
+ m_pLBBox->Move(rcLBBox, true, false);
m_pLBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcLBBox));
CPDF_Rect rcRBBox = rcClient;
rcRBBox.top = rcRBBox.bottom + 7.0f;
rcRBBox.left = rcRBBox.right - 7.0f;
rcRBBox.Normalize();
- m_pRBBox->Move(rcRBBox, TRUE, FALSE);
+ m_pRBBox->Move(rcRBBox, true, false);
m_pRBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcRBBox));
CPDF_Rect rcContents = rcClient;
@@ -1396,20 +1396,20 @@ void CPWL_Note::RePosNoteChildren()
rcContents.right -= PWL_SCROLLBAR_WIDTH;
rcContents.bottom += 14.0f;
rcContents.Normalize();
- m_pContents->Move(rcContents, FALSE, FALSE);
+ m_pContents->Move(rcContents, false, false);
m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcContents));
CPDF_Rect rcContentsBar = rcContents;
rcContentsBar.right = rcClient.right - 3.0f;
rcContentsBar.left = rcContentsBar.right - PWL_SCROLLBAR_WIDTH;
rcContentsBar.Normalize();
- m_pContentsBar->Move(rcContentsBar, TRUE, FALSE);
+ m_pContentsBar->Move(rcContentsBar, true, false);
m_rcCaption = rcClient;
m_rcCaption.bottom = rcContents.top;
}
- m_bResizing = FALSE;
+ m_bResizing = false;
}
//0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close / 5-options
@@ -1507,7 +1507,7 @@ void CPWL_Note::CreateChildWnd(const PWL_CREATEPARAM & cp)
scp.sBackgroundColor = CPWL_Color(COLORTYPE_RGB, 240/255.0f, 240/255.0f, 240/255.0f);
scp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_BACKGROUND;
m_pContentsBar->Create(scp);
- m_pContentsBar->SetNotifyForever(TRUE);
+ m_pContentsBar->SetNotifyForever(true);
}
void CPWL_Note::SetSubjectName(const CFX_WideString& sName)
@@ -1538,7 +1538,7 @@ CFX_WideString CPWL_Note::GetAuthorName() const
return L"";
}
-FX_BOOL CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
CPDF_Point ptScroll = m_pContents->GetScrollPos();
CPDF_Rect rcScroll = m_pContents->GetScrollArea();
@@ -1566,11 +1566,11 @@ FX_BOOL CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD
m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (intptr_t)&ptNew.y);
m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptNew.y);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -1591,7 +1591,7 @@ void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t
if (FXSYS_memcmp(&m_OldScrollInfo, &sInfo, sizeof(PWL_SCROLL_INFO)) != 0)
{
- FX_BOOL bScrollChanged = FALSE;
+ bool bScrollChanged = false;
if (lParam < 3) //·ÀÖ¹ËÀÑ­»· mantis:15759
{
@@ -1704,7 +1704,7 @@ void CPWL_Note::SetBkColor(const CPWL_Color& color)
m_pRBBox->SetTextColor(sTextColor);
}
-FX_BOOL CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
+bool CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
{
if (m_pOptions->WndHitTest(m_pOptions->ParentToChild(point)))
{
@@ -1717,14 +1717,14 @@ FX_BOOL CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
KillFocus();
pNotify->OnPopupMenu(x, y);
- return TRUE;
+ return true;
}
}
return CPWL_Wnd::OnLButtonDown(point,nFlag);
}
-FX_BOOL CPWL_Note::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Note::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
return CPWL_Wnd::OnRButtonUp(point,nFlag);
}
@@ -1748,12 +1748,12 @@ void CPWL_Note::SetIconType(int32_t nType)
m_pIcon->SetIconType(nType);
}
-void CPWL_Note::EnableModify(FX_BOOL bEnabled)
+void CPWL_Note::EnableModify(bool bEnabled)
{
m_pContents->EnableModify(bEnabled);
}
-void CPWL_Note::EnableRead(FX_BOOL bEnabled)
+void CPWL_Note::EnableRead(bool bEnabled)
{
m_pContents->EnableRead(bEnabled);
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
index 6d61705222..4287bc2753 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
@@ -47,7 +47,7 @@ void PWL_FLOATRANGE::Set(FX_FLOAT min,FX_FLOAT max)
}
}
-FX_BOOL PWL_FLOATRANGE::In(FX_FLOAT x) const
+bool PWL_FLOATRANGE::In(FX_FLOAT x) const
{
return (IsFloatBigger(x,fMin) || IsFloatEqual(x, fMin)) &&
(IsFloatSmaller(x, fMax) || IsFloatEqual(x, fMax));
@@ -99,14 +99,14 @@ void PWL_SCROLL_PRIVATEDATA::SetBigStep(FX_FLOAT step)
fBigStep = step;
}
-FX_BOOL PWL_SCROLL_PRIVATEDATA::SetPos(FX_FLOAT pos)
+bool PWL_SCROLL_PRIVATEDATA::SetPos(FX_FLOAT pos)
{
if (ScrollRange.In(pos))
{
fScrollPos = pos;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void PWL_SCROLL_PRIVATEDATA::AddSmall()
@@ -140,7 +140,7 @@ CPWL_SBButton::CPWL_SBButton(PWL_SCROLLBAR_TYPE eScrollBarType,PWL_SBBUTTON_TYPE
m_eScrollBarType = eScrollBarType;
m_eSBButtonType = eButtonType;
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
}
CPWL_SBButton::~CPWL_SBButton()
@@ -359,7 +359,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p
rcDraw = CPWL_Utils::DeflateRect(rectWnd,1.0f);
if (IsEnabled())
- CPWL_Utils::DrawShadow(pDevice, pUser2Device, TRUE, FALSE, rcDraw, nTransparancy, 80, 220);
+ CPWL_Utils::DrawShadow(pDevice, pUser2Device, true, false, rcDraw, nTransparancy, 80, 220);
else
CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcDraw, ArgbEncode(255,255,255,255));
@@ -402,7 +402,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p
//draw background
rcDraw = CPWL_Utils::DeflateRect(rectWnd,1.0f);
if (IsEnabled())
- CPWL_Utils::DrawShadow(pDevice, pUser2Device, TRUE, FALSE, rcDraw, nTransparancy, 80, 220);
+ CPWL_Utils::DrawShadow(pDevice, pUser2Device, true, false, rcDraw, nTransparancy, 80, 220);
else
CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcDraw, ArgbEncode(255,255,255,255));
@@ -565,33 +565,33 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p
}
}
-FX_BOOL CPWL_SBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_SBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
if (CPWL_Wnd * pParent = GetParentWindow())
pParent->OnNotify(this,PNM_LBUTTONDOWN,0,(intptr_t)&point);
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
SetCapture();
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_SBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_SBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
if (CPWL_Wnd * pParent = GetParentWindow())
pParent->OnNotify(this,PNM_LBUTTONUP,0,(intptr_t)&point);
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
ReleaseCapture();
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_SBButton::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_SBButton::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnMouseMove(point,nFlag);
@@ -603,12 +603,12 @@ FX_BOOL CPWL_SBButton::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
if (m_bMouseDown && (m_eSBButtonType == PSBT_MIN || m_eSBButtonType == PSBT_MAX))
{
if (!pParent->OnNotify(this,PNM_LBUTTONDOWN,nFlags,(intptr_t)&point))
- return FALSE;
+ return false;
}
*/
}
- return TRUE;
+ return true;
}
/* ------------------------------- CPWL_ScrollBar ---------------------------------- */
@@ -618,9 +618,9 @@ CPWL_ScrollBar::CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType):
m_pMinButton(NULL),
m_pMaxButton(NULL),
m_pPosButton(NULL),
- m_bMouseDown(FALSE),
- m_bMinOrMax(FALSE),
- m_bNotifyForever(TRUE)
+ m_bMouseDown(false),
+ m_bMinOrMax(false),
+ m_bNotifyForever(true)
{
}
@@ -665,7 +665,7 @@ void CPWL_ScrollBar::RePosChildWnd()
rcMaxButton = CPDF_Rect(rcClient.right - fBWidth,rcClient.bottom,
rcClient.right,rcClient.top);
}
- else SetVisible(FALSE);
+ else SetVisible(false);
}
break;
case SBT_VSCROLL:
@@ -687,16 +687,16 @@ void CPWL_ScrollBar::RePosChildWnd()
rcMaxButton = CPDF_Rect(rcClient.left,rcClient.bottom,
rcClient.right,rcClient.bottom + fBWidth);
}
- else SetVisible(FALSE);
+ else SetVisible(false);
}
break;
}
if (m_pMinButton)
- m_pMinButton->Move(rcMinButton, TRUE, FALSE);
+ m_pMinButton->Move(rcMinButton, true, false);
if (m_pMaxButton)
- m_pMaxButton->Move(rcMaxButton, TRUE, FALSE);
- MovePosButton(FALSE);
+ m_pMaxButton->Move(rcMaxButton, true, false);
+ MovePosButton(false);
}
void CPWL_ScrollBar::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
@@ -708,7 +708,7 @@ void CPWL_ScrollBar::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
CFX_ByteTextBuf sButton;
sButton << "q\n";
- sButton << "0 w\n" << CPWL_Utils::GetColorAppStream(GetBackgroundColor(),TRUE);
+ sButton << "0 w\n" << CPWL_Utils::GetColorAppStream(GetBackgroundColor(),true);
sButton << rectWnd.left << " " << rectWnd.bottom << " "
<< rectWnd.right - rectWnd.left << " " << rectWnd.top - rectWnd.bottom << " re b Q\n";
@@ -734,7 +734,7 @@ void CPWL_ScrollBar::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix*
}
}
-FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ScrollBar::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
@@ -777,22 +777,22 @@ FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
if (rcMinArea.Contains(point.x,point.y))
{
m_sData.SubBig();
- MovePosButton(TRUE);
+ MovePosButton(true);
NotifyScrollWindow();
}
if (rcMaxArea.Contains(point.x,point.y))
{
m_sData.AddBig();
- MovePosButton(TRUE);
+ MovePosButton(true);
NotifyScrollWindow();
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ScrollBar::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
@@ -806,9 +806,9 @@ FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
}
EndTimer();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
- return TRUE;
+ return true;
}
void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -922,7 +922,7 @@ void CPWL_ScrollBar::CreateButtons(const PWL_CREATEPARAM & cp)
if (!m_pPosButton)
{
m_pPosButton = new CPWL_SBButton(m_sbType,PSBT_POS);
- m_pPosButton->SetVisible(FALSE);
+ m_pPosButton->SetVisible(false);
m_pPosButton->Create(scp);
}
}
@@ -943,12 +943,12 @@ void CPWL_ScrollBar::SetScrollRange(FX_FLOAT fMin,FX_FLOAT fMax,FX_FLOAT fClient
if (IsFloatSmaller(m_sData.ScrollRange.GetWidth(), 0.0f))
{
- m_pPosButton->SetVisible(FALSE);
+ m_pPosButton->SetVisible(false);
}
else
{
- m_pPosButton->SetVisible(TRUE);
- MovePosButton(TRUE);
+ m_pPosButton->SetVisible(true);
+ MovePosButton(true);
}
}
}
@@ -960,7 +960,7 @@ void CPWL_ScrollBar::SetScrollPos(FX_FLOAT fPos)
m_sData.SetPos(fPos);
if (!IsFloatEqual(m_sData.fScrollPos, fOldPos))
- MovePosButton(TRUE);
+ MovePosButton(true);
}
void CPWL_ScrollBar::SetScrollStep(FX_FLOAT fBigStep,FX_FLOAT fSmallStep)
@@ -969,7 +969,7 @@ void CPWL_ScrollBar::SetScrollStep(FX_FLOAT fBigStep,FX_FLOAT fSmallStep)
m_sData.SetSmallStep(fSmallStep);
}
-void CPWL_ScrollBar::MovePosButton(FX_BOOL bRefresh)
+void CPWL_ScrollBar::MovePosButton(bool bRefresh)
{
ASSERT (m_pPosButton != NULL);
ASSERT (m_pMinButton != NULL);
@@ -1031,17 +1031,17 @@ void CPWL_ScrollBar::MovePosButton(FX_BOOL bRefresh)
break;
}
- m_pPosButton->Move(rcPosButton,TRUE,bRefresh);
+ m_pPosButton->Move(rcPosButton,true,bRefresh);
}
}
void CPWL_ScrollBar::OnMinButtonLBDown(const CPDF_Point & point)
{
m_sData.SubSmall();
- MovePosButton(TRUE);
+ MovePosButton(true);
NotifyScrollWindow();
- m_bMinOrMax = TRUE;
+ m_bMinOrMax = true;
EndTimer();
BeginTimer(100);
@@ -1058,10 +1058,10 @@ void CPWL_ScrollBar::OnMinButtonMouseMove(const CPDF_Point & point)
void CPWL_ScrollBar::OnMaxButtonLBDown(const CPDF_Point & point)
{
m_sData.AddSmall();
- MovePosButton(TRUE);
+ MovePosButton(true);
NotifyScrollWindow();
- m_bMinOrMax = FALSE;
+ m_bMinOrMax = false;
EndTimer();
BeginTimer(100);
@@ -1077,7 +1077,7 @@ void CPWL_ScrollBar::OnMaxButtonMouseMove(const CPDF_Point & point)
void CPWL_ScrollBar::OnPosButtonLBDown(const CPDF_Point & point)
{
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
if (m_pPosButton)
{
@@ -1104,7 +1104,7 @@ void CPWL_ScrollBar::OnPosButtonLBUp(const CPDF_Point & point)
if (!m_bNotifyForever)
NotifyScrollWindow();
}
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
}
void CPWL_ScrollBar::OnPosButtonMouseMove(const CPDF_Point & point)
@@ -1163,7 +1163,7 @@ void CPWL_ScrollBar::OnPosButtonMouseMove(const CPDF_Point & point)
if (!IsFloatEqual(fOldScrollPos, m_sData.fScrollPos))
{
- MovePosButton(TRUE);
+ MovePosButton(true);
if (m_bNotifyForever)
NotifyScrollWindow();
@@ -1297,7 +1297,7 @@ void CPWL_ScrollBar::TimerProc()
if (FXSYS_memcmp(&m_sData, &sTemp, sizeof(PWL_SCROLL_PRIVATEDATA)) != 0)
{
- MovePosButton(TRUE);
+ MovePosButton(true);
NotifyScrollWindow();
}
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
index 76b2bd333a..23be71a29d 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
@@ -70,9 +70,9 @@ CPWL_Signature::CPWL_Signature() :
m_pText(NULL),
m_pDescription(NULL),
m_pImage(NULL),
- m_bTextExist(TRUE),
- m_bImageExist(FALSE),
- m_bFlagExist(TRUE)
+ m_bTextExist(true),
+ m_bImageExist(false),
+ m_bFlagExist(true)
{
}
@@ -80,21 +80,21 @@ CPWL_Signature::~CPWL_Signature()
{
}
-void CPWL_Signature::SetTextFlag(FX_BOOL bTextExist)
+void CPWL_Signature::SetTextFlag(bool bTextExist)
{
m_bTextExist = bTextExist;
RePosChildWnd();
}
-void CPWL_Signature::SetImageFlag(FX_BOOL bImageExist)
+void CPWL_Signature::SetImageFlag(bool bImageExist)
{
m_bImageExist = bImageExist;
RePosChildWnd();
}
-void CPWL_Signature::SetFoxitFlag(FX_BOOL bFlagExist)
+void CPWL_Signature::SetFoxitFlag(bool bFlagExist)
{
m_bFlagExist = bFlagExist;
}
@@ -135,7 +135,7 @@ void CPWL_Signature::RePosChildWnd()
CPDF_Rect rcText = rcClient;
CPDF_Rect rcDescription = rcClient;
- FX_BOOL bTextVisible = m_bTextExist && m_pText->GetText().GetLength() > 0;
+ bool bTextVisible = m_bTextExist && m_pText->GetText().GetLength() > 0;
if ((bTextVisible || m_bImageExist) &&
m_pDescription->GetText().GetLength() > 0)
@@ -155,9 +155,9 @@ void CPWL_Signature::RePosChildWnd()
m_pText->SetVisible(bTextVisible);
m_pImage->SetVisible(m_bImageExist);
- m_pText->Move(rcText, TRUE, FALSE);
- m_pImage->Move(rcText, TRUE, FALSE);
- m_pDescription->Move(rcDescription, TRUE, FALSE);
+ m_pText->Move(rcText, true, false);
+ m_pImage->Move(rcText, true, false);
+ m_pDescription->Move(rcDescription, true, false);
}
void CPWL_Signature::CreateChildWnd(const PWL_CREATEPARAM & cp)
diff --git a/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp b/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
index 90fa8f880d..7bb38c4bfe 100644
--- a/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
@@ -32,7 +32,7 @@ CPDF_Rect CPWL_PushButton::GetFocusRect() const
/* --------------------------- CPWL_CheckBox ---------------------------- */
-CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(FALSE)
+CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(false)
{
}
@@ -45,33 +45,33 @@ CFX_ByteString CPWL_CheckBox::GetClassName() const
return "CPWL_CheckBox";
}
-void CPWL_CheckBox::SetCheck(FX_BOOL bCheck)
+void CPWL_CheckBox::SetCheck(bool bCheck)
{
m_bChecked = bCheck;
}
-FX_BOOL CPWL_CheckBox::IsChecked() const
+bool CPWL_CheckBox::IsChecked() const
{
return m_bChecked;
}
-FX_BOOL CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- if (IsReadOnly()) return FALSE;
+ if (IsReadOnly()) return false;
SetCheck(!IsChecked());
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_CheckBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_CheckBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
SetCheck(!IsChecked());
- return TRUE;
+ return true;
}
/* --------------------------- CPWL_RadioButton ---------------------------- */
-CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(FALSE)
+CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(false)
{
}
@@ -84,27 +84,27 @@ CFX_ByteString CPWL_RadioButton::GetClassName() const
return "CPWL_RadioButton";
}
-FX_BOOL CPWL_RadioButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_RadioButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- if (IsReadOnly()) return FALSE;
+ if (IsReadOnly()) return false;
- SetCheck(TRUE);
- return TRUE;
+ SetCheck(true);
+ return true;
}
-void CPWL_RadioButton::SetCheck(FX_BOOL bCheck)
+void CPWL_RadioButton::SetCheck(bool bCheck)
{
m_bChecked = bCheck;
}
-FX_BOOL CPWL_RadioButton::IsChecked() const
+bool CPWL_RadioButton::IsChecked() const
{
return m_bChecked;
}
-FX_BOOL CPWL_RadioButton::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_RadioButton::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
- SetCheck(TRUE);
- return TRUE;
+ SetCheck(true);
+ return true;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
index b9ba7661af..4e4ac94238 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
@@ -87,13 +87,13 @@ CPDF_Rect CPWL_Utils::OffsetRect(const CPDF_Rect & rect,FX_FLOAT x,FX_FLOAT y)
rect.right + x,rect.top + y);
}
-FX_BOOL CPWL_Utils::ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcChild)
+bool CPWL_Utils::ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcChild)
{
return rcChild.left >= rcParent.left && rcChild.bottom >= rcParent.bottom &&
rcChild.right <= rcParent.right && rcChild.top <= rcParent.top;
}
-FX_BOOL CPWL_Utils::IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2)
+bool CPWL_Utils::IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2)
{
FX_FLOAT left = rect1.left > rect2.left ? rect1.left : rect2.left;
FX_FLOAT right = rect1.right < rect2.right ? rect1.right : rect2.right;
@@ -420,7 +420,7 @@ CFX_ByteString CPWL_Utils::GetRectFillAppStream(const CPDF_Rect & rect,const CPW
{
CFX_ByteTextBuf sAppStream;
- CFX_ByteString sColor = GetColorAppStream(color,TRUE);
+ CFX_ByteString sColor = GetColorAppStream(color,true);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << sColor;
@@ -435,7 +435,7 @@ CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CPDF_Rect & rect,const C
{
CFX_ByteTextBuf sAppStream;
- CFX_ByteString sColor = GetColorAppStream(color,TRUE);
+ CFX_ByteString sColor = GetColorAppStream(color,true);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << sColor << CPWL_Utils::GetAP_Circle(rect) << "f\nQ\n";
@@ -458,7 +458,7 @@ CPDF_Rect CPWL_Utils::GetCenterSquare(const CPDF_Rect & rect)
}
CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange,
- FX_BOOL bContinuous, FX_WORD SubWord)
+ bool bContinuous, FX_WORD SubWord)
{
return IFX_Edit::GetEditAppearanceStream(pEdit,ptOffset,pRange,bContinuous,SubWord);
}
@@ -498,7 +498,7 @@ static CFX_ByteString GetWordSpellCheckAppearanceStream(IFX_Edit_Iterator* pIter
FX_FLOAT fY = 0.0f;
FX_FLOAT fStep = 0.0f;
- FX_BOOL bBreak = FALSE;
+ bool bBreak = false;
if (pIterator)
{
@@ -538,7 +538,7 @@ static CFX_ByteString GetWordSpellCheckAppearanceStream(IFX_Edit_Iterator* pIter
fEndX = word.ptWord.x + word.fWidth;
}
- bBreak = TRUE;
+ bBreak = true;
}
else
{
@@ -569,7 +569,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
{
pIterator->SetAt(pRange->BeginPos);
- FX_BOOL bLatinWord = FALSE;
+ bool bLatinWord = false;
CPVT_WordPlace wpWordStart;
CFX_ByteString sWord;
@@ -587,7 +587,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
if (!bLatinWord)
{
wpWordStart = place;
- bLatinWord = TRUE;
+ bLatinWord = true;
}
sWord += (char)word.Word;
@@ -602,7 +602,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
pIterator->SetAt(place);
}
- bLatinWord = FALSE;
+ bLatinWord = false;
}
sWord.Empty();
@@ -614,7 +614,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
{
if (!pSpellCheck->CheckWord(sWord))
sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
- bLatinWord = FALSE;
+ bLatinWord = false;
sWord.Empty();
}
}
@@ -625,7 +625,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
if (!pSpellCheck->CheckWord(sWord))
sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
- bLatinWord = FALSE;
+ bLatinWord = false;
sWord.Empty();
}
}
@@ -636,7 +636,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_FontMap * pFontMap,
const CFX_WideString & sText, int32_t nAlignmentH, int32_t nAlignmentV,
- FX_FLOAT fFontSize, FX_BOOL bMultiLine, FX_BOOL bAutoReturn, const CPWL_Color & crText)
+ FX_FLOAT fFontSize, bool bMultiLine, bool bAutoReturn, const CPWL_Color & crText)
{
CFX_ByteTextBuf sRet;
@@ -649,7 +649,7 @@ CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_Fo
pEdit->SetMultiLine(bMultiLine);
pEdit->SetAutoReturn(bAutoReturn);
if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(TRUE);
+ pEdit->SetAutoFontSize(true);
else
pEdit->SetFontSize(fFontSize);
@@ -683,10 +683,10 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
pEdit->SetFontMap(pFontMap);
pEdit->SetAlignmentH(1);
pEdit->SetAlignmentV(1);
- pEdit->SetMultiLine(FALSE);
- pEdit->SetAutoReturn(FALSE);
+ pEdit->SetMultiLine(false);
+ pEdit->SetAutoReturn(false);
if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(TRUE);
+ pEdit->SetAutoFontSize(true);
else
pEdit->SetFontSize(fFontSize);
@@ -892,7 +892,7 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
if (!rcIcon.IsEmpty())
{
- Icon.Move(rcIcon, FALSE, FALSE);
+ Icon.Move(rcIcon, false, false);
sTemp << Icon.GetImageAppStream();
}
@@ -923,7 +923,7 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
return "";
}
-CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color & color,const FX_BOOL & bFillOrStroke)
+CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color & color,const bool & bFillOrStroke)
{
CFX_ByteTextBuf sColorStream;
@@ -967,7 +967,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
{
default:
case PBS_SOLID:
- sColor = CPWL_Utils::GetColorAppStream(color,TRUE);
+ sColor = CPWL_Utils::GetColorAppStream(color,true);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -978,7 +978,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
}
break;
case PBS_DASH:
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(color,false);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -992,7 +992,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
break;
case PBS_BEVELED:
case PBS_INSET:
- sColor = CPWL_Utils::GetColorAppStream(crLeftTop,TRUE);
+ sColor = CPWL_Utils::GetColorAppStream(crLeftTop,true);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -1004,7 +1004,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l f\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crRightBottom,TRUE);
+ sColor = CPWL_Utils::GetColorAppStream(crRightBottom,true);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -1016,7 +1016,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l f\n";
}
- sColor = CPWL_Utils::GetColorAppStream(color,TRUE);
+ sColor = CPWL_Utils::GetColorAppStream(color,true);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -1026,7 +1026,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
}
break;
case PBS_UNDERLINED:
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(color,false);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -1065,7 +1065,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
case PBS_SOLID:
case PBS_UNDERLINED:
{
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(color,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fWidth << " w\n" << sColor
@@ -1076,7 +1076,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
break;
case PBS_DASH:
{
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(color,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fWidth << " w\n"
@@ -1090,7 +1090,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
{
FX_FLOAT fHalfWidth = fWidth / 2.0f;
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(color,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1098,7 +1098,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
<< " S\nQ\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crLeftTop,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(crLeftTop,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1106,7 +1106,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
<< " S\nQ\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crRightBottom,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(crRightBottom,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1119,7 +1119,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
{
FX_FLOAT fHalfWidth = fWidth / 2.0f;
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(color,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1127,7 +1127,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
<< " S\nQ\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crLeftTop,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(crLeftTop,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1135,7 +1135,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
<< " S\nQ\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crRightBottom,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(crRightBottom,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1208,42 +1208,42 @@ CPWL_Color CPWL_Utils::DevideColor(const CPWL_Color & sColor,FX_FLOAT fColorDevi
CFX_ByteString CPWL_Utils::GetAppStream_Check(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Check(rcBBox) << "f\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Check(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Circle(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Circle(rcBBox) << "f\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Circle(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Cross(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,FALSE) << CPWL_Utils::GetAP_Cross(rcBBox) << "S\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,false) << CPWL_Utils::GetAP_Cross(rcBBox) << "S\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Diamond(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n1 w\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Diamond(rcBBox) << "f\nQ\n";
+ sAP << "q\n1 w\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Diamond(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Square(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Square(rcBBox) << "f\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Square(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Star(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Star(rcBBox) << "f\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Star(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
@@ -1299,7 +1299,7 @@ CFX_ByteString CPWL_Utils::GetDropButtonAppStream(const CPDF_Rect & rcBBox)
if (!rcBBox.IsEmpty())
{
- sAppStream << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,220.0f/255.0f,220.0f/255.0f,220.0f/255.0f),TRUE);
+ sAppStream << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,220.0f/255.0f,220.0f/255.0f,220.0f/255.0f),true);
sAppStream << rcBBox.left << " " << rcBBox.bottom << " "
<< rcBBox.right - rcBBox.left << " " << rcBBox.top - rcBBox.bottom << " re f\n";
sAppStream << "Q\n";
@@ -1474,7 +1474,7 @@ void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devi
}
void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- FX_BOOL bVertical, FX_BOOL bHorizontal, CPDF_Rect rect,
+ bool bVertical, bool bHorizontal, CPDF_Rect rect,
int32_t nTransparancy, int32_t nStartGray, int32_t nEndGray)
{
FX_FLOAT fStepGray = 1.0f;
@@ -1638,7 +1638,7 @@ static void AddSpellCheckObj(CFX_PathData & PathData, IFX_Edit* pEdit, const CPV
FX_FLOAT fY = 0.0f;
FX_FLOAT fStep = 0.0f;
- FX_BOOL bBreak = FALSE;
+ bool bBreak = false;
if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
{
@@ -1678,7 +1678,7 @@ static void AddSpellCheckObj(CFX_PathData & PathData, IFX_Edit* pEdit, const CPV
fEndX = word.ptWord.x + word.fWidth;
}
- bBreak = TRUE;
+ bBreak = true;
}
else
{
@@ -1700,7 +1700,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
const FX_COLORREF crSpell = ArgbEncode(255,255,0,0);
//for spellcheck
- FX_BOOL bLatinWord = FALSE;
+ bool bLatinWord = false;
CPVT_WordPlace wpWordStart;
CFX_ByteString sLatinWord;
@@ -1744,7 +1744,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
if (!bLatinWord)
{
wpWordStart = place;
- bLatinWord = TRUE;
+ bLatinWord = true;
}
sLatinWord += (char)word.Word;
@@ -1761,7 +1761,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
pIterator->SetAt(place);
}
}
- bLatinWord = FALSE;
+ bLatinWord = false;
}
sLatinWord.Empty();
@@ -1781,7 +1781,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
pIterator->SetAt(place);
}
}
- bLatinWord = FALSE;
+ bLatinWord = false;
}
sLatinWord.Empty();
@@ -1806,12 +1806,12 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
pDevice->RestoreState();
}
-FX_BOOL CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color)
+bool CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color)
{
switch (color.nColorType)
{
case COLORTYPE_TRANSPARENT:
- return FALSE;
+ return false;
case COLORTYPE_GRAY:
return color.fColor1 < 0.5f;
case COLORTYPE_RGB:
@@ -1820,7 +1820,7 @@ FX_BOOL CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color)
return color.fColor1 + color.fColor2 + color.fColor3 + color.fColor4 > 2.0f;
}
- return TRUE;
+ return true;
}
CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color)
@@ -1851,8 +1851,8 @@ CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color)
CFX_ByteString CPWL_Utils::GetIconAppStream(int32_t nType, const CPDF_Rect& rect, const CPWL_Color& crFill,
const CPWL_Color& crStroke)
{
- CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, FALSE);
- sAppStream += CPWL_Utils::GetColorAppStream(crFill, TRUE);
+ CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, false);
+ sAppStream += CPWL_Utils::GetColorAppStream(crFill, true);
CFX_ByteString sPath;
CFX_PathData path;
diff --git a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
index 433b3c6846..f214fb30a2 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
@@ -123,40 +123,40 @@ public:
m_pMainKeyboardWnd = NULL;
}
- FX_BOOL IsWndCreated(const CPWL_Wnd * pWnd) const
+ bool IsWndCreated(const CPWL_Wnd * pWnd) const
{
return m_pCreatedWnd == pWnd;
}
- FX_BOOL IsMainCaptureMouse(const CPWL_Wnd * pWnd) const
+ bool IsMainCaptureMouse(const CPWL_Wnd * pWnd) const
{
return pWnd == m_pMainMouseWnd;
}
- FX_BOOL IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
+ bool IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
{
if (pWnd)
for( int32_t i=0,sz=m_aMousePath.GetSize(); i<sz; i++)
if (m_aMousePath.GetAt(i) == pWnd)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
- FX_BOOL IsMainCaptureKeyboard(const CPWL_Wnd * pWnd) const
+ bool IsMainCaptureKeyboard(const CPWL_Wnd * pWnd) const
{
return pWnd == m_pMainKeyboardWnd;
}
- FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
+ bool IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
{
if (pWnd)
for( int32_t i=0,sz=m_aKeyboardPath.GetSize(); i<sz; i++)
if (m_aKeyboardPath.GetAt(i) == pWnd)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
void SetFocus(CPWL_Wnd * pWnd)
@@ -225,16 +225,16 @@ CPWL_Wnd::CPWL_Wnd() :
m_pVScrollBar(NULL),
m_rcWindow(),
m_rcClip(),
- m_bCreated(FALSE),
- m_bVisible(FALSE),
- m_bNotifying(FALSE),
- m_bEnabled(TRUE)
+ m_bCreated(false),
+ m_bVisible(false),
+ m_bNotifying(false),
+ m_bEnabled(true)
{
}
CPWL_Wnd::~CPWL_Wnd()
{
- ASSERT(m_bCreated == FALSE);
+ ASSERT(m_bCreated == false);
}
CFX_ByteString CPWL_Wnd::GetClassName() const
@@ -272,7 +272,7 @@ void CPWL_Wnd::Create(const PWL_CREATEPARAM & cp)
OnCreated();
RePosChildWnd();
- m_bCreated = TRUE;
+ m_bCreated = true;
}
}
@@ -308,7 +308,7 @@ void CPWL_Wnd::Destroy()
if (m_sPrivateParam.pParentWnd)
m_sPrivateParam.pParentWnd->OnNotify(this, PNM_REMOVECHILD);
- m_bCreated = FALSE;
+ m_bCreated = false;
}
DestroyMsgControl();
@@ -318,7 +318,7 @@ void CPWL_Wnd::Destroy()
m_pVScrollBar = NULL;
}
-void CPWL_Wnd::Move(const CPDF_Rect & rcNew, FX_BOOL bReset,FX_BOOL bRefresh)
+void CPWL_Wnd::Move(const CPDF_Rect & rcNew, bool bReset,bool bRefresh)
{
if (IsValid())
{
@@ -494,7 +494,7 @@ void CPWL_Wnd::InvalidateRect(CPDF_Rect* pRect)
}
#define PWL_IMPLEMENT_KEY_METHOD(key_method_name)\
-FX_BOOL CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag)\
+bool CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag)\
{\
if (IsValid() && IsVisible() && IsEnabled())\
{\
@@ -512,11 +512,11 @@ FX_BOOL CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag)\
}\
}\
}\
- return FALSE;\
+ return false;\
}
#define PWL_IMPLEMENT_MOUSE_METHOD(mouse_method_name)\
-FX_BOOL CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\
+bool CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\
{\
if (IsValid() && IsVisible() && IsEnabled())\
{\
@@ -550,7 +550,7 @@ FX_BOOL CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\
SetCursor();\
}\
}\
- return FALSE;\
+ return false;\
}
PWL_IMPLEMENT_KEY_METHOD(OnKeyDown)
@@ -567,7 +567,7 @@ PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonDown)
PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonUp)
PWL_IMPLEMENT_MOUSE_METHOD(OnMouseMove)
-FX_BOOL CPWL_Wnd::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Wnd::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
if (IsValid() && IsVisible() && IsEnabled())
{
@@ -586,7 +586,7 @@ FX_BOOL CPWL_Wnd::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD
}
}
}
- return FALSE;
+ return false;
}
void CPWL_Wnd::AddChild(CPWL_Wnd * pWnd)
@@ -624,7 +624,7 @@ void CPWL_Wnd::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t
}
}
-FX_BOOL CPWL_Wnd::IsValid() const
+bool CPWL_Wnd::IsValid() const
{
return m_bCreated;
}
@@ -677,7 +677,7 @@ CPDF_Rect CPWL_Wnd::GetWindowCenterSquare() const
return CPWL_Utils::GetCenterSquare(CPWL_Utils::DeflateRect(GetWindowRect(),0.1f));
}
-FX_BOOL CPWL_Wnd::HasFlag(FX_DWORD dwFlags) const
+bool CPWL_Wnd::HasFlag(FX_DWORD dwFlags) const
{
return (m_sPrivateParam.dwFlags & dwFlags) != 0;
}
@@ -865,12 +865,12 @@ void CPWL_Wnd::OnKillFocus()
{
}
-FX_BOOL CPWL_Wnd::WndHitTest(const CPDF_Point & point) const
+bool CPWL_Wnd::WndHitTest(const CPDF_Point & point) const
{
return IsValid() && IsVisible() && GetWindowRect().Contains(point.x,point.y);
}
-FX_BOOL CPWL_Wnd::ClientHitTest(const CPDF_Point & point) const
+bool CPWL_Wnd::ClientHitTest(const CPDF_Point & point) const
{
return IsValid() && IsVisible() && GetClientRect().Contains(point.x,point.y);
}
@@ -883,7 +883,7 @@ const CPWL_Wnd* CPWL_Wnd::GetRootWnd() const
return this;
}
-void CPWL_Wnd::SetVisible(FX_BOOL bVisible)
+void CPWL_Wnd::SetVisible(bool bVisible)
{
if (IsValid())
{
@@ -915,7 +915,7 @@ CPDF_Rect CPWL_Wnd::GetClipRect() const
return m_rcClip;
}
-FX_BOOL CPWL_Wnd::IsReadOnly() const
+bool CPWL_Wnd::IsReadOnly() const
{
return HasFlag(PWS_READONLY);
}
@@ -931,7 +931,7 @@ void CPWL_Wnd::RePosChildWnd()
rcContent.right-1.0f,
rcContent.top);
- if (pVSB) pVSB->Move(rcVScroll,TRUE,FALSE);
+ if (pVSB) pVSB->Move(rcVScroll,true,false);
}
void CPWL_Wnd::CreateChildWnd(const PWL_CREATEPARAM & cp)
@@ -968,33 +968,33 @@ CPWL_MsgControl* CPWL_Wnd::GetMsgControl() const
return m_sPrivateParam.pMsgControl;
}
-FX_BOOL CPWL_Wnd::IsCaptureMouse() const
+bool CPWL_Wnd::IsCaptureMouse() const
{
return IsWndCaptureMouse(this);
}
-FX_BOOL CPWL_Wnd::IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
+bool CPWL_Wnd::IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
{
if (CPWL_MsgControl * pCtrl = GetMsgControl())
return pCtrl->IsWndCaptureMouse(pWnd);
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_Wnd::IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
+bool CPWL_Wnd::IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
{
if (CPWL_MsgControl * pCtrl = GetMsgControl())
return pCtrl->IsWndCaptureKeyboard(pWnd);
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_Wnd::IsFocused() const
+bool CPWL_Wnd::IsFocused() const
{
if (CPWL_MsgControl * pCtrl = GetMsgControl())
return pCtrl->IsMainCaptureKeyboard(this);
- return FALSE;
+ return false;
}
CPDF_Rect CPWL_Wnd::GetFocusRect() const
@@ -1217,7 +1217,7 @@ const CPWL_Wnd* CPWL_Wnd::GetFocused() const
return NULL;
}
-void CPWL_Wnd::EnableWindow(FX_BOOL bEnable)
+void CPWL_Wnd::EnableWindow(bool bEnable)
{
if (m_bEnabled != bEnable)
{
@@ -1238,7 +1238,7 @@ void CPWL_Wnd::EnableWindow(FX_BOOL bEnable)
}
}
-FX_BOOL CPWL_Wnd::IsEnabled()
+bool CPWL_Wnd::IsEnabled()
{
return m_bEnabled;
}
@@ -1251,42 +1251,42 @@ void CPWL_Wnd::OnDisabled()
{
}
-FX_BOOL CPWL_Wnd::IsCTRLpressed(FX_DWORD nFlag) const
+bool CPWL_Wnd::IsCTRLpressed(FX_DWORD nFlag) const
{
if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
{
return pSystemHandler->IsCTRLKeyDown(nFlag);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_Wnd::IsSHIFTpressed(FX_DWORD nFlag) const
+bool CPWL_Wnd::IsSHIFTpressed(FX_DWORD nFlag) const
{
if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
{
return pSystemHandler->IsSHIFTKeyDown(nFlag);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_Wnd::IsALTpressed(FX_DWORD nFlag) const
+bool CPWL_Wnd::IsALTpressed(FX_DWORD nFlag) const
{
if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
{
return pSystemHandler->IsALTKeyDown(nFlag);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_Wnd::IsINSERTpressed(FX_DWORD nFlag) const
+bool CPWL_Wnd::IsINSERTpressed(FX_DWORD nFlag) const
{
if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
{
return pSystemHandler->IsINSERTKeyDown(nFlag);
}
- return FALSE;
+ return false;
}