Chromium Code Reviews| 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 <memory> | 10 #include <memory> |
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 772 if (!CanRedo()) | 772 if (!CanRedo()) |
| 773 return FALSE; | 773 return FALSE; |
| 774 return Redo(m_DoRecords[++m_iCurRecord].get()); | 774 return Redo(m_DoRecords[++m_iCurRecord].get()); |
| 775 } | 775 } |
| 776 | 776 |
| 777 FX_BOOL CFWL_EditImp::CanUndo() { | 777 FX_BOOL CFWL_EditImp::CanUndo() { |
| 778 return m_iCurRecord >= 0; | 778 return m_iCurRecord >= 0; |
| 779 } | 779 } |
| 780 | 780 |
| 781 FX_BOOL CFWL_EditImp::CanRedo() { | 781 FX_BOOL CFWL_EditImp::CanRedo() { |
| 782 return m_iCurRecord < m_DoRecords.size() - 1; | 782 int32_t nCount = m_DoRecords.size(); |
| 783 return m_iCurRecord < nCount - 1; | |
|
Tom Sepez
2016/05/20 00:09:19
nit:
return m_iCurRecord < pdfium::CollectionSiz
| |
| 783 } | 784 } |
| 784 | 785 |
| 785 FWL_Error CFWL_EditImp::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) { | 786 FWL_Error CFWL_EditImp::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) { |
| 786 if (!m_pEdtEngine) | 787 if (!m_pEdtEngine) |
| 787 return FWL_Error::Indefinite; | 788 return FWL_Error::Indefinite; |
| 788 | 789 |
| 789 FDE_TXTEDTPARAMS* pParams = m_pEdtEngine->GetEditParams(); | 790 FDE_TXTEDTPARAMS* pParams = m_pEdtEngine->GetEditParams(); |
| 790 pParams->fTabWidth = fTabWidth; | 791 pParams->fTabWidth = fTabWidth; |
| 791 pParams->bTabEquidistant = bEquidistant; | 792 pParams->bTabEquidistant = bEquidistant; |
| 792 return FWL_Error::Succeeded; | 793 return FWL_Error::Succeeded; |
| (...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2186 } | 2187 } |
| 2187 CFX_RectF rect; | 2188 CFX_RectF rect; |
| 2188 m_pOwner->GetWidgetRect(rect); | 2189 m_pOwner->GetWidgetRect(rect); |
| 2189 CFX_RectF rtInvalidate; | 2190 CFX_RectF rtInvalidate; |
| 2190 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); | 2191 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); |
| 2191 m_pOwner->Repaint(&rtInvalidate); | 2192 m_pOwner->Repaint(&rtInvalidate); |
| 2192 } | 2193 } |
| 2193 return TRUE; | 2194 return TRUE; |
| 2194 } | 2195 } |
| 2195 void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) {} | 2196 void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) {} |
| OLD | NEW |