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 "fxjs/include/cfxjse_value.h" | 9 #include "fxjs/include/cfxjse_value.h" |
10 #include "xfa/fxfa/app/xfa_ffbarcode.h" | 10 #include "xfa/fxfa/app/xfa_ffbarcode.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 | 167 |
168 if (pWidget) | 168 if (pWidget) |
169 pWidget->SetDocView(pDocView); | 169 pWidget->SetDocView(pDocView); |
170 return pWidget; | 170 return pWidget; |
171 } | 171 } |
172 | 172 |
173 void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node* pItem, | 173 void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node* pItem, |
174 FX_FLOAT& fCalcWidth, | 174 FX_FLOAT& fCalcWidth, |
175 FX_FLOAT& fCalcHeight) { | 175 FX_FLOAT& fCalcHeight) { |
176 CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pItem->GetWidgetData()); | 176 CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pItem->GetWidgetData()); |
177 if (!pAcc) { | 177 if (!pAcc) |
178 return; | 178 return; |
179 } | 179 |
180 pAcc->StartWidgetLayout(fCalcWidth, fCalcHeight); | 180 pAcc->StartWidgetLayout(fCalcWidth, fCalcHeight); |
181 } | 181 } |
182 | |
182 FX_BOOL CXFA_FFNotify::FindSplitPos(CXFA_Node* pItem, | 183 FX_BOOL CXFA_FFNotify::FindSplitPos(CXFA_Node* pItem, |
183 int32_t iBlockIndex, | 184 int32_t iBlockIndex, |
184 FX_FLOAT& fCalcHeightPos) { | 185 FX_FLOAT& fCalcHeightPos) { |
185 CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pItem->GetWidgetData()); | 186 CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pItem->GetWidgetData()); |
186 if (!pAcc) { | 187 return pAcc && pAcc->FindSplitPos(iBlockIndex, fCalcHeightPos); |
187 return FALSE; | |
188 } | |
189 return (XFA_LAYOUTRESULT)pAcc->FindSplitPos(iBlockIndex, fCalcHeightPos); | |
dsinclair
2016/07/19 15:20:13
I have no idea why this was casting to an XFA_LAYO
| |
190 } | 188 } |
189 | |
191 FX_BOOL CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) { | 190 FX_BOOL CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) { |
192 FX_BOOL bRet = FALSE; | 191 FX_BOOL bRet = FALSE; |
193 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); | 192 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); |
194 if (!pDocView) { | 193 if (!pDocView) { |
195 return bRet; | 194 return bRet; |
196 } | 195 } |
197 CXFA_WidgetAcc* pWidgetAcc = | 196 CXFA_WidgetAcc* pWidgetAcc = |
198 static_cast<CXFA_WidgetAcc*>(pFormItem->GetWidgetData()); | 197 static_cast<CXFA_WidgetAcc*>(pFormItem->GetWidgetData()); |
199 if (!pWidgetAcc) { | 198 if (!pWidgetAcc) { |
200 return bRet; | 199 return bRet; |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
505 return; | 504 return; |
506 | 505 |
507 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); | 506 CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender); |
508 if (!pWidget) | 507 if (!pWidget) |
509 return; | 508 return; |
510 | 509 |
511 pDocView->DeleteLayoutItem(pWidget); | 510 pDocView->DeleteLayoutItem(pWidget); |
512 m_pDoc->GetDocProvider()->WidgetPreRemove(pWidget, pWidget->GetDataAcc()); | 511 m_pDoc->GetDocProvider()->WidgetPreRemove(pWidget, pWidget->GetDataAcc()); |
513 pWidget->AddInvalidateRect(nullptr); | 512 pWidget->AddInvalidateRect(nullptr); |
514 } | 513 } |
OLD | NEW |