From 0bb1333a9eff1190ddd68f34c71d6a779c69dfef Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 30 Mar 2017 16:12:02 -0400 Subject: Add some calls to MakeUnique This CL replaces some new's with pdfium::MakeUnique. Change-Id: I50faf3ed55e7730b094c14a7989a9dd51cf33cbb Reviewed-on: https://pdfium-review.googlesource.com/3430 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- xfa/fxfa/app/cxfa_textlayout.cpp | 5 ++--- xfa/fxfa/app/xfa_fwltheme.cpp | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 15 deletions(-) (limited to 'xfa/fxfa/app') diff --git a/xfa/fxfa/app/cxfa_textlayout.cpp b/xfa/fxfa/app/cxfa_textlayout.cpp index c8ed4f7f46..f16fd8c1a9 100644 --- a/xfa/fxfa/app/cxfa_textlayout.cpp +++ b/xfa/fxfa/app/cxfa_textlayout.cpp @@ -559,8 +559,7 @@ bool CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice, if (!pFxDevice) return false; - std::unique_ptr pDevice( - new CFDE_RenderDevice(pFxDevice, false)); + auto pDevice = pdfium::MakeUnique(pFxDevice, false); pDevice->SaveState(); pDevice->SetClipRect(rtClip); @@ -1176,7 +1175,7 @@ void CXFA_TextLayout::RenderPath(CFDE_RenderDevice* pDevice, return; pPen->SetColor(pPiece->dwColor); - std::unique_ptr pPath(new CFDE_Path); + auto pPath = pdfium::MakeUnique(); int32_t iChars = GetDisplayPos(pPiece, pCharPos); if (iChars > 0) { CFX_PointF pt1, pt2; diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp index 4d5b20e438..629cd509e8 100644 --- a/xfa/fxfa/app/xfa_fwltheme.cpp +++ b/xfa/fxfa/app/xfa_fwltheme.cpp @@ -44,18 +44,18 @@ CXFA_FFWidget* XFA_ThemeGetOuterWidget(CFWL_Widget* pWidget) { } CXFA_FWLTheme::CXFA_FWLTheme(CXFA_FFApp* pApp) - : m_pCheckBoxTP(new CFWL_CheckBoxTP), - m_pListBoxTP(new CFWL_ListBoxTP), - m_pPictureBoxTP(new CFWL_PictureBoxTP), - m_pSrollBarTP(new CFWL_ScrollBarTP), - m_pEditTP(new CFWL_EditTP), - m_pComboBoxTP(new CFWL_ComboBoxTP), - m_pMonthCalendarTP(new CFWL_MonthCalendarTP), - m_pDateTimePickerTP(new CFWL_DateTimePickerTP), - m_pPushButtonTP(new CFWL_PushButtonTP), - m_pCaretTP(new CFWL_CaretTP), - m_pBarcodeTP(new CFWL_BarcodeTP), - m_pTextOut(new CFDE_TextOut), + : m_pCheckBoxTP(pdfium::MakeUnique()), + m_pListBoxTP(pdfium::MakeUnique()), + m_pPictureBoxTP(pdfium::MakeUnique()), + m_pSrollBarTP(pdfium::MakeUnique()), + m_pEditTP(pdfium::MakeUnique()), + m_pComboBoxTP(pdfium::MakeUnique()), + m_pMonthCalendarTP(pdfium::MakeUnique()), + m_pDateTimePickerTP(pdfium::MakeUnique()), + m_pPushButtonTP(pdfium::MakeUnique()), + m_pCaretTP(pdfium::MakeUnique()), + m_pBarcodeTP(pdfium::MakeUnique()), + m_pTextOut(pdfium::MakeUnique()), m_pCalendarFont(nullptr), m_pApp(pApp) { m_Rect.Reset(); -- cgit v1.2.3