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 "../../../foxitlib.h" | 7 #include "../../../foxitlib.h" |
8 #include "../common/xfa_common.h" | 8 #include "../common/xfa_common.h" |
9 #include "xfa_ffwidget.h" | 9 #include "xfa_ffwidget.h" |
10 #include "xfa_fffield.h" | 10 #include "xfa_fffield.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 FX_BOOL CXFA_FFField::IsLoaded() { | 120 FX_BOOL CXFA_FFField::IsLoaded() { |
121 return m_pNormalWidget != NULL && CXFA_FFWidget::IsLoaded(); | 121 return m_pNormalWidget != NULL && CXFA_FFWidget::IsLoaded(); |
122 } | 122 } |
123 FX_BOOL CXFA_FFField::LoadWidget() { | 123 FX_BOOL CXFA_FFField::LoadWidget() { |
124 SetFWLThemeProvider(); | 124 SetFWLThemeProvider(); |
125 m_pDataAcc->LoadCaption(); | 125 m_pDataAcc->LoadCaption(); |
126 LayoutWidget(); | 126 LayoutWidget(); |
127 return TRUE; | 127 return TRUE; |
128 } | 128 } |
129 void CXFA_FFField::UnloadWidget() { | 129 void CXFA_FFField::UnloadWidget() { |
130 if (m_pNormalWidget) { | 130 delete m_pNormalWidget; |
131 m_pNormalWidget->Release(); | 131 m_pNormalWidget = nullptr; |
132 m_pNormalWidget = NULL; | |
133 } | |
134 } | 132 } |
135 void CXFA_FFField::SetEditScrollOffset() { | 133 void CXFA_FFField::SetEditScrollOffset() { |
136 XFA_ELEMENT eType = m_pDataAcc->GetUIType(); | 134 XFA_ELEMENT eType = m_pDataAcc->GetUIType(); |
137 if (eType == XFA_ELEMENT_TextEdit || eType == XFA_ELEMENT_NumericEdit || | 135 if (eType == XFA_ELEMENT_TextEdit || eType == XFA_ELEMENT_NumericEdit || |
138 eType == XFA_ELEMENT_PasswordEdit) { | 136 eType == XFA_ELEMENT_PasswordEdit) { |
139 FX_FLOAT fScrollOffset = 0; | 137 FX_FLOAT fScrollOffset = 0; |
140 CXFA_FFField* pPrev = static_cast<CXFA_FFField*>(GetPrev()); | 138 CXFA_FFField* pPrev = static_cast<CXFA_FFField*>(GetPrev()); |
141 if (pPrev) { | 139 if (pPrev) { |
142 CFX_RectF rtMargin; | 140 CFX_RectF rtMargin; |
143 m_pDataAcc->GetUIMargin(rtMargin); | 141 m_pDataAcc->GetUIMargin(rtMargin); |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 break; | 841 break; |
844 } | 842 } |
845 default: {} | 843 default: {} |
846 } | 844 } |
847 return FWL_ERR_Succeeded; | 845 return FWL_ERR_Succeeded; |
848 } | 846 } |
849 FWL_ERR CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, | 847 FWL_ERR CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, |
850 const CFX_Matrix* pMatrix) { | 848 const CFX_Matrix* pMatrix) { |
851 return FWL_ERR_Succeeded; | 849 return FWL_ERR_Succeeded; |
852 } | 850 } |
OLD | NEW |