CPDF_TextStream::m_pObjArray is always NULL

Also, use full path to include "text_int.h", as there are
two of them; I suspect that fpdf_text_search was including
the wrong one as the compiler didn't complain about a
signature mismatch I had overlooked.

In fact, rename the fxge file to avoid collision completely.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1679743003 .
diff --git a/BUILD.gn b/BUILD.gn
index 6a02aeb..6ece5e7 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -572,7 +572,7 @@
     "core/src/fxge/ge/fx_ge_path.cpp",
     "core/src/fxge/ge/fx_ge_ps.cpp",
     "core/src/fxge/ge/fx_ge_text.cpp",
-    "core/src/fxge/ge/text_int.h",
+    "core/src/fxge/ge/fx_text_int.h",
   ]
 
   configs += [
diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp
index 3871d25..4653fa6 100644
--- a/core/src/fpdftext/fpdf_text.cpp
+++ b/core/src/fpdftext/fpdf_text.cpp
@@ -14,8 +14,8 @@
 #include "core/include/fpdftext/fpdf_text.h"
 #include "core/include/fxcrt/fx_bidi.h"
 #include "core/include/fxcrt/fx_ucd.h"
-#include "text_int.h"
-#include "txtproc.h"
+#include "core/src/fpdftext/text_int.h"
+#include "core/src/fpdftext/txtproc.h"
 
 CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode,
                                   int destcp,
@@ -785,5 +785,5 @@
   options.m_bTextOnly = TRUE;
   options.m_bSeparateForm = FALSE;
   page.ParseContent(&options);
-  GetTextStream_Unicode(buffer, &page, TRUE, NULL);
+  GetTextStream_Unicode(buffer, &page, TRUE);
 }
diff --git a/core/src/fpdftext/fpdf_text_search.cpp b/core/src/fpdftext/fpdf_text_search.cpp
index b77f942..5bbfbd9 100644
--- a/core/src/fpdftext/fpdf_text_search.cpp
+++ b/core/src/fpdftext/fpdf_text_search.cpp
@@ -6,28 +6,19 @@
 
 #include "core/include/fpdfapi/fpdf_page.h"
 #include "core/include/fpdfapi/fpdf_pageobj.h"
-#include "text_int.h"
+#include "core/src/fpdftext/text_int.h"
 
 class CPDF_TextStream {
  public:
-  CPDF_TextStream(CFX_WideTextBuf& buffer,
-                  FX_BOOL bUseLF,
-                  CFX_PtrArray* pObjArray);
+  CPDF_TextStream(CFX_WideTextBuf& buffer, FX_BOOL bUseLF)
+      : m_Buffer(buffer), m_bUseLF(bUseLF), m_pLastObj(nullptr) {}
   ~CPDF_TextStream() {}
   FX_BOOL ProcessObject(const CPDF_TextObject* pObj, FX_BOOL bFirstLine);
+
   CFX_WideTextBuf& m_Buffer;
   FX_BOOL m_bUseLF;
-  CFX_PtrArray* m_pObjArray;
   const CPDF_TextObject* m_pLastObj;
 };
-CPDF_TextStream::CPDF_TextStream(CFX_WideTextBuf& buffer,
-                                 FX_BOOL bUseLF,
-                                 CFX_PtrArray* pObjArray)
-    : m_Buffer(buffer) {
-  m_pLastObj = NULL;
-  m_bUseLF = bUseLF;
-  m_pObjArray = pObjArray;
-}
 FX_BOOL FPDFText_IsSameTextObject(const CPDF_TextObject* pTextObj1,
                                   const CPDF_TextObject* pTextObj2) {
   if (!pTextObj1 || !pTextObj2) {
@@ -160,9 +151,6 @@
       int len = m_Buffer.GetLength();
       if (len && m_bUseLF && m_Buffer.GetBuffer()[len - 1] == L'-') {
         m_Buffer.Delete(len - 1, 1);
-        if (m_pObjArray) {
-          m_pObjArray->RemoveAt((len - 1) * 2, 2);
-        }
       } else {
         if (bFirstLine) {
           return TRUE;
@@ -170,25 +158,12 @@
         if (m_bUseLF) {
           m_Buffer.AppendChar(L'\r');
           m_Buffer.AppendChar(L'\n');
-          if (m_pObjArray) {
-            for (int i = 0; i < 4; i++) {
-              m_pObjArray->Add(NULL);
-            }
-          }
         } else {
           m_Buffer.AppendChar(' ');
-          if (m_pObjArray) {
-            m_pObjArray->Add(NULL);
-            m_pObjArray->Add(NULL);
-          }
         }
       }
     } else if (result == 1) {
       m_Buffer.AppendChar(L' ');
-      if (m_pObjArray) {
-        m_pObjArray->Add(NULL);
-        m_pObjArray->Add(NULL);
-      }
     } else if (result == -1) {
       m_pLastObj = pObj;
       return FALSE;
@@ -266,10 +241,6 @@
       }
       if (threshold && (spacing && spacing >= threshold)) {
         m_Buffer.AppendChar(L' ');
-        if (m_pObjArray) {
-          m_pObjArray->Add(NULL);
-          m_pObjArray->Add(NULL);
-        }
       }
       if (item.m_CharCode == (FX_DWORD)-1) {
         continue;
@@ -279,27 +250,16 @@
     CFX_WideString unicode_str = pFont->UnicodeFromCharCode(item.m_CharCode);
     if (unicode_str.IsEmpty()) {
       m_Buffer.AppendChar((FX_WCHAR)item.m_CharCode);
-      if (m_pObjArray) {
-        m_pObjArray->Add((void*)pObj);
-        m_pObjArray->Add((void*)(intptr_t)item_index);
-      }
     } else {
       m_Buffer << unicode_str;
-      if (m_pObjArray) {
-        for (int i = 0; i < unicode_str.GetLength(); i++) {
-          m_pObjArray->Add((void*)pObj);
-          m_pObjArray->Add((void*)(intptr_t)item_index);
-        }
-      }
     }
   }
   return FALSE;
 }
 void GetTextStream_Unicode(CFX_WideTextBuf& buffer,
                            CPDF_PageObjectList* pPage,
-                           FX_BOOL bUseLF,
-                           CFX_PtrArray* pObjArray) {
-  CPDF_TextStream textstream(buffer, bUseLF, pObjArray);
+                           FX_BOOL bUseLF) {
+  CPDF_TextStream textstream(buffer, bUseLF);
   FX_POSITION pos = pPage->GetFirstObjectPosition();
   while (pos) {
     CPDF_PageObject* pObject = pPage->GetNextObject(pos);
@@ -317,7 +277,7 @@
   options.m_bTextOnly = TRUE;
   options.m_bSeparateForm = FALSE;
   page.ParseContent(&options);
-  CPDF_TextStream textstream(buffer, FALSE, NULL);
+  CPDF_TextStream textstream(buffer, FALSE);
   FX_POSITION pos = page.GetFirstObjectPosition();
   while (pos) {
     CPDF_PageObject* pObject = page.GetNextObject(pos);
diff --git a/core/src/fpdftext/text_int.h b/core/src/fpdftext/text_int.h
index bc4d181..8a80326 100644
--- a/core/src/fpdftext/text_int.h
+++ b/core/src/fpdftext/text_int.h
@@ -240,7 +240,6 @@
 void NormalizeCompositeChar(FX_WCHAR wChar, CFX_WideString& sDest);
 void GetTextStream_Unicode(CFX_WideTextBuf& buffer,
                            CPDF_PageObjectList* pPage,
-                           FX_BOOL bUseLF,
-                           CFX_PtrArray* pObjArray);
+                           FX_BOOL bUseLF);
 
 #endif  // CORE_SRC_FPDFTEXT_TEXT_INT_H_
diff --git a/core/src/fxge/agg/src/fx_agg_driver.cpp b/core/src/fxge/agg/src/fx_agg_driver.cpp
index 6828531..5006254 100644
--- a/core/src/fxge/agg/src/fx_agg_driver.cpp
+++ b/core/src/fxge/agg/src/fx_agg_driver.cpp
@@ -11,7 +11,7 @@
 #include "core/include/fxcodec/fx_codec.h"
 #include "core/include/fxge/fx_ge.h"
 #include "core/src/fxge/dib/dib_int.h"
-#include "core/src/fxge/ge/text_int.h"
+#include "core/src/fxge/ge/fx_text_int.h"
 #include "third_party/agg23/agg_conv_dash.h"
 #include "third_party/agg23/agg_conv_stroke.h"
 #include "third_party/agg23/agg_curves.h"
diff --git a/core/src/fxge/apple/fx_apple_platform.cpp b/core/src/fxge/apple/fx_apple_platform.cpp
index f0a2382..a448ae5 100644
--- a/core/src/fxge/apple/fx_apple_platform.cpp
+++ b/core/src/fxge/apple/fx_apple_platform.cpp
@@ -14,7 +14,7 @@
 #include "core/include/fxge/fx_ge_apple.h"
 #include "core/src/fxge/agg/include/fx_agg_driver.h"
 #include "core/src/fxge/dib/dib_int.h"
-#include "core/src/fxge/ge/text_int.h"
+#include "core/src/fxge/ge/fx_text_int.h"
 
 void CFX_AggDeviceDriver::InitPlatform() {
   CQuartz2D& quartz2d =
diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp
index 0b19438..a7b0a9e 100644
--- a/core/src/fxge/apple/fx_quartz_device.cpp
+++ b/core/src/fxge/apple/fx_quartz_device.cpp
@@ -9,7 +9,7 @@
 #include "core/include/fxge/fx_ge.h"
 #include "core/src/fxge/agg/include/fx_agg_driver.h"
 #include "core/src/fxge/dib/dib_int.h"
-#include "core/src/fxge/ge/text_int.h"
+#include "core/src/fxge/ge/fx_text_int.h"
 
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
 #include "apple_int.h"
diff --git a/core/src/fxge/ge/fx_ge.cpp b/core/src/fxge/ge/fx_ge.cpp
index f7787cf..d310a3f 100644
--- a/core/src/fxge/ge/fx_ge.cpp
+++ b/core/src/fxge/ge/fx_ge.cpp
@@ -6,7 +6,7 @@
 
 #include "core/include/fxge/fx_ge.h"
 
-#include "text_int.h"
+#include "core/src/fxge/ge/fx_text_int.h"
 
 static CFX_GEModule* g_pGEModule = NULL;
 CFX_GEModule::CFX_GEModule(const char** pUserFontPaths) {
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index 56e178f..672c28d 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -6,7 +6,7 @@
 
 #include "core/include/fxge/fx_freetype.h"
 #include "core/include/fxge/fx_ge.h"
-#include "text_int.h"
+#include "core/src/fxge/ge/fx_text_int.h"
 
 #define EM_ADJUST(em, a) (em == 0 ? (a) : (a)*1000 / em)
 
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index be71f6b..f624d5a 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -10,7 +10,7 @@
 #include "core/include/fxge/fx_freetype.h"
 #include "core/include/fxge/fx_ge.h"
 #include "core/src/fxge/fontdata/chromefontdata/chromefontdata.h"
-#include "core/src/fxge/ge/text_int.h"
+#include "core/src/fxge/ge/fx_text_int.h"
 #include "third_party/base/stl_util.h"
 
 #define GET_TT_SHORT(w) (FX_WORD)(((w)[0] << 8) | (w)[1])
diff --git a/core/src/fxge/ge/fx_ge_linux.cpp b/core/src/fxge/ge/fx_ge_linux.cpp
index d581627..8ad5ff0 100644
--- a/core/src/fxge/ge/fx_ge_linux.cpp
+++ b/core/src/fxge/ge/fx_ge_linux.cpp
@@ -6,7 +6,7 @@
 
 #include "core/include/fxge/fx_ge.h"
 #include "core/src/fxge/agg/include/fx_agg_driver.h"
-#include "text_int.h"
+#include "core/src/fxge/ge/fx_text_int.h"
 
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_
 class CFX_LinuxFontInfo : public CFX_FolderFontInfo {
diff --git a/core/src/fxge/ge/fx_ge_ps.cpp b/core/src/fxge/ge/fx_ge_ps.cpp
index f9fd8de..d6f6089 100644
--- a/core/src/fxge/ge/fx_ge_ps.cpp
+++ b/core/src/fxge/ge/fx_ge_ps.cpp
@@ -5,8 +5,9 @@
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
 #include "core/include/fxge/fx_ge.h"
+
 #include "core/include/fxcodec/fx_codec.h"
-#include "text_int.h"
+#include "core/src/fxge/ge/fx_text_int.h"
 
 struct PSGlyph {
   CFX_Font* m_pFont;
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index 0ed0bbb..7dbeac3 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -7,7 +7,7 @@
 #include "core/include/fxge/fx_ge.h"
 #include "core/include/fxge/fx_freetype.h"
 #include "core/include/fxcodec/fx_codec.h"
-#include "text_int.h"
+#include "core/src/fxge/ge/fx_text_int.h"
 
 #undef FX_GAMMA
 #undef FX_GAMMA_INVERSE
diff --git a/core/src/fxge/ge/text_int.h b/core/src/fxge/ge/fx_text_int.h
similarity index 94%
rename from core/src/fxge/ge/text_int.h
rename to core/src/fxge/ge/fx_text_int.h
index 5a69167..b568b61 100644
--- a/core/src/fxge/ge/text_int.h
+++ b/core/src/fxge/ge/fx_text_int.h
@@ -4,8 +4,8 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef CORE_SRC_FXGE_GE_TEXT_INT_H_
-#define CORE_SRC_FXGE_GE_TEXT_INT_H_
+#ifndef CORE_SRC_FXGE_GE_FX_TEXT_INT_H_
+#define CORE_SRC_FXGE_GE_FX_TEXT_INT_H_
 
 #include <map>
 
@@ -81,4 +81,4 @@
   FX_DWORD m_Charsets;
 };
 
-#endif  // CORE_SRC_FXGE_GE_TEXT_INT_H_
+#endif  // CORE_SRC_FXGE_GE_FX_TEXT_INT_H_
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index c346d1b..a7dd22f 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -14,7 +14,7 @@
 #include "core/include/fxge/fx_ge_win32.h"
 #include "core/src/fxge/agg/include/fx_agg_driver.h"
 #include "core/src/fxge/dib/dib_int.h"
-#include "core/src/fxge/ge/text_int.h"
+#include "core/src/fxge/ge/fx_text_int.h"
 #include "dwrite_int.h"
 #include "win32_int.h"
 
diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp
index 0c00a7b..fc7cd79 100644
--- a/core/src/fxge/win32/fx_win32_print.cpp
+++ b/core/src/fxge/win32/fx_win32_print.cpp
@@ -13,7 +13,7 @@
 #include "core/include/fxge/fx_freetype.h"
 #include "core/include/fxge/fx_ge_win32.h"
 #include "core/src/fxge/dib/dib_int.h"
-#include "core/src/fxge/ge/text_int.h"
+#include "core/src/fxge/ge/fx_text_int.h"
 #include "win32_int.h"
 
 #define SIZETHRESHOLD 1000
diff --git a/pdfium.gyp b/pdfium.gyp
index 50ce24c..09c9028 100644
--- a/pdfium.gyp
+++ b/pdfium.gyp
@@ -548,7 +548,7 @@
         'core/src/fxge/ge/fx_ge_path.cpp',
         'core/src/fxge/ge/fx_ge_ps.cpp',
         'core/src/fxge/ge/fx_ge_text.cpp',
-        'core/src/fxge/ge/text_int.h',
+        'core/src/fxge/ge/fx_text_int.h',
       ],
       'variables': {
         'clang_warning_flags': [