From 9c292fef316739f43730f11b9a2b6d3e4b725b54 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 21 Jun 2018 15:02:24 +0000 Subject: Avoid const-refs to implicitly constructed strings. Because the invisible temporary goes out of scope at the next semicolon. Also avoid returning const string references since the cost is low to properly keep the string alive. Change-Id: Id283e4fd99f79a02d79d739a533a4ce05e831e2a Reviewed-on: https://pdfium-review.googlesource.com/35710 Commit-Queue: dsinclair Reviewed-by: dsinclair --- core/fpdfapi/font/cpdf_font.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/fpdfapi/font') diff --git a/core/fpdfapi/font/cpdf_font.h b/core/fpdfapi/font/cpdf_font.h index a137879891..4b099ae0d0 100644 --- a/core/fpdfapi/font/cpdf_font.h +++ b/core/fpdfapi/font/cpdf_font.h @@ -63,7 +63,7 @@ class CPDF_Font { virtual uint32_t CharCodeFromUnicode(wchar_t Unicode) const; virtual bool HasFontWidths() const; - const ByteString& GetBaseFont() const { return m_BaseFont; } + ByteString GetBaseFont() const { return m_BaseFont; } CFX_SubstFont* GetSubstFont() const { return m_Font.GetSubstFont(); } bool IsEmbedded() const { return IsType3Font() || m_pFontFile != nullptr; } const CPDF_Dictionary* GetFontDict() const { return m_pFontDict; } -- cgit v1.2.3