Commit Graph
5 Commits
Author SHA1 Message Date
Tom Tromey 3f91c32af3 Bug 1401821 - nsTextFormatter "*" width argument comes before the actual argument; r=froydnj
Bug 1388789 introduced a bug breaking formats like "%*.f".  The problem
was that the next "natural" argument was taken before the "*" width
argument.

MozReview-Commit-ID: BZack9faY7a
2017-09-21 09:43:28 -06:00
Tom Tromey bda71f4da8 Bug 1388789 - clean up \0 emission in nsTextFormatter; r=froydnj
nsTextFormatter unconditionally emitted a trailing \0, leading some code
elsewhere to have to work around this.  This changes the code to only
emit it in snprintf.

MozReview-Commit-ID: G3CBpAPp9Tn
2017-09-06 09:38:58 -06:00
Tom Tromey 9c9f19fe97 Bug 1388789 - make nsTextFormatter runtime type-safe; r=froydnj
Change nsTextFormatter functions to template functions, box their
arguments, and then make the formatter mostly impervious to type
mismatches.  Most formatting is done according to the type of the actual
argument.

MozReview-Commit-ID: H8WmyxFCb7s
2017-09-01 14:03:56 -06:00
Tom Tromey 1ab6214824 Bug 1388789 - handle unrecognized escapes in nsTextFormatter; r=froydnj
nsTextFormatter tried to pass unrecognized escapes in the format string
through to the output.  However, if the format held a width or
precision, that text was not output.  It seems better to me to try to
preserve the format text as-is.

MozReview-Commit-ID: HoBykpfzK7C
2017-09-01 08:31:49 -06:00
Eric Rahm af1bf442a8 Bug 1313482 - Convert XPCOM test TestTextFormatter to a gtest. r=froydnj
MozReview-Commit-ID: FQ5K3jvqb7c
2016-11-04 16:24:42 -07:00