Closed Bug 282819 Opened 19 years ago Closed 19 years ago

use NS_ConvertASCIItoUTF16(aString, aLength) instead of the manual expansion in nsFontMetricsGTK/Xlib

Categories

(Core Graveyard :: GFX: Gtk, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jshin1987, Assigned: jshin1987)

Details

(Keywords: intl)

Attachments

(1 file)

nsFontMetricsGTK and nsFontMetricsXlib use the following pattern in several places.
        // need to fix this for long strings
        PRUint32 len = PR_MIN(aLength, WIDEN_8_TO_16_BUF_SIZE);

        // convert 7 bit data to unicode
        // this function is only supposed to be called for ascii data
        for (PRUint32 i=0; i<len; i++) {
            unichars[i] = (PRUnichar)((unsigned char)aString[i]);
        }

We can get rid of them using NS_ConvertASCIItoUTF16(aString, aLength)
Attached patch patchSplinter Review
Attachment #174789 - Flags: superreview?(dbaron)
Attachment #174789 - Flags: review?(roland.mainz)
Comment on attachment 174789 [details] [diff] [review]
patch

sr=dbaron assuming the TryNode/TryNodes change was not supposed to be included
in this patch
Attachment #174789 - Flags: superreview?(dbaron) → superreview+
Comment on attachment 174789 [details] [diff] [review]
patch

Simon should be as good as Roland for this.
Attachment #174789 - Flags: review?(roland.mainz) → review?(smontagu)
Comment on attachment 174789 [details] [diff] [review]
patch

Gee, I almost lost this among today's bugspam.

r=smontagu, but you might want to retain the comments
// this function is only supposed to be called for ascii data
Attachment #174789 - Flags: review?(smontagu) → review+
Thankss for review. I added back the comment when landing.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: