From ec8ff7d258ef25f7e3193572aeef220ff86784f0 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 7 Apr 2017 16:58:00 -0700 Subject: 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 Reviewed-by: Lei Zhang --- fpdfsdk/fpdf_sysfontinfo.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fpdfsdk/fpdf_sysfontinfo.cpp') diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp index 3d15ca3a41..6939eba14d 100644 --- a/fpdfsdk/fpdf_sysfontinfo.cpp +++ b/fpdfsdk/fpdf_sysfontinfo.cpp @@ -58,7 +58,7 @@ class CFX_ExternalFontInfo final : public IFX_SystemFontInfo { return m_pInfo->GetFontData(m_pInfo, hFont, table, buffer, size); } - bool GetFaceName(void* hFont, CFX_ByteString& name) override { + bool GetFaceName(void* hFont, CFX_ByteString* name) override { if (!m_pInfo->GetFaceName) return false; uint32_t size = m_pInfo->GetFaceName(m_pInfo, hFont, nullptr, 0); @@ -66,16 +66,16 @@ class CFX_ExternalFontInfo final : public IFX_SystemFontInfo { return false; char* buffer = FX_Alloc(char, size); size = m_pInfo->GetFaceName(m_pInfo, hFont, buffer, size); - name = CFX_ByteString(buffer, size); + *name = CFX_ByteString(buffer, size); FX_Free(buffer); return true; } - bool GetFontCharset(void* hFont, int& charset) override { + bool GetFontCharset(void* hFont, int* charset) override { if (!m_pInfo->GetFontCharset) return false; - charset = m_pInfo->GetFontCharset(m_pInfo, hFont); + *charset = m_pInfo->GetFontCharset(m_pInfo, hFont); return true; } @@ -155,7 +155,7 @@ static unsigned long DefaultGetFaceName(struct _FPDF_SYSFONTINFO* pThis, unsigned long buf_size) { CFX_ByteString name; auto* pDefault = static_cast(pThis); - if (!pDefault->m_pFontInfo->GetFaceName(hFont, name)) + if (!pDefault->m_pFontInfo->GetFaceName(hFont, &name)) return 0; if (name.GetLength() >= (long)buf_size) return name.GetLength() + 1; @@ -168,7 +168,7 @@ static unsigned long DefaultGetFaceName(struct _FPDF_SYSFONTINFO* pThis, static int DefaultGetFontCharset(struct _FPDF_SYSFONTINFO* pThis, void* hFont) { int charset; auto* pDefault = static_cast(pThis); - if (!pDefault->m_pFontInfo->GetFontCharset(hFont, charset)) + if (!pDefault->m_pFontInfo->GetFontCharset(hFont, &charset)) return 0; return charset; } -- cgit v1.2.3