diff options
author | Lei Zhang <thestig@chromium.org> | 2018-04-25 18:01:52 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-25 18:01:52 +0000 |
commit | 537f4c7b592a6981f9686297496cb23b461dfd5e (patch) | |
tree | af3ba90c5a64eaa24e252484c3484f9b8ed94d9b /core/fxge/win32/fx_win32_print.cpp | |
parent | 306b9a87090ba4c4cc8453ef04f230620e224fe0 (diff) | |
download | pdfium-537f4c7b592a6981f9686297496cb23b461dfd5e.tar.xz |
Use WindowsPrintMode in more places in place of ints.
Move WindowsPrintMode assertion into CPSPrinterDriver.
Change-Id: I570076b43751e052c5396e89a6674b83a4ad1a1e
Reviewed-on: https://pdfium-review.googlesource.com/31298
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/win32/fx_win32_print.cpp')
-rw-r--r-- | core/fxge/win32/fx_win32_print.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp index 66fbdd9b02..da40b8a762 100644 --- a/core/fxge/win32/fx_win32_print.cpp +++ b/core/fxge/win32/fx_win32_print.cpp @@ -328,8 +328,15 @@ bool CGdiPrinterDriver::DrawDeviceText(int nChars, #endif } -CPSPrinterDriver::CPSPrinterDriver(HDC hDC, int pslevel, bool bCmykOutput) +CPSPrinterDriver::CPSPrinterDriver(HDC hDC, + WindowsPrintMode mode, + bool bCmykOutput) : m_hDC(hDC), m_bCmykOutput(bCmykOutput) { + // |mode| should be PostScript. + ASSERT(mode == WindowsPrintMode::kModePostScript2 || + mode == WindowsPrintMode::kModePostScript3); + int pslevel = mode == WindowsPrintMode::kModePostScript2 ? 2 : 3; + m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE); m_VertSize = ::GetDeviceCaps(m_hDC, VERTSIZE); m_Width = ::GetDeviceCaps(m_hDC, HORZRES); |