From a5c1323ae6a2379fb5fe3ddea4c223fccd0c41b0 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 12 Apr 2016 13:19:36 -0700 Subject: Remove IFDE_Pen and IFDE_Brush. This Cl removes the two interfaces and renames CFDE_SolidBrush to CFDE_Brush. Uncalled methods are removed from both CFDE_Brush and CFDE_Pen and code simplified to match. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1881803003 --- xfa/fde/tto/fde_textout.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'xfa/fde/tto/fde_textout.cpp') diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp index 49d3abb8ab..265db253fc 100644 --- a/xfa/fde/tto/fde_textout.cpp +++ b/xfa/fde/tto/fde_textout.cpp @@ -10,9 +10,7 @@ #include "core/fxcrt/include/fx_coordinates.h" #include "core/fxcrt/include/fx_system.h" -#include "xfa/fde/fde_brush.h" #include "xfa/fde/fde_object.h" -#include "xfa/fde/fde_pen.h" #include "xfa/fde/fde_renderdevice.h" #include "xfa/fgas/crt/fgas_memory.h" #include "xfa/fgas/crt/fgas_utils.h" @@ -145,7 +143,7 @@ class CFDE_TextOut : public IFDE_TextOut, public CFX_Target { int32_t GetCharRects(FDE_LPTTOPIECE pPiece); void ToTextRun(const FDE_LPTTOPIECE pPiece, FX_TXTRUN& tr); - void DrawLine(const FDE_LPTTOPIECE pPiece, IFDE_Pen*& pPen); + void DrawLine(const FDE_LPTTOPIECE pPiece, CFDE_Pen*& pPen); IFX_TxtBreak* m_pTxtBreak; IFX_Font* m_pFont; @@ -951,9 +949,9 @@ void CFDE_TextOut::OnDraw(const CFX_RectF& rtClip) { if (iLines < 1) { return; } - IFDE_SolidBrush* pBrush = new CFDE_SolidBrush; + CFDE_Brush* pBrush = new CFDE_Brush; pBrush->SetColor(m_TxtColor); - IFDE_Pen* pPen = NULL; + CFDE_Pen* pPen = NULL; FDE_HDEVICESTATE hDev = m_pRenderDevice->SaveState(); if (rtClip.Width() > 0.0f && rtClip.Height() > 0.0f) { m_pRenderDevice->SetClipRect(rtClip); @@ -975,12 +973,8 @@ void CFDE_TextOut::OnDraw(const CFX_RectF& rtClip) { } } m_pRenderDevice->RestoreState(hDev); - if (pBrush) { - pBrush->Release(); - } - if (pPen) { - pPen->Release(); - } + delete pBrush; + delete pPen; } int32_t CFDE_TextOut::GetDisplayPos(FDE_LPTTOPIECE pPiece) { FX_TXTRUN tr; @@ -1008,7 +1002,7 @@ void CFDE_TextOut::ToTextRun(const FDE_LPTTOPIECE pPiece, FX_TXTRUN& tr) { tr.wLineBreakChar = m_wParagraphBkChar; tr.pRect = &pPiece->rtPiece; } -void CFDE_TextOut::DrawLine(const FDE_LPTTOPIECE pPiece, IFDE_Pen*& pPen) { +void CFDE_TextOut::DrawLine(const FDE_LPTTOPIECE pPiece, CFDE_Pen*& pPen) { FX_BOOL bUnderLine = !!(m_dwStyles & FDE_TTOSTYLE_Underline); FX_BOOL bStrikeOut = !!(m_dwStyles & FDE_TTOSTYLE_Strikeout); FX_BOOL bHotKey = !!(m_dwStyles & FDE_TTOSTYLE_HotKey); -- cgit v1.2.3