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

Side by Side Diff: fpdfsdk/src/javascript/Field.cpp

Issue 1487553003: Fix an assertion failure in CPDFSDK_Widget* Field::GetWidget() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years 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 | no next file » | 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 "Field.h" 7 #include "Field.h"
8 8
9 #include "Document.h" 9 #include "Document.h"
10 #include "Icon.h" 10 #include "Icon.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 pDoc->UpdateAllViews(NULL, pWidget); 282 pDoc->UpdateAllViews(NULL, pWidget);
283 } 283 }
284 } 284 }
285 285
286 if (bChangeMark) 286 if (bChangeMark)
287 pDocument->SetChangeMark(); 287 pDocument->SetChangeMark();
288 } 288 }
289 289
290 CPDFSDK_Widget* Field::GetWidget(CPDFSDK_Document* pDocument, 290 CPDFSDK_Widget* Field::GetWidget(CPDFSDK_Document* pDocument,
291 CPDF_FormControl* pFormControl) { 291 CPDF_FormControl* pFormControl) {
292 ASSERT(pDocument != NULL); 292 CPDFSDK_InterForm* pInterForm =
293 ASSERT(pFormControl != NULL); 293 static_cast<CPDFSDK_InterForm*>(pDocument->GetInterForm());
294 294 return pInterForm ? pInterForm->GetWidget(pFormControl) : nullptr;
295 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
296 ASSERT(pInterForm != NULL);
297
298 return pInterForm->GetWidget(pFormControl);
299 } 295 }
300 296
301 FX_BOOL Field::ValueIsOccur(CPDF_FormField* pFormField, 297 FX_BOOL Field::ValueIsOccur(CPDF_FormField* pFormField,
302 CFX_WideString csOptLabel) { 298 CFX_WideString csOptLabel) {
303 ASSERT(pFormField != NULL); 299 ASSERT(pFormField != NULL);
304 300
305 for (int i = 0, sz = pFormField->CountOptions(); i < sz; i++) { 301 for (int i = 0, sz = pFormField->CountOptions(); i < sz; i++) {
306 if (csOptLabel.Compare(pFormField->GetOptionLabel(i)) == 0) 302 if (csOptLabel.Compare(pFormField->GetOptionLabel(i)) == 0)
307 return TRUE; 303 return TRUE;
308 } 304 }
(...skipping 3429 matching lines...) Expand 10 before | Expand all | Expand 10 after
3738 #define JS_FIELD_MINWIDTH 1 3734 #define JS_FIELD_MINWIDTH 1
3739 #define JS_FIELD_MINHEIGHT 1 3735 #define JS_FIELD_MINHEIGHT 1
3740 3736
3741 void Field::AddField(CPDFSDK_Document* pDocument, 3737 void Field::AddField(CPDFSDK_Document* pDocument,
3742 int nPageIndex, 3738 int nPageIndex,
3743 int nFieldType, 3739 int nFieldType,
3744 const CFX_WideString& sName, 3740 const CFX_WideString& sName,
3745 const CPDF_Rect& rcCoords) { 3741 const CPDF_Rect& rcCoords) {
3746 // Not supported. 3742 // Not supported.
3747 } 3743 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698