Revert "Cleanup some numeric code."
[pdfium.git] / core / src / fpdftext / fpdf_text.cpp
index af944d9..9ecbc21 100644 (file)
@@ -22,10 +22,7 @@ CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode,
       return CFX_ByteString((char)unicode);
     }
     const FX_CHAR* altstr = FCS_GetAltStr(unicode);
-    if (altstr) {
-      return CFX_ByteString(altstr, -1);
-    }
-    return CFX_ByteString(defchar, -1);
+    return CFX_ByteString(altstr ? altstr : defchar);
   }
   char buf[10];
   int iDef = 0;
@@ -35,10 +32,7 @@ CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode,
     return CFX_ByteString(buf, ret);
   }
   const FX_CHAR* altstr = FCS_GetAltStr(unicode);
-  if (altstr) {
-    return CFX_ByteString(altstr, -1);
-  }
-  return CFX_ByteString(defchar, -1);
+  return CFX_ByteString(altstr ? altstr : defchar);
 }
 CTextPage::CTextPage() {}
 CTextPage::~CTextPage() {
@@ -783,10 +777,6 @@ void PDF_GetPageText(CFX_ByteStringArray& lines,
     lines.Add(str);
   }
 }
-extern void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer,
-                                       CPDF_PageObjects* pPage,
-                                       FX_BOOL bUseLF,
-                                       CFX_PtrArray* pObjArray);
 void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer,
                                CPDF_Document* pDoc,
                                CPDF_Dictionary* pPage,
@@ -798,5 +788,5 @@ void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer,
   options.m_bTextOnly = TRUE;
   options.m_bSeparateForm = FALSE;
   page.ParseContent(&options);
-  _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL);
+  GetTextStream_Unicode(buffer, &page, TRUE, NULL);
 }