summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-01-11 11:59:17 -0800
committerLei Zhang <thestig@chromium.org>2016-01-11 11:59:17 -0800
commit375a86403b7fa8d17d7b142c270e2d8e33bb924f (patch)
tree1db1ffddb2bbbcd429cd1d7954b1949bfa54e1ab /fpdfsdk/src/pdfwindow/PWL_Utils.cpp
parent492961df3011ccc25646eae12ac6e6dcfe7f26da (diff)
downloadpdfium-375a86403b7fa8d17d7b142c270e2d8e33bb924f.tar.xz
Merge to XFA: Switch most min/max macros to std::min/max.
Fix lint errors along the way. R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1567343002 . (cherry picked from commit 9adfbb0920a258e916003b1ee9515e97879db82a) Review URL: https://codereview.chromium.org/1577503002 .
Diffstat (limited to 'fpdfsdk/src/pdfwindow/PWL_Utils.cpp')
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Utils.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
index 3b0f3beff9..27ba8bc99f 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
@@ -4,8 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "fpdfsdk/include/pdfwindow/PWL_Icon.h"
#include "fpdfsdk/include/pdfwindow/PWL_Utils.h"
+
+#include <algorithm>
+
+#include "fpdfsdk/include/pdfwindow/PWL_Icon.h"
#include "fpdfsdk/include/pdfwindow/PWL_Wnd.h"
#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
@@ -1256,7 +1259,7 @@ void CPWL_Utils::ConvertCMYK2GRAY(FX_FLOAT dC,
if (dC < 0 || dC > 1 || dM < 0 || dM > 1 || dY < 0 || dY > 1 || dK < 0 ||
dK > 1)
return;
- dGray = 1.0f - FX_MIN(1.0f, 0.3f * dC + 0.59f * dM + 0.11f * dY + dK);
+ dGray = 1.0f - std::min(1.0f, 0.3f * dC + 0.59f * dM + 0.11f * dY + dK);
}
void CPWL_Utils::ConvertGRAY2CMYK(FX_FLOAT dGray,
@@ -1302,9 +1305,9 @@ void CPWL_Utils::ConvertCMYK2RGB(FX_FLOAT dC,
if (dC < 0 || dC > 1 || dM < 0 || dM > 1 || dY < 0 || dY > 1 || dK < 0 ||
dK > 1)
return;
- dR = 1.0f - FX_MIN(1.0f, dC + dK);
- dG = 1.0f - FX_MIN(1.0f, dM + dK);
- dB = 1.0f - FX_MIN(1.0f, dY + dK);
+ dR = 1.0f - std::min(1.0f, dC + dK);
+ dG = 1.0f - std::min(1.0f, dM + dK);
+ dB = 1.0f - std::min(1.0f, dY + dK);
}
void CPWL_Utils::ConvertRGB2CMYK(FX_FLOAT dR,
@@ -1320,7 +1323,7 @@ void CPWL_Utils::ConvertRGB2CMYK(FX_FLOAT dR,
dC = 1.0f - dR;
dM = 1.0f - dG;
dY = 1.0f - dB;
- dK = FX_MIN(dC, FX_MIN(dM, dY));
+ dK = std::min(dC, std::min(dM, dY));
}
void CPWL_Utils::PWLColorToARGB(const CPWL_Color& color,