summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_textfield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/formfiller/cffl_textfield.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_textfield.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp
index 566051c2de..c1cd7868c8 100644
--- a/fpdfsdk/formfiller/cffl_textfield.cpp
+++ b/fpdfsdk/formfiller/cffl_textfield.cpp
@@ -105,9 +105,9 @@ CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp,
return pWnd;
}
-FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot,
- uint32_t nChar,
- uint32_t nFlags) {
+bool CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot,
+ uint32_t nChar,
+ uint32_t nFlags) {
switch (nChar) {
case FWL_VKEY_Return:
if (!(m_pWidget->GetFieldFlags() & FIELDFLAG_MULTILINE)) {
@@ -119,42 +119,42 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot,
rcAnnot.top, rcAnnot.right, rcAnnot.bottom);
if (m_bValid) {
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE))
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true))
pWnd->SetFocus();
} else {
if (CommitData(pPageView, nFlags)) {
DestroyPDFWindow(pPageView);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
}
break;
case FWL_VKEY_Escape: {
CPDFSDK_PageView* pPageView = GetCurPageView(true);
ASSERT(pPageView);
- EscapeFiller(pPageView, TRUE);
- return TRUE;
+ EscapeFiller(pPageView, true);
+ return true;
}
}
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
-FX_BOOL CFFL_TextField::IsDataChanged(CPDFSDK_PageView* pPageView) {
- if (CPWL_Edit* pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
+bool CFFL_TextField::IsDataChanged(CPDFSDK_PageView* pPageView) {
+ if (CPWL_Edit* pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, false))
return pEdit->GetText() != m_pWidget->GetValue();
- return FALSE;
+ return false;
}
void CFFL_TextField::SaveData(CPDFSDK_PageView* pPageView) {
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false)) {
CFX_WideString sOldValue = m_pWidget->GetValue();
CFX_WideString sNewValue = pWnd->GetText();
- m_pWidget->SetValue(sNewValue, FALSE);
- m_pWidget->ResetFieldAppearance(TRUE);
+ m_pWidget->SetValue(sNewValue, false);
+ m_pWidget->ResetFieldAppearance(true);
m_pWidget->UpdateField();
SetChangeMark();
}
@@ -165,7 +165,7 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView,
PDFSDK_FieldAction& fa) {
switch (type) {
case CPDF_AAction::KeyStroke:
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false)) {
fa.bFieldFull = pWnd->IsTextFull();
fa.sValue = pWnd->GetText();
@@ -177,7 +177,7 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView,
}
break;
case CPDF_AAction::Validate:
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false)) {
fa.sValue = pWnd->GetText();
}
break;
@@ -195,7 +195,7 @@ void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView,
const PDFSDK_FieldAction& fa) {
switch (type) {
case CPDF_AAction::KeyStroke:
- if (CPWL_Edit* pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Edit* pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, false)) {
pEdit->SetFocus();
pEdit->SetSel(fa.nSelStart, fa.nSelEnd);
pEdit->ReplaceSel(fa.sChange);
@@ -206,9 +206,9 @@ void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView,
}
}
-FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& faOld,
- const PDFSDK_FieldAction& faNew) {
+bool CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& faOld,
+ const PDFSDK_FieldAction& faNew) {
switch (type) {
case CPDF_AAction::KeyStroke:
return (!faOld.bFieldFull && faOld.nSelEnd != faNew.nSelEnd) ||
@@ -218,13 +218,13 @@ FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type,
break;
}
- return FALSE;
+ return false;
}
void CFFL_TextField::SaveState(CPDFSDK_PageView* pPageView) {
ASSERT(pPageView);
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false)) {
pWnd->GetSel(m_State.nStart, m_State.nEnd);
m_State.sValue = pWnd->GetText();
}
@@ -233,14 +233,14 @@ void CFFL_TextField::SaveState(CPDFSDK_PageView* pPageView) {
void CFFL_TextField::RestoreState(CPDFSDK_PageView* pPageView) {
ASSERT(pPageView);
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, TRUE)) {
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, true)) {
pWnd->SetText(m_State.sValue);
pWnd->SetSel(m_State.nStart, m_State.nEnd);
}
}
CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView,
- FX_BOOL bRestoreValue) {
+ bool bRestoreValue) {
if (bRestoreValue)
SaveState(pPageView);
@@ -250,9 +250,9 @@ CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView,
if (bRestoreValue) {
RestoreState(pPageView);
- pRet = GetPDFWindow(pPageView, FALSE);
+ pRet = GetPDFWindow(pPageView, false);
} else {
- pRet = GetPDFWindow(pPageView, TRUE);
+ pRet = GetPDFWindow(pPageView, true);
}
m_pWidget->UpdateField();
@@ -261,12 +261,12 @@ CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView,
}
#ifdef PDF_ENABLE_XFA
-FX_BOOL CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) {
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) {
+bool CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) {
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false)) {
return pWnd->IsTextFull();
}
- return FALSE;
+ return false;
}
#endif // PDF_ENABLE_XFA
@@ -282,6 +282,6 @@ void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) {
int nCharacters = wsText.GetLength();
CFX_ByteString bsUTFText = wsText.UTF16LE_Encode();
unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str();
- m_pFormFillEnv->OnSetFieldInputFocus(pBuffer, nCharacters, TRUE);
+ m_pFormFillEnv->OnSetFieldInputFocus(pBuffer, nCharacters, true);
}
}