diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-25 20:28:01 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-25 20:28:01 +0000 |
commit | 3a5d4c44a8829662ac1258ad7b08f5a843c4a13d (patch) | |
tree | 5ced89ef19f76c86850b9692b3859d9b7d17185b /printing | |
parent | 749e8d645403bdef7846318d60cb713baf76a369 (diff) | |
download | chromium_src-3a5d4c44a8829662ac1258ad7b08f5a843c4a13d.zip chromium_src-3a5d4c44a8829662ac1258ad7b08f5a843c4a13d.tar.gz chromium_src-3a5d4c44a8829662ac1258ad7b08f5a843c4a13d.tar.bz2 |
default is a keyword in C++, don't use it as variable name.
BUG=82385
R=kmadhusu@chromium.org
Review URL: https://codereview.chromium.org/356803002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279798 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r-- | printing/backend/win_helper.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/printing/backend/win_helper.cc b/printing/backend/win_helper.cc index 075913e..ac5892b 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(); } |