Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: fpdfsdk/pdfwindow/PWL_Utils.cpp

Issue 2326883002: CPWL_Color::ConvertColorType should compare current color type with the given convert color type. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/pdfwindow/PWL_Utils.cpp
diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp
index 823873f19dfeca9a314d2ad9e91e853746c086c8..0574454c4f95577ebfb42bdb20911e0c26350e0a 100644
--- a/fpdfsdk/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp
@@ -3308,12 +3308,15 @@ void CPWL_Utils::GetGraphics_Foxit(CFX_ByteString& sPathData,
GetPathDataFromArray(path, PathArray, 23);
}
-void CPWL_Color::ConvertColorType(int32_t other_nColorType) {
- switch (other_nColorType) {
+void CPWL_Color::ConvertColorType(int32_t nConvertColorType) {
+ if (nColorType == nConvertColorType)
+ return;
+
+ switch (nColorType) {
dsinclair 2016/09/09 00:09:26 Are we sure nColorType is the correct item for the
jaepark 2016/09/09 00:39:41 Since the inner switch is calling functions OUTER2
case COLORTYPE_TRANSPARENT:
break;
case COLORTYPE_GRAY:
- switch (other_nColorType) {
+ switch (nConvertColorType) {
case COLORTYPE_RGB:
CPWL_Utils::ConvertGRAY2RGB(fColor1, fColor1, fColor2, fColor3);
break;
@@ -3324,7 +3327,7 @@ void CPWL_Color::ConvertColorType(int32_t other_nColorType) {
}
break;
case COLORTYPE_RGB:
- switch (other_nColorType) {
+ switch (nConvertColorType) {
case COLORTYPE_GRAY:
CPWL_Utils::ConvertRGB2GRAY(fColor1, fColor2, fColor3, fColor1);
break;
@@ -3335,7 +3338,7 @@ void CPWL_Color::ConvertColorType(int32_t other_nColorType) {
}
break;
case COLORTYPE_CMYK:
- switch (other_nColorType) {
+ switch (nConvertColorType) {
case COLORTYPE_GRAY:
CPWL_Utils::ConvertCMYK2GRAY(fColor1, fColor2, fColor3, fColor4,
fColor1);
@@ -3347,5 +3350,5 @@ void CPWL_Color::ConvertColorType(int32_t other_nColorType) {
}
break;
}
- nColorType = other_nColorType;
+ nColorType = nConvertColorType;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698