| 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_ffnotify.h" | 7 #include "xfa/fxfa/app/xfa_ffnotify.h" |
| 8 | 8 |
| 9 #include "xfa/fxfa/app/xfa_ffbarcode.h" | 9 #include "xfa/fxfa/app/xfa_ffbarcode.h" |
| 10 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" | 10 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 XFA_EVENTTYPE eEventType, | 215 XFA_EVENTTYPE eEventType, |
| 216 FX_BOOL bIsFormReady, | 216 FX_BOOL bIsFormReady, |
| 217 FX_BOOL bRecursive, | 217 FX_BOOL bRecursive, |
| 218 CXFA_WidgetAcc* pExclude) { | 218 CXFA_WidgetAcc* pExclude) { |
| 219 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 219 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
| 220 if (!pDocView) { | 220 if (!pDocView) { |
| 221 return XFA_EVENTERROR_NotExist; | 221 return XFA_EVENTERROR_NotExist; |
| 222 } | 222 } |
| 223 return pDocView->ExecEventActivityByDeepFirst( | 223 return pDocView->ExecEventActivityByDeepFirst( |
| 224 pFormNode, eEventType, bIsFormReady, bRecursive, | 224 pFormNode, eEventType, bIsFormReady, bRecursive, |
| 225 pExclude ? pExclude->GetNode() : NULL); | 225 pExclude ? pExclude->GetNode() : nullptr); |
| 226 } | 226 } |
| 227 void CXFA_FFNotify::AddCalcValidate(CXFA_Node* pNode) { | 227 void CXFA_FFNotify::AddCalcValidate(CXFA_Node* pNode) { |
| 228 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 228 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
| 229 if (!pDocView) { | 229 if (!pDocView) { |
| 230 return; | 230 return; |
| 231 } | 231 } |
| 232 CXFA_WidgetAcc* pWidgetAcc = | 232 CXFA_WidgetAcc* pWidgetAcc = |
| 233 static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()); | 233 static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()); |
| 234 if (!pWidgetAcc) { | 234 if (!pWidgetAcc) { |
| 235 return; | 235 return; |
| 236 } | 236 } |
| 237 pDocView->AddCalculateWidgetAcc(pWidgetAcc); | 237 pDocView->AddCalculateWidgetAcc(pWidgetAcc); |
| 238 pDocView->AddValidateWidget(pWidgetAcc); | 238 pDocView->AddValidateWidget(pWidgetAcc); |
| 239 } | 239 } |
| 240 CXFA_FFDoc* CXFA_FFNotify::GetHDOC() { | 240 CXFA_FFDoc* CXFA_FFNotify::GetHDOC() { |
| 241 return m_pDoc; | 241 return m_pDoc; |
| 242 } | 242 } |
| 243 IXFA_DocProvider* CXFA_FFNotify::GetDocProvider() { | 243 IXFA_DocProvider* CXFA_FFNotify::GetDocProvider() { |
| 244 return m_pDoc->GetDocProvider(); | 244 return m_pDoc->GetDocProvider(); |
| 245 } | 245 } |
| 246 IXFA_AppProvider* CXFA_FFNotify::GetAppProvider() { | 246 IXFA_AppProvider* CXFA_FFNotify::GetAppProvider() { |
| 247 return m_pDoc->GetApp()->GetAppProvider(); | 247 return m_pDoc->GetApp()->GetAppProvider(); |
| 248 } | 248 } |
| 249 CXFA_FFWidgetHandler* CXFA_FFNotify::GetWidgetHandler() { | 249 CXFA_FFWidgetHandler* CXFA_FFNotify::GetWidgetHandler() { |
| 250 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 250 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
| 251 return pDocView ? pDocView->GetWidgetHandler() : NULL; | 251 return pDocView ? pDocView->GetWidgetHandler() : nullptr; |
| 252 } | 252 } |
| 253 CXFA_FFWidget* CXFA_FFNotify::GetHWidget(CXFA_LayoutItem* pLayoutItem) { | 253 CXFA_FFWidget* CXFA_FFNotify::GetHWidget(CXFA_LayoutItem* pLayoutItem) { |
| 254 return XFA_GetWidgetFromLayoutItem(pLayoutItem); | 254 return XFA_GetWidgetFromLayoutItem(pLayoutItem); |
| 255 } | 255 } |
| 256 void CXFA_FFNotify::OpenDropDownList(CXFA_FFWidget* hWidget) { | 256 void CXFA_FFNotify::OpenDropDownList(CXFA_FFWidget* hWidget) { |
| 257 if (hWidget->GetDataAcc()->GetUIType() != XFA_ELEMENT_ChoiceList) { | 257 if (hWidget->GetDataAcc()->GetUIType() != XFA_ELEMENT_ChoiceList) { |
| 258 return; | 258 return; |
| 259 } | 259 } |
| 260 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 260 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
| 261 pDocView->LockUpdate(); | 261 pDocView->LockUpdate(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 void CXFA_FFNotify::RunSubformIndexChange(CXFA_Node* pSubformNode) { | 293 void CXFA_FFNotify::RunSubformIndexChange(CXFA_Node* pSubformNode) { |
| 294 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 294 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
| 295 if (!pDocView) { | 295 if (!pDocView) { |
| 296 return; | 296 return; |
| 297 } | 297 } |
| 298 pDocView->AddIndexChangedSubform(pSubformNode); | 298 pDocView->AddIndexChangedSubform(pSubformNode); |
| 299 } | 299 } |
| 300 CXFA_Node* CXFA_FFNotify::GetFocusWidgetNode() { | 300 CXFA_Node* CXFA_FFNotify::GetFocusWidgetNode() { |
| 301 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 301 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
| 302 if (!pDocView) { | 302 if (!pDocView) { |
| 303 return NULL; | 303 return nullptr; |
| 304 } | 304 } |
| 305 CXFA_WidgetAcc* pAcc = pDocView->GetFocusWidgetAcc(); | 305 CXFA_WidgetAcc* pAcc = pDocView->GetFocusWidgetAcc(); |
| 306 return pAcc ? pAcc->GetNode() : NULL; | 306 return pAcc ? pAcc->GetNode() : nullptr; |
| 307 } | 307 } |
| 308 void CXFA_FFNotify::SetFocusWidgetNode(CXFA_Node* pNode) { | 308 void CXFA_FFNotify::SetFocusWidgetNode(CXFA_Node* pNode) { |
| 309 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 309 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
| 310 if (!pDocView) { | 310 if (!pDocView) { |
| 311 return; | 311 return; |
| 312 } | 312 } |
| 313 CXFA_WidgetAcc* pAcc = | 313 CXFA_WidgetAcc* pAcc = |
| 314 pNode ? static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()) : nullptr; | 314 pNode ? static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData()) : nullptr; |
| 315 pDocView->SetFocusWidgetAcc(pAcc); | 315 pDocView->SetFocusWidgetAcc(pAcc); |
| 316 } | 316 } |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 return; | 506 return; |
| 507 | 507 |
| 508 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); | 508 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); |
| 509 if (!pWidget) | 509 if (!pWidget) |
| 510 return; | 510 return; |
| 511 | 511 |
| 512 pDocView->DeleteLayoutItem(pWidget); | 512 pDocView->DeleteLayoutItem(pWidget); |
| 513 m_pDoc->GetDocProvider()->WidgetPreRemove(pWidget, pWidget->GetDataAcc()); | 513 m_pDoc->GetDocProvider()->WidgetPreRemove(pWidget, pWidget->GetDataAcc()); |
| 514 pWidget->AddInvalidateRect(nullptr); | 514 pWidget->AddInvalidateRect(nullptr); |
| 515 } | 515 } |
| OLD | NEW |