Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: xfa/fde/cfde_txtedtdorecord_insert.cpp

Issue 2557103002: Cleanup FWL default values part II. (Closed)
Patch Set: Rebase to master Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fde/cfde_txtedtdorecord_deleterange.cpp ('k') | xfa/fde/cfde_txtedtengine.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_insert.h" 7 #include "xfa/fde/cfde_txtedtdorecord_insert.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 13 matching lines...) Expand all
24 CFDE_TxtEdtDoRecord_Insert::~CFDE_TxtEdtDoRecord_Insert() {} 24 CFDE_TxtEdtDoRecord_Insert::~CFDE_TxtEdtDoRecord_Insert() {}
25 25
26 bool CFDE_TxtEdtDoRecord_Insert::Undo() const { 26 bool CFDE_TxtEdtDoRecord_Insert::Undo() const {
27 if (m_pEngine->IsSelect()) 27 if (m_pEngine->IsSelect())
28 m_pEngine->ClearSelection(); 28 m_pEngine->ClearSelection();
29 29
30 m_pEngine->Inner_DeleteRange(m_nCaret, m_wsInsert.GetLength()); 30 m_pEngine->Inner_DeleteRange(m_nCaret, m_wsInsert.GetLength());
31 FDE_TXTEDTPARAMS& Param = m_pEngine->m_Param; 31 FDE_TXTEDTPARAMS& Param = m_pEngine->m_Param;
32 m_pEngine->m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Delete; 32 m_pEngine->m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Delete;
33 m_pEngine->m_ChangeInfo.wsDelete = m_wsInsert; 33 m_pEngine->m_ChangeInfo.wsDelete = m_wsInsert;
34 Param.pEventSink->On_TextChanged(m_pEngine, m_pEngine->m_ChangeInfo); 34 Param.pEventSink->OnTextChanged(m_pEngine->m_ChangeInfo);
35 m_pEngine->SetCaretPos(m_nCaret, true); 35 m_pEngine->SetCaretPos(m_nCaret, true);
36 return true; 36 return true;
37 } 37 }
38 38
39 bool CFDE_TxtEdtDoRecord_Insert::Redo() const { 39 bool CFDE_TxtEdtDoRecord_Insert::Redo() const {
40 m_pEngine->Inner_Insert(m_nCaret, m_wsInsert.c_str(), m_wsInsert.GetLength()); 40 m_pEngine->Inner_Insert(m_nCaret, m_wsInsert.c_str(), m_wsInsert.GetLength());
41 FDE_TXTEDTPARAMS& Param = m_pEngine->m_Param; 41 FDE_TXTEDTPARAMS& Param = m_pEngine->m_Param;
42 m_pEngine->m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Insert; 42 m_pEngine->m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Insert;
43 m_pEngine->m_ChangeInfo.wsDelete = m_wsInsert; 43 m_pEngine->m_ChangeInfo.wsDelete = m_wsInsert;
44 Param.pEventSink->On_TextChanged(m_pEngine, m_pEngine->m_ChangeInfo); 44 Param.pEventSink->OnTextChanged(m_pEngine->m_ChangeInfo);
45 m_pEngine->SetCaretPos(m_nCaret, false); 45 m_pEngine->SetCaretPos(m_nCaret, false);
46 return true; 46 return true;
47 } 47 }
OLDNEW
« no previous file with comments | « xfa/fde/cfde_txtedtdorecord_deleterange.cpp ('k') | xfa/fde/cfde_txtedtengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698