summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_sysfontinfo.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-07 16:58:00 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-10 16:33:54 +0000
commitec8ff7d258ef25f7e3193572aeef220ff86784f0 (patch)
tree1c72cae7e3b43908840c9a6881b239850933680b /fpdfsdk/fpdf_sysfontinfo.cpp
parent84b596d64aab8f8c6dd6145e9c210b145fc5631a (diff)
downloadpdfium-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 'fpdfsdk/fpdf_sysfontinfo.cpp')
-rw-r--r--fpdfsdk/fpdf_sysfontinfo.cpp12
1 files changed, 6 insertions, 6 deletions
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<FPDF_SYSFONTINFO_DEFAULT*>(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<FPDF_SYSFONTINFO_DEFAULT*>(pThis);
- if (!pDefault->m_pFontInfo->GetFontCharset(hFont, charset))
+ if (!pDefault->m_pFontInfo->GetFontCharset(hFont, &charset))
return 0;
return charset;
}