| 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/fxfa/app/xfa_textlayout.h" | 7 #include "xfa/fxfa/app/xfa_textlayout.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "core/fxcrt/include/fx_ext.h" | 11 #include "core/fxcrt/include/fx_ext.h" |
| 12 #include "xfa/fde/css/fde_csscache.h" | 12 #include "xfa/fde/css/fde_csscache.h" |
| 13 #include "xfa/fde/fde_object.h" |
| 13 #include "xfa/fde/fde_pen.h" | 14 #include "xfa/fde/fde_pen.h" |
| 14 #include "xfa/fde/xml/fde_xml_imp.h" | 15 #include "xfa/fde/xml/fde_xml_imp.h" |
| 15 #include "xfa/fgas/crt/fgas_algorithm.h" | 16 #include "xfa/fgas/crt/fgas_algorithm.h" |
| 16 #include "xfa/fgas/crt/fgas_codepage.h" | 17 #include "xfa/fgas/crt/fgas_codepage.h" |
| 17 #include "xfa/fxfa/app/xfa_ffwidgetacc.h" | 18 #include "xfa/fxfa/app/xfa_ffwidgetacc.h" |
| 18 #include "xfa/fxfa/include/xfa_ffapp.h" | 19 #include "xfa/fxfa/include/xfa_ffapp.h" |
| 19 #include "xfa/fxfa/include/xfa_ffdoc.h" | 20 #include "xfa/fxfa/include/xfa_ffdoc.h" |
| 20 #include "xfa/fxfa/include/xfa_fontmgr.h" | 21 #include "xfa/fxfa/include/xfa_fontmgr.h" |
| 21 | 22 |
| 22 CXFA_CSSTagProvider::~CXFA_CSSTagProvider() { | 23 CXFA_CSSTagProvider::~CXFA_CSSTagProvider() { |
| (...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice, | 1216 FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice, |
| 1216 const CFX_Matrix& tmDoc2Device, | 1217 const CFX_Matrix& tmDoc2Device, |
| 1217 const CFX_RectF& rtClip, | 1218 const CFX_RectF& rtClip, |
| 1218 int32_t iBlock) { | 1219 int32_t iBlock) { |
| 1219 IFDE_RenderDevice* pDevice = IFDE_RenderDevice::Create(pFxDevice); | 1220 IFDE_RenderDevice* pDevice = IFDE_RenderDevice::Create(pFxDevice); |
| 1220 if (pDevice == NULL) { | 1221 if (pDevice == NULL) { |
| 1221 return FALSE; | 1222 return FALSE; |
| 1222 } | 1223 } |
| 1223 FDE_HDEVICESTATE state = pDevice->SaveState(); | 1224 FDE_HDEVICESTATE state = pDevice->SaveState(); |
| 1224 pDevice->SetClipRect(rtClip); | 1225 pDevice->SetClipRect(rtClip); |
| 1225 IFDE_SolidBrush* pSolidBrush = | 1226 IFDE_SolidBrush* pSolidBrush = new CFDE_SolidBrush; |
| 1226 (IFDE_SolidBrush*)IFDE_Brush::Create(FDE_BRUSHTYPE_Solid); | 1227 IFDE_Pen* pPen = new CFDE_Pen; |
| 1227 IFDE_Pen* pPen = IFDE_Pen::Create(); | |
| 1228 FXSYS_assert(pDevice); | 1228 FXSYS_assert(pDevice); |
| 1229 FXSYS_assert(pSolidBrush); | 1229 |
| 1230 FXSYS_assert(pPen); | |
| 1231 if (m_pieceLines.GetSize() == 0) { | 1230 if (m_pieceLines.GetSize() == 0) { |
| 1232 int32_t iBlockCount = CountBlocks(); | 1231 int32_t iBlockCount = CountBlocks(); |
| 1233 for (int32_t i = 0; i < iBlockCount; i++) { | 1232 for (int32_t i = 0; i < iBlockCount; i++) { |
| 1234 Layout(i); | 1233 Layout(i); |
| 1235 } | 1234 } |
| 1236 } | 1235 } |
| 1237 FXTEXT_CHARPOS* pCharPos = NULL; | 1236 FXTEXT_CHARPOS* pCharPos = NULL; |
| 1238 int32_t iCharCount = 0; | 1237 int32_t iCharCount = 0; |
| 1239 int32_t iLineStart = 0; | 1238 int32_t iLineStart = 0; |
| 1240 int32_t iPieceLines = m_pieceLines.GetSize(); | 1239 int32_t iPieceLines = m_pieceLines.GetSize(); |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1992 tr.iLength = iLength; | 1991 tr.iLength = iLength; |
| 1993 tr.fFontSize = pPiece->fFontSize; | 1992 tr.fFontSize = pPiece->fFontSize; |
| 1994 tr.iBidiLevel = pPiece->iBidiLevel; | 1993 tr.iBidiLevel = pPiece->iBidiLevel; |
| 1995 tr.iCharRotation = 0; | 1994 tr.iCharRotation = 0; |
| 1996 tr.wLineBreakChar = L'\n'; | 1995 tr.wLineBreakChar = L'\n'; |
| 1997 tr.iVerticalScale = pPiece->iVerScale; | 1996 tr.iVerticalScale = pPiece->iVerScale; |
| 1998 tr.dwLayoutStyles = FX_RTFLAYOUTSTYLE_ExpandTab; | 1997 tr.dwLayoutStyles = FX_RTFLAYOUTSTYLE_ExpandTab; |
| 1999 tr.iHorizontalScale = pPiece->iHorScale; | 1998 tr.iHorizontalScale = pPiece->iHorScale; |
| 2000 return TRUE; | 1999 return TRUE; |
| 2001 } | 2000 } |
| OLD | NEW |