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

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

Issue 2027273002: Fix all the code which has duplicate variable declarations (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 6 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 | « fpdfsdk/fpdf_transformpage.cpp ('k') | fpdfsdk/jsapi/fxjs_v8_embeddertest.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 "fpdfsdk/javascript/Field.h" 7 #include "fpdfsdk/javascript/Field.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 int& iControlNo) { 137 int& iControlNo) {
138 int iStart = strFieldNameParsed.find_last_of(L'.'); 138 int iStart = strFieldNameParsed.find_last_of(L'.');
139 if (iStart == -1) { 139 if (iStart == -1) {
140 strFieldName = strFieldNameParsed; 140 strFieldName = strFieldNameParsed;
141 iControlNo = -1; 141 iControlNo = -1;
142 return; 142 return;
143 } 143 }
144 std::wstring suffixal = strFieldNameParsed.substr(iStart + 1); 144 std::wstring suffixal = strFieldNameParsed.substr(iStart + 1);
145 iControlNo = FXSYS_wtoi(suffixal.c_str()); 145 iControlNo = FXSYS_wtoi(suffixal.c_str());
146 if (iControlNo == 0) { 146 if (iControlNo == 0) {
147 int iStart; 147 int iSpaceStart;
148 while ((iStart = suffixal.find_last_of(L" ")) != -1) { 148 while ((iSpaceStart = suffixal.find_last_of(L" ")) != -1) {
149 suffixal.erase(iStart, 1); 149 suffixal.erase(iSpaceStart, 1);
150 } 150 }
151 151
152 if (suffixal.compare(L"0") != 0) { 152 if (suffixal.compare(L"0") != 0) {
153 strFieldName = strFieldNameParsed; 153 strFieldName = strFieldNameParsed;
154 iControlNo = -1; 154 iControlNo = -1;
155 return; 155 return;
156 } 156 }
157 } 157 }
158 strFieldName = strFieldNameParsed.substr(0, iStart); 158 strFieldName = strFieldNameParsed.substr(0, iStart);
159 } 159 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 pDocument->SetChangeMark(); 242 pDocument->SetChangeMark();
243 } 243 }
244 244
245 void Field::UpdateFormControl(CPDFSDK_Document* pDocument, 245 void Field::UpdateFormControl(CPDFSDK_Document* pDocument,
246 CPDF_FormControl* pFormControl, 246 CPDF_FormControl* pFormControl,
247 FX_BOOL bChangeMark, 247 FX_BOOL bChangeMark,
248 FX_BOOL bResetAP, 248 FX_BOOL bResetAP,
249 FX_BOOL bRefresh) { 249 FX_BOOL bRefresh) {
250 ASSERT(pFormControl); 250 ASSERT(pFormControl);
251 251
252 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm(); 252 CPDFSDK_InterForm* pForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
253 CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl); 253 CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl);
254 254
255 if (pWidget) { 255 if (pWidget) {
256 if (bResetAP) { 256 if (bResetAP) {
257 int nFieldType = pWidget->GetFieldType(); 257 int nFieldType = pWidget->GetFieldType();
258 if (nFieldType == FIELDTYPE_COMBOBOX || 258 if (nFieldType == FIELDTYPE_COMBOBOX ||
259 nFieldType == FIELDTYPE_TEXTFIELD) { 259 nFieldType == FIELDTYPE_TEXTFIELD) {
260 FX_BOOL bFormated = FALSE; 260 FX_BOOL bFormated = FALSE;
261 CFX_WideString sValue = pWidget->OnFormat(bFormated); 261 CFX_WideString sValue = pWidget->OnFormat(bFormated);
262 if (bFormated) 262 if (bFormated)
263 pWidget->ResetAppearance(sValue.c_str(), FALSE); 263 pWidget->ResetAppearance(sValue.c_str(), FALSE);
(...skipping 3283 matching lines...) Expand 10 before | Expand all | Expand 10 after
3547 } 3547 }
3548 } 3548 }
3549 3549
3550 void Field::AddField(CPDFSDK_Document* pDocument, 3550 void Field::AddField(CPDFSDK_Document* pDocument,
3551 int nPageIndex, 3551 int nPageIndex,
3552 int nFieldType, 3552 int nFieldType,
3553 const CFX_WideString& sName, 3553 const CFX_WideString& sName,
3554 const CFX_FloatRect& rcCoords) { 3554 const CFX_FloatRect& rcCoords) {
3555 // Not supported. 3555 // Not supported.
3556 } 3556 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdf_transformpage.cpp ('k') | fpdfsdk/jsapi/fxjs_v8_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698