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

Side by Side Diff: xfa/fwl/core/cfwl_comboedit.cpp

Issue 2535623002: Cleanup caret show/hide code (Closed)
Patch Set: Rebase to master Created 4 years 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/core/cfwl_caret.cpp ('k') | xfa/fwl/core/cfwl_edit.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 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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/core/cfwl_comboedit.h" 7 #include "xfa/fwl/core/cfwl_comboedit.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 21 matching lines...) Expand all
32 AddSelRange(0); 32 AddSelRange(0);
33 } 33 }
34 34
35 void CFWL_ComboEdit::FlagFocus(bool bSet) { 35 void CFWL_ComboEdit::FlagFocus(bool bSet) {
36 if (bSet) { 36 if (bSet) {
37 m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; 37 m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
38 return; 38 return;
39 } 39 }
40 40
41 m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; 41 m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
42 ShowCaret(false); 42 HideCaret(nullptr);
43 } 43 }
44 44
45 void CFWL_ComboEdit::OnProcessMessage(CFWL_Message* pMessage) { 45 void CFWL_ComboEdit::OnProcessMessage(CFWL_Message* pMessage) {
46 if (!pMessage) 46 if (!pMessage)
47 return; 47 return;
48 48
49 bool backDefault = true; 49 bool backDefault = true;
50 switch (pMessage->GetType()) { 50 switch (pMessage->GetType()) {
51 case CFWL_Message::Type::SetFocus: { 51 case CFWL_Message::Type::SetFocus: {
52 m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; 52 m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
(...skipping 13 matching lines...) Expand all
66 m_pOuter->SetFocus(true); 66 m_pOuter->SetFocus(true);
67 } 67 }
68 break; 68 break;
69 } 69 }
70 default: 70 default:
71 break; 71 break;
72 } 72 }
73 if (backDefault) 73 if (backDefault)
74 CFWL_Edit::OnProcessMessage(pMessage); 74 CFWL_Edit::OnProcessMessage(pMessage);
75 } 75 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/cfwl_caret.cpp ('k') | xfa/fwl/core/cfwl_edit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698