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 "../../include/fxedit/fxet_stub.h" | 7 #include "../../include/fxedit/fxet_stub.h" |
8 #include "../../include/fxedit/fxet_edit.h" | 8 #include "../../include/fxedit/fxet_edit.h" |
9 | 9 |
10 #define FX_EDIT_UNDO_MAXITEM 10000 | 10 #define FX_EDIT_UNDO_MAXITEM 10000 |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 m_pEdit->Clear(FALSE,TRUE); | 738 m_pEdit->Clear(FALSE,TRUE); |
739 } | 739 } |
740 } | 740 } |
741 | 741 |
742 void CFXEU_Clear::Undo() | 742 void CFXEU_Clear::Undo() |
743 { | 743 { |
744 if (m_pEdit) | 744 if (m_pEdit) |
745 { | 745 { |
746 m_pEdit->SelectNone(); | 746 m_pEdit->SelectNone(); |
747 m_pEdit->SetCaret(m_wrSel.BeginPos); | 747 m_pEdit->SetCaret(m_wrSel.BeginPos); |
748 » » m_pEdit->InsertText(m_swText, DEFAULT_CHARSET, NULL,NULL,FALSE,T
RUE); | 748 » » m_pEdit->InsertText(m_swText.c_str(), DEFAULT_CHARSET, NULL, NUL
L, FALSE, TRUE); |
749 m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos); | 749 m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos); |
750 } | 750 } |
751 } | 751 } |
752 | 752 |
753 /* -------------------------------------------------------------------------- */ | 753 /* -------------------------------------------------------------------------- */ |
754 //CFXEU_ClearRich | 754 //CFXEU_ClearRich |
755 | 755 |
756 CFXEU_ClearRich::CFXEU_ClearRich(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldP
lace, const CPVT_WordPlace & wpNewPlace, | 756 CFXEU_ClearRich::CFXEU_ClearRich(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldP
lace, const CPVT_WordPlace & wpNewPlace, |
757 const CPVT_WordRange
& wrSel, FX_WORD word, FX_INT32 charset, | 757 const CPVT_WordRange
& wrSel, FX_WORD word, FX_INT32 charset, |
758 const CPVT_SecProps &
SecProps, const CPVT_WordProps & WordProps) : | 758 const CPVT_SecProps &
SecProps, const CPVT_WordProps & WordProps) : |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 CFXEU_InsertText::~CFXEU_InsertText() | 826 CFXEU_InsertText::~CFXEU_InsertText() |
827 { | 827 { |
828 } | 828 } |
829 | 829 |
830 void CFXEU_InsertText::Redo() | 830 void CFXEU_InsertText::Redo() |
831 { | 831 { |
832 if (m_pEdit && IsLast()) | 832 if (m_pEdit && IsLast()) |
833 { | 833 { |
834 m_pEdit->SelectNone(); | 834 m_pEdit->SelectNone(); |
835 m_pEdit->SetCaret(m_wpOld); | 835 m_pEdit->SetCaret(m_wpOld); |
836 » » m_pEdit->InsertText(m_swText, m_nCharset,&m_SecProps, &m_WordPro
ps,FALSE,TRUE); | 836 » » m_pEdit->InsertText(m_swText.c_str(), m_nCharset, &m_SecProps, &
m_WordProps, FALSE, TRUE); |
837 } | 837 } |
838 } | 838 } |
839 | 839 |
840 void CFXEU_InsertText::Undo() | 840 void CFXEU_InsertText::Undo() |
841 { | 841 { |
842 if (m_pEdit) | 842 if (m_pEdit) |
843 { | 843 { |
844 m_pEdit->SelectNone(); | 844 m_pEdit->SelectNone(); |
845 m_pEdit->SetSel(m_wpOld,m_wpNew); | 845 m_pEdit->SetSel(m_wpOld,m_wpNew); |
846 m_pEdit->Clear(FALSE,TRUE); | 846 m_pEdit->Clear(FALSE,TRUE); |
(...skipping 2737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3584 } | 3584 } |
3585 } | 3585 } |
3586 | 3586 |
3587 void CFX_Edit::AddUndoItem(IFX_Edit_UndoItem* pUndoItem) | 3587 void CFX_Edit::AddUndoItem(IFX_Edit_UndoItem* pUndoItem) |
3588 { | 3588 { |
3589 m_Undo.AddItem(pUndoItem); | 3589 m_Undo.AddItem(pUndoItem); |
3590 if (m_bOprNotify && m_pOprNotify) | 3590 if (m_bOprNotify && m_pOprNotify) |
3591 m_pOprNotify->OnAddUndo(pUndoItem); | 3591 m_pOprNotify->OnAddUndo(pUndoItem); |
3592 } | 3592 } |
3593 | 3593 |
OLD | NEW |