diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-20 22:57:35 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-20 22:57:35 +0000 |
commit | 128bec3cd249be7675fec39d184da047d7fbab76 (patch) | |
tree | e43106dea3eeee586c22cb0e994df0fd49414246 /printing | |
parent | bc669d1f61befa7639d5cebb051bd4ccd85bee90 (diff) | |
download | chromium_src-128bec3cd249be7675fec39d184da047d7fbab76.zip chromium_src-128bec3cd249be7675fec39d184da047d7fbab76.tar.gz chromium_src-128bec3cd249be7675fec39d184da047d7fbab76.tar.bz2 |
Use the existing PRINTPAGERANGE rather than allocating a new one.
BUG=68307
TEST=Dr. Memory no longer complains.
Review URL: http://codereview.chromium.org/5998010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72032 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r-- | printing/printing_context_win.cc | 12 | ||||
-rw-r--r-- | printing/printing_context_win_unittest.cc | 3 |
2 files changed, 6 insertions, 9 deletions
diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc index 9afa511..c5130c0 100644 --- a/printing/printing_context_win.cc +++ b/printing/printing_context_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,7 +6,6 @@ #include <winspool.h> -#include "base/file_util.h" #include "base/i18n/file_util_icu.h" #include "base/i18n/time_formatting.h" #include "base/message_loop.h" @@ -188,12 +187,11 @@ void PrintingContextWin::AskUserForSettings(HWND view, dialog_options.Flags |= PD_NOPAGENUMS; } - { - if ((*print_dialog_func_)(&dialog_options) != S_OK) { - ResetSettings(); - callback->Run(FAILED); - } + if ((*print_dialog_func_)(&dialog_options) != S_OK) { + ResetSettings(); + callback->Run(FAILED); } + // TODO(maruel): Support PD_PRINTTOFILE. callback->Run(ParseDialogResultEx(dialog_options)); } diff --git a/printing/printing_context_win_unittest.cc b/printing/printing_context_win_unittest.cc index 874c62d..802ba44 100644 --- a/printing/printing_context_win_unittest.cc +++ b/printing/printing_context_win_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -38,7 +38,6 @@ HRESULT WINAPI PrintDlgExMock(LPPRINTDLGEX lppd) { // Pretend the page range is 1-5, but since lppd->Flags does not have // PD_SELECTION set, this really shouldn't matter. lppd->nPageRanges = 1; - lppd->lpPageRanges = new PRINTPAGERANGE[1]; lppd->lpPageRanges[0].nFromPage = 1; lppd->lpPageRanges[0].nToPage = 5; |