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

Unified Diff: printing/backend/win_helper.cc

Issue 356803002: default is a keyword in C++, don't use it as variable name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/backend/win_helper.cc
diff --git a/printing/backend/win_helper.cc b/printing/backend/win_helper.cc
index 075913eed3e3bc92f5ea90778d47fbb57581633a..ac5892b8b5a2320e0e96ca2982ad254bab5996a8 100644
--- a/printing/backend/win_helper.cc
+++ b/printing/backend/win_helper.cc
@@ -432,39 +432,40 @@ scoped_ptr<DEVMODE, base::FreeDeleter> CreateDevModeWithColor(
HANDLE printer,
const base::string16& printer_name,
bool color) {
- scoped_ptr<DEVMODE, base::FreeDeleter> default = CreateDevMode(printer, NULL);
- if (!default)
- return default.Pass();
-
- if ((default->dmFields & DM_COLOR) &&
- ((default->dmColor == DMCOLOR_COLOR) == color)) {
- return default.Pass();
+ scoped_ptr<DEVMODE, base::FreeDeleter> default_ticket =
+ CreateDevMode(printer, NULL);
+ if (!default_ticket)
+ return default_ticket.Pass();
+
+ if ((default_ticket->dmFields & DM_COLOR) &&
+ ((default_ticket->dmColor == DMCOLOR_COLOR) == color)) {
+ return default_ticket.Pass();
}
- default->dmFields |= DM_COLOR;
- default->dmColor = color ? DMCOLOR_COLOR : DMCOLOR_MONOCHROME;
+ default_ticket->dmFields |= DM_COLOR;
+ default_ticket->dmColor = color ? DMCOLOR_COLOR : DMCOLOR_MONOCHROME;
DriverInfo6 info_6;
if (!info_6.Init(printer))
- return default.Pass();
+ return default_ticket.Pass();
const DRIVER_INFO_6* p = info_6.get();
// Only HP known to have issues.
if (!p->pszMfgName || wcscmp(p->pszMfgName, L"HP") != 0)
- return default.Pass();
+ return default_ticket.Pass();
// Need XPS for this workaround.
printing::ScopedXPSInitializer xps_initializer;
if (!xps_initializer.initialized())
- return default.Pass();
+ return default_ticket.Pass();
const char* xps_color = color ? kXpsTicketColor : kXpsTicketMonochrome;
std::string xps_ticket = base::StringPrintf(kXpsTicketTemplate, xps_color);
scoped_ptr<DEVMODE, base::FreeDeleter> ticket =
printing::XpsTicketToDevMode(printer_name, xps_ticket);
if (!ticket)
- return default.Pass();
+ return default_ticket.Pass();
return ticket.Pass();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698