summaryrefslogtreecommitdiff
path: root/xfa/fde/tto
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-12 13:19:36 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-12 13:19:36 -0700
commita5c1323ae6a2379fb5fe3ddea4c223fccd0c41b0 (patch)
treeaccc30b91dd79d90921b13ae430d17f4a51a737f /xfa/fde/tto
parent6b19ec629d32e872d2e430987526162b2954b851 (diff)
downloadpdfium-a5c1323ae6a2379fb5fe3ddea4c223fccd0c41b0.tar.xz
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
Diffstat (limited to 'xfa/fde/tto')
-rw-r--r--xfa/fde/tto/fde_textout.cpp18
1 files changed, 6 insertions, 12 deletions
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);