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

Issue 1582013002: Cleanup CJS_PublicMethods::ParseNumber (Closed)

Created:
4 years, 11 months ago by Tom Bergan
Modified:
4 years, 11 months ago
Reviewers:
Tom Sepez, Lei Zhang
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Cleanup CJS_PublicMethods::ParseNumber Original patch by tombergan. The old version of this function was basically strtod with a few quirks: 1. It always interpreted ',' as '.' independent of locale. I kept this behavior, to be conservative. 2. It interpreted the first non-number character as a decimal point, unless there was a prior decimal point, in which case all characters up to that point are ignored. This would parse "123z4" as "123.4" and "123xy6" as "6". I did not keep this behavior -- in the new code, these examples all fail to parse. The new ParseNumber was inlined into ConvertStringToNumber, which returns true on success and (false, 0) on failure. BUG=pdfium:361 R=tsepez@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/4cd5b80e70e5fc50d8bd805cfa3c7b54878a0a35

Patch Set 1 #

Patch Set 2 : Update bug_361_expected.txt #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -172 lines) Patch
M fpdfsdk/src/javascript/Field.cpp View 3 chunks +5 lines, -17 lines 0 comments Download
M fpdfsdk/src/javascript/PublicMethods.h View 1 chunk +1 line, -8 lines 0 comments Download
M fpdfsdk/src/javascript/PublicMethods.cpp View 1 chunk +22 lines, -131 lines 0 comments Download
M testing/resources/javascript/bug_361_expected.txt View 1 1 chunk +16 lines, -16 lines 0 comments Download

Messages

Total messages: 19 (5 generated)
Tom Bergan
Not sure who the right reviewer is for this CL. tsepez@ and thestig@ look like ...
4 years, 11 months ago (2016-01-13 17:19:38 UTC) #3
Tom Sepez
On 2016/01/13 17:19:38, Tom Bergan wrote: > Not sure who the right reviewer is for ...
4 years, 11 months ago (2016-01-13 18:38:56 UTC) #4
Tom Bergan
On 2016/01/13 18:38:56, Tom Sepez wrote: > On 2016/01/13 17:19:38, Tom Bergan wrote: > > ...
4 years, 11 months ago (2016-01-13 18:51:25 UTC) #6
Tom Sepez
On 2016/01/13 18:51:25, Tom Bergan wrote: > On 2016/01/13 18:38:56, Tom Sepez wrote: > > ...
4 years, 11 months ago (2016-01-13 20:35:34 UTC) #7
Tom Sepez
Given that there isn't an obvious right answer, and that the existing code eventually calls ...
4 years, 11 months ago (2016-01-13 21:00:55 UTC) #8
Tom Sepez
On 2016/01/13 21:00:55, Tom Sepez wrote: > Given that there isn't an obvious right answer, ...
4 years, 11 months ago (2016-01-13 21:04:16 UTC) #9
Tom Sepez
And just for laughs, git grep 'FX.*to[fd]' lists a bunch of buggy, mostly unused, variants ...
4 years, 11 months ago (2016-01-14 00:59:48 UTC) #10
Tom Bergan
On 2016/01/13 21:04:16, Tom Sepez wrote: > On 2016/01/13 21:00:55, Tom Sepez wrote: > > ...
4 years, 11 months ago (2016-01-14 07:52:28 UTC) #11
Tom Sepez
On 2016/01/14 07:52:28, Tom Bergan wrote: > On 2016/01/13 21:04:16, Tom Sepez wrote: > > ...
4 years, 11 months ago (2016-01-14 16:54:43 UTC) #12
Tom Bergan
On 2016/01/14 16:54:43, Tom Sepez wrote: > On 2016/01/14 07:52:28, Tom Bergan wrote: > > ...
4 years, 11 months ago (2016-01-15 00:54:40 UTC) #13
Tom Sepez
Thanks for your help. I agree that this is a good interim solution. LGTM. Do ...
4 years, 11 months ago (2016-01-15 01:10:53 UTC) #14
Tom Sepez
On 2016/01/15 01:10:53, Tom Sepez wrote: > Thanks for your help. I agree that this ...
4 years, 11 months ago (2016-01-15 01:22:00 UTC) #15
Tom Sepez
Committed patchset #2 (id:20001) manually as 4cd5b80e70e5fc50d8bd805cfa3c7b54878a0a35 (presubmit successful).
4 years, 11 months ago (2016-01-15 01:25:13 UTC) #18
Tom Sepez
4 years, 11 months ago (2016-01-15 01:35:49 UTC) #19
Message was sent while issue was closed.
On 2016/01/15 01:25:13, Tom Sepez wrote:
> Committed patchset #2 (id:20001) manually as
> 4cd5b80e70e5fc50d8bd805cfa3c7b54878a0a35 (presubmit successful).

And its reverted due to test breakage.  Tom (B) I'll take it from here.

Powered by Google App Engine
This is Rietveld 408576698