diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-04-07 16:58:00 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-10 16:33:54 +0000 |
commit | ec8ff7d258ef25f7e3193572aeef220ff86784f0 (patch) | |
tree | 1c72cae7e3b43908840c9a6881b239850933680b /core/fxge/ge | |
parent | 84b596d64aab8f8c6dd6145e9c210b145fc5631a (diff) | |
download | pdfium-ec8ff7d258ef25f7e3193572aeef220ff86784f0.tar.xz |
Fix bytestring passing conventions, part 2.
Change pass by reference to const reference or pointer.
Change-Id: Ic007f14e6569679a846980a96cc627eac4ecd5d6
Reviewed-on: https://pdfium-review.googlesource.com/3953
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/ge')
-rw-r--r-- | core/fxge/ge/cfx_folderfontinfo.cpp | 8 | ||||
-rw-r--r-- | core/fxge/ge/cfx_folderfontinfo.h | 4 | ||||
-rw-r--r-- | core/fxge/ge/cfx_fontmapper.cpp | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/core/fxge/ge/cfx_folderfontinfo.cpp b/core/fxge/ge/cfx_folderfontinfo.cpp index 15a8daf95c..ff8cc4c29f 100644 --- a/core/fxge/ge/cfx_folderfontinfo.cpp +++ b/core/fxge/ge/cfx_folderfontinfo.cpp @@ -366,14 +366,14 @@ uint32_t CFX_FolderFontInfo::GetFontData(void* hFont, } void CFX_FolderFontInfo::DeleteFont(void* hFont) {} -bool CFX_FolderFontInfo::GetFaceName(void* hFont, CFX_ByteString& name) { + +bool CFX_FolderFontInfo::GetFaceName(void* hFont, CFX_ByteString* name) { if (!hFont) return false; - CFX_FontFaceInfo* pFont = (CFX_FontFaceInfo*)hFont; - name = pFont->m_FaceName; + *name = static_cast<CFX_FontFaceInfo*>(hFont)->m_FaceName; return true; } -bool CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset) { +bool CFX_FolderFontInfo::GetFontCharset(void* hFont, int* charset) { return false; } diff --git a/core/fxge/ge/cfx_folderfontinfo.h b/core/fxge/ge/cfx_folderfontinfo.h index 17940bdbee..ab2468ade0 100644 --- a/core/fxge/ge/cfx_folderfontinfo.h +++ b/core/fxge/ge/cfx_folderfontinfo.h @@ -41,8 +41,8 @@ class CFX_FolderFontInfo : public IFX_SystemFontInfo { uint8_t* buffer, uint32_t size) override; void DeleteFont(void* hFont) override; - bool GetFaceName(void* hFont, CFX_ByteString& name) override; - bool GetFontCharset(void* hFont, int& charset) override; + bool GetFaceName(void* hFont, CFX_ByteString* name) override; + bool GetFontCharset(void* hFont, int* charset) override; protected: void ScanPath(const CFX_ByteString& path); diff --git a/core/fxge/ge/cfx_fontmapper.cpp b/core/fxge/ge/cfx_fontmapper.cpp index e8fb988fdb..0cff344599 100644 --- a/core/fxge/ge/cfx_fontmapper.cpp +++ b/core/fxge/ge/cfx_fontmapper.cpp @@ -677,9 +677,9 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, if (!hFont) return nullptr; - m_pFontInfo->GetFaceName(hFont, SubstName); + m_pFontInfo->GetFaceName(hFont, &SubstName); if (Charset == FXFONT_DEFAULT_CHARSET) - m_pFontInfo->GetFontCharset(hFont, Charset); + m_pFontInfo->GetFontCharset(hFont, &Charset); uint32_t ttc_size = m_pFontInfo->GetFontData(hFont, kTableTTCF, nullptr, 0); uint32_t font_size = m_pFontInfo->GetFontData(hFont, 0, nullptr, 0); if (font_size == 0 && ttc_size == 0) { @@ -742,7 +742,7 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(uint32_t dwUnicode, face = GetCachedTTCFace(hFont, 0x74746366, ttc_size, font_size); } else { CFX_ByteString SubstName; - m_pFontInfo->GetFaceName(hFont, SubstName); + m_pFontInfo->GetFaceName(hFont, &SubstName); face = GetCachedFace(hFont, SubstName, weight, bItalic, font_size); } m_pFontInfo->DeleteFont(hFont); |