summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfxfa/fpdfxfa_util.cpp8
-rw-r--r--fpdfsdk/fsdk_baseform.cpp16
-rw-r--r--fpdfsdk/include/fpdfxfa/fpdfxfa_util.h11
3 files changed, 17 insertions, 18 deletions
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_util.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_util.cpp
index 7814d8bd8a..7cabe0fb80 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_util.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_util.cpp
@@ -20,10 +20,10 @@ FWL_ERR CXFA_FWLAdapterTimerMgr::Start(IFWL_Timer* pTimer,
if (!m_pEnv)
return FWL_ERR_Indefinite;
- uint32_t uIDEvent = m_pEnv->FFI_SetTimer(dwElapse, TimerProc);
+ int32_t id_event = m_pEnv->FFI_SetTimer(dwElapse, TimerProc);
if (!s_TimerArray)
s_TimerArray = new std::vector<CFWL_TimerInfo*>;
- s_TimerArray->push_back(new CFWL_TimerInfo(uIDEvent, pTimer));
+ s_TimerArray->push_back(new CFWL_TimerInfo(id_event, pTimer));
hTimer = reinterpret_cast<FWL_HTIMER>(s_TimerArray->back());
return FWL_ERR_Succeeded;
}
@@ -33,7 +33,7 @@ FWL_ERR CXFA_FWLAdapterTimerMgr::Stop(FWL_HTIMER hTimer) {
return FWL_ERR_Indefinite;
CFWL_TimerInfo* pInfo = reinterpret_cast<CFWL_TimerInfo*>(hTimer);
- m_pEnv->FFI_KillTimer(pInfo->uIDEvent);
+ m_pEnv->FFI_KillTimer(pInfo->idEvent);
if (s_TimerArray) {
auto it = std::find(s_TimerArray->begin(), s_TimerArray->end(), pInfo);
if (it != s_TimerArray->end()) {
@@ -50,7 +50,7 @@ void CXFA_FWLAdapterTimerMgr::TimerProc(int32_t idEvent) {
return;
for (CFWL_TimerInfo* pInfo : *s_TimerArray) {
- if (pInfo->uIDEvent == idEvent) {
+ if (pInfo->idEvent == idEvent) {
pInfo->pTimer->Run(reinterpret_cast<FWL_HTIMER>(pInfo));
break;
}
diff --git a/fpdfsdk/fsdk_baseform.cpp b/fpdfsdk/fsdk_baseform.cpp
index 141e1f5f82..6a01813494 100644
--- a/fpdfsdk/fsdk_baseform.cpp
+++ b/fpdfsdk/fsdk_baseform.cpp
@@ -350,19 +350,19 @@ void CPDFSDK_Widget::SynchronizeXFAValue(IXFA_DocView* pXFADocView,
case FIELDTYPE_CHECKBOX: {
if (CXFA_WidgetAcc* pWidgetAcc =
pXFAWidgetHandler->GetDataAcc(hWidget)) {
- FX_BOOL bChecked = pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On;
-
- pFormField->CheckControl(pFormField->GetControlIndex(pFormControl),
- bChecked, TRUE);
+ pFormField->CheckControl(
+ pFormField->GetControlIndex(pFormControl),
+ pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On, true);
}
} break;
case FIELDTYPE_RADIOBUTTON: {
+ // TODO(weili): Check whether we need to handle checkbox and radio
+ // button differently, otherwise, merge these two cases.
if (CXFA_WidgetAcc* pWidgetAcc =
pXFAWidgetHandler->GetDataAcc(hWidget)) {
- FX_BOOL bChecked = pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On;
-
- pFormField->CheckControl(pFormField->GetControlIndex(pFormControl),
- bChecked, TRUE);
+ pFormField->CheckControl(
+ pFormField->GetControlIndex(pFormControl),
+ pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On, true);
}
} break;
case FIELDTYPE_TEXTFIELD: {
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h
index af69812471..545d910206 100644
--- a/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h
+++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h
@@ -17,7 +17,7 @@
#define JS_STR_VIEWERVARIATION L"Full"
#define JS_STR_VIEWERVERSION_XFA L"11"
-class CFWL_TimerInfo;
+struct CFWL_TimerInfo;
class CXFA_FWLAdapterTimerMgr : public IFWL_AdapterTimerMgr {
public:
@@ -35,13 +35,12 @@ class CXFA_FWLAdapterTimerMgr : public IFWL_AdapterTimerMgr {
CPDFDoc_Environment* const m_pEnv;
};
-class CFWL_TimerInfo {
- public:
+struct CFWL_TimerInfo {
CFWL_TimerInfo() : pTimer(nullptr) {}
- CFWL_TimerInfo(uint32_t event, IFWL_Timer* timer)
- : uIDEvent(event), pTimer(timer) {}
+ CFWL_TimerInfo(int32_t event, IFWL_Timer* timer)
+ : idEvent(event), pTimer(timer) {}
- uint32_t uIDEvent;
+ int32_t idEvent;
IFWL_Timer* pTimer;
};