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

Side by Side Diff: xfa/fgas/layout/fgas_textbreak.h

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 #ifndef XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_ 7 #ifndef XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_
8 #define XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_ 8 #define XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 struct FX_TXTRUN { 86 struct FX_TXTRUN {
87 FX_TXTRUN(); 87 FX_TXTRUN();
88 FX_TXTRUN(const FX_TXTRUN& other); 88 FX_TXTRUN(const FX_TXTRUN& other);
89 ~FX_TXTRUN(); 89 ~FX_TXTRUN();
90 90
91 IFX_TxtAccess* pAccess; 91 IFX_TxtAccess* pAccess;
92 const FDE_TEXTEDITPIECE* pIdentity; 92 const FDE_TEXTEDITPIECE* pIdentity;
93 CFX_WideString wsStr; 93 CFX_WideString wsStr;
94 int32_t* pWidths; 94 int32_t* pWidths;
95 int32_t iLength; 95 int32_t iLength;
96 CFGAS_GEFont* pFont; 96 CFX_RetainPtr<CFGAS_GEFont> pFont;
97 FX_FLOAT fFontSize; 97 FX_FLOAT fFontSize;
98 uint32_t dwStyles; 98 uint32_t dwStyles;
99 int32_t iHorizontalScale; 99 int32_t iHorizontalScale;
100 int32_t iVerticalScale; 100 int32_t iVerticalScale;
101 int32_t iCharRotation; 101 int32_t iCharRotation;
102 uint32_t dwCharStyles; 102 uint32_t dwCharStyles;
103 const CFX_RectF* pRect; 103 const CFX_RectF* pRect;
104 FX_WCHAR wLineBreakChar; 104 FX_WCHAR wLineBreakChar;
105 bool bSkipSpace; 105 bool bSkipSpace;
106 }; 106 };
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 class CFX_TxtBreak { 200 class CFX_TxtBreak {
201 public: 201 public:
202 explicit CFX_TxtBreak(uint32_t dwPolicies); 202 explicit CFX_TxtBreak(uint32_t dwPolicies);
203 ~CFX_TxtBreak(); 203 ~CFX_TxtBreak();
204 204
205 void SetLineWidth(FX_FLOAT fLineWidth); 205 void SetLineWidth(FX_FLOAT fLineWidth);
206 void SetLinePos(FX_FLOAT fLinePos); 206 void SetLinePos(FX_FLOAT fLinePos);
207 uint32_t GetLayoutStyles() const { return m_dwLayoutStyles; } 207 uint32_t GetLayoutStyles() const { return m_dwLayoutStyles; }
208 void SetLayoutStyles(uint32_t dwLayoutStyles); 208 void SetLayoutStyles(uint32_t dwLayoutStyles);
209 void SetFont(CFGAS_GEFont* pFont); 209 void SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont);
210 void SetFontSize(FX_FLOAT fFontSize); 210 void SetFontSize(FX_FLOAT fFontSize);
211 void SetTabWidth(FX_FLOAT fTabWidth, bool bEquidistant); 211 void SetTabWidth(FX_FLOAT fTabWidth, bool bEquidistant);
212 void SetDefaultChar(FX_WCHAR wch); 212 void SetDefaultChar(FX_WCHAR wch);
213 void SetParagraphBreakChar(FX_WCHAR wch); 213 void SetParagraphBreakChar(FX_WCHAR wch);
214 void SetLineBreakTolerance(FX_FLOAT fTolerance); 214 void SetLineBreakTolerance(FX_FLOAT fTolerance);
215 void SetHorizontalScale(int32_t iScale); 215 void SetHorizontalScale(int32_t iScale);
216 void SetVerticalScale(int32_t iScale); 216 void SetVerticalScale(int32_t iScale);
217 void SetCharRotation(int32_t iCharRotation); 217 void SetCharRotation(int32_t iCharRotation);
218 void SetCharSpace(FX_FLOAT fCharSpace); 218 void SetCharSpace(FX_FLOAT fCharSpace);
219 void SetAlignment(int32_t iAlignment); 219 void SetAlignment(int32_t iAlignment);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 int32_t m_iLineWidth; 273 int32_t m_iLineWidth;
274 uint32_t m_dwLayoutStyles; 274 uint32_t m_dwLayoutStyles;
275 bool m_bVertical; 275 bool m_bVertical;
276 bool m_bArabicContext; 276 bool m_bArabicContext;
277 bool m_bArabicShapes; 277 bool m_bArabicShapes;
278 bool m_bRTL; 278 bool m_bRTL;
279 bool m_bSingleLine; 279 bool m_bSingleLine;
280 bool m_bCombText; 280 bool m_bCombText;
281 int32_t m_iArabicContext; 281 int32_t m_iArabicContext;
282 int32_t m_iCurArabicContext; 282 int32_t m_iCurArabicContext;
283 CFGAS_GEFont* m_pFont; 283 CFX_RetainPtr<CFGAS_GEFont> m_pFont;
284 int32_t m_iFontSize; 284 int32_t m_iFontSize;
285 bool m_bEquidistant; 285 bool m_bEquidistant;
286 int32_t m_iTabWidth; 286 int32_t m_iTabWidth;
287 FX_WCHAR m_wDefChar; 287 FX_WCHAR m_wDefChar;
288 FX_WCHAR m_wParagBreakChar; 288 FX_WCHAR m_wParagBreakChar;
289 int32_t m_iDefChar; 289 int32_t m_iDefChar;
290 int32_t m_iLineRotation; 290 int32_t m_iLineRotation;
291 int32_t m_iCharRotation; 291 int32_t m_iCharRotation;
292 int32_t m_iRotation; 292 int32_t m_iRotation;
293 int32_t m_iAlignment; 293 int32_t m_iAlignment;
294 uint32_t m_dwContextCharStyles; 294 uint32_t m_dwContextCharStyles;
295 int32_t m_iCombWidth; 295 int32_t m_iCombWidth;
296 void* m_pUserData; 296 void* m_pUserData;
297 FX_CHARTYPE m_eCharType; 297 FX_CHARTYPE m_eCharType;
298 bool m_bCurRTL; 298 bool m_bCurRTL;
299 int32_t m_iCurAlignment; 299 int32_t m_iCurAlignment;
300 bool m_bArabicNumber; 300 bool m_bArabicNumber;
301 bool m_bArabicComma; 301 bool m_bArabicComma;
302 std::unique_ptr<CFX_TxtLine> m_pTxtLine1; 302 std::unique_ptr<CFX_TxtLine> m_pTxtLine1;
303 std::unique_ptr<CFX_TxtLine> m_pTxtLine2; 303 std::unique_ptr<CFX_TxtLine> m_pTxtLine2;
304 CFX_TxtLine* m_pCurLine; 304 CFX_TxtLine* m_pCurLine;
305 int32_t m_iReady; 305 int32_t m_iReady;
306 int32_t m_iTolerance; 306 int32_t m_iTolerance;
307 int32_t m_iHorScale; 307 int32_t m_iHorScale;
308 int32_t m_iVerScale; 308 int32_t m_iVerScale;
309 int32_t m_iCharSpace; 309 int32_t m_iCharSpace;
310 }; 310 };
311 311
312 #endif // XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_ 312 #endif // XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698