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