Closed Bug 164633 Opened 24 years ago Closed 24 years ago

nsTextFormatter should accept nsAString as well

Categories

(Core :: XPCOM, defect, P2)

x86
Windows 2000
defect

Tracking

()

RESOLVED FIXED
mozilla1.2alpha

People

(Reporter: alecf, Assigned: alecf)

Details

(Whiteboard: fix in hand)

Attachments

(1 file)

ok, one more minor thing I was working on.. there are a lot of places where we're using nsTextFormatter and allocate a temporary string then throw it away again. nsTextFormatter needs another function, nsTextFormatter::ssprintf which prints to an nsAString.. patch forthcoming
a few minor bits about this: 1) I #if 0'ed out the func stuff in the SprintfStateStr because it confused me as to whether those functions were used or not. There is other #if 0'ed code that allows you to plug in your own "grow" callback function, that I can either rip out or leave #if 0'ed 2) I try to be smart about flatstring stuff, because internally the SprintfStateStr is supposed to be holding a reference to a writable region of memory. I need an nsAFlatString to write to. I use the same check as PromiseFlatString() has.
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: fix in hand
Target Milestone: --- → mozilla1.2alpha
Comment on attachment 96681 [details] [diff] [review] add ssprintf/vssprintf to nsTextFormatter rip out the #if 0 stuff. we have cvs for file history. Are you sure you want a reinterpret cast to void*? Why won't a static cast work? r=dougt
Attachment #96681 - Flags: review+
by george, you're right. I wish I could keep C++ casts straight :)
? + return n ? n - 1 : n-1;
oops! fixed in my tree to be "n ? n - 1 : n;" - I don't quite understand the logic behind it, but it is consistent with the other v*sprintf methods.
Comment on attachment 96681 [details] [diff] [review] add ssprintf/vssprintf to nsTextFormatter sr=darin
Attachment #96681 - Flags: superreview+
landed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: