| 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/cfwl_edit.h" | 7 #include "xfa/fwl/cfwl_edit.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 | 1161 |
| 1162 CFWL_Widget* pOuter = this; | 1162 CFWL_Widget* pOuter = this; |
| 1163 pRect->Offset(m_pProperties->m_rtWidget.left, m_pProperties->m_rtWidget.top); | 1163 pRect->Offset(m_pProperties->m_rtWidget.left, m_pProperties->m_rtWidget.top); |
| 1164 while (pOuter->GetOuter()) { | 1164 while (pOuter->GetOuter()) { |
| 1165 pOuter = pOuter->GetOuter(); | 1165 pOuter = pOuter->GetOuter(); |
| 1166 | 1166 |
| 1167 CFX_RectF rtOuter = pOuter->GetWidgetRect(); | 1167 CFX_RectF rtOuter = pOuter->GetWidgetRect(); |
| 1168 pRect->Offset(rtOuter.left, rtOuter.top); | 1168 pRect->Offset(rtOuter.left, rtOuter.top); |
| 1169 } | 1169 } |
| 1170 | 1170 |
| 1171 CXFA_FFWidget* pXFAWidget = | 1171 CXFA_FFWidget* pXFAWidget = pOuter->GetLayoutItem(); |
| 1172 static_cast<CXFA_FFWidget*>(pOuter->GetLayoutItem()); | |
| 1173 if (!pXFAWidget) | 1172 if (!pXFAWidget) |
| 1174 return; | 1173 return; |
| 1175 | 1174 |
| 1176 IXFA_DocEnvironment* pDocEnvironment = | 1175 IXFA_DocEnvironment* pDocEnvironment = |
| 1177 pXFAWidget->GetDoc()->GetDocEnvironment(); | 1176 pXFAWidget->GetDoc()->GetDocEnvironment(); |
| 1178 if (!pDocEnvironment) | 1177 if (!pDocEnvironment) |
| 1179 return; | 1178 return; |
| 1180 | 1179 |
| 1181 CFX_Matrix mt; | 1180 CFX_Matrix mt; |
| 1182 pXFAWidget->GetRotateMatrix(mt); | 1181 pXFAWidget->GetRotateMatrix(mt); |
| 1183 | 1182 |
| 1184 CFX_RectF rt(*pRect); | 1183 CFX_RectF rt(*pRect); |
| 1185 mt.TransformRect(rt); | 1184 mt.TransformRect(rt); |
| 1186 pDocEnvironment->DisplayCaret(pXFAWidget, true, &rt); | 1185 pDocEnvironment->DisplayCaret(pXFAWidget, true, &rt); |
| 1187 } | 1186 } |
| 1188 | 1187 |
| 1189 void CFWL_Edit::HideCaret(CFX_RectF* pRect) { | 1188 void CFWL_Edit::HideCaret(CFX_RectF* pRect) { |
| 1190 if (m_pCaret) { | 1189 if (m_pCaret) { |
| 1191 m_pCaret->HideCaret(); | 1190 m_pCaret->HideCaret(); |
| 1192 RepaintRect(m_rtEngine); | 1191 RepaintRect(m_rtEngine); |
| 1193 return; | 1192 return; |
| 1194 } | 1193 } |
| 1195 | 1194 |
| 1196 CFWL_Widget* pOuter = this; | 1195 CFWL_Widget* pOuter = this; |
| 1197 while (pOuter->GetOuter()) | 1196 while (pOuter->GetOuter()) |
| 1198 pOuter = pOuter->GetOuter(); | 1197 pOuter = pOuter->GetOuter(); |
| 1199 | 1198 |
| 1200 CXFA_FFWidget* pXFAWidget = | 1199 CXFA_FFWidget* pXFAWidget = pOuter->GetLayoutItem(); |
| 1201 static_cast<CXFA_FFWidget*>(pOuter->GetLayoutItem()); | |
| 1202 if (!pXFAWidget) | 1200 if (!pXFAWidget) |
| 1203 return; | 1201 return; |
| 1204 | 1202 |
| 1205 IXFA_DocEnvironment* pDocEnvironment = | 1203 IXFA_DocEnvironment* pDocEnvironment = |
| 1206 pXFAWidget->GetDoc()->GetDocEnvironment(); | 1204 pXFAWidget->GetDoc()->GetDocEnvironment(); |
| 1207 if (!pDocEnvironment) | 1205 if (!pDocEnvironment) |
| 1208 return; | 1206 return; |
| 1209 | 1207 |
| 1210 pDocEnvironment->DisplayCaret(pXFAWidget, false, pRect); | 1208 pDocEnvironment->DisplayCaret(pXFAWidget, false, pRect); |
| 1211 } | 1209 } |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 pScrollBar->SetTrackPos(fPos); | 1626 pScrollBar->SetTrackPos(fPos); |
| 1629 UpdateOffset(pScrollBar, fPos - iCurPos); | 1627 UpdateOffset(pScrollBar, fPos - iCurPos); |
| 1630 UpdateCaret(); | 1628 UpdateCaret(); |
| 1631 | 1629 |
| 1632 CFX_RectF rect = GetWidgetRect(); | 1630 CFX_RectF rect = GetWidgetRect(); |
| 1633 CFX_RectF rtInvalidate; | 1631 CFX_RectF rtInvalidate; |
| 1634 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); | 1632 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); |
| 1635 RepaintRect(rtInvalidate); | 1633 RepaintRect(rtInvalidate); |
| 1636 return true; | 1634 return true; |
| 1637 } | 1635 } |
| OLD | NEW |