OLD | NEW |
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 FX_BOOL bEnd); | 138 FX_BOOL bEnd); |
139 void ReplaceWidthEllipsis(); | 139 void ReplaceWidthEllipsis(); |
140 void DoAlignment(const CFX_RectF& rect); | 140 void DoAlignment(const CFX_RectF& rect); |
141 void OnDraw(const CFX_RectF& rtClip); | 141 void OnDraw(const CFX_RectF& rtClip); |
142 int32_t GetDisplayPos(FDE_LPTTOPIECE pPiece); | 142 int32_t GetDisplayPos(FDE_LPTTOPIECE pPiece); |
143 int32_t GetCharRects(FDE_LPTTOPIECE pPiece); | 143 int32_t GetCharRects(FDE_LPTTOPIECE pPiece); |
144 | 144 |
145 void ToTextRun(const FDE_LPTTOPIECE pPiece, FX_TXTRUN& tr); | 145 void ToTextRun(const FDE_LPTTOPIECE pPiece, FX_TXTRUN& tr); |
146 void DrawLine(const FDE_LPTTOPIECE pPiece, CFDE_Pen*& pPen); | 146 void DrawLine(const FDE_LPTTOPIECE pPiece, CFDE_Pen*& pPen); |
147 | 147 |
148 IFX_TxtBreak* m_pTxtBreak; | 148 CFX_TxtBreak* m_pTxtBreak; |
149 IFX_Font* m_pFont; | 149 IFX_Font* m_pFont; |
150 FX_FLOAT m_fFontSize; | 150 FX_FLOAT m_fFontSize; |
151 FX_FLOAT m_fLineSpace; | 151 FX_FLOAT m_fLineSpace; |
152 FX_FLOAT m_fLinePos; | 152 FX_FLOAT m_fLinePos; |
153 FX_FLOAT m_fTolerance; | 153 FX_FLOAT m_fTolerance; |
154 int32_t m_iAlignment; | 154 int32_t m_iAlignment; |
155 int32_t m_iTxtBkAlignment; | 155 int32_t m_iTxtBkAlignment; |
156 int32_t* m_pCharWidths; | 156 int32_t* m_pCharWidths; |
157 int32_t m_iChars; | 157 int32_t m_iChars; |
158 int32_t* m_pEllCharWidths; | 158 int32_t* m_pEllCharWidths; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 m_dwTxtBkStyles(0), | 202 m_dwTxtBkStyles(0), |
203 m_bElliChanged(FALSE), | 203 m_bElliChanged(FALSE), |
204 m_iEllipsisWidth(0), | 204 m_iEllipsisWidth(0), |
205 m_ttoLines(5), | 205 m_ttoLines(5), |
206 m_iCurLine(0), | 206 m_iCurLine(0), |
207 m_iCurPiece(0), | 207 m_iCurPiece(0), |
208 m_iTotalLines(0), | 208 m_iTotalLines(0), |
209 m_pCharPos(NULL), | 209 m_pCharPos(NULL), |
210 m_iCharPosSize(0), | 210 m_iCharPosSize(0), |
211 m_pRenderDevice(NULL) { | 211 m_pRenderDevice(NULL) { |
212 m_pTxtBreak = IFX_TxtBreak::Create(FX_TXTBREAKPOLICY_None); | 212 m_pTxtBreak = new CFX_TxtBreak(FX_TXTBREAKPOLICY_None); |
213 FXSYS_assert(m_pTxtBreak != NULL); | |
214 m_Matrix.SetIdentity(); | 213 m_Matrix.SetIdentity(); |
215 m_rtClip.Reset(); | 214 m_rtClip.Reset(); |
216 m_rtLogicClip.Reset(); | 215 m_rtLogicClip.Reset(); |
217 } | 216 } |
218 CFDE_TextOut::~CFDE_TextOut() { | 217 CFDE_TextOut::~CFDE_TextOut() { |
219 if (m_pTxtBreak) { | 218 if (m_pTxtBreak) { |
220 m_pTxtBreak->Release(); | 219 m_pTxtBreak->Release(); |
221 } | 220 } |
222 FX_Free(m_pCharWidths); | 221 FX_Free(m_pCharWidths); |
223 FX_Free(m_pEllCharWidths); | 222 FX_Free(m_pEllCharWidths); |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 return NULL; | 1104 return NULL; |
1106 } | 1105 } |
1107 return m_pieces.GetPtrAt(index); | 1106 return m_pieces.GetPtrAt(index); |
1108 } | 1107 } |
1109 void CFDE_TTOLine::RemoveLast(int32_t iCount) { | 1108 void CFDE_TTOLine::RemoveLast(int32_t iCount) { |
1110 m_pieces.RemoveLast(iCount); | 1109 m_pieces.RemoveLast(iCount); |
1111 } | 1110 } |
1112 void CFDE_TTOLine::RemoveAll(FX_BOOL bLeaveMemory) { | 1111 void CFDE_TTOLine::RemoveAll(FX_BOOL bLeaveMemory) { |
1113 m_pieces.RemoveAll(bLeaveMemory); | 1112 m_pieces.RemoveAll(bLeaveMemory); |
1114 } | 1113 } |
OLD | NEW |