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

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

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 4 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
« no previous file with comments | « core/src/fxge/win32/fx_win32_device.cpp ('k') | fpdfsdk/src/fsdk_actionhandler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 handle = NULL; 276 handle = NULL;
277 return ret; 277 return ret;
278 } 278 }
279 return FALSE; 279 return FALSE;
280 } 280 }
281 CPSOutput::CPSOutput(HDC hDC) { 281 CPSOutput::CPSOutput(HDC hDC) {
282 m_hDC = hDC; 282 m_hDC = hDC;
283 m_pBuf = NULL; 283 m_pBuf = NULL;
284 } 284 }
285 CPSOutput::~CPSOutput() { 285 CPSOutput::~CPSOutput() {
286 if (m_pBuf) { 286 FX_Free(m_pBuf);
287 FX_Free(m_pBuf);
288 }
289 } 287 }
290 void CPSOutput::Init() { 288 void CPSOutput::Init() {
291 m_pBuf = FX_Alloc(FX_CHAR, 1026); 289 m_pBuf = FX_Alloc(FX_CHAR, 1026);
292 } 290 }
293 void CPSOutput::OutputPS(const FX_CHAR* string, int len) { 291 void CPSOutput::OutputPS(const FX_CHAR* string, int len) {
294 if (len < 0) { 292 if (len < 0) {
295 len = (int)FXSYS_strlen(string); 293 len = (int)FXSYS_strlen(string);
296 } 294 }
297 int sent_len = 0; 295 int sent_len = 0;
298 while (len > 0) { 296 while (len > 0) {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 CFX_FontCache* pCache, 466 CFX_FontCache* pCache,
469 const CFX_AffineMatrix* pObject2Device, 467 const CFX_AffineMatrix* pObject2Device,
470 FX_FLOAT font_size, 468 FX_FLOAT font_size,
471 FX_DWORD color, 469 FX_DWORD color,
472 int alpha_flag, 470 int alpha_flag,
473 void* pIccTransform) { 471 void* pIccTransform) {
474 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device, 472 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device,
475 font_size, color, alpha_flag, pIccTransform); 473 font_size, color, alpha_flag, pIccTransform);
476 } 474 }
477 #endif 475 #endif
OLDNEW
« no previous file with comments | « core/src/fxge/win32/fx_win32_device.cpp ('k') | fpdfsdk/src/fsdk_actionhandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698