From 25c223d1c3a662a0e69a5bf95083afbd5fa3cd97 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 12 Apr 2016 09:51:45 -0700 Subject: Only SolidBrush types are created, remove other brushes. We only ever create a CFDE_SolidBrush, there is nothing which creates Texture, Hatch or LinearGradient brushes. This Cl removes all the code that isn't used for SolidBrush. A followup Cl will rename SolidBrush to Brush and remove the Brush interface in favour of the concrete class. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1877383002 --- xfa/fxfa/app/xfa_textlayout.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp index 15625f2998..a15fb95925 100644 --- a/xfa/fxfa/app/xfa_textlayout.cpp +++ b/xfa/fxfa/app/xfa_textlayout.cpp @@ -10,6 +10,7 @@ #include "core/fxcrt/include/fx_ext.h" #include "xfa/fde/css/fde_csscache.h" +#include "xfa/fde/fde_object.h" #include "xfa/fde/fde_pen.h" #include "xfa/fde/xml/fde_xml_imp.h" #include "xfa/fgas/crt/fgas_algorithm.h" @@ -1222,12 +1223,10 @@ FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice, } FDE_HDEVICESTATE state = pDevice->SaveState(); pDevice->SetClipRect(rtClip); - IFDE_SolidBrush* pSolidBrush = - (IFDE_SolidBrush*)IFDE_Brush::Create(FDE_BRUSHTYPE_Solid); - IFDE_Pen* pPen = IFDE_Pen::Create(); + IFDE_SolidBrush* pSolidBrush = new CFDE_SolidBrush; + IFDE_Pen* pPen = new CFDE_Pen; FXSYS_assert(pDevice); - FXSYS_assert(pSolidBrush); - FXSYS_assert(pPen); + if (m_pieceLines.GetSize() == 0) { int32_t iBlockCount = CountBlocks(); for (int32_t i = 0; i < iBlockCount; i++) { -- cgit v1.2.3