Remove IsLatinWord() code.

It's all dead code. Then move the FX_EDIT_ISLATINWORD() macro closer to
where it used, and rename it to match PWL_ISARABICWORD().

Change-Id: I1cd93ae6b243f815936457cbf507d0290ca7d93c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/79057
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp
index 68cdf9c..57df06f 100644
--- a/core/fpdfdoc/cpdf_variabletext.cpp
+++ b/core/fpdfdoc/cpdf_variabletext.cpp
@@ -74,11 +74,6 @@
   return -1;
 }
 
-bool CPDF_VariableText::Provider::IsLatinWord(uint16_t word) {
-  return (word >= 0x61 && word <= 0x7A) || (word >= 0x41 && word <= 0x5A) ||
-         word == 0x2D || word == 0x27;
-}
-
 int32_t CPDF_VariableText::Provider::GetDefaultFontIndex() {
   return 0;
 }
@@ -870,10 +865,6 @@
   return m_pVTProvider ? m_pVTProvider->GetDefaultFontIndex() : -1;
 }
 
-bool CPDF_VariableText::IsLatinWord(uint16_t word) {
-  return m_pVTProvider && m_pVTProvider->IsLatinWord(word);
-}
-
 CPDF_VariableText::Iterator* CPDF_VariableText::GetIterator() {
   if (!m_pVTIterator)
     m_pVTIterator = std::make_unique<CPDF_VariableText::Iterator>(this);
diff --git a/core/fpdfdoc/cpdf_variabletext.h b/core/fpdfdoc/cpdf_variabletext.h
index 8c43b1f..705b7d4 100644
--- a/core/fpdfdoc/cpdf_variabletext.h
+++ b/core/fpdfdoc/cpdf_variabletext.h
@@ -59,7 +59,6 @@
     virtual int32_t GetWordFontIndex(uint16_t word,
                                      int32_t charset,
                                      int32_t nFontIndex);
-    virtual bool IsLatinWord(uint16_t word);
     virtual int32_t GetDefaultFontIndex();
 
     IPVT_FontMap* GetFontMap() { return m_pFontMap.Get(); }
@@ -166,7 +165,6 @@
  private:
   int GetCharWidth(int32_t nFontIndex, uint16_t Word, uint16_t SubWord);
   int32_t GetWordFontIndex(uint16_t word, int32_t charset, int32_t nFontIndex);
-  bool IsLatinWord(uint16_t word);
 
   CPVT_WordPlace AddSection(const CPVT_WordPlace& place);
   CPVT_WordPlace AddLine(const CPVT_WordPlace& place,
diff --git a/fpdfsdk/pwl/cpwl_edit.cpp b/fpdfsdk/pwl/cpwl_edit.cpp
index bd35e47..22f3cce 100644
--- a/fpdfsdk/pwl/cpwl_edit.cpp
+++ b/fpdfsdk/pwl/cpwl_edit.cpp
@@ -586,8 +586,12 @@
   return GetSameWordsRange(place, true, false);
 }
 
-#define PWL_ISARABICWORD(word) \
-  ((word >= 0x0600 && word <= 0x06FF) || (word >= 0xFB50 && word <= 0xFEFC))
+#define PWL_ISLATINWORD(u)                      \
+  (u == 0x2D || (u >= 0x0041 && u <= 0x005A) || \
+   (u >= 0x0061 && u <= 0x007A) || (u >= 0x00C0 && u <= 0x02AF))
+
+#define PWL_ISARABICWORD(u) \
+  ((u >= 0x0600 && u <= 0x06FF) || (u >= 0xFB50 && u <= 0xFEFC))
 
 CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace& place,
                                             bool bLatin,
@@ -599,8 +603,7 @@
 
   if (bLatin) {
     while (pIterator->NextWord()) {
-      if (!pIterator->GetWord(wordinfo) ||
-          !FX_EDIT_ISLATINWORD(wordinfo.Word)) {
+      if (!pIterator->GetWord(wordinfo) || !PWL_ISLATINWORD(wordinfo.Word)) {
         break;
       }
 
@@ -619,8 +622,7 @@
 
   if (bLatin) {
     do {
-      if (!pIterator->GetWord(wordinfo) ||
-          !FX_EDIT_ISLATINWORD(wordinfo.Word)) {
+      if (!pIterator->GetWord(wordinfo) || !PWL_ISLATINWORD(wordinfo.Word)) {
         break;
       }
 
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index 44a1d67..1bc69f3 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -125,10 +125,6 @@
   return GetFontMap()->GetWordFontIndex(word, charset, nFontIndex);
 }
 
-bool CPWL_EditImpl_Provider::IsLatinWord(uint16_t word) {
-  return FX_EDIT_ISLATINWORD(word);
-}
-
 CPWL_EditImpl_Refresh::CPWL_EditImpl_Refresh() = default;
 
 CPWL_EditImpl_Refresh::~CPWL_EditImpl_Refresh() = default;
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.h b/fpdfsdk/pwl/cpwl_edit_impl.h
index 6a35c3e..5c81645 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.h
+++ b/fpdfsdk/pwl/cpwl_edit_impl.h
@@ -17,10 +17,6 @@
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxge/dib/fx_dib.h"
 
-#define FX_EDIT_ISLATINWORD(u)                  \
-  (u == 0x2D || (u <= 0x005A && u >= 0x0041) || \
-   (u <= 0x007A && u >= 0x0061) || (u <= 0x02AF && u >= 0x00C0))
-
 class CFFL_FormFiller;
 class CPWL_EditImpl;
 class CPWL_EditImpl_Iterator;
@@ -450,7 +446,6 @@
   int32_t GetWordFontIndex(uint16_t word,
                            int32_t charset,
                            int32_t nFontIndex) override;
-  bool IsLatinWord(uint16_t word) override;
 };
 
 #endif  // FPDFSDK_PWL_CPWL_EDIT_IMPL_H_