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

Side by Side Diff: xfa/fwl/cfwl_edit.cpp

Issue 2609423003: Properly ref-count CFGAS_GEFont with CFX_RetainPtr. (Closed)
Patch Set: comments Created 3 years, 11 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 "xfa/fwl/cfwl_edit.h" 7 #include "xfa/fwl/cfwl_edit.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 CFWL_ThemePart part; 681 CFWL_ThemePart part;
682 part.m_pWidget = this; 682 part.m_pWidget = this;
683 m_fFontSize = theme ? theme->GetFontSize(&part) : FWLTHEME_CAPACITY_FontSize; 683 m_fFontSize = theme ? theme->GetFontSize(&part) : FWLTHEME_CAPACITY_FontSize;
684 684
685 if (!theme) 685 if (!theme)
686 return; 686 return;
687 687
688 params.dwFontColor = theme->GetTextColor(&part); 688 params.dwFontColor = theme->GetTextColor(&part);
689 params.fLineSpace = theme->GetLineHeight(&part); 689 params.fLineSpace = theme->GetLineHeight(&part);
690 690
691 CFGAS_GEFont* pFont = theme->GetFont(&part); 691 CFX_RetainPtr<CFGAS_GEFont> pFont = theme->GetFont(&part);
692 if (!pFont) 692 if (!pFont)
693 return; 693 return;
694 694
695 params.pFont = pFont; 695 params.pFont = pFont;
696 params.fFontSize = m_fFontSize; 696 params.fFontSize = m_fFontSize;
697 params.nLineCount = (int32_t)(params.fPlateHeight / params.fLineSpace); 697 params.nLineCount = (int32_t)(params.fPlateHeight / params.fLineSpace);
698 if (params.nLineCount <= 0) 698 if (params.nLineCount <= 0)
699 params.nLineCount = 1; 699 params.nLineCount = 1;
700 params.fTabWidth = params.fFontSize * 1; 700 params.fTabWidth = params.fFontSize * 1;
701 params.bTabEquidistant = true; 701 params.bTabEquidistant = true;
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 pScrollBar->SetTrackPos(fPos); 1563 pScrollBar->SetTrackPos(fPos);
1564 UpdateOffset(pScrollBar, fPos - iCurPos); 1564 UpdateOffset(pScrollBar, fPos - iCurPos);
1565 UpdateCaret(); 1565 UpdateCaret();
1566 1566
1567 CFX_RectF rect = GetWidgetRect(); 1567 CFX_RectF rect = GetWidgetRect();
1568 CFX_RectF rtInvalidate; 1568 CFX_RectF rtInvalidate;
1569 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); 1569 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2);
1570 RepaintRect(rtInvalidate); 1570 RepaintRect(rtInvalidate);
1571 return true; 1571 return true;
1572 } 1572 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698