summaryrefslogtreecommitdiff
path: root/core/src/fxge/ge/fx_ge_font.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-22 14:59:55 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-22 14:59:55 -0700
commit7cc97521db1e52d5927f5605de5f9a7102f8af40 (patch)
treedf96cf98cd470e794c7817f347511f3c554c96e4 /core/src/fxge/ge/fx_ge_font.cpp
parentb05f1fd710496dea44b001bb905fa1c16a39bb28 (diff)
downloadpdfium-7cc97521db1e52d5927f5605de5f9a7102f8af40.tar.xz
Fix else-after-returns throughout pdfium.
Driven by CS search for pcre:yes file:third_party/pdfium/ -file:pdfium/third_party/ \breturn\b[^;]*;\s*\n*\s*\}*\s*\n*\r*else Note: Care is required to ensure the preceding block is not an else-if. As usual, removed any tabs I saw. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1243883003 .
Diffstat (limited to 'core/src/fxge/ge/fx_ge_font.cpp')
-rw-r--r--core/src/fxge/ge/fx_ge_font.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index f88cbaacde..6a950bf20b 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -309,9 +309,8 @@ CFX_ByteString CFX_Font::GetFamilyName() const
}
if (m_Face) {
return CFX_ByteString(FXFT_Get_Face_Family_Name(m_Face));
- } else {
- return m_pSubstFont->m_Family;
}
+ return m_pSubstFont->m_Family;
}
CFX_ByteString CFX_Font::GetFaceName() const
{
@@ -329,9 +328,8 @@ CFX_ByteString CFX_Font::GetFaceName() const
facename += " " + style;
}
return facename;
- } else {
- return m_pSubstFont->m_Family;
}
+ return m_pSubstFont->m_Family;
}
FX_BOOL CFX_Font::GetBBox(FX_RECT &bbox)
{
@@ -410,21 +408,20 @@ FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCode(FX_DWORD charcode)
}
FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCodeEx(FX_DWORD charcode, int encoding)
{
- FXFT_Face face = m_pFont->GetFace();
+ FXFT_Face face = m_pFont->GetFace();
if (!face) {
return charcode;
}
if (encoding == ENCODING_UNICODE) {
- return GlyphFromCharCode(charcode);
- } else {
- int nmaps = FXFT_Get_Face_CharmapCount(m_pFont->m_Face);
- int i = 0;
- while (i < nmaps) {
- int encoding = FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[i++]);
- if (encoding != FXFT_ENCODING_UNICODE) {
- FXFT_Select_Charmap(face, encoding);
- break;
- }
+ return GlyphFromCharCode(charcode);
+ }
+ int nmaps = FXFT_Get_Face_CharmapCount(m_pFont->m_Face);
+ int i = 0;
+ while (i < nmaps) {
+ int encoding = FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[i++]);
+ if (encoding != FXFT_ENCODING_UNICODE) {
+ FXFT_Select_Charmap(face, encoding);
+ break;
}
}
return FXFT_Get_Char_Index(face, charcode);