summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-10-26 15:06:11 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-26 15:06:11 -0700
commite5cb0b191aed020da99757c117dae014ea65c6ba (patch)
tree49f6f8124adbf24f94def640932adbf7e1460175 /fpdfsdk
parentcd5f026e7b277ec73d53e149c7c48ee981547d1a (diff)
downloadpdfium-e5cb0b191aed020da99757c117dae014ea65c6ba.tar.xz
Take advantage of implicit std::unique_ptr<>(nulltpr_t) ctor.
Review-Url: https://codereview.chromium.org/2453163002
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdf_progressive.cpp2
-rw-r--r--fpdfsdk/fpdfdoc_unittest.cpp2
-rw-r--r--fpdfsdk/fpdfview.cpp6
-rw-r--r--fpdfsdk/pdfwindow/PWL_FontMap.cpp3
4 files changed, 6 insertions, 7 deletions
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<CPDF_PageRenderContext>());
+ 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_Parser>()) {}
+ 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<CPDF_PageRenderContext>());
+ 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<CPDF_PageRenderContext>());
+ 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<CPDF_PageRenderContext>());
+ 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<CPDF_Document>(std::unique_ptr<CPDF_Parser>());
+ m_pPDFDoc = pdfium::MakeUnique<CPDF_Document>(nullptr);
m_pPDFDoc->CreateNewDoc();
}
}