| 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 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1633 } | 1633 } |
| 1634 | 1634 |
| 1635 FX_BOOL FWL_ShowCaret(IFWL_Widget* pWidget, | 1635 FX_BOOL FWL_ShowCaret(IFWL_Widget* pWidget, |
| 1636 FX_BOOL bVisible, | 1636 FX_BOOL bVisible, |
| 1637 const CFX_RectF* pRtAnchor) { | 1637 const CFX_RectF* pRtAnchor) { |
| 1638 CXFA_FFWidget* pXFAWidget = | 1638 CXFA_FFWidget* pXFAWidget = |
| 1639 static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem()); | 1639 static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem()); |
| 1640 if (!pXFAWidget) | 1640 if (!pXFAWidget) |
| 1641 return FALSE; | 1641 return FALSE; |
| 1642 | 1642 |
| 1643 IXFA_DocProvider* pDocProvider = pXFAWidget->GetDoc()->GetDocProvider(); | 1643 IXFA_DocEnvironment* pDocEnvironment = |
| 1644 if (!pDocProvider) | 1644 pXFAWidget->GetDoc()->GetDocEnvironment(); |
| 1645 if (!pDocEnvironment) |
| 1645 return FALSE; | 1646 return FALSE; |
| 1646 | 1647 |
| 1647 if (bVisible) { | 1648 if (bVisible) { |
| 1648 CFX_Matrix mt; | 1649 CFX_Matrix mt; |
| 1649 pXFAWidget->GetRotateMatrix(mt); | 1650 pXFAWidget->GetRotateMatrix(mt); |
| 1650 CFX_RectF rt(*pRtAnchor); | 1651 CFX_RectF rt(*pRtAnchor); |
| 1651 mt.TransformRect(rt); | 1652 mt.TransformRect(rt); |
| 1652 pDocProvider->DisplayCaret(pXFAWidget, bVisible, &rt); | 1653 pDocEnvironment->DisplayCaret(pXFAWidget, bVisible, &rt); |
| 1653 return TRUE; | 1654 return TRUE; |
| 1654 } | 1655 } |
| 1655 pDocProvider->DisplayCaret(pXFAWidget, bVisible, pRtAnchor); | 1656 pDocEnvironment->DisplayCaret(pXFAWidget, bVisible, pRtAnchor); |
| 1656 return TRUE; | 1657 return TRUE; |
| 1657 } | 1658 } |
| 1658 | 1659 |
| 1659 void CFWL_EditImp::ShowCaret(FX_BOOL bVisible, CFX_RectF* pRect) { | 1660 void CFWL_EditImp::ShowCaret(FX_BOOL bVisible, CFX_RectF* pRect) { |
| 1660 if (m_pCaret) { | 1661 if (m_pCaret) { |
| 1661 m_pCaret->ShowCaret(bVisible); | 1662 m_pCaret->ShowCaret(bVisible); |
| 1662 if (bVisible && !pRect->IsEmpty()) { | 1663 if (bVisible && !pRect->IsEmpty()) { |
| 1663 m_pCaret->SetWidgetRect(*pRect); | 1664 m_pCaret->SetWidgetRect(*pRect); |
| 1664 } | 1665 } |
| 1665 Repaint(&m_rtEngine); | 1666 Repaint(&m_rtEngine); |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2185 } | 2186 } |
| 2186 CFX_RectF rect; | 2187 CFX_RectF rect; |
| 2187 m_pOwner->GetWidgetRect(rect); | 2188 m_pOwner->GetWidgetRect(rect); |
| 2188 CFX_RectF rtInvalidate; | 2189 CFX_RectF rtInvalidate; |
| 2189 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); | 2190 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); |
| 2190 m_pOwner->Repaint(&rtInvalidate); | 2191 m_pOwner->Repaint(&rtInvalidate); |
| 2191 } | 2192 } |
| 2192 return TRUE; | 2193 return TRUE; |
| 2193 } | 2194 } |
| 2194 void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) {} | 2195 void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) {} |
| OLD | NEW |