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

Side by Side Diff: xfa/fxfa/app/cxfa_textlayout.h

Issue 2631703003: Avoid endless loop deleting CFGAS_GEFont. (Closed)
Patch Set: rebase 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
« no previous file with comments | « xfa/fxfa/app/cxfa_pieceline.cpp ('k') | xfa/fxfa/app/cxfa_textlayout.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 PDFium Authors. All rights reserved. 1 // Copyright 2017 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_FXFA_APP_CXFA_TEXTLAYOUT_H_ 7 #ifndef XFA_FXFA_APP_CXFA_TEXTLAYOUT_H_
8 #define XFA_FXFA_APP_CXFA_TEXTLAYOUT_H_ 8 #define XFA_FXFA_APP_CXFA_TEXTLAYOUT_H_
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector>
11 12
12 #include "core/fxcrt/fx_basic.h" 13 #include "core/fxcrt/fx_basic.h"
13 #include "core/fxcrt/fx_coordinates.h" 14 #include "core/fxcrt/fx_coordinates.h"
14 #include "core/fxcrt/fx_string.h" 15 #include "core/fxcrt/fx_string.h"
15 #include "xfa/fde/css/fde_css.h" 16 #include "xfa/fde/css/fde_css.h"
16 #include "xfa/fgas/layout/fgas_rtfbreak.h" 17 #include "xfa/fgas/layout/fgas_rtfbreak.h"
17 #include "xfa/fxfa/app/cxfa_textparser.h" 18 #include "xfa/fxfa/app/cxfa_textparser.h"
18 19
19 class CFDE_Brush; 20 class CFDE_Brush;
20 class CFDE_CSSComputedStyle; 21 class CFDE_CSSComputedStyle;
(...skipping 24 matching lines...) Expand all
45 46
46 bool CalcSize(const CFX_SizeF& minSize, 47 bool CalcSize(const CFX_SizeF& minSize,
47 const CFX_SizeF& maxSize, 48 const CFX_SizeF& maxSize,
48 CFX_SizeF& defaultSize); 49 CFX_SizeF& defaultSize);
49 bool Layout(const CFX_SizeF& size, FX_FLOAT* fHeight = nullptr); 50 bool Layout(const CFX_SizeF& size, FX_FLOAT* fHeight = nullptr);
50 void ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex); 51 void ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex);
51 bool DrawString(CFX_RenderDevice* pFxDevice, 52 bool DrawString(CFX_RenderDevice* pFxDevice,
52 const CFX_Matrix& tmDoc2Device, 53 const CFX_Matrix& tmDoc2Device,
53 const CFX_RectF& rtClip, 54 const CFX_RectF& rtClip,
54 int32_t iBlock = 0); 55 int32_t iBlock = 0);
55 bool IsLoaded() const { return m_pieceLines.GetSize() > 0; } 56 bool IsLoaded() const { return !m_pieceLines.empty(); }
56 void Unload(); 57 void Unload();
57 const CFX_ArrayTemplate<CXFA_PieceLine*>* GetPieceLines(); 58 const std::vector<std::unique_ptr<CXFA_PieceLine>>* GetPieceLines() const {
59 return &m_pieceLines;
60 }
58 61
59 bool m_bHasBlock; 62 bool m_bHasBlock;
60 CFX_Int32Array m_Blocks; 63 CFX_Int32Array m_Blocks;
61 64
62 private: 65 private:
63 void GetTextDataNode(); 66 void GetTextDataNode();
64 CFDE_XMLNode* GetXMLContainerNode(); 67 CFDE_XMLNode* GetXMLContainerNode();
65 CFX_RTFBreak* CreateBreak(bool bDefault); 68 CFX_RTFBreak* CreateBreak(bool bDefault);
66 void InitBreak(FX_FLOAT fLineWidth); 69 void InitBreak(FX_FLOAT fLineWidth);
67 void InitBreak(CFDE_CSSComputedStyle* pStyle, 70 void InitBreak(CFDE_CSSComputedStyle* pStyle,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 const CFX_Matrix& tmDoc2Device); 108 const CFX_Matrix& tmDoc2Device);
106 void RenderPath(CFDE_RenderDevice* pDevice, 109 void RenderPath(CFDE_RenderDevice* pDevice,
107 CFDE_Pen* pPen, 110 CFDE_Pen* pPen,
108 CXFA_PieceLine* pPieceLine, 111 CXFA_PieceLine* pPieceLine,
109 int32_t iPiece, 112 int32_t iPiece,
110 FXTEXT_CHARPOS* pCharPos, 113 FXTEXT_CHARPOS* pCharPos,
111 const CFX_Matrix& tmDoc2Device); 114 const CFX_Matrix& tmDoc2Device);
112 int32_t GetDisplayPos(const XFA_TextPiece* pPiece, 115 int32_t GetDisplayPos(const XFA_TextPiece* pPiece,
113 FXTEXT_CHARPOS* pCharPos, 116 FXTEXT_CHARPOS* pCharPos,
114 bool bCharCode = false); 117 bool bCharCode = false);
115 bool ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ& tr); 118 bool ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ* tr);
116 void DoTabstops(CFDE_CSSComputedStyle* pStyle, CXFA_PieceLine* pPieceLine); 119 void DoTabstops(CFDE_CSSComputedStyle* pStyle, CXFA_PieceLine* pPieceLine);
117 bool Layout(int32_t iBlock); 120 bool Layout(int32_t iBlock);
118 int32_t CountBlocks() const; 121 int32_t CountBlocks() const;
119 122
120 CXFA_TextProvider* m_pTextProvider; 123 CXFA_TextProvider* m_pTextProvider;
121 CXFA_Node* m_pTextDataNode; 124 CXFA_Node* m_pTextDataNode;
122 bool m_bRichText; 125 bool m_bRichText;
123 std::unique_ptr<CFX_RTFBreak> m_pBreak; 126 std::unique_ptr<CFX_RTFBreak> m_pBreak;
124 std::unique_ptr<CXFA_LoaderContext> m_pLoader; 127 std::unique_ptr<CXFA_LoaderContext> m_pLoader;
125 int32_t m_iLines; 128 int32_t m_iLines;
126 FX_FLOAT m_fMaxWidth; 129 FX_FLOAT m_fMaxWidth;
127 CXFA_TextParser m_textParser; 130 CXFA_TextParser m_textParser;
128 CFX_ArrayTemplate<CXFA_PieceLine*> m_pieceLines; 131 std::vector<std::unique_ptr<CXFA_PieceLine>> m_pieceLines;
129 std::unique_ptr<CXFA_TextTabstopsContext> m_pTabstopContext; 132 std::unique_ptr<CXFA_TextTabstopsContext> m_pTabstopContext;
130 bool m_bBlockContinue; 133 bool m_bBlockContinue;
131 }; 134 };
132 135
133 #endif // XFA_FXFA_APP_CXFA_TEXTLAYOUT_H_ 136 #endif // XFA_FXFA_APP_CXFA_TEXTLAYOUT_H_
OLDNEW
« no previous file with comments | « xfa/fxfa/app/cxfa_pieceline.cpp ('k') | xfa/fxfa/app/cxfa_textlayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698