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

Side by Side Diff: xfa/fde/tto/fde_textout.h

Issue 1960673003: Replace some calls to Release() with direct delete, part 1. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add unique ptrs 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
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 #ifndef XFA_FDE_TTO_FDE_TEXTOUT_H_ 7 #ifndef XFA_FDE_TTO_FDE_TEXTOUT_H_
8 #define XFA_FDE_TTO_FDE_TEXTOUT_H_ 8 #define XFA_FDE_TTO_FDE_TEXTOUT_H_
9 9
10 #include <memory>
11
10 #include "core/fxge/include/fx_dib.h" 12 #include "core/fxge/include/fx_dib.h"
11 #include "core/fxge/include/fx_ge.h" 13 #include "core/fxge/include/fx_ge.h"
12 #include "xfa/fde/fde_object.h" 14 #include "xfa/fde/fde_object.h"
13 #include "xfa/fgas/crt/fgas_utils.h" 15 #include "xfa/fgas/crt/fgas_utils.h"
14 #include "xfa/fgas/font/fgas_font.h" 16 #include "xfa/fgas/font/fgas_font.h"
15 #include "xfa/fgas/layout/fgas_textbreak.h" 17 #include "xfa/fgas/layout/fgas_textbreak.h"
16 18
17 #define FDE_TTOSTYLE_Underline 0x0001 19 #define FDE_TTOSTYLE_Underline 0x0001
18 #define FDE_TTOSTYLE_Strikeout 0x0002 20 #define FDE_TTOSTYLE_Strikeout 0x0002
19 #define FDE_TTOSTYLE_VerticalLayout 0x0004 21 #define FDE_TTOSTYLE_VerticalLayout 0x0004
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 CFDE_TTOPieceArray m_pieces; 67 CFDE_TTOPieceArray m_pieces;
66 68
67 protected: 69 protected:
68 int32_t m_iPieceCount; 70 int32_t m_iPieceCount;
69 }; 71 };
70 typedef CFX_ObjectMassArrayTemplate<CFDE_TTOLine> CFDE_TTOLineArray; 72 typedef CFX_ObjectMassArrayTemplate<CFDE_TTOLine> CFDE_TTOLineArray;
71 73
72 class CFDE_TextOut : public CFX_Target { 74 class CFDE_TextOut : public CFX_Target {
73 public: 75 public:
74 CFDE_TextOut(); 76 CFDE_TextOut();
75 ~CFDE_TextOut(); 77 ~CFDE_TextOut() override;
76 78
77 void Release() { delete this; }
78 void SetFont(IFX_Font* pFont); 79 void SetFont(IFX_Font* pFont);
79 void SetFontSize(FX_FLOAT fFontSize); 80 void SetFontSize(FX_FLOAT fFontSize);
80 void SetTextColor(FX_ARGB color); 81 void SetTextColor(FX_ARGB color);
81 void SetStyles(uint32_t dwStyles); 82 void SetStyles(uint32_t dwStyles);
82 void SetTabWidth(FX_FLOAT fTabWidth); 83 void SetTabWidth(FX_FLOAT fTabWidth);
83 void SetEllipsisString(const CFX_WideString& wsEllipsis); 84 void SetEllipsisString(const CFX_WideString& wsEllipsis);
84 void SetParagraphBreakChar(FX_WCHAR wch); 85 void SetParagraphBreakChar(FX_WCHAR wch);
85 void SetAlignment(int32_t iAlignment); 86 void SetAlignment(int32_t iAlignment);
86 void SetLineSpace(FX_FLOAT fLineSpace); 87 void SetLineSpace(FX_FLOAT fLineSpace);
87 void SetDIBitmap(CFX_DIBitmap* pDIB); 88 void SetDIBitmap(CFX_DIBitmap* pDIB);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 CFX_WideString m_wsText; 173 CFX_WideString m_wsText;
173 CFX_RectF m_rtClip; 174 CFX_RectF m_rtClip;
174 CFX_RectF m_rtLogicClip; 175 CFX_RectF m_rtLogicClip;
175 CFX_Matrix m_Matrix; 176 CFX_Matrix m_Matrix;
176 CFDE_TTOLineArray m_ttoLines; 177 CFDE_TTOLineArray m_ttoLines;
177 int32_t m_iCurLine; 178 int32_t m_iCurLine;
178 int32_t m_iCurPiece; 179 int32_t m_iCurPiece;
179 int32_t m_iTotalLines; 180 int32_t m_iTotalLines;
180 FXTEXT_CHARPOS* m_pCharPos; 181 FXTEXT_CHARPOS* m_pCharPos;
181 int32_t m_iCharPosSize; 182 int32_t m_iCharPosSize;
182 CFDE_RenderDevice* m_pRenderDevice; 183 std::unique_ptr<CFDE_RenderDevice> m_pRenderDevice;
183 CFX_Int32Array m_hotKeys; 184 CFX_Int32Array m_hotKeys;
184 CFX_RectFArray m_rectArray; 185 CFX_RectFArray m_rectArray;
185 }; 186 };
186 187
187 #endif // XFA_FDE_TTO_FDE_TEXTOUT_H_ 188 #endif // XFA_FDE_TTO_FDE_TEXTOUT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698