diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-18 14:23:18 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-18 18:40:16 +0000 |
commit | 275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch) | |
tree | 2029b9158ec044764ceff122fe5fb5d0a3f123d1 /core/fxge/android/cfpf_skiafontmgr.cpp | |
parent | 450fbeaaabf1ab340c1018de2e58f1950657517e (diff) | |
download | pdfium-275e260a6cd4a8e506ba974feb85ebcd926c1739.tar.xz |
Convert string class names
Automated using git grep & sed.
Replace StringC classes with StringView classes.
Remove the CFX_ prefix and put string classes in fxcrt namespace.
Change AsStringC() to AsStringView().
Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*,
Foo).
Couple of tests needed to have their names regularlized.
BUG=pdfium:894
Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d
Reviewed-on: https://pdfium-review.googlesource.com/14151
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxge/android/cfpf_skiafontmgr.cpp')
-rw-r--r-- | core/fxge/android/cfpf_skiafontmgr.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/core/fxge/android/cfpf_skiafontmgr.cpp b/core/fxge/android/cfpf_skiafontmgr.cpp index 16a6df5f8f..a50b9ead63 100644 --- a/core/fxge/android/cfpf_skiafontmgr.cpp +++ b/core/fxge/android/cfpf_skiafontmgr.cpp @@ -158,7 +158,7 @@ uint32_t FPF_SkiaGetCharset(uint8_t uCharset) { return FPF_SKIACHARSET_Default; } -uint32_t FPF_SKIANormalizeFontName(const CFX_ByteStringC& bsfamily) { +uint32_t FPF_SKIANormalizeFontName(const ByteStringView& bsfamily) { uint32_t dwHash = 0; int32_t iLength = bsfamily.GetLength(); const char* pBuffer = bsfamily.unterminated_c_str(); @@ -171,10 +171,10 @@ uint32_t FPF_SKIANormalizeFontName(const CFX_ByteStringC& bsfamily) { return dwHash; } -uint32_t FPF_SKIAGetFamilyHash(const CFX_ByteStringC& bsFamily, +uint32_t FPF_SKIAGetFamilyHash(const ByteStringView& bsFamily, uint32_t dwStyle, uint8_t uCharset) { - CFX_ByteString bsFont(bsFamily); + ByteString bsFont(bsFamily); if (dwStyle & FXFONT_BOLD) bsFont += "Bold"; if (dwStyle & FXFONT_ITALIC) @@ -191,14 +191,14 @@ bool FPF_SkiaIsCJK(uint8_t uCharset) { (uCharset == FX_CHARSET_Hangul) || (uCharset == FX_CHARSET_ShiftJIS); } -bool FPF_SkiaMaybeSymbol(const CFX_ByteStringC& bsFacename) { - CFX_ByteString bsName(bsFacename); +bool FPF_SkiaMaybeSymbol(const ByteStringView& bsFacename) { + ByteString bsName(bsFacename); bsName.MakeLower(); return bsName.Contains("symbol"); } -bool FPF_SkiaMaybeArabic(const CFX_ByteStringC& bsFacename) { - CFX_ByteString bsName(bsFacename); +bool FPF_SkiaMaybeArabic(const ByteStringView& bsFacename) { + ByteString bsName(bsFacename); bsName.MakeLower(); return bsName.Contains("arabic"); } @@ -280,7 +280,7 @@ void CFPF_SkiaFontMgr::LoadSystemFonts() { m_bLoaded = true; } -CFPF_SkiaFont* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, +CFPF_SkiaFont* CFPF_SkiaFontMgr::CreateFont(const ByteStringView& bsFamilyname, uint8_t uCharset, uint32_t dwStyle, uint32_t dwMatch) { @@ -387,7 +387,7 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace( return face; } -FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const CFX_ByteStringC& bsFile, +FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const ByteStringView& bsFile, int32_t iFaceIndex) { if (bsFile.IsEmpty()) return nullptr; @@ -421,23 +421,23 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const uint8_t* pBuffer, return face; } -void CFPF_SkiaFontMgr::ScanPath(const CFX_ByteString& path) { +void CFPF_SkiaFontMgr::ScanPath(const ByteString& path) { DIR* handle = FX_OpenFolder(path.c_str()); if (!handle) return; - CFX_ByteString filename; + ByteString filename; bool bFolder = false; while (FX_GetNextFile(handle, &filename, &bFolder)) { if (bFolder) { if (filename == "." || filename == "..") continue; } else { - CFX_ByteString ext = filename.Right(4); + ByteString ext = filename.Right(4); ext.MakeLower(); if (ext != ".ttf" && ext != ".ttc" && ext != ".otf") continue; } - CFX_ByteString fullpath(path); + ByteString fullpath(path); fullpath += "/"; fullpath += filename; if (bFolder) @@ -448,8 +448,8 @@ void CFPF_SkiaFontMgr::ScanPath(const CFX_ByteString& path) { FX_CloseFolder(handle); } -void CFPF_SkiaFontMgr::ScanFile(const CFX_ByteString& file) { - FXFT_Face face = GetFontFace(file.AsStringC()); +void CFPF_SkiaFontMgr::ScanFile(const ByteString& file) { + FXFT_Face face = GetFontFace(file.AsStringView()); if (!face) return; CFPF_SkiaPathFont* pFontDesc = new CFPF_SkiaPathFont; |