diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-04-08 08:29:46 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-04-08 08:29:46 -0700 |
commit | 564be8ebf756c641be8ccacae6cb8f4fed8c4b58 (patch) | |
tree | a8e22af9bd40e9dc7f3f119812db06f0e4f79a55 /fpdfsdk | |
parent | c851dbd549edcd211dc1e9e5f70c740abaa4933f (diff) | |
download | pdfium-564be8ebf756c641be8ccacae6cb8f4fed8c4b58.tar.xz |
FFL_MIN and FFL_MAX are pointless and stupid.
Kill some nearby dead code while I'm at it.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1064283002
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/include/formfiller/FFL_Utils.h | 3 | ||||
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_Utils.cpp | 31 |
2 files changed, 6 insertions, 28 deletions
diff --git a/fpdfsdk/include/formfiller/FFL_Utils.h b/fpdfsdk/include/formfiller/FFL_Utils.h index 4b77aa222e..c5ac2a2b87 100644 --- a/fpdfsdk/include/formfiller/FFL_Utils.h +++ b/fpdfsdk/include/formfiller/FFL_Utils.h @@ -9,9 +9,6 @@ #define FFL_BASE_USERUNIT 1.0f / 72.0f -template<class T> T FFL_MIN (const T & i, const T & j) { return ((i < j) ? i : j); } -template<class T> T FFL_MAX (const T & i, const T & j) { return ((i > j) ? i : j); } - class CFFL_Utils { public: diff --git a/fpdfsdk/src/formfiller/FFL_Utils.cpp b/fpdfsdk/src/formfiller/FFL_Utils.cpp index 3ea78918be..196102bfb4 100644 --- a/fpdfsdk/src/formfiller/FFL_Utils.cpp +++ b/fpdfsdk/src/formfiller/FFL_Utils.cpp @@ -4,6 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include <algorithm> + #include "../../include/formfiller/FormFiller.h" #include "../../include/formfiller/FFL_Utils.h" @@ -11,10 +13,10 @@ CPDF_Rect CFFL_Utils::MaxRect(const CPDF_Rect & rect1,const CPDF_Rect & rect2) { CPDF_Rect rcRet; - rcRet.left = FFL_MIN(rect1.left,rect2.left); - rcRet.bottom = FFL_MIN(rect1.bottom,rect2.bottom); - rcRet.right = FFL_MAX(rect1.right,rect2.right); - rcRet.top = FFL_MAX(rect1.top,rect2.top); + rcRet.left = std::min(rect1.left, rect2.left); + rcRet.bottom = std::min(rect1.bottom, rect2.bottom); + rcRet.right = std::max(rect1.right, rect2.right); + rcRet.top = std::max(rect1.top, rect2.top); return rcRet; } @@ -39,27 +41,6 @@ CPDF_Rect CFFL_Utils::DeflateRect(const CPDF_Rect & crRect,const FX_FLOAT & fSiz return crNew; } -/* -FX_BOOL CFFL_Utils::RectContainsRect(const CPDF_Rect & father,const CPDF_Rect & son) -{ - return (father.left <= son.left && father.right >= son.right && - father.bottom <= son.bottom && father.top >= son.top); - -} - -FX_BOOL CFFL_Utils::RectContainsPoint(const CPDF_Rect & father,const CPDF_Point & son) -{ - return (father.left <= son.x && father.right >= son.x && - father.bottom <= son.y && father.top >= son.y); -} - -FX_BOOL CFFL_Utils::RectContainsXY(const CPDF_Rect & father,FX_FLOAT x,FX_FLOAT y) -{ - return (father.left <= x && father.right >= x && - father.bottom <= y && father.top >= y); -} -*/ - FX_BOOL CFFL_Utils::TraceObject(CPDF_Object* pObj) { if (!pObj) return FALSE; |