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/pdfwindow/cpwl_list_box.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/pdfwindow/cpwl_list_box.cpp') diff --git a/fpdfsdk/pdfwindow/cpwl_list_box.cpp b/fpdfsdk/pdfwindow/cpwl_list_box.cpp index 61f9aafa8f..79559d33f0 100644 --- a/fpdfsdk/pdfwindow/cpwl_list_box.cpp +++ b/fpdfsdk/pdfwindow/cpwl_list_box.cpp @@ -405,8 +405,13 @@ float CPWL_ListBox::GetFirstHeight() const { } CFX_FloatRect CPWL_ListBox::GetListRect() const { - return CPWL_Utils::DeflateRect( - GetWindowRect(), (float)(GetBorderWidth() + GetInnerBorderWidth())); + CFX_FloatRect rect = GetWindowRect(); + if (!rect.IsEmpty()) { + float width = static_cast(GetBorderWidth() + GetInnerBorderWidth()); + rect.Deflate(width, width); + rect.Normalize(); + } + return rect; } bool CPWL_ListBox::OnMouseWheel(short zDelta, -- cgit v1.2.3