summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_fontmgr.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_fontmgr.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_fontmgr.cpp')
-rw-r--r--core/fxge/cfx_fontmgr.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/fxge/cfx_fontmgr.cpp b/core/fxge/cfx_fontmgr.cpp
index e12f341b3e..d9b03549e0 100644
--- a/core/fxge/cfx_fontmgr.cpp
+++ b/core/fxge/cfx_fontmgr.cpp
@@ -123,13 +123,13 @@ FXFT_Face CFX_FontMgr::FindSubstFont(const ByteString& face_name,
FXFT_Face CFX_FontMgr::GetCachedFace(const ByteString& face_name,
int weight,
bool bItalic,
- uint8_t*& pFontData) {
+ uint8_t** pFontData) {
auto it = m_FaceMap.find(KeyNameFromFace(face_name, weight, bItalic));
if (it == m_FaceMap.end())
return nullptr;
CTTFontDesc* pFontDesc = it->second.get();
- pFontData = pFontDesc->m_pFontData;
+ *pFontData = pFontDesc->m_pFontData;
pFontDesc->m_RefCount++;
return pFontDesc->m_SingleFace;
}
@@ -165,13 +165,13 @@ FXFT_Face CFX_FontMgr::AddCachedFace(const ByteString& face_name,
FXFT_Face CFX_FontMgr::GetCachedTTCFace(int ttc_size,
uint32_t checksum,
int font_offset,
- uint8_t*& pFontData) {
+ uint8_t** pFontData) {
auto it = m_FaceMap.find(KeyNameFromSize(ttc_size, checksum));
if (it == m_FaceMap.end())
return nullptr;
CTTFontDesc* pFontDesc = it->second.get();
- pFontData = pFontDesc->m_pFontData;
+ *pFontData = pFontDesc->m_pFontData;
pFontDesc->m_RefCount++;
int face_index = GetTTCIndex(pFontDesc->m_pFontData, ttc_size, font_offset);
if (!pFontDesc->m_TTCFaces[face_index]) {