From 8db114ab60439f6d598ec68aa629f4385a532a92 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Wed, 12 Jul 2017 22:05:28 -0400 Subject: Use Translate instead of OffsetRect This CL removes CPWL_Utils::OffsetRect in favour of CFX_FloatRect::Translate. Change-Id: I10e654fcd32639f2121fa78cd343879562c54186 Reviewed-on: https://pdfium-review.googlesource.com/7711 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fpdfsdk/pdfwindow/cpwl_caret.cpp | 4 ++-- fpdfsdk/pdfwindow/cpwl_utils.cpp | 7 ------- fpdfsdk/pdfwindow/cpwl_utils.h | 2 -- 3 files changed, 2 insertions(+), 11 deletions(-) (limited to 'fpdfsdk/pdfwindow') diff --git a/fpdfsdk/pdfwindow/cpwl_caret.cpp b/fpdfsdk/pdfwindow/cpwl_caret.cpp index f49c77120c..def479a4df 100644 --- a/fpdfsdk/pdfwindow/cpwl_caret.cpp +++ b/fpdfsdk/pdfwindow/cpwl_caret.cpp @@ -66,8 +66,8 @@ void CPWL_Caret::GetCaretApp(const CFX_PointF& ptOffset, CFX_FloatRect rcRect = GetCaretRect(); CFX_FloatRect rcClip = GetClipRect(); - rcRect = CPWL_Utils::OffsetRect(rcRect, ptOffset.x, ptOffset.y); - rcClip = CPWL_Utils::OffsetRect(rcClip, ptOffset.x, ptOffset.y); + rcRect.Translate(ptOffset.x, ptOffset.y); + rcClip.Translate(ptOffset.x, ptOffset.y); *psAppStream << "q\n"; if (!rcClip.IsEmpty()) { diff --git a/fpdfsdk/pdfwindow/cpwl_utils.cpp b/fpdfsdk/pdfwindow/cpwl_utils.cpp index c31e092cd6..651f21e0b7 100644 --- a/fpdfsdk/pdfwindow/cpwl_utils.cpp +++ b/fpdfsdk/pdfwindow/cpwl_utils.cpp @@ -18,13 +18,6 @@ #include "fpdfsdk/pdfwindow/cpwl_icon.h" #include "fpdfsdk/pdfwindow/cpwl_wnd.h" -CFX_FloatRect CPWL_Utils::OffsetRect(const CFX_FloatRect& rect, - float x, - float y) { - return CFX_FloatRect(rect.left + x, rect.bottom + y, rect.right + x, - rect.top + y); -} - CPVT_WordRange CPWL_Utils::OverlapWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2) { if (wr2.EndPos < wr1.BeginPos || wr2.BeginPos > wr1.EndPos || diff --git a/fpdfsdk/pdfwindow/cpwl_utils.h b/fpdfsdk/pdfwindow/cpwl_utils.h index ef06073d99..b0caf0b386 100644 --- a/fpdfsdk/pdfwindow/cpwl_utils.h +++ b/fpdfsdk/pdfwindow/cpwl_utils.h @@ -36,8 +36,6 @@ class CPWL_Utils { const CPVT_WordRange& wr2); static CFX_FloatRect GetCenterSquare(const CFX_FloatRect& rect); - static CFX_FloatRect OffsetRect(const CFX_FloatRect& rect, float x, float y); - static CFX_ByteString GetColorAppStream(const CPWL_Color& color, const bool& bFillOrStroke = true); static CFX_ByteString GetBorderAppStream(const CFX_FloatRect& rect, -- cgit v1.2.3