| 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/fxfa/app/xfa_fwladapter.h" | 7 #include "xfa/fxfa/app/xfa_fwladapter.h" | 
| 8 | 8 | 
| 9 #include "xfa/fxfa/app/xfa_fffield.h" | 9 #include "xfa/fxfa/app/xfa_fffield.h" | 
| 10 #include "xfa/fxfa/xfa_ffdoc.h" | 10 #include "xfa/fxfa/xfa_ffdoc.h" | 
| 11 | 11 | 
| 12 CXFA_FWLAdapterWidgetMgr::CXFA_FWLAdapterWidgetMgr() {} | 12 CXFA_FWLAdapterWidgetMgr::CXFA_FWLAdapterWidgetMgr() {} | 
| 13 | 13 | 
| 14 CXFA_FWLAdapterWidgetMgr::~CXFA_FWLAdapterWidgetMgr() {} | 14 CXFA_FWLAdapterWidgetMgr::~CXFA_FWLAdapterWidgetMgr() {} | 
| 15 | 15 | 
| 16 FWL_Error CXFA_FWLAdapterWidgetMgr::RepaintWidget(IFWL_Widget* pWidget, | 16 FWL_Error CXFA_FWLAdapterWidgetMgr::RepaintWidget(IFWL_Widget* pWidget, | 
| 17                                                   const CFX_RectF* pRect) { | 17                                                   const CFX_RectF* pRect) { | 
| 18   if (!pWidget) | 18   if (!pWidget) | 
| 19     return FWL_Error::Indefinite; | 19     return FWL_Error::Indefinite; | 
| 20 | 20 | 
| 21   CXFA_FFWidget* pFFWidget = | 21   CXFA_FFWidget* pFFWidget = | 
| 22       static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem()); | 22       static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem()); | 
| 23   if (!pFFWidget) | 23   if (!pFFWidget) | 
| 24     return FWL_Error::Indefinite; | 24     return FWL_Error::Indefinite; | 
| 25 | 25 | 
| 26   pFFWidget->AddInvalidateRect(nullptr); | 26   pFFWidget->AddInvalidateRect(nullptr); | 
| 27   return FWL_Error::Succeeded; | 27   return FWL_Error::Succeeded; | 
| 28 } | 28 } | 
| 29 | 29 | 
| 30 FX_BOOL CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget, | 30 bool CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget, | 
| 31                                               FX_FLOAT fMinHeight, | 31                                            FX_FLOAT fMinHeight, | 
| 32                                               FX_FLOAT fMaxHeight, | 32                                            FX_FLOAT fMaxHeight, | 
| 33                                               const CFX_RectF& rtAnchor, | 33                                            const CFX_RectF& rtAnchor, | 
| 34                                               CFX_RectF& rtPopup) { | 34                                            CFX_RectF& rtPopup) { | 
| 35   CXFA_FFWidget* pFFWidget = | 35   CXFA_FFWidget* pFFWidget = | 
| 36       static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem()); | 36       static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem()); | 
| 37   CFX_Matrix mt; | 37   CFX_Matrix mt; | 
| 38   pFFWidget->GetRotateMatrix(mt); | 38   pFFWidget->GetRotateMatrix(mt); | 
| 39   CFX_RectF rtRotateAnchor(rtAnchor); | 39   CFX_RectF rtRotateAnchor(rtAnchor); | 
| 40   mt.TransformRect(rtRotateAnchor); | 40   mt.TransformRect(rtRotateAnchor); | 
| 41   pFFWidget->GetDoc()->GetDocEnvironment()->GetPopupPos( | 41   pFFWidget->GetDoc()->GetDocEnvironment()->GetPopupPos( | 
| 42       pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, rtPopup); | 42       pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, rtPopup); | 
| 43   return TRUE; | 43   return true; | 
| 44 } | 44 } | 
| OLD | NEW | 
|---|