OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_txtedtdorecord_deleterange.h" | 7 #include "xfa/fde/cfde_txtedtdorecord_deleterange.h" |
8 | 8 |
9 #include "xfa/fde/cfde_txtedtengine.h" | 9 #include "xfa/fde/cfde_txtedtengine.h" |
10 #include "xfa/fwl/core/cfwl_edit.h" | 10 #include "xfa/fwl/core/cfwl_edit.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 if (m_pEngine->IsSelect()) | 29 if (m_pEngine->IsSelect()) |
30 m_pEngine->ClearSelection(); | 30 m_pEngine->ClearSelection(); |
31 | 31 |
32 m_pEngine->Inner_Insert(m_nIndex, m_wsRange.c_str(), m_wsRange.GetLength()); | 32 m_pEngine->Inner_Insert(m_nIndex, m_wsRange.c_str(), m_wsRange.GetLength()); |
33 if (m_bSel) | 33 if (m_bSel) |
34 m_pEngine->AddSelRange(m_nIndex, m_wsRange.GetLength()); | 34 m_pEngine->AddSelRange(m_nIndex, m_wsRange.GetLength()); |
35 | 35 |
36 FDE_TXTEDTPARAMS& Param = m_pEngine->m_Param; | 36 FDE_TXTEDTPARAMS& Param = m_pEngine->m_Param; |
37 m_pEngine->m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Insert; | 37 m_pEngine->m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Insert; |
38 m_pEngine->m_ChangeInfo.wsDelete = m_wsRange; | 38 m_pEngine->m_ChangeInfo.wsDelete = m_wsRange; |
39 Param.pEventSink->On_TextChanged(m_pEngine, m_pEngine->m_ChangeInfo); | 39 Param.pEventSink->On_TextChanged(m_pEngine->m_ChangeInfo); |
40 m_pEngine->SetCaretPos(m_nCaret, true); | 40 m_pEngine->SetCaretPos(m_nCaret, true); |
41 return true; | 41 return true; |
42 } | 42 } |
43 | 43 |
44 bool CFDE_TxtEdtDoRecord_DeleteRange::Redo() const { | 44 bool CFDE_TxtEdtDoRecord_DeleteRange::Redo() const { |
45 m_pEngine->Inner_DeleteRange(m_nIndex, m_wsRange.GetLength()); | 45 m_pEngine->Inner_DeleteRange(m_nIndex, m_wsRange.GetLength()); |
46 if (m_bSel) | 46 if (m_bSel) |
47 m_pEngine->RemoveSelRange(m_nIndex, m_wsRange.GetLength()); | 47 m_pEngine->RemoveSelRange(m_nIndex, m_wsRange.GetLength()); |
48 | 48 |
49 FDE_TXTEDTPARAMS& Param = m_pEngine->m_Param; | 49 FDE_TXTEDTPARAMS& Param = m_pEngine->m_Param; |
50 m_pEngine->m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Insert; | 50 m_pEngine->m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Insert; |
51 m_pEngine->m_ChangeInfo.wsDelete = m_wsRange; | 51 m_pEngine->m_ChangeInfo.wsDelete = m_wsRange; |
52 Param.pEventSink->On_TextChanged(m_pEngine, m_pEngine->m_ChangeInfo); | 52 Param.pEventSink->On_TextChanged(m_pEngine->m_ChangeInfo); |
53 m_pEngine->SetCaretPos(m_nIndex, true); | 53 m_pEngine->SetCaretPos(m_nIndex, true); |
54 return true; | 54 return true; |
55 } | 55 } |
OLD | NEW |