Don't bother passing -1 as the length to the CFX_ByteString ctor.
[pdfium.git] / core / src / fpdfapi / fpdf_edit / fpdf_edit_doc.cpp
index a259a0b..9c1c292 100644 (file)
@@ -219,15 +219,13 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont,
   FXSYS_strcpy(lfa.lfFaceName, face.c_str());
   return AddWindowsFont(&lfa, bVert, bTranslateName);
 }
-extern CFX_ByteString _FPDF_GetNameFromTT(const uint8_t* name_table,
-                                          FX_DWORD name);
 CFX_ByteString _FPDF_GetPSNameFromTT(HDC hDC) {
   CFX_ByteString result;
   DWORD size = ::GetFontData(hDC, 'eman', 0, NULL, 0);
   if (size != GDI_ERROR) {
     LPBYTE buffer = FX_Alloc(BYTE, size);
     ::GetFontData(hDC, 'eman', 0, buffer, size);
-    result = _FPDF_GetNameFromTT(buffer, 6);
+    result = GetNameFromTT(buffer, 6);
     FX_Free(buffer);
   }
   return result;
@@ -1107,15 +1105,15 @@ CPDF_Dictionary* CPDF_Document::CreateNewPage(int iPage) {
   }
   return pDict;
 }
-int _PDF_GetStandardFontName(CFX_ByteString& name);
+
 CPDF_Font* CPDF_Document::AddStandardFont(const FX_CHAR* font,
                                           CPDF_FontEncoding* pEncoding) {
-  CFX_ByteString name(font, -1);
-  if (_PDF_GetStandardFontName(name) < 0) {
-    return NULL;
-  }
+  CFX_ByteString name(font);
+  if (PDF_GetStandardFontName(&name) < 0)
+    return nullptr;
   return GetPageData()->GetStandardFont(name, pEncoding);
 }
+
 void CPDF_Document::DeletePage(int iPage) {
   CPDF_Dictionary* pRoot = GetRoot();
   if (pRoot == NULL) {