From e5cb0b191aed020da99757c117dae014ea65c6ba Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 26 Oct 2016 15:06:11 -0700 Subject: Take advantage of implicit std::unique_ptr<>(nulltpr_t) ctor. Review-Url: https://codereview.chromium.org/2453163002 --- fpdfsdk/fpdf_progressive.cpp | 2 +- fpdfsdk/fpdfdoc_unittest.cpp | 2 +- fpdfsdk/fpdfview.cpp | 6 +++--- fpdfsdk/pdfwindow/PWL_FontMap.cpp | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp index 1933c88485..13349cd762 100644 --- a/fpdfsdk/fpdf_progressive.cpp +++ b/fpdfsdk/fpdf_progressive.cpp @@ -91,5 +91,5 @@ DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page) { return; pContext->m_pDevice->RestoreState(false); - pPage->SetRenderContext(std::unique_ptr()); + pPage->SetRenderContext(nullptr); } diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp index fc85404dba..48be72399c 100644 --- a/fpdfsdk/fpdfdoc_unittest.cpp +++ b/fpdfsdk/fpdfdoc_unittest.cpp @@ -25,7 +25,7 @@ class CPDF_TestDocument : public CPDF_Document { public: - CPDF_TestDocument() : CPDF_Document(std::unique_ptr()) {} + CPDF_TestDocument() : CPDF_Document(nullptr) {} void SetRoot(CPDF_Dictionary* root) { m_pRootDict = root; } CPDF_IndirectObjectHolder* GetHolder() { return this; } diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 92ca34effa..be56c531d2 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -575,7 +575,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, } } - pPage->SetRenderContext(std::unique_ptr()); + pPage->SetRenderContext(nullptr); } #endif // defined(_WIN32) @@ -604,7 +604,7 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y, rotate, flags, TRUE, nullptr); - pPage->SetRenderContext(std::unique_ptr()); + pPage->SetRenderContext(nullptr); } #ifdef _SKIA_SUPPORT_ @@ -622,7 +622,7 @@ DLLEXPORT FPDF_RECORDER STDCALL FPDF_RenderPageSkp(FPDF_PAGE page, pContext->m_pDevice.reset(skDevice); FPDF_RenderPage_Retail(pContext, page, 0, 0, size_x, size_y, 0, 0, TRUE, nullptr); - pPage->SetRenderContext(std::unique_ptr()); + pPage->SetRenderContext(nullptr); return recorder; } #endif diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/pdfwindow/PWL_FontMap.cpp index a6f79e283c..b2a1f2580d 100644 --- a/fpdfsdk/pdfwindow/PWL_FontMap.cpp +++ b/fpdfsdk/pdfwindow/PWL_FontMap.cpp @@ -48,8 +48,7 @@ CPWL_FontMap::~CPWL_FontMap() { CPDF_Document* CPWL_FontMap::GetDocument() { if (!m_pPDFDoc) { if (CPDF_ModuleMgr::Get()) { - m_pPDFDoc = - pdfium::MakeUnique(std::unique_ptr()); + m_pPDFDoc = pdfium::MakeUnique(nullptr); m_pPDFDoc->CreateNewDoc(); } } -- cgit v1.2.3