diff options
author | tsepez <tsepez@chromium.org> | 2016-12-14 19:50:23 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-14 19:50:23 -0800 |
commit | 37b12ad873198a9644f3de0d2eff001285e1ad42 (patch) | |
tree | 30471459df282284efdf363fa48f8e072ce629a2 /fpdfsdk | |
parent | b8642f8a3c3a6d359c4e319b8ba91f8df6448a4f (diff) | |
download | pdfium-37b12ad873198a9644f3de0d2eff001285e1ad42.tar.xz |
Return unique_ptr from CXFA_FFApp::CreateDoc.
Remove one unused CreateDoc variant.
Review-Url: https://codereview.chromium.org/2576893002
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/fpdfview.cpp | 6 | ||||
-rw-r--r-- | fpdfsdk/fpdfxfa/cpdfxfa_context.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index b49be38716..c292384e88 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -890,10 +890,10 @@ DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page, DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, int height, int alpha) { - std::unique_ptr<CFX_DIBitmap> pBitmap(new CFX_DIBitmap); - if (!pBitmap->Create(width, height, alpha ? FXDIB_Argb : FXDIB_Rgb32)) { + auto pBitmap = pdfium::MakeUnique<CFX_DIBitmap>(); + if (!pBitmap->Create(width, height, alpha ? FXDIB_Argb : FXDIB_Rgb32)) return nullptr; - } + return pBitmap.release(); } diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp index 1995882388..7a0ffeb256 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp @@ -92,7 +92,7 @@ bool CPDFXFA_Context::LoadXFADoc() { if (!pApp) return false; - m_pXFADoc.reset(pApp->CreateDoc(&m_DocEnv, m_pPDFDoc.get())); + m_pXFADoc = pApp->CreateDoc(&m_DocEnv, m_pPDFDoc.get()); if (!m_pXFADoc) { SetLastError(FPDF_ERR_XFALOAD); return false; |