From e6db16e7e6cdc3dd213c16de0d792b77656ac7a6 Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 19 Sep 2016 10:45:09 -0700 Subject: Clean up CPDF_Stream. Replace the CPDF_Stream(nullptr, 0, nullptr) pattern with a default ctor. Remove unused parameters from CPDF_Stream::SetData(). Both are always passed as FALSE. CPDF_Stream declared its own m_GenNum, which shadowed the one in CPDF_Object. It was used only to distinguish file/memory streams, so add a bool explicitly for this purpose. Remove the union, it would be sad if we confused user data with a C++ object with virtual function calls. Use unique_ptrs with appropriate deleters to manage memory. Review-Url: https://codereview.chromium.org/2347993002 --- fpdfsdk/formfiller/cba_fontmap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fpdfsdk/formfiller') diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp index 264366bfa4..fe690f23d5 100644 --- a/fpdfsdk/formfiller/cba_fontmap.cpp +++ b/fpdfsdk/formfiller/cba_fontmap.cpp @@ -167,7 +167,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, CPDF_Stream* pStream = pAPDict->GetStreamFor(m_sAPType); if (!pStream) { - pStream = new CPDF_Stream(nullptr, 0, nullptr); + pStream = new CPDF_Stream; int32_t objnum = m_pDocument->AddIndirectObject(pStream); pAPDict->SetReferenceFor(m_sAPType, m_pDocument, objnum); } -- cgit v1.2.3