summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/formfiller/FFL_Utils.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-07 16:58:02 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-07 16:58:02 -0700
commit8d4210712a1b112d9118b7a592e0e09ad838476f (patch)
tree04d689c5d9be10d1cb1721023e297bf9d6dce1dc /fpdfsdk/src/formfiller/FFL_Utils.cpp
parent34f5fc0f2a18ab03613dc6ecaf4668392d0b4423 (diff)
downloadpdfium-8d4210712a1b112d9118b7a592e0e09ad838476f.tar.xz
Land on master: FFL_MIN and FFL_MAX are pointless and stupid.
Original CL was accidentally based off of XFA. This CL is off of master. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1069553002
Diffstat (limited to 'fpdfsdk/src/formfiller/FFL_Utils.cpp')
-rw-r--r--fpdfsdk/src/formfiller/FFL_Utils.cpp31
1 files changed, 6 insertions, 25 deletions
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;