diff --git a/gfx/src/mac/nsDeviceContextMac.cpp b/gfx/src/mac/nsDeviceContextMac.cpp index 82acafb591a..702712ed43f 100644 --- a/gfx/src/mac/nsDeviceContextMac.cpp +++ b/gfx/src/mac/nsDeviceContextMac.cpp @@ -880,8 +880,9 @@ void nsDeviceContextMac :: InitFontInfoList() err = ::TECConvertText(converter, &fontName[1], fontName[0], &actualInputLength, (TextPtr)unicodeFontName , sizeof(unicodeFontName), &actualOutputLength); unicodeFontName[actualOutputLength / sizeof(PRUnichar)] = '\0'; + nsAutoString fontNameString(unicodeFontName); - FontNameKey key(unicodeFontName); + FontNameKey key(fontNameString); gFontInfoList->Put(&key, (void*)fondID); } ::ReleaseResource(fond); diff --git a/gfx/src/mac/nsUnicodeFontMappingMac.cpp b/gfx/src/mac/nsUnicodeFontMappingMac.cpp index 263240441a1..923030bfe15 100644 --- a/gfx/src/mac/nsUnicodeFontMappingMac.cpp +++ b/gfx/src/mac/nsUnicodeFontMappingMac.cpp @@ -312,7 +312,7 @@ nsUnicodeFontMappingMac* nsUnicodeFontMappingMac::GetCachedInstance( gCache = gUtil->GetFontMappingCache(); nsUnicodeFontMappingMac* obj = nsnull; - nsAutoString key = aFont->name; + nsAutoString key(aFont->name); key.AppendWithConversion(":"); key.Append(aLangGroup); key.AppendWithConversion(":"); diff --git a/gfx/src/nsGraphicsImpl.cpp b/gfx/src/nsGraphicsImpl.cpp index fcb485ee407..985f9688558 100755 --- a/gfx/src/nsGraphicsImpl.cpp +++ b/gfx/src/nsGraphicsImpl.cpp @@ -142,7 +142,7 @@ NS_IMETHODIMP nsGraphicsImpl::DrawString(const PRUnichar *text, nscoord x, nscoo NS_IMETHODIMP nsGraphicsImpl::SetFont(const PRUnichar *name, nscoord size) { size *= mDev2App; - nsFont font(name, NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL, NS_FONT_WEIGHT_NORMAL, NS_FONT_DECORATION_NONE, size); + nsFont font(nsAutoString(name), NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL, NS_FONT_WEIGHT_NORMAL, NS_FONT_DECORATION_NONE, size); return mRenderer->SetFont(font); }