Commit 9c970fc7 authored by Shimi Zhang's avatar Shimi Zhang Committed by Commit Bot

[Printing] Remove unnecessary Round() function

There is no need to keep this function since printing/units.h has such
conversion already.

R=thestig

Bug: None
Change-Id: Ib6164b40d5f8a6b812b7ebc2f81942403eb3926a
Reviewed-on: https://chromium-review.googlesource.com/1255604Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595591}
parent 36aebfaa
...@@ -28,10 +28,6 @@ namespace printing { ...@@ -28,10 +28,6 @@ namespace printing {
namespace { namespace {
int Round(double x) {
return static_cast<int>(x + 0.5);
}
// Sets the page sizes for a |PrintSettings| object. |width| and |height| // Sets the page sizes for a |PrintSettings| object. |width| and |height|
// arguments should be in device units. // arguments should be in device units.
void SetSizes(PrintSettings* settings, int dpi, int width, int height) { void SetSizes(PrintSettings* settings, int dpi, int width, int height) {
...@@ -128,8 +124,8 @@ void PrintingContextAndroid::AskUserForSettingsReply( ...@@ -128,8 +124,8 @@ void PrintingContextAndroid::AskUserForSettingsReply(
int dpi = Java_PrintingContext_getDpi(env, j_printing_context_); int dpi = Java_PrintingContext_getDpi(env, j_printing_context_);
int width = Java_PrintingContext_getWidth(env, j_printing_context_); int width = Java_PrintingContext_getWidth(env, j_printing_context_);
int height = Java_PrintingContext_getHeight(env, j_printing_context_); int height = Java_PrintingContext_getHeight(env, j_printing_context_);
width = Round(ConvertUnitDouble(width, kMilsPerInch, 1.0) * dpi); width = ConvertUnit(width, kMilsPerInch, dpi);
height = Round(ConvertUnitDouble(height, kMilsPerInch, 1.0) * dpi); height = ConvertUnit(height, kMilsPerInch, dpi);
SetSizes(&settings_, dpi, width, height); SetSizes(&settings_, dpi, width, height);
std::move(callback_).Run(OK); std::move(callback_).Run(OK);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment