summaryrefslogtreecommitdiff
path: root/xfa/fde/fde_render.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-14 05:57:10 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-14 05:57:10 -0800
commita9caab94c1f16929e5acf2676117224617d80f53 (patch)
treed71ff9a82fae6e6080deb76375f43056127b3ee2 /xfa/fde/fde_render.cpp
parent992ecf7c189e5cabf43e5ad862511cf63d030966 (diff)
downloadpdfium-a9caab94c1f16929e5acf2676117224617d80f53.tar.xz
Avoid the ptr.reset(new XXX()) anti-pattern
Be suspicious of |new|. This removes some of the easy cases. Review-Url: https://codereview.chromium.org/2571913002
Diffstat (limited to 'xfa/fde/fde_render.cpp')
-rw-r--r--xfa/fde/fde_render.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/xfa/fde/fde_render.cpp b/xfa/fde/fde_render.cpp
index e1d46f55f9..9528219b45 100644
--- a/xfa/fde/fde_render.cpp
+++ b/xfa/fde/fde_render.cpp
@@ -6,6 +6,7 @@
#include "xfa/fde/fde_render.h"
+#include "third_party/base/ptr_util.h"
#include "xfa/fde/fde_gedevice.h"
#include "xfa/fde/fde_object.h"
#include "xfa/fgas/crt/fgas_memory.h"
@@ -38,7 +39,7 @@ bool CFDE_RenderContext::StartRender(CFDE_RenderDevice* pRenderDevice,
m_pRenderDevice = pRenderDevice;
m_Transform = tmDoc2Device;
if (!m_pIterator)
- m_pIterator.reset(new CFDE_VisualSetIterator);
+ m_pIterator = pdfium::MakeUnique<CFDE_VisualSetIterator>();
return m_pIterator->AttachCanvas(pCanvasSet) && m_pIterator->FilterObjects();
}
@@ -116,7 +117,7 @@ void CFDE_RenderContext::RenderText(IFDE_TextSet* pTextSet,
return;
if (!m_pBrush)
- m_pBrush.reset(new CFDE_Brush);
+ m_pBrush = pdfium::MakeUnique<CFDE_Brush>();
if (m_CharPos.size() < static_cast<size_t>(iCount))
m_CharPos.resize(iCount, FXTEXT_CHARPOS());