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

Side by Side Diff: xfa/fxfa/parser/xfa_utils_imp.cpp

Issue 1830323006: Remove FX_DWORD from XFA. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 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 | « xfa/fxfa/parser/xfa_script_resolveprocessor.cpp ('k') | xfa/fxgraphics/cfx_graphics.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 "xfa/fxfa/parser/xfa_utils.h" 7 #include "xfa/fxfa/parser/xfa_utils.h"
8 8
9 #include "core/fxcrt/include/fx_ext.h" 9 #include "core/fxcrt/include/fx_ext.h"
10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" 10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 0.000000000001, 309 0.000000000001,
310 0.0000000000001, 310 0.0000000000001,
311 0.00000000000001, 311 0.00000000000001,
312 0.000000000000001, 312 0.000000000000001,
313 0.0000000000000001}; 313 0.0000000000000001};
314 FX_DOUBLE XFA_WideStringToDouble(const CFX_WideString& wsStringVal) { 314 FX_DOUBLE XFA_WideStringToDouble(const CFX_WideString& wsStringVal) {
315 CFX_WideString wsValue = wsStringVal; 315 CFX_WideString wsValue = wsStringVal;
316 wsValue.TrimLeft(); 316 wsValue.TrimLeft();
317 wsValue.TrimRight(); 317 wsValue.TrimRight();
318 int64_t nIntegral = 0; 318 int64_t nIntegral = 0;
319 FX_DWORD dwFractional = 0; 319 uint32_t dwFractional = 0;
320 int32_t nExponent = 0; 320 int32_t nExponent = 0;
321 int32_t cc = 0; 321 int32_t cc = 0;
322 FX_BOOL bNegative = FALSE, bExpSign = FALSE; 322 FX_BOOL bNegative = FALSE, bExpSign = FALSE;
323 const FX_WCHAR* str = (const FX_WCHAR*)wsValue; 323 const FX_WCHAR* str = (const FX_WCHAR*)wsValue;
324 int32_t len = wsValue.GetLength(); 324 int32_t len = wsValue.GetLength();
325 if (str[0] == '+') { 325 if (str[0] == '+') {
326 cc++; 326 cc++;
327 } else if (str[0] == '-') { 327 } else if (str[0] == '-') {
328 bNegative = TRUE; 328 bNegative = TRUE;
329 cc++; 329 cc++;
(...skipping 24 matching lines...) Expand all
354 break; 354 break;
355 } 355 }
356 if (scale == sizeof(fraction_scales) / sizeof(FX_DOUBLE) || 356 if (scale == sizeof(fraction_scales) / sizeof(FX_DOUBLE) ||
357 str[cc] == 'E' || str[cc] == 'e') { 357 str[cc] == 'E' || str[cc] == 'e') {
358 break; 358 break;
359 } 359 }
360 if (!XFA_IsDigit(str[cc])) { 360 if (!XFA_IsDigit(str[cc])) {
361 return 0; 361 return 0;
362 } 362 }
363 } 363 }
364 dwFractional = (FX_DWORD)(fraction * 4294967296.0); 364 dwFractional = (uint32_t)(fraction * 4294967296.0);
365 } 365 }
366 if (cc < len && (str[cc] == 'E' || str[cc] == 'e')) { 366 if (cc < len && (str[cc] == 'E' || str[cc] == 'e')) {
367 cc++; 367 cc++;
368 if (cc < len) { 368 if (cc < len) {
369 if (str[cc] == '+') { 369 if (str[cc] == '+') {
370 cc++; 370 cc++;
371 } else if (str[cc] == '-') { 371 } else if (str[cc] == '-') {
372 bExpSign = TRUE; 372 bExpSign = TRUE;
373 cc++; 373 cc++;
374 } 374 }
(...skipping 19 matching lines...) Expand all
394 CFX_WideString wsValue = 394 CFX_WideString wsValue =
395 CFX_WideString::FromUTF8(szStringVal.GetCStr(), szStringVal.GetLength()); 395 CFX_WideString::FromUTF8(szStringVal.GetCStr(), szStringVal.GetLength());
396 return XFA_WideStringToDouble(wsValue); 396 return XFA_WideStringToDouble(wsValue);
397 } 397 }
398 398
399 int32_t XFA_MapRotation(int32_t nRotation) { 399 int32_t XFA_MapRotation(int32_t nRotation) {
400 nRotation = nRotation % 360; 400 nRotation = nRotation % 360;
401 nRotation = nRotation < 0 ? nRotation + 360 : nRotation; 401 nRotation = nRotation < 0 ? nRotation + 360 : nRotation;
402 return nRotation; 402 return nRotation;
403 } 403 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/xfa_script_resolveprocessor.cpp ('k') | xfa/fxgraphics/cfx_graphics.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698