Skip to content

Commit

Permalink
Use the existing PRINTPAGERANGE rather than allocating a new one.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
thestig@chromium.org committed Jan 20, 2011
1 parent bc669d1 commit 128bec3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
12 changes: 5 additions & 7 deletions printing/printing_context_win.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// 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.

#include "printing/printing_context_win.h"

#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"
Expand Down Expand Up @@ -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));
}
Expand Down
3 changes: 1 addition & 2 deletions printing/printing_context_win_unittest.cc
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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;

Expand Down
7 changes: 0 additions & 7 deletions tools/valgrind/drmemory/suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,5 @@ POSSIBLE LEAK
*!remoting::DecompressorZlib::InitStream
*!remoting::DecompressorZlib::Reset

# http://crbug.com/68307
POSSIBLE LEAK
...
*!PrintDlgExMock
...
*!PrintingContextTest_PrintAll_Test::TestBody

# Empty line at EOF - workaround for
# http://code.google.com/p/drmemory/issues/detail?id=41

0 comments on commit 128bec3

Please sign in to comment.