Closed Bug 1228934 Opened 9 years ago Closed 9 years ago

remove more parameters (style, weight, stretch) to nsFont constructor

Categories

(Core :: Layout: Text and Fonts, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(1 file)

In https://hg.mozilla.org/integration/mozilla-inbound/rev/e1fd92eeb5ba I removed a parameter to the nsFont constructor.

But there are three other parameters that are passed as the same value by all callers of those constructors.  Given that long constructors are pretty unreadable anyway, and most if not all C++ callers want "NORMAL" for style, weight, and stretch (choosing the font style in a C++ constructor is a bit silly anyway), may as well remove them too.
Comment on attachment 8693449 [details] [diff] [review]
Remove style, weight, and stretch parameters from nsFont constructor

Review of attachment 8693449 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good.
Attachment #8693449 - Flags: review?(jdaggett) → review+
https://hg.mozilla.org/mozilla-central/rev/99a32ec308b8
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Is there any particular reason why we want to leave members uninitialized?
Flags: needinfo?(dbaron)
for nsFont::nsFont().
Probably to avoid spending the time to initialize them... though it's not necessarily a good reason.

I also don't think that constructor was used much; it might be worth seeing if it could be removed.
Flags: needinfo?(dbaron)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: