| 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/fwl/basewidget/fwl_editimp.h" | 7 #include "xfa/fwl/basewidget/fwl_editimp.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_NoRedoUndo) { | 727 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_NoRedoUndo) { |
| 728 return TRUE; | 728 return TRUE; |
| 729 } | 729 } |
| 730 return m_pEdtEngine->Undo(bsRecord); | 730 return m_pEdtEngine->Undo(bsRecord); |
| 731 } | 731 } |
| 732 FX_BOOL CFWL_EditImp::Undo() { | 732 FX_BOOL CFWL_EditImp::Undo() { |
| 733 if (!CanUndo()) { | 733 if (!CanUndo()) { |
| 734 return FALSE; | 734 return FALSE; |
| 735 } | 735 } |
| 736 CFX_ByteString bsRecord = m_RecordArr[m_iCurRecord--]; | 736 CFX_ByteString bsRecord = m_RecordArr[m_iCurRecord--]; |
| 737 return Undo(bsRecord); | 737 return Undo(bsRecord.AsByteStringC()); |
| 738 } | 738 } |
| 739 FX_BOOL CFWL_EditImp::Redo() { | 739 FX_BOOL CFWL_EditImp::Redo() { |
| 740 if (!CanRedo()) { | 740 if (!CanRedo()) { |
| 741 return FALSE; | 741 return FALSE; |
| 742 } | 742 } |
| 743 CFX_ByteString bsRecord = m_RecordArr[++m_iCurRecord]; | 743 CFX_ByteString bsRecord = m_RecordArr[++m_iCurRecord]; |
| 744 return Redo(bsRecord); | 744 return Redo(bsRecord.AsByteStringC()); |
| 745 } | 745 } |
| 746 FX_BOOL CFWL_EditImp::CanUndo() { | 746 FX_BOOL CFWL_EditImp::CanUndo() { |
| 747 return m_iCurRecord >= 0; | 747 return m_iCurRecord >= 0; |
| 748 } | 748 } |
| 749 FX_BOOL CFWL_EditImp::CanRedo() { | 749 FX_BOOL CFWL_EditImp::CanRedo() { |
| 750 return m_iCurRecord < m_RecordArr.GetSize() - 1; | 750 return m_iCurRecord < m_RecordArr.GetSize() - 1; |
| 751 } | 751 } |
| 752 FWL_ERR CFWL_EditImp::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) { | 752 FWL_ERR CFWL_EditImp::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) { |
| 753 if (!m_pEdtEngine) | 753 if (!m_pEdtEngine) |
| 754 return FWL_ERR_Succeeded; | 754 return FWL_ERR_Succeeded; |
| (...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2170 } | 2170 } |
| 2171 CFX_RectF rect; | 2171 CFX_RectF rect; |
| 2172 m_pOwner->GetWidgetRect(rect); | 2172 m_pOwner->GetWidgetRect(rect); |
| 2173 CFX_RectF rtInvalidate; | 2173 CFX_RectF rtInvalidate; |
| 2174 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); | 2174 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); |
| 2175 m_pOwner->Repaint(&rtInvalidate); | 2175 m_pOwner->Repaint(&rtInvalidate); |
| 2176 } | 2176 } |
| 2177 return TRUE; | 2177 return TRUE; |
| 2178 } | 2178 } |
| 2179 void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) {} | 2179 void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) {} |
| OLD | NEW |