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

Side by Side Diff: core/fpdfdoc/cpdf_formfield.cpp

Issue 2484953003: Force compiler to deduce src type for checked_cast<dst, src>. (Closed)
Patch Set: Created 4 years, 1 month 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 | « core/fpdfapi/parser/cpdf_parser.cpp ('k') | fpdfsdk/fpdfview.cpp » ('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 "core/fpdfdoc/cpdf_formfield.h" 7 #include "core/fpdfdoc/cpdf_formfield.h"
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 675
676 CFX_ByteString csStr = 676 CFX_ByteString csStr =
677 PDF_EncodeText(csOptLabel.c_str(), csOptLabel.GetLength()); 677 PDF_EncodeText(csOptLabel.c_str(), csOptLabel.GetLength());
678 CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "Opt"); 678 CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "Opt");
679 CPDF_Array* pOpt = ToArray(pValue); 679 CPDF_Array* pOpt = ToArray(pValue);
680 if (!pOpt) { 680 if (!pOpt) {
681 pOpt = new CPDF_Array; 681 pOpt = new CPDF_Array;
682 m_pDict->SetFor("Opt", pOpt); 682 m_pDict->SetFor("Opt", pOpt);
683 } 683 }
684 684
685 int iCount = pdfium::base::checked_cast<int, size_t>(pOpt->GetCount()); 685 int iCount = pdfium::base::checked_cast<int>(pOpt->GetCount());
686 if (index >= iCount) { 686 if (index >= iCount) {
687 pOpt->AddString(csStr); 687 pOpt->AddString(csStr);
688 index = iCount; 688 index = iCount;
689 } else { 689 } else {
690 CPDF_String* pString = new CPDF_String(csStr, false); 690 CPDF_String* pString = new CPDF_String(csStr, false);
691 pOpt->InsertAt(index, pString); 691 pOpt->InsertAt(index, pString);
692 } 692 }
693 693
694 if (bNotify) 694 if (bNotify)
695 NotifyListOrComboBoxAfterChange(); 695 NotifyListOrComboBoxAfterChange();
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 case ListBox: 989 case ListBox:
990 NotifyAfterSelectionChange(); 990 NotifyAfterSelectionChange();
991 break; 991 break;
992 case ComboBox: 992 case ComboBox:
993 NotifyAfterValueChange(); 993 NotifyAfterValueChange();
994 break; 994 break;
995 default: 995 default:
996 break; 996 break;
997 } 997 }
998 } 998 }
OLDNEW
« no previous file with comments | « core/fpdfapi/parser/cpdf_parser.cpp ('k') | fpdfsdk/fpdfview.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698