From 641528df7fb201a63a076ec2d222781ea024de42 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Tue, 17 Apr 2001 03:21:16 +0000 Subject: [PATCH] use CoreFoundation for setting control text from a unicode string under carbon. r=saari/sr=hyatt bug# 75653 git-svn-id: svn://10.0.0.236/trunk@92503 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/mac/nsMacControl.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mozilla/widget/src/mac/nsMacControl.cpp b/mozilla/widget/src/mac/nsMacControl.cpp index 7de18905bd1..b81e55ee89f 100644 --- a/mozilla/widget/src/mac/nsMacControl.cpp +++ b/mozilla/widget/src/mac/nsMacControl.cpp @@ -466,6 +466,14 @@ void nsMacControl::Str255ToString(const Str255& aStr255, nsString& aText) void nsMacControl::NSStringSetControlTitle(ControlHandle theControl, nsString title) { +#if TARGET_CARBON + + // wow, it sure is nice being able to use core foundation ;) + CFStringRef str = CFStringCreateWithCharacters(NULL, title.GetUnicode(), title.Length()); + SetControlTitleWithCFString(theControl, str); + CFRelease(str); + +#else TextStyle theStyle; ScriptCode fontScript; OSErr err; @@ -547,7 +555,7 @@ void nsMacControl::NSStringSetControlTitle(ControlHandle theControl, nsString ti // ::SetControlTitle(theControl,c2pstr(scriptRunText)); delete [] scriptRunText; - +#endif } //------------------------------------------------------------------------- //