Closed Bug 276002 Opened 20 years ago Closed 20 years ago

Get/FormatLocalizedString should use nsXPIDLString

Categories

(Core :: Layout, defect)

defect
Not set
trivial

Tracking

()

RESOLVED FIXED

People

(Reporter: neil, Assigned: neil)

Details

Attachments

(1 file)

This is just a minor code simplification.
They should probably either stay as they are or use PRUnichar**, actually. 
Taking an nsXPIDLString& just so that the function can use getter_Copies seems
silly.
Attached patch Proposed patchSplinter Review
Assignee: nobody → neil.parkwaycc.co.uk
Status: NEW → ASSIGNED
Attachment #169587 - Flags: superreview?(bryner)
Attachment #169587 - Flags: review?(dbaron)
Comment on attachment 169587 [details] [diff] [review]
Proposed patch

I guess it does have a codesize advantage this way too, so r=dbaron
Attachment #169587 - Flags: review?(dbaron) → review+
Comment on attachment 169587 [details] [diff] [review]
Proposed patch

Looks ok, but we probably want to make nsIStringBundle use AString at some
point.
Attachment #169587 - Flags: superreview?(bryner) → superreview+
Not sure why this isn't marked fixed yet, but it caused the bustage on creature.
c:/builds/tinderbox/MozillaTrunk/WINNT_5.0_Clobber/mozilla/layout/forms/nsGfxButtonControlFrame.cpp(179)
: error C2666: '[]' : 2 overloads have similar conversions

I checked in a bandaid fix, but we should find out why [] doesn't work on CREATURE.

+++ nsGfxButtonControlFrame.cpp 19 Jan 2005 03:34:28 -0000
@@ -175,8 +175,8 @@
   // Compress whitespace out of label if needed.
   if (!GetStyleText()->WhiteSpaceIsSignificant()) {
     value.CompressWhitespace();
-  } else if (value.Length() > 2 && value[0] == ' ' &&
-             value[value.Length() - 1] == ' '){
+  } else if (value.Length() > 2 && value.First() == ' ' &&
+             value.CharAt(value.Length() - 1) == ' ') {
     // This is a bit of a hack.  The reason this is here is as follows: we now
     // have default padding on our buttons to make them non-ugly.
     // Unfortunately, IE-windows does not have such padding, so people will

Checking in nsGfxButtonControlFrame.cpp;
/cvsroot/mozilla/layout/forms/nsGfxButtonControlFrame.cpp,v  <-- 
nsGfxButtonControlFrame.cpp
new revision: 1.115; previous revision: 1.114
done
aaron, thanks for the bustage fix. I think you could have used Last() though.
darin, any idea why creature got confused about nsXPIDLString::operator[]?
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: