summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-01 20:18:41 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-01 20:18:41 -0700
commita31d4a90f3446df76d8d3ffa0b441db0ad4623af (patch)
treeb66f6dafdb562a4aa5ec7364028c00e888836f20 /core/fpdfapi
parentdbdcb81a82cd9e46023a3ee500df75717c1a47b4 (diff)
downloadpdfium-a31d4a90f3446df76d8d3ffa0b441db0ad4623af.tar.xz
Change CFX_Font::GetPsName() to return a CFX_ByteString.
So everyone can avoid doing Byte to WideString conversions. Also remove CFX_GEFont::GetPsName() and deduplicate a couple of GetPsName() calls. Review-Url: https://codereview.chromium.org/2019173002
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/fpdf_font/cpdf_type1font.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/core/fpdfapi/fpdf_font/cpdf_type1font.cpp b/core/fpdfapi/fpdf_font/cpdf_type1font.cpp
index 5fbc520ae5..fc12ae78ee 100644
--- a/core/fpdfapi/fpdf_font/cpdf_type1font.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_type1font.cpp
@@ -118,19 +118,18 @@ void CPDF_Type1Font::LoadGlyphMap() {
return;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- FX_BOOL bCoreText = TRUE;
+ bool bCoreText = true;
CQuartz2D& quartz2d =
static_cast<CApplePlatform*>(CFX_GEModule::Get()->GetPlatformData())
->m_quartz2d;
if (!m_Font.GetPlatformFont()) {
- if (m_Font.GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
- bCoreText = FALSE;
- }
+ if (m_Font.GetPsName() == "DFHeiStd-W5")
+ bCoreText = false;
+
m_Font.SetPlatformFont(
quartz2d.CreateFont(m_Font.GetFontData(), m_Font.GetSize()));
- if (!m_Font.GetPlatformFont()) {
- bCoreText = FALSE;
- }
+ if (!m_Font.GetPlatformFont())
+ bCoreText = false;
}
#endif
if (!IsEmbedded() && (m_Base14Font < 12) && m_Font.IsTTFont()) {
@@ -164,9 +163,8 @@ void CPDF_Type1Font::LoadGlyphMap() {
}
if (bGotOne) {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!bCoreText) {
+ if (!bCoreText)
FXSYS_memcpy(m_ExtGID, m_GlyphIndex, 256);
- }
#endif
return;
}
@@ -218,9 +216,8 @@ void CPDF_Type1Font::LoadGlyphMap() {
}
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!bCoreText) {
+ if (!bCoreText)
FXSYS_memcpy(m_ExtGID, m_GlyphIndex, 256);
- }
#endif
return;
}
@@ -366,9 +363,9 @@ void CPDF_Type1Font::LoadGlyphMap() {
}
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!bCoreText) {
+ if (!bCoreText)
FXSYS_memcpy(m_ExtGID, m_GlyphIndex, 256);
- }
+
#endif
return;
}
@@ -397,8 +394,7 @@ void CPDF_Type1Font::LoadGlyphMap() {
}
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!bCoreText) {
+ if (!bCoreText)
FXSYS_memcpy(m_ExtGID, m_GlyphIndex, 256);
- }
#endif
}