Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Unified Diff: xfa/fde/tto/fde_textout.cpp

Issue 1881803003: Remove IFDE_Pen and IFDE_Brush. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fde/fde_visualset.h ('k') | xfa/fxfa/app/xfa_textlayout.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fde/tto/fde_textout.cpp
diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp
index 49d3abb8ab1883630740c3b3e0e557acd73a0a5d..265db253fc81bf3bc0bd188420311832ca47fb25 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);
« no previous file with comments | « xfa/fde/fde_visualset.h ('k') | xfa/fxfa/app/xfa_textlayout.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698