OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fde/cfde_txtedtengine.h" | 7 #include "xfa/fde/cfde_txtedtengine.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 CFDE_TxtEdtEngine::~CFDE_TxtEdtEngine() { | 76 CFDE_TxtEdtEngine::~CFDE_TxtEdtEngine() { |
77 RemoveAllParags(); | 77 RemoveAllParags(); |
78 RemoveAllPages(); | 78 RemoveAllPages(); |
79 m_Param.pEventSink = nullptr; | 79 m_Param.pEventSink = nullptr; |
80 ClearSelection(); | 80 ClearSelection(); |
81 } | 81 } |
82 | 82 |
83 void CFDE_TxtEdtEngine::SetEditParams(const FDE_TXTEDTPARAMS& params) { | 83 void CFDE_TxtEdtEngine::SetEditParams(const FDE_TXTEDTPARAMS& params) { |
84 if (!m_pTextBreak) | 84 if (!m_pTextBreak) |
85 m_pTextBreak.reset(new CFX_TxtBreak(FX_TXTBREAKPOLICY_None)); | 85 m_pTextBreak = pdfium::MakeUnique<CFX_TxtBreak>(FX_TXTBREAKPOLICY_None); |
86 | 86 |
87 FXSYS_memcpy(&m_Param, ¶ms, sizeof(FDE_TXTEDTPARAMS)); | 87 FXSYS_memcpy(&m_Param, ¶ms, sizeof(FDE_TXTEDTPARAMS)); |
88 m_wLineEnd = params.wLineBreakChar; | 88 m_wLineEnd = params.wLineBreakChar; |
89 m_bAutoLineEnd = (m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto); | 89 m_bAutoLineEnd = (m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto); |
90 UpdateTxtBreak(); | 90 UpdateTxtBreak(); |
91 } | 91 } |
92 | 92 |
93 FDE_TXTEDTPARAMS* CFDE_TxtEdtEngine::GetEditParams() { | 93 FDE_TXTEDTPARAMS* CFDE_TxtEdtEngine::GetEditParams() { |
94 return &m_Param; | 94 return &m_Param; |
95 } | 95 } |
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1610 m_SelRangePtrArr.RemoveAt(nCountRange); | 1610 m_SelRangePtrArr.RemoveAt(nCountRange); |
1611 DeleteRange_DoRecord(nSelStart, nSelCount, true); | 1611 DeleteRange_DoRecord(nSelStart, nSelCount, true); |
1612 } | 1612 } |
1613 ClearSelection(); | 1613 ClearSelection(); |
1614 m_Param.pEventSink->OnTextChanged(m_ChangeInfo); | 1614 m_Param.pEventSink->OnTextChanged(m_ChangeInfo); |
1615 m_Param.pEventSink->OnSelChanged(); | 1615 m_Param.pEventSink->OnSelChanged(); |
1616 SetCaretPos(nSelStart, true); | 1616 SetCaretPos(nSelStart, true); |
1617 return; | 1617 return; |
1618 } | 1618 } |
1619 } | 1619 } |
OLD | NEW |