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

Side by Side Diff: xfa/fde/tto/fde_textout.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/fde/tto/fde_textout.h" 7 #include "xfa/fde/tto/fde_textout.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 28 matching lines...) Expand all
39 m_iTotalLines(0) { 39 m_iTotalLines(0) {
40 m_Matrix.SetIdentity(); 40 m_Matrix.SetIdentity();
41 m_rtClip.Reset(); 41 m_rtClip.Reset();
42 m_rtLogicClip.Reset(); 42 m_rtLogicClip.Reset();
43 } 43 }
44 44
45 CFDE_TextOut::~CFDE_TextOut() { 45 CFDE_TextOut::~CFDE_TextOut() {
46 m_ttoLines.RemoveAll(false); 46 m_ttoLines.RemoveAll(false);
47 } 47 }
48 48
49 void CFDE_TextOut::SetFont(CFGAS_GEFont* pFont) { 49 void CFDE_TextOut::SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont) {
50 ASSERT(pFont); 50 ASSERT(pFont);
51 m_pFont = pFont; 51 m_pFont = pFont;
52 m_pTxtBreak->SetFont(pFont); 52 m_pTxtBreak->SetFont(pFont);
53 } 53 }
54 54
55 void CFDE_TextOut::SetFontSize(FX_FLOAT fFontSize) { 55 void CFDE_TextOut::SetFontSize(FX_FLOAT fFontSize) {
56 ASSERT(fFontSize > 0); 56 ASSERT(fFontSize > 0);
57 m_fFontSize = fFontSize; 57 m_fFontSize = fFontSize;
58 m_pTxtBreak->SetFontSize(fFontSize); 58 m_pTxtBreak->SetFontSize(fFontSize);
59 } 59 }
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 return m_pieces.GetPtrAt(index); 942 return m_pieces.GetPtrAt(index);
943 } 943 }
944 944
945 void CFDE_TTOLine::RemoveLast(int32_t iCount) { 945 void CFDE_TTOLine::RemoveLast(int32_t iCount) {
946 m_pieces.RemoveLast(iCount); 946 m_pieces.RemoveLast(iCount);
947 } 947 }
948 948
949 void CFDE_TTOLine::RemoveAll(bool bLeaveMemory) { 949 void CFDE_TTOLine::RemoveAll(bool bLeaveMemory) {
950 m_pieces.RemoveAll(bLeaveMemory); 950 m_pieces.RemoveAll(bLeaveMemory);
951 } 951 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698