Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: xfa/fxfa/app/xfa_ffwidget.cpp

Issue 1951653002: Return bool rather than bitwise-and for FX_BOOL (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: More bool, fix nits. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fwl/theme/cfwl_checkboxtp.cpp ('k') | xfa/fxfa/include/xfa_ffwidget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fxfa/include/xfa_ffwidget.h" 7 #include "xfa/fxfa/include/xfa_ffwidget.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 m_pDocView->AddInvalidateRect(m_pPageView, rtWidget); 165 m_pDocView->AddInvalidateRect(m_pPageView, rtWidget);
166 } 166 }
167 FX_BOOL CXFA_FFWidget::GetCaptionText(CFX_WideString& wsCap) { 167 FX_BOOL CXFA_FFWidget::GetCaptionText(CFX_WideString& wsCap) {
168 CXFA_TextLayout* pCapTextlayout = m_pDataAcc->GetCaptionTextLayout(); 168 CXFA_TextLayout* pCapTextlayout = m_pDataAcc->GetCaptionTextLayout();
169 if (!pCapTextlayout) { 169 if (!pCapTextlayout) {
170 return FALSE; 170 return FALSE;
171 } 171 }
172 pCapTextlayout->GetText(wsCap); 172 pCapTextlayout->GetText(wsCap);
173 return TRUE; 173 return TRUE;
174 } 174 }
175 FX_BOOL CXFA_FFWidget::IsFocused() { 175
176 return m_dwStatus & XFA_WIDGETSTATUS_Focused; 176 bool CXFA_FFWidget::IsFocused() {
177 return !!(m_dwStatus & XFA_WIDGETSTATUS_Focused);
177 } 178 }
179
178 FX_BOOL CXFA_FFWidget::OnMouseEnter() { 180 FX_BOOL CXFA_FFWidget::OnMouseEnter() {
179 return FALSE; 181 return FALSE;
180 } 182 }
181 FX_BOOL CXFA_FFWidget::OnMouseExit() { 183 FX_BOOL CXFA_FFWidget::OnMouseExit() {
182 return FALSE; 184 return FALSE;
183 } 185 }
184 FX_BOOL CXFA_FFWidget::OnLButtonDown(uint32_t dwFlags, 186 FX_BOOL CXFA_FFWidget::OnLButtonDown(uint32_t dwFlags,
185 FX_FLOAT fx, 187 FX_FLOAT fx,
186 FX_FLOAT fy) { 188 FX_FLOAT fy) {
187 return FALSE; 189 return FALSE;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 void CXFA_FFWidget::GetMinMaxHeight(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight) { 395 void CXFA_FFWidget::GetMinMaxHeight(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight) {
394 fMinHeight = fMaxHeight = 0; 396 fMinHeight = fMaxHeight = 0;
395 FX_FLOAT fHeight = 0; 397 FX_FLOAT fHeight = 0;
396 if (m_pDataAcc->GetHeight(fHeight)) { 398 if (m_pDataAcc->GetHeight(fHeight)) {
397 fMinHeight = fMaxHeight = fHeight; 399 fMinHeight = fMaxHeight = fHeight;
398 } else { 400 } else {
399 m_pDataAcc->GetMinHeight(fMinHeight); 401 m_pDataAcc->GetMinHeight(fMinHeight);
400 m_pDataAcc->GetMaxHeight(fMaxHeight); 402 m_pDataAcc->GetMaxHeight(fMaxHeight);
401 } 403 }
402 } 404 }
403 FX_BOOL CXFA_FFWidget::IsMatchVisibleStatus(uint32_t dwStatus) { 405
404 return m_dwStatus & XFA_WIDGETSTATUS_Visible; 406 bool CXFA_FFWidget::IsMatchVisibleStatus(uint32_t dwStatus) {
407 return !!(m_dwStatus & XFA_WIDGETSTATUS_Visible);
405 } 408 }
409
406 void CXFA_FFWidget::EventKillFocus() { 410 void CXFA_FFWidget::EventKillFocus() {
407 if (m_dwStatus & XFA_WIDGETSTATUS_Access) { 411 if (m_dwStatus & XFA_WIDGETSTATUS_Access) {
408 m_dwStatus &= ~XFA_WIDGETSTATUS_Access; 412 m_dwStatus &= ~XFA_WIDGETSTATUS_Access;
409 return; 413 return;
410 } 414 }
411 CXFA_EventParam eParam; 415 CXFA_EventParam eParam;
412 eParam.m_eType = XFA_EVENT_Exit; 416 eParam.m_eType = XFA_EVENT_Exit;
413 eParam.m_pTarget = m_pDataAcc; 417 eParam.m_pTarget = m_pDataAcc;
414 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Exit, &eParam); 418 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Exit, &eParam);
415 } 419 }
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, 668 void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
665 int left, 669 int left,
666 int top, 670 int top,
667 FX_ARGB mask_argb, 671 FX_ARGB mask_argb,
668 int bitmap_alpha, 672 int bitmap_alpha,
669 int blend_mode, 673 int blend_mode,
670 int Transparency) { 674 int Transparency) {
671 if (pDIBitmap == NULL) { 675 if (pDIBitmap == NULL) {
672 return; 676 return;
673 } 677 }
674 FX_BOOL bIsolated = Transparency & PDFTRANS_ISOLATED; 678 bool bIsolated = !!(Transparency & PDFTRANS_ISOLATED);
675 FX_BOOL bGroup = Transparency & PDFTRANS_GROUP; 679 bool bGroup = !!(Transparency & PDFTRANS_GROUP);
676 if (blend_mode == FXDIB_BLEND_NORMAL) { 680 if (blend_mode == FXDIB_BLEND_NORMAL) {
677 if (!pDIBitmap->IsAlphaMask()) { 681 if (!pDIBitmap->IsAlphaMask()) {
678 if (bitmap_alpha < 255) { 682 if (bitmap_alpha < 255) {
679 pDIBitmap->MultiplyAlpha(bitmap_alpha); 683 pDIBitmap->MultiplyAlpha(bitmap_alpha);
680 } 684 }
681 if (m_pDevice->SetDIBits(pDIBitmap, left, top)) { 685 if (m_pDevice->SetDIBits(pDIBitmap, left, top)) {
682 return; 686 return;
683 } 687 }
684 } else { 688 } else {
685 uint32_t fill_argb = (mask_argb); 689 uint32_t fill_argb = (mask_argb);
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1955 iType != XFA_ELEMENT_Rectangle) { 1959 iType != XFA_ELEMENT_Rectangle) {
1956 return; 1960 return;
1957 } 1961 }
1958 CXFA_StrokeArray strokes; 1962 CXFA_StrokeArray strokes;
1959 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { 1963 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) {
1960 box.GetStrokes(strokes); 1964 box.GetStrokes(strokes);
1961 } 1965 }
1962 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); 1966 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags);
1963 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); 1967 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags);
1964 } 1968 }
OLDNEW
« no previous file with comments | « xfa/fwl/theme/cfwl_checkboxtp.cpp ('k') | xfa/fxfa/include/xfa_ffwidget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698