From adf922f278d23e7f955b89f48cc64b5de7925977 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Wed, 12 Jul 2017 21:56:27 -0400 Subject: Remove CPWL_Utils::{In,De}flateRect This CL removes the custom InflateRect and Deflate rect code in CPWL_Utils in favour of calling the CFX_FloatRect version. This required inlining some extra code at each callsite to check the rect size and normalize. Change-Id: I7f60e5de03fc1db0c1d8e51eaa1d0e0700ebf157 Reviewed-on: https://pdfium-review.googlesource.com/7710 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fpdfsdk/formfiller/cffl_formfiller.cpp | 6 +++++- fpdfsdk/formfiller/cffl_interactiveformfiller.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/formfiller') diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp index 31f6963348..6d71be5b6c 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.cpp +++ b/fpdfsdk/formfiller/cffl_formfiller.cpp @@ -73,7 +73,11 @@ FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, if (!rcFocus.IsEmpty()) rcWin.Union(rcFocus); - return CPWL_Utils::InflateRect(rcWin, 1).GetOuterRect(); + if (!rcWin.IsEmpty()) { + rcWin.Inflate(1, 1); + rcWin.Normalize(); + } + return rcWin.GetOuterRect(); } void CFFL_FormFiller::OnDraw(CPDFSDK_PageView* pPageView, diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp index d718e7ca40..5f5e21a274 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp @@ -45,7 +45,11 @@ FX_RECT CFFL_InteractiveFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, ASSERT(pPageView); CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); - CFX_FloatRect rcWin = CPWL_Utils::InflateRect(pPDFAnnot->GetRect(), 1); + CFX_FloatRect rcWin = pPDFAnnot->GetRect(); + if (!rcWin.IsEmpty()) { + rcWin.Inflate(1, 1); + rcWin.Normalize(); + } return rcWin.GetOuterRect(); } -- cgit v1.2.3