From 45c910f02063cab51d0d90137d451a666c33b85f Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 13 Aug 2015 17:50:20 -0700 Subject: Cleanup: s/Torelance/Tolerance/ R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1294713002 . --- core/include/fpdftext/fpdf_text.h | 8 ++++---- core/src/fpdftext/fpdf_text_int.cpp | 20 ++++++++++---------- core/src/fpdftext/text_int.h | 8 ++++---- fpdfsdk/src/fpdftext.cpp | 8 ++++---- public/fpdf_text.h | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/core/include/fpdftext/fpdf_text.h b/core/include/fpdftext/fpdf_text.h index eb16ca9a90..f27f1db7e6 100644 --- a/core/include/fpdftext/fpdf_text.h +++ b/core/include/fpdftext/fpdf_text.h @@ -102,13 +102,13 @@ class IPDF_TextPage { CFX_RectArray& rectArray) const = 0; virtual int GetIndexAtPos(CPDF_Point point, - FX_FLOAT xTorelance, - FX_FLOAT yTorelance) const = 0; + FX_FLOAT xTolerance, + FX_FLOAT yTolerance) const = 0; virtual int GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, - FX_FLOAT xTorelance, - FX_FLOAT yTorelance) const = 0; + FX_FLOAT xTolerance, + FX_FLOAT yTolerance) const = 0; virtual CFX_WideString GetTextByRect(const CFX_FloatRect& rect) const = 0; diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp index 7b2f3abf48..ce673447a4 100644 --- a/core/src/fpdftext/fpdf_text_int.cpp +++ b/core/src/fpdftext/fpdf_text_int.cpp @@ -350,8 +350,8 @@ void CPDF_TextPage::GetRectArray(int start, return; } int CPDF_TextPage::GetIndexAtPos(CPDF_Point point, - FX_FLOAT xTorelance, - FX_FLOAT yTorelance) const { + FX_FLOAT xTolerance, + FX_FLOAT yTolerance) const { if (m_ParseOptions.m_bGetCharCodeOnly) { return -3; } @@ -367,13 +367,13 @@ int CPDF_TextPage::GetIndexAtPos(CPDF_Point point, if (charrect.Contains(point.x, point.y)) { break; } - if (xTorelance > 0 || yTorelance > 0) { + if (xTolerance > 0 || yTolerance > 0) { CFX_FloatRect charRectExt; charrect.Normalize(); - charRectExt.left = charrect.left - xTorelance / 2; - charRectExt.right = charrect.right + xTorelance / 2; - charRectExt.top = charrect.top + yTorelance / 2; - charRectExt.bottom = charrect.bottom - yTorelance / 2; + charRectExt.left = charrect.left - xTolerance / 2; + charRectExt.right = charrect.right + xTolerance / 2; + charRectExt.top = charrect.top + yTolerance / 2; + charRectExt.bottom = charrect.bottom - yTolerance / 2; if (charRectExt.Contains(point.x, point.y)) { double curXdif, curYdif; curXdif = FXSYS_fabs(point.x - charrect.left) < @@ -489,13 +489,13 @@ void CPDF_TextPage::GetRectsArrayByRect(const CFX_FloatRect& rect, } int CPDF_TextPage::GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, - FX_FLOAT xTorelance, - FX_FLOAT yTorelance) const { + FX_FLOAT xTolerance, + FX_FLOAT yTolerance) const { if (m_ParseOptions.m_bGetCharCodeOnly) { return -3; } CPDF_Point point(x, y); - return GetIndexAtPos(point, xTorelance, yTorelance); + return GetIndexAtPos(point, xTolerance, yTolerance); } void CPDF_TextPage::GetCharInfo(int index, FPDF_CHAR_INFO& info) const { if (m_ParseOptions.m_bGetCharCodeOnly) { diff --git a/core/src/fpdftext/text_int.h b/core/src/fpdftext/text_int.h index f92ca549fe..9e7073d24e 100644 --- a/core/src/fpdftext/text_int.h +++ b/core/src/fpdftext/text_int.h @@ -61,12 +61,12 @@ class CPDF_TextPage : public IPDF_TextPage { int nCount, CFX_RectArray& rectArray) const; virtual int GetIndexAtPos(CPDF_Point point, - FX_FLOAT xTorelance, - FX_FLOAT yTorelance) const; + FX_FLOAT xTolerance, + FX_FLOAT yTolerance) const; virtual int GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, - FX_FLOAT xTorelance, - FX_FLOAT yTorelance) const; + FX_FLOAT xTolerance, + FX_FLOAT yTolerance) const; virtual CFX_WideString GetTextByRect(const CFX_FloatRect& rect) const; virtual void GetRectsArrayByRect(const CFX_FloatRect& rect, CFX_RectArray& resRectArray) const; diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp index 0761ffa91a..4030b7172b 100644 --- a/fpdfsdk/src/fpdftext.cpp +++ b/fpdfsdk/src/fpdftext.cpp @@ -85,13 +85,13 @@ DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, double x, double y, - double xTorelance, - double yTorelance) { + double xTolerance, + double yTolerance) { if (!text_page) return -3; IPDF_TextPage* textpage = (IPDF_TextPage*)text_page; - return textpage->GetIndexAtPos((FX_FLOAT)x, (FX_FLOAT)y, (FX_FLOAT)xTorelance, - (FX_FLOAT)yTorelance); + return textpage->GetIndexAtPos((FX_FLOAT)x, (FX_FLOAT)y, (FX_FLOAT)xTolerance, + (FX_FLOAT)yTolerance); } DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page, diff --git a/public/fpdf_text.h b/public/fpdf_text.h index 30d1033a12..32cc131859 100644 --- a/public/fpdf_text.h +++ b/public/fpdf_text.h @@ -133,7 +133,7 @@ DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, double x, double y, - double xTorelance, + double xTolerance, double yTolerance); // Function: FPDFText_GetText -- cgit v1.2.3