diff options
author | Lei Zhang <thestig@chromium.org> | 2015-10-16 16:29:59 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-10-16 16:29:59 -0700 |
commit | 0c6e6824979c9a3e7006a925f7b307db04342146 (patch) | |
tree | 12be3af6450fbb37cc5c12247eea888c9cf09d11 /core/src | |
parent | c40ccaff017691b7d31e0597863bfb954aebd739 (diff) | |
download | pdfium-0c6e6824979c9a3e7006a925f7b307db04342146.tar.xz |
Merge to XFA: Don't bother passing -1 as the length to the CFX_ByteString ctor.
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1406363002 .
(cherry picked from commit 316e482630d5f5d9084edd9725f98a0d89a5bbdf)
Review URL: https://codereview.chromium.org/1406303006 .
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp | 2 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp | 2 | ||||
-rw-r--r-- | core/src/fpdftext/fpdf_text.cpp | 10 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_fontmap.cpp | 2 | ||||
-rw-r--r-- | core/src/fxge/win32/fx_win32_device.cpp | 2 |
5 files changed, 6 insertions, 12 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp index 95eac538bb..72df84ed95 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp @@ -1109,7 +1109,7 @@ CPDF_Dictionary* CPDF_Document::CreateNewPage(int iPage) { CPDF_Font* CPDF_Document::AddStandardFont(const FX_CHAR* font, CPDF_FontEncoding* pEncoding) { - CFX_ByteString name(font, -1); + CFX_ByteString name(font); if (PDF_GetStandardFontName(&name) < 0) return nullptr; return GetPageData()->GetStandardFont(name, pEncoding); diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp index 308dac9782..92d1719efe 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp @@ -1778,5 +1778,5 @@ FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR* name) { CFX_ByteString PDF_AdobeNameFromUnicode(FX_WCHAR unicode) { char glyph_name[64]; FXFT_adobe_name_from_unicode(glyph_name, unicode); - return CFX_ByteString(glyph_name, -1); + return CFX_ByteString(glyph_name); } diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp index 0b53338ea0..2bd8b7d6ce 100644 --- a/core/src/fpdftext/fpdf_text.cpp +++ b/core/src/fpdftext/fpdf_text.cpp @@ -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() { diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index 817ce2786a..2dfb3c7a17 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -463,7 +463,7 @@ void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) { m_pFontInfo = pFontInfo; } static CFX_ByteString _TT_NormalizeName(const FX_CHAR* family) { - CFX_ByteString norm(family, -1); + CFX_ByteString norm(family); norm.Remove(' '); norm.Remove('-'); norm.Remove(','); diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp index a40e79bde7..93c2fd6836 100644 --- a/core/src/fxge/win32/fx_win32_device.cpp +++ b/core/src/fxge/win32/fx_win32_device.cpp @@ -122,7 +122,7 @@ FX_BOOL CFX_Win32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf) { } void CFX_Win32FontInfo::AddInstalledFont(const LOGFONTA* plf, FX_DWORD FontType) { - CFX_ByteString name(plf->lfFaceName, -1); + CFX_ByteString name(plf->lfFaceName); if (name[0] == '@') { return; } |