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 --- core/fxge/win32/fx_win32_device.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core/fxge/win32/fx_win32_device.cpp') diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index 39533e1ef6..73a1ac6a0e 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -347,8 +347,8 @@ class CFX_Win32FontInfo final : public IFX_SystemFontInfo { uint32_t table, uint8_t* buffer, uint32_t size) 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; void DeleteFont(void* hFont) override; bool IsOpenTypeFromDiv(const LOGFONTA* plf); @@ -664,7 +664,7 @@ uint32_t CFX_Win32FontInfo::GetFontData(void* hFont, return size; } -bool CFX_Win32FontInfo::GetFaceName(void* hFont, CFX_ByteString& name) { +bool CFX_Win32FontInfo::GetFaceName(void* hFont, CFX_ByteString* name) { char facebuf[100]; HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont); int ret = ::GetTextFaceA(m_hDC, 100, facebuf); @@ -672,16 +672,16 @@ bool CFX_Win32FontInfo::GetFaceName(void* hFont, CFX_ByteString& name) { if (ret == 0) { return false; } - name = facebuf; + *name = facebuf; return true; } -bool CFX_Win32FontInfo::GetFontCharset(void* hFont, int& charset) { +bool CFX_Win32FontInfo::GetFontCharset(void* hFont, int* charset) { TEXTMETRIC tm; HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont); ::GetTextMetrics(m_hDC, &tm); ::SelectObject(m_hDC, hOldFont); - charset = tm.tmCharSet; + *charset = tm.tmCharSet; return true; } -- cgit v1.2.3