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

Side by Side Diff: xfa/fwl/basewidget/fwl_editimp.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/basewidget/fwl_comboboximp.cpp ('k') | xfa/fwl/basewidget/fwl_listboximp.cpp » ('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/fwl/basewidget/fwl_editimp.h" 7 #include "xfa/fwl/basewidget/fwl_editimp.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 m_pOwner->DeviceToEngine(pt); 1824 m_pOwner->DeviceToEngine(pt);
1825 FX_BOOL bBefore = TRUE; 1825 FX_BOOL bBefore = TRUE;
1826 int32_t nIndex = pPage->GetCharIndex(pt, bBefore); 1826 int32_t nIndex = pPage->GetCharIndex(pt, bBefore);
1827 if (nIndex < 0) { 1827 if (nIndex < 0) {
1828 nIndex = 0; 1828 nIndex = 0;
1829 } 1829 }
1830 m_pOwner->m_pEdtEngine->SetCaretPos(nIndex, bBefore); 1830 m_pOwner->m_pEdtEngine->SetCaretPos(nIndex, bBefore);
1831 } 1831 }
1832 void CFWL_EditImpDelegate::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) { 1832 void CFWL_EditImpDelegate::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
1833 uint32_t dwStyleEx = m_pOwner->GetStylesEx(); 1833 uint32_t dwStyleEx = m_pOwner->GetStylesEx();
1834 FX_BOOL bRepaint = dwStyleEx & FWL_STYLEEXT_EDT_InnerCaret; 1834 bool bRepaint = !!(dwStyleEx & FWL_STYLEEXT_EDT_InnerCaret);
1835 if (bSet) { 1835 if (bSet) {
1836 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; 1836 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
1837 if (!m_pOwner->m_pEdtEngine) { 1837 if (!m_pOwner->m_pEdtEngine) {
1838 m_pOwner->UpdateEditEngine(); 1838 m_pOwner->UpdateEditEngine();
1839 } 1839 }
1840 m_pOwner->UpdateVAlignment(); 1840 m_pOwner->UpdateVAlignment();
1841 m_pOwner->UpdateOffset(); 1841 m_pOwner->UpdateOffset();
1842 m_pOwner->UpdateCaret(); 1842 m_pOwner->UpdateCaret();
1843 } else if (m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) { 1843 } else if (m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) {
1844 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; 1844 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
2153 } 2153 }
2154 CFX_RectF rect; 2154 CFX_RectF rect;
2155 m_pOwner->GetWidgetRect(rect); 2155 m_pOwner->GetWidgetRect(rect);
2156 CFX_RectF rtInvalidate; 2156 CFX_RectF rtInvalidate;
2157 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); 2157 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2);
2158 m_pOwner->Repaint(&rtInvalidate); 2158 m_pOwner->Repaint(&rtInvalidate);
2159 } 2159 }
2160 return TRUE; 2160 return TRUE;
2161 } 2161 }
2162 void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) {} 2162 void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) {}
OLDNEW
« no previous file with comments | « xfa/fwl/basewidget/fwl_comboboximp.cpp ('k') | xfa/fwl/basewidget/fwl_listboximp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698