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

Side by Side Diff: core/src/fxge/win32/fx_win32_print.cpp

Issue 1192743004: Cleanup: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
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 "../../../include/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ 8 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_
9 #include <windows.h> 9 #include <windows.h>
10 #include "../../../include/fxge/fx_ge_win32.h" 10 #include "../../../include/fxge/fx_ge_win32.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 266 }
267 } 267 }
268 CPSPrinterDriver::CPSPrinterDriver() 268 CPSPrinterDriver::CPSPrinterDriver()
269 { 269 {
270 m_pPSOutput = NULL; 270 m_pPSOutput = NULL;
271 m_bCmykOutput = FALSE; 271 m_bCmykOutput = FALSE;
272 } 272 }
273 CPSPrinterDriver::~CPSPrinterDriver() 273 CPSPrinterDriver::~CPSPrinterDriver()
274 { 274 {
275 EndRendering(); 275 EndRendering();
276 if (m_pPSOutput) { 276 delete m_pPSOutput;
277 delete m_pPSOutput;
278 }
279 } 277 }
280 FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput) 278 FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput)
281 { 279 {
282 m_hDC = hDC; 280 m_hDC = hDC;
283 m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE); 281 m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE);
284 m_VertSize = ::GetDeviceCaps(m_hDC, VERTSIZE); 282 m_VertSize = ::GetDeviceCaps(m_hDC, VERTSIZE);
285 m_Width = ::GetDeviceCaps(m_hDC, HORZRES); 283 m_Width = ::GetDeviceCaps(m_hDC, HORZRES);
286 m_Height = ::GetDeviceCaps(m_hDC, VERTRES); 284 m_Height = ::GetDeviceCaps(m_hDC, VERTRES);
287 m_nBitsPerPixel = ::GetDeviceCaps(m_hDC, BITSPIXEL); 285 m_nBitsPerPixel = ::GetDeviceCaps(m_hDC, BITSPIXEL);
288 m_pPSOutput = new CPSOutput(hDC); 286 m_pPSOutput = new CPSOutput(hDC);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 handle = NULL; 403 handle = NULL;
406 return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_ flag, pIccTransform); 404 return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_ flag, pIccTransform);
407 } 405 }
408 FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pChar Pos, CFX_Font* pFont, 406 FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pChar Pos, CFX_Font* pFont,
409 CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color, 407 CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
410 int alpha_flag, void* pIccTransform) 408 int alpha_flag, void* pIccTransform)
411 { 409 {
412 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device , font_size, color, alpha_flag, pIccTransform); 410 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device , font_size, color, alpha_flag, pIccTransform);
413 } 411 }
414 #endif 412 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698