summaryrefslogtreecommitdiff
path: root/xfa/fxfa
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-04 13:38:11 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-04 13:38:11 -0700
commit7d89e728a450c681c53d40d7f67ee2eef0400705 (patch)
treea82e90ff7b65382965395a7b323cfbc7ea5009f4 /xfa/fxfa
parent10b01bf44695ce9a354660b16f607da70727a846 (diff)
downloadpdfium-7d89e728a450c681c53d40d7f67ee2eef0400705.tar.xz
Return bool rather than bitwise-and for FX_BOOL
Investigate results of: git grep -ni 'return [(]*[a-z0-9_]* &[^&]' git grep -ni 'BOOL.*= [(]*[a-z0-9_]* &[^&]' Review-Url: https://codereview.chromium.org/1951653002
Diffstat (limited to 'xfa/fxfa')
-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
3 files changed, 13 insertions, 9 deletions
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) {