Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Side by Side Diff: xfa/fxfa/app/xfa_ffnotify.cpp

Issue 2166433002: Cleanup CXFA_Document (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | xfa/fxfa/parser/xfa_document.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | xfa/fxfa/parser/xfa_document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698