Skip to content

Commit

Permalink
Remove unused printing unit conversion functions.
Browse files Browse the repository at this point in the history
Change-Id: I4a325218a3db80731e1a110e1beab38ecc071530
Reviewed-on: https://chromium-review.googlesource.com/1111678
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569764}
  • Loading branch information
leizleiz authored and Commit Bot committed Jun 22, 2018
1 parent dcdd42d commit f2f7de3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
12 changes: 0 additions & 12 deletions printing/units.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ double ConvertUnitDouble(double value, double old_unit, double new_unit) {
return value * new_unit / old_unit;
}

int ConvertMilliInchToHundredThousanthMeter(int milli_inch) {
// 1" == 25.4 mm
// 1" == 25400 um
// 0.001" == 25.4 um
// 0.001" == 2.54 cmm
return ConvertUnit(milli_inch, 100, 254);
}

int ConvertHundredThousanthMeterToMilliInch(int cmm) {
return ConvertUnit(cmm, 254, 100);
}

int ConvertPixelsToPoint(int pixels) {
return ConvertUnit(pixels, kPixelsPerInch, kPointsPerInch);
}
Expand Down
6 changes: 0 additions & 6 deletions printing/units.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ PRINTING_EXPORT int ConvertUnit(double value, int old_unit, int new_unit);
PRINTING_EXPORT double ConvertUnitDouble(double value, double old_unit,
double new_unit);

// Converts from 0.001 inch unit to 0.00001 meter.
PRINTING_EXPORT int ConvertMilliInchToHundredThousanthMeter(int milli_inch);

// Converts from 0.00001 meter unit to 0.001 inch.
PRINTING_EXPORT int ConvertHundredThousanthMeterToMilliInch(int cmm);

// Converts from 1 pixel to 1 point using integers.
PRINTING_EXPORT int ConvertPixelsToPoint(int pixels);

Expand Down
9 changes: 0 additions & 9 deletions printing/units_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@ TEST(UnitsTest, Convertions) {
EXPECT_DOUBLE_EQ(0.000002, ConvertUnitDouble(2, 1000, 0.001));
EXPECT_EQ(2000000, ConvertUnitDouble(2, 0.001, 1000));

EXPECT_EQ(kHundrethsMMPerInch, ConvertMilliInchToHundredThousanthMeter(1000));
EXPECT_EQ(-kHundrethsMMPerInch,
ConvertMilliInchToHundredThousanthMeter(-1000));
EXPECT_EQ(0, ConvertMilliInchToHundredThousanthMeter(0));
EXPECT_EQ(1000, ConvertHundredThousanthMeterToMilliInch(kHundrethsMMPerInch));
EXPECT_EQ(-1000,
ConvertHundredThousanthMeterToMilliInch(-kHundrethsMMPerInch));
EXPECT_EQ(0, ConvertHundredThousanthMeterToMilliInch(0));

EXPECT_EQ(8.25, ConvertPixelsToPointDouble(11.0));
// Round down.
EXPECT_EQ(8, ConvertPixelsToPoint(11));
Expand Down

0 comments on commit f2f7de3

Please sign in to comment.