summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fpdfsdk/include/formfiller/FFL_Utils.h3
-rw-r--r--fpdfsdk/src/formfiller/FFL_Utils.cpp31
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;