summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_fontmapper.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-11-21 22:07:50 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-21 22:07:50 +0000
commit56e04d2656bdd5f2b9448d857e8e73ab16aadf8e (patch)
tree57ed8ebed62f498bdd1fe010b0909f162bbcd29c /core/fxge/cfx_fontmapper.cpp
parentebe865db548f768038186054fc0f1eb024565c43 (diff)
downloadpdfium-56e04d2656bdd5f2b9448d857e8e73ab16aadf8e.tar.xz
Avoid passing pointers by reference in core.
This gets rid of most core/ non-const ref passing, either by passing by pointer-to-pointer instead, or by returning std::pair. Change-Id: Id7bdc355a1a725a05f9fa2f1e982ca8c975beef1 Reviewed-on: https://pdfium-review.googlesource.com/19030 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/cfx_fontmapper.cpp')
-rw-r--r--core/fxge/cfx_fontmapper.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp
index 0511b0a76a..bb80c27d51 100644
--- a/core/fxge/cfx_fontmapper.cpp
+++ b/core/fxge/cfx_fontmapper.cpp
@@ -763,7 +763,6 @@ FXFT_Face CFX_FontMapper::GetCachedTTCFace(void* hFont,
const uint32_t tableTTCF,
uint32_t ttc_size,
uint32_t font_size) {
- FXFT_Face face;
uint8_t buffer[1024];
m_pFontInfo->GetFontData(hFont, tableTTCF, buffer, FX_ArraySize(buffer));
uint32_t* pBuffer = reinterpret_cast<uint32_t*>(buffer);
@@ -771,8 +770,8 @@ FXFT_Face CFX_FontMapper::GetCachedTTCFace(void* hFont,
for (int i = 0; i < 256; i++)
checksum += pBuffer[i];
uint8_t* pFontData;
- face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, ttc_size - font_size,
- pFontData);
+ FXFT_Face face = m_pFontMgr->GetCachedTTCFace(
+ ttc_size, checksum, ttc_size - font_size, &pFontData);
if (!face) {
pFontData = FX_Alloc(uint8_t, ttc_size);
m_pFontInfo->GetFontData(hFont, tableTTCF, pFontData, ttc_size);
@@ -787,9 +786,9 @@ FXFT_Face CFX_FontMapper::GetCachedFace(void* hFont,
int weight,
bool bItalic,
uint32_t font_size) {
- FXFT_Face face;
uint8_t* pFontData;
- face = m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, pFontData);
+ FXFT_Face face =
+ m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, &pFontData);
if (!face) {
pFontData = FX_Alloc(uint8_t, font_size);
m_pFontInfo->GetFontData(hFont, 0, pFontData, font_size);