diff options
Diffstat (limited to 'xfa/fde')
-rw-r--r-- | xfa/fde/cfde_txtedtengine.cpp | 11 | ||||
-rw-r--r-- | xfa/fde/tto/fde_textout.cpp | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp index a61f6ab4d9..fbc5e159ed 100644 --- a/xfa/fde/cfde_txtedtengine.cpp +++ b/xfa/fde/cfde_txtedtengine.cpp @@ -53,7 +53,7 @@ FDE_TXTEDT_TEXTCHANGE_INFO::FDE_TXTEDT_TEXTCHANGE_INFO() {} FDE_TXTEDT_TEXTCHANGE_INFO::~FDE_TXTEDT_TEXTCHANGE_INFO() {} CFDE_TxtEdtEngine::CFDE_TxtEdtEngine() - : m_pTxtBuf(new CFDE_TxtEdtBuf()), + : m_pTxtBuf(pdfium::MakeUnique<CFDE_TxtEdtBuf>()), m_nPageLineCount(20), m_nLineCount(0), m_nAnchorPos(-1), @@ -81,11 +81,11 @@ CFDE_TxtEdtEngine::~CFDE_TxtEdtEngine() { void CFDE_TxtEdtEngine::SetEditParams(const FDE_TXTEDTPARAMS& params) { if (!m_pTextBreak) - m_pTextBreak = pdfium::MakeUnique<CFX_TxtBreak>(FX_TXTBREAKPOLICY_None); + m_pTextBreak = pdfium::MakeUnique<CFX_TxtBreak>(); m_Param = params; m_wLineEnd = params.wLineBreakChar; - m_bAutoLineEnd = (m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto); + m_bAutoLineEnd = m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto; UpdateTxtBreak(); } @@ -930,8 +930,7 @@ void CFDE_TxtEdtEngine::RebuildParagraphs() { FX_WCHAR wChar = L' '; int32_t nParagStart = 0; int32_t nIndex = 0; - std::unique_ptr<IFX_CharIter> pIter( - new CFDE_TxtEdtBuf::Iterator(m_pTxtBuf.get())); + auto pIter = pdfium::MakeUnique<CFDE_TxtEdtBuf::Iterator>(m_pTxtBuf.get()); pIter->SetAt(0); do { wChar = pIter->GetChar(); @@ -1376,7 +1375,7 @@ bool CFDE_TxtEdtEngine::MoveEnd() { } bool CFDE_TxtEdtEngine::IsFitArea(CFX_WideString& wsText) { - std::unique_ptr<CFDE_TextOut> pTextOut(new CFDE_TextOut); + auto pTextOut = pdfium::MakeUnique<CFDE_TextOut>(); pTextOut->SetLineSpace(m_Param.fLineSpace); pTextOut->SetFont(m_Param.pFont); pTextOut->SetFontSize(m_Param.fFontSize); diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp index 421876b48d..b4bbe67238 100644 --- a/xfa/fde/tto/fde_textout.cpp +++ b/xfa/fde/tto/fde_textout.cpp @@ -23,7 +23,7 @@ FDE_TTOPIECE::FDE_TTOPIECE(const FDE_TTOPIECE& that) = default; FDE_TTOPIECE::~FDE_TTOPIECE() = default; CFDE_TextOut::CFDE_TextOut() - : m_pTxtBreak(new CFX_TxtBreak(FX_TXTBREAKPOLICY_None)), + : m_pTxtBreak(pdfium::MakeUnique<CFX_TxtBreak>()), m_pFont(nullptr), m_fFontSize(12.0f), m_fLineSpace(m_fFontSize), @@ -771,7 +771,7 @@ void CFDE_TextOut::DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen* pPen) { if (!bUnderLine && !bStrikeOut && !bHotKey) return; - std::unique_ptr<CFDE_Path> pPath(new CFDE_Path); + auto pPath = pdfium::MakeUnique<CFDE_Path>(); int32_t iLineCount = 0; CFX_RectF rtText = pPiece->rtPiece; CFX_PointF pt1, pt2; |