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

Side by Side Diff: fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp

Issue 1243883003: Fix else-after-returns throughout pdfium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 5 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
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 "../../include/pdfwindow/PDFWindow.h" 7 #include "../../include/pdfwindow/PDFWindow.h"
8 #include "../../include/pdfwindow/PWL_Wnd.h" 8 #include "../../include/pdfwindow/PWL_Wnd.h"
9 #include "../../include/pdfwindow/PWL_EditCtrl.h" 9 #include "../../include/pdfwindow/PWL_EditCtrl.h"
10 #include "../../include/pdfwindow/PWL_ScrollBar.h" 10 #include "../../include/pdfwindow/PWL_ScrollBar.h"
(...skipping 18 matching lines...) Expand all
29 { 29 {
30 m_pEdit = IFX_Edit::NewEdit(); 30 m_pEdit = IFX_Edit::NewEdit();
31 ASSERT(m_pEdit != NULL); 31 ASSERT(m_pEdit != NULL);
32 } 32 }
33 33
34 CPWL_EditCtrl::~CPWL_EditCtrl() 34 CPWL_EditCtrl::~CPWL_EditCtrl()
35 { 35 {
36 IFX_Edit::DelEdit(m_pEdit); 36 IFX_Edit::DelEdit(m_pEdit);
37 } 37 }
38 38
39 void CPWL_EditCtrl::OnCreate(PWL_CREATEPARAM & cp) 39 void CPWL_EditCtrl::OnCreate(PWL_CREATEPARAM& cp)
40 { 40 {
41 cp.eCursorType = FXCT_VBEAM; 41 cp.eCursorType = FXCT_VBEAM;
42 } 42 }
43 43
44 void CPWL_EditCtrl::OnCreated() 44 void CPWL_EditCtrl::OnCreated()
45 { 45 {
46 SetFontSize(GetCreationParam().fFontSize); 46 SetFontSize(GetCreationParam().fFontSize);
47 47
48 m_pEdit->SetFontMap(GetFontMap()); 48 m_pEdit->SetFontMap(GetFontMap());
49 m_pEdit->SetNotify(this); 49 m_pEdit->SetNotify(this);
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 } 523 }
524 else if (HasFlag(PES_RICH)) 524 else if (HasFlag(PES_RICH))
525 { 525 {
526 if (pIterator->GetSection(section)) 526 if (pIterator->GetSection(section))
527 { 527 {
528 nFontIndex = section.WordProps.nFontIndex; 528 nFontIndex = section.WordProps.nFontIndex;
529 } 529 }
530 } 530 }
531 } 531 }
532 532
533 » if (IFX_Edit_FontMap * pFontMap = GetFontMap()) 533 » if (IFX_Edit_FontMap* pFontMap = GetFontMap())
534 return pFontMap->GetPDFFont(nFontIndex); 534 return pFontMap->GetPDFFont(nFontIndex);
535 » else 535
536 » » return NULL; 536 return NULL;
537 } 537 }
538 538
539 FX_FLOAT CPWL_EditCtrl::GetCaretFontSize() const 539 FX_FLOAT CPWL_EditCtrl::GetCaretFontSize() const
540 { 540 {
541 FX_FLOAT fFontSize = GetFontSize(); 541 FX_FLOAT fFontSize = GetFontSize();
542 542
543 if (IFX_Edit_Iterator * pIterator = m_pEdit->GetIterator()) 543 if (IFX_Edit_Iterator * pIterator = m_pEdit->GetIterator())
544 { 544 {
545 pIterator->SetAt(m_pEdit->GetCaret()); 545 pIterator->SetAt(m_pEdit->GetCaret());
546 CPVT_Word word; 546 CPVT_Word word;
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 } 713 }
714 714
715 void CPWL_EditCtrl::SetReadyToInput() 715 void CPWL_EditCtrl::SetReadyToInput()
716 { 716 {
717 if (m_bMouseDown) 717 if (m_bMouseDown)
718 { 718 {
719 ReleaseCapture(); 719 ReleaseCapture();
720 m_bMouseDown = FALSE; 720 m_bMouseDown = FALSE;
721 } 721 }
722 } 722 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698