summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fwl/basewidget/fwl_comboboximp.cpp8
-rw-r--r--xfa/fwl/basewidget/fwl_editimp.cpp2
-rw-r--r--xfa/fwl/basewidget/fwl_listboximp.cpp7
-rw-r--r--xfa/fwl/core/fwl_formimp.h2
-rw-r--r--xfa/fwl/core/fwl_noteimp.cpp56
-rw-r--r--xfa/fwl/core/fwl_widgetmgrimp.cpp9
-rw-r--r--xfa/fwl/core/fwl_widgetmgrimp.h4
-rw-r--r--xfa/fwl/theme/cfwl_checkboxtp.cpp2
-rw-r--r--xfa/fxfa/app/xfa_ffwidget.cpp16
-rw-r--r--xfa/fxfa/include/xfa_ffwidget.h4
-rw-r--r--xfa/fxfa/parser/xfa_document_imp.cpp2
11 files changed, 48 insertions, 64 deletions
diff --git a/xfa/fwl/basewidget/fwl_comboboximp.cpp b/xfa/fwl/basewidget/fwl_comboboximp.cpp
index fd7c6d6266..35ac5fa240 100644
--- a/xfa/fwl/basewidget/fwl_comboboximp.cpp
+++ b/xfa/fwl/basewidget/fwl_comboboximp.cpp
@@ -557,8 +557,8 @@ FWL_ERR CFWL_ComboBoxImp::ModifyStylesEx(uint32_t dwStylesExAdded,
if (m_pWidgetMgr->IsFormDisabled()) {
return DisForm_ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
}
- FX_BOOL bAddDropDown = dwStylesExAdded & FWL_STYLEEXT_CMB_DropDown;
- FX_BOOL bRemoveDropDown = dwStylesExRemoved & FWL_STYLEEXT_CMB_DropDown;
+ bool bAddDropDown = !!(dwStylesExAdded & FWL_STYLEEXT_CMB_DropDown);
+ bool bRemoveDropDown = !!(dwStylesExRemoved & FWL_STYLEEXT_CMB_DropDown);
if (bAddDropDown && !m_pEdit) {
CFWL_WidgetImpProperties prop;
m_pEdit.reset(IFWL_Edit::CreateComboEdit(prop, nullptr));
@@ -1232,8 +1232,8 @@ FWL_ERR CFWL_ComboBoxImp::DisForm_ModifyStylesEx(uint32_t dwStylesExAdded,
if (!m_pEdit) {
DisForm_InitComboEdit();
}
- FX_BOOL bAddDropDown = dwStylesExAdded & FWL_STYLEEXT_CMB_DropDown;
- FX_BOOL bDelDropDown = dwStylesExRemoved & FWL_STYLEEXT_CMB_DropDown;
+ bool bAddDropDown = !!(dwStylesExAdded & FWL_STYLEEXT_CMB_DropDown);
+ bool bDelDropDown = !!(dwStylesExRemoved & FWL_STYLEEXT_CMB_DropDown);
dwStylesExRemoved &= ~FWL_STYLEEXT_CMB_DropDown;
m_pProperties->m_dwStyleExes |= FWL_STYLEEXT_CMB_DropDown;
if (bAddDropDown) {
diff --git a/xfa/fwl/basewidget/fwl_editimp.cpp b/xfa/fwl/basewidget/fwl_editimp.cpp
index 8b4dd39321..a80b89f9a7 100644
--- a/xfa/fwl/basewidget/fwl_editimp.cpp
+++ b/xfa/fwl/basewidget/fwl_editimp.cpp
@@ -1831,7 +1831,7 @@ void CFWL_EditImpDelegate::DoButtonDown(CFWL_MsgMouse* pMsg) {
}
void CFWL_EditImpDelegate::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
uint32_t dwStyleEx = m_pOwner->GetStylesEx();
- FX_BOOL bRepaint = dwStyleEx & FWL_STYLEEXT_EDT_InnerCaret;
+ bool bRepaint = !!(dwStyleEx & FWL_STYLEEXT_EDT_InnerCaret);
if (bSet) {
m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
if (!m_pOwner->m_pEdtEngine) {
diff --git a/xfa/fwl/basewidget/fwl_listboximp.cpp b/xfa/fwl/basewidget/fwl_listboximp.cpp
index dd017e215f..d514f7e1e3 100644
--- a/xfa/fwl/basewidget/fwl_listboximp.cpp
+++ b/xfa/fwl/basewidget/fwl_listboximp.cpp
@@ -399,14 +399,11 @@ void CFWL_ListBoxImp::ClearSelection() {
for (int32_t i = 0; i < iCount; i++) {
FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i);
uint32_t dwState = pData->GetItemStyles(m_pInterface, hItem);
- FX_BOOL bFindSel = dwState & FWL_ITEMSTATE_LTB_Selected;
- if (!bFindSel) {
+ if (!(dwState & FWL_ITEMSTATE_LTB_Selected))
continue;
- }
SetSelectionDirect(hItem, FALSE);
- if (!bMulti) {
+ if (!bMulti)
return;
- }
}
}
void CFWL_ListBoxImp::SelectAll() {
diff --git a/xfa/fwl/core/fwl_formimp.h b/xfa/fwl/core/fwl_formimp.h
index 4ee3e0ddae..d8bc80522e 100644
--- a/xfa/fwl/core/fwl_formimp.h
+++ b/xfa/fwl/core/fwl_formimp.h
@@ -32,7 +32,7 @@ class CFWL_SysBtn {
m_dwState = 0;
}
- FX_BOOL IsDisabled() { return m_dwState & FWL_SYSBUTTONSTATE_Disabled; }
+ bool IsDisabled() { return !!(m_dwState & FWL_SYSBUTTONSTATE_Disabled); }
void SetNormal() { m_dwState &= 0xFFF0; }
void SetPressed() {
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp
index 39afa783c0..41e749fc9a 100644
--- a/xfa/fwl/core/fwl_noteimp.cpp
+++ b/xfa/fwl/core/fwl_noteimp.cpp
@@ -810,47 +810,27 @@ FX_BOOL CFWL_EventTarget::IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) {
if (dwFilter == FWL_EVENT_ALL_MASK)
return TRUE;
- FX_BOOL bRet = FALSE;
switch (pEvent->GetClassID()) {
- case CFWL_EventType::Mouse: {
- bRet = dwFilter & FWL_EVENT_MOUSE_MASK;
- break;
- }
- case CFWL_EventType::MouseWheel: {
- bRet = dwFilter & FWL_EVENT_MOUSEWHEEL_MASK;
- break;
- }
- case CFWL_EventType::Key: {
- bRet = dwFilter & FWL_EVENT_KEY_MASK;
- break;
- }
+ case CFWL_EventType::Mouse:
+ return !!(dwFilter & FWL_EVENT_MOUSE_MASK);
+ case CFWL_EventType::MouseWheel:
+ return !!(dwFilter & FWL_EVENT_MOUSEWHEEL_MASK);
+ case CFWL_EventType::Key:
+ return !!(dwFilter & FWL_EVENT_KEY_MASK);
case CFWL_EventType::SetFocus:
- case CFWL_EventType::KillFocus: {
- bRet = dwFilter & FWL_EVENT_FOCUSCHANGED_MASK;
- break;
- }
- case CFWL_EventType::Draw: {
- bRet = dwFilter & FWL_EVENT_DRAW_MASK;
- break;
- }
- case CFWL_EventType::Close: {
- bRet = dwFilter & FWL_EVENT_CLOSE_MASK;
- break;
- }
- case CFWL_EventType::SizeChanged: {
- bRet = dwFilter & FWL_EVENT_SIZECHANGED_MASK;
- break;
- }
- case CFWL_EventType::Idle: {
- bRet = dwFilter & FWL_EVENT_IDLE_MASK;
- break;
- }
- default: {
- bRet = dwFilter & FWL_EVENT_CONTROL_MASK;
- break;
- }
+ case CFWL_EventType::KillFocus:
+ return !!(dwFilter & FWL_EVENT_FOCUSCHANGED_MASK);
+ case CFWL_EventType::Draw:
+ return !!(dwFilter & FWL_EVENT_DRAW_MASK);
+ case CFWL_EventType::Close:
+ return !!(dwFilter & FWL_EVENT_CLOSE_MASK);
+ case CFWL_EventType::SizeChanged:
+ return !!(dwFilter & FWL_EVENT_SIZECHANGED_MASK);
+ case CFWL_EventType::Idle:
+ return !!(dwFilter & FWL_EVENT_IDLE_MASK);
+ default:
+ return !!(dwFilter & FWL_EVENT_CONTROL_MASK);
}
- return bRet;
}
CFWL_ToolTipContainer* CFWL_ToolTipContainer::s_pInstance = NULL;
diff --git a/xfa/fwl/core/fwl_widgetmgrimp.cpp b/xfa/fwl/core/fwl_widgetmgrimp.cpp
index 02b63862e5..1985cbdeaf 100644
--- a/xfa/fwl/core/fwl_widgetmgrimp.cpp
+++ b/xfa/fwl/core/fwl_widgetmgrimp.cpp
@@ -667,12 +667,15 @@ FX_BOOL CFWL_WidgetMgr::IsAbleNative(IFWL_Widget* pWidget) {
FWL_WGTSTYLE_OverLapper) ||
(dwStyles & FWL_WGTSTYLE_Popup);
}
-FX_BOOL CFWL_WidgetMgr::IsThreadEnabled() {
+
+bool CFWL_WidgetMgr::IsThreadEnabled() {
return !(m_dwCapability & FWL_WGTMGR_DisableThread);
}
-FX_BOOL CFWL_WidgetMgr::IsFormDisabled() {
- return m_dwCapability & FWL_WGTMGR_DisableForm;
+
+bool CFWL_WidgetMgr::IsFormDisabled() {
+ return !!(m_dwCapability & FWL_WGTMGR_DisableForm);
}
+
FX_BOOL CFWL_WidgetMgr::GetAdapterPopupPos(IFWL_Widget* pWidget,
FX_FLOAT fMinHeight,
FX_FLOAT fMaxHeight,
diff --git a/xfa/fwl/core/fwl_widgetmgrimp.h b/xfa/fwl/core/fwl_widgetmgrimp.h
index 0b4e2bf79d..0fcd057aeb 100644
--- a/xfa/fwl/core/fwl_widgetmgrimp.h
+++ b/xfa/fwl/core/fwl_widgetmgrimp.h
@@ -120,8 +120,8 @@ class CFWL_WidgetMgr : public IFWL_WidgetMgr {
IFWL_AdapterWidgetMgr* GetAdapterWidgetMgr() { return m_pAdapter; }
CFWL_WidgetMgrDelegate* GetDelegate() { return m_pDelegate; }
CFWL_WidgetMgrItem* GetWidgetMgrItem(IFWL_Widget* pWidget);
- FX_BOOL IsThreadEnabled();
- FX_BOOL IsFormDisabled();
+ bool IsThreadEnabled();
+ bool IsFormDisabled();
FX_BOOL GetAdapterPopupPos(IFWL_Widget* pWidget,
FX_FLOAT fMinHeight,
FX_FLOAT fMaxHeight,
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index ac94c80d6d..a6d70eb452 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -114,7 +114,7 @@ void CFWL_CheckBoxTP::DrawBoxBk(IFWL_Widget* pWidget,
path.Create();
FX_FLOAT fRight = pRect->right();
FX_FLOAT fBottom = pRect->bottom();
- FX_BOOL bClipSign = dwStates & CFWL_PartState_Hovered;
+ bool bClipSign = !!(dwStates & CFWL_PartState_Hovered);
if ((dwStyleEx == FWL_STYLEEXT_CKB_ShapeSolidSquare) ||
(dwStyleEx == FWL_STYLEEXT_CKB_ShapeSunkenSquare)) {
path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height);
diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp
index 47be58e889..ed29996010 100644
--- a/xfa/fxfa/app/xfa_ffwidget.cpp
+++ b/xfa/fxfa/app/xfa_ffwidget.cpp
@@ -172,9 +172,11 @@ FX_BOOL CXFA_FFWidget::GetCaptionText(CFX_WideString& wsCap) {
pCapTextlayout->GetText(wsCap);
return TRUE;
}
-FX_BOOL CXFA_FFWidget::IsFocused() {
- return m_dwStatus & XFA_WIDGETSTATUS_Focused;
+
+bool CXFA_FFWidget::IsFocused() {
+ return !!(m_dwStatus & XFA_WIDGETSTATUS_Focused);
}
+
FX_BOOL CXFA_FFWidget::OnMouseEnter() {
return FALSE;
}
@@ -400,9 +402,11 @@ void CXFA_FFWidget::GetMinMaxHeight(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight) {
m_pDataAcc->GetMaxHeight(fMaxHeight);
}
}
-FX_BOOL CXFA_FFWidget::IsMatchVisibleStatus(uint32_t dwStatus) {
- return m_dwStatus & XFA_WIDGETSTATUS_Visible;
+
+bool CXFA_FFWidget::IsMatchVisibleStatus(uint32_t dwStatus) {
+ return !!(m_dwStatus & XFA_WIDGETSTATUS_Visible);
}
+
void CXFA_FFWidget::EventKillFocus() {
if (m_dwStatus & XFA_WIDGETSTATUS_Access) {
m_dwStatus &= ~XFA_WIDGETSTATUS_Access;
@@ -671,8 +675,8 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
if (pDIBitmap == NULL) {
return;
}
- FX_BOOL bIsolated = Transparency & PDFTRANS_ISOLATED;
- FX_BOOL bGroup = Transparency & PDFTRANS_GROUP;
+ bool bIsolated = !!(Transparency & PDFTRANS_ISOLATED);
+ bool bGroup = !!(Transparency & PDFTRANS_GROUP);
if (blend_mode == FXDIB_BLEND_NORMAL) {
if (!pDIBitmap->IsAlphaMask()) {
if (bitmap_alpha < 255) {
diff --git a/xfa/fxfa/include/xfa_ffwidget.h b/xfa/fxfa/include/xfa_ffwidget.h
index 74e4c84c4d..783bac5ab4 100644
--- a/xfa/fxfa/include/xfa_ffwidget.h
+++ b/xfa/fxfa/include/xfa_ffwidget.h
@@ -119,7 +119,7 @@ class CXFA_FFWidget : public CFX_PrivateData, public CXFA_ContentLayoutItem {
void InvalidateWidget(const CFX_RectF* pRect = NULL);
void AddInvalidateRect(const CFX_RectF* pRect = NULL);
FX_BOOL GetCaptionText(CFX_WideString& wsCap);
- FX_BOOL IsFocused();
+ bool IsFocused();
void Rotate2Normal(FX_FLOAT& fx, FX_FLOAT& fy);
void GetRotateMatrix(CFX_Matrix& mt);
FX_BOOL IsLayoutRectEmpty();
@@ -136,7 +136,7 @@ class CXFA_FFWidget : public CFX_PrivateData, public CXFA_ContentLayoutItem {
void GetMinMaxWidth(FX_FLOAT fMinWidth, FX_FLOAT fMaxWidth);
void GetMinMaxHeight(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight);
void GetRectWithoutRotate(CFX_RectF& rtWidget);
- FX_BOOL IsMatchVisibleStatus(uint32_t dwStatus);
+ bool IsMatchVisibleStatus(uint32_t dwStatus);
void EventKillFocus();
FX_BOOL IsButtonDown();
diff --git a/xfa/fxfa/parser/xfa_document_imp.cpp b/xfa/fxfa/parser/xfa_document_imp.cpp
index 083fe24a7e..3601c5b621 100644
--- a/xfa/fxfa/parser/xfa_document_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_imp.cpp
@@ -198,7 +198,7 @@ void CXFA_Document::SetFlag(uint32_t dwFlag, FX_BOOL bOn) {
}
FX_BOOL CXFA_Document::IsInteractive() {
if (m_dwDocFlags & XFA_DOCFLAG_HasInteractive) {
- return m_dwDocFlags & XFA_DOCFLAG_Interactive;
+ return !!(m_dwDocFlags & XFA_DOCFLAG_Interactive);
}
CXFA_Node* pConfig = ToNode(GetXFAObject(XFA_HASHCODE_Config));
if (!pConfig) {