Fixing ToNewUnicode(). Checking in for rickg.

approved: cyeh


git-svn-id: svn://10.0.0.236/trunk@41489 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
harishd%netscape.com
1999-07-28 21:43:11 +00:00
parent e2a7ed2062
commit 5b842bedfd
3 changed files with 45 additions and 15 deletions

View File

@@ -573,11 +573,21 @@ char* nsString::ToNewCString() const {
* @return ptr to new ascii string
*/
PRUnichar* nsString::ToNewUnicode() const {
nsString temp(mUStr);
temp.SetCapacity(8);
PRUnichar* result=temp.mUStr;
temp.mStr=0;
temp.mOwnsBuffer=PR_FALSE;
PRUnichar* result=0;
if(eOneByte==mCharSize) {
nsString temp(mStr);
temp.SetCapacity(8);
result=temp.mUStr;
temp.mStr=0;
temp.mOwnsBuffer=PR_FALSE;
}
else{
nsString temp(mUStr);
temp.SetCapacity(8);
result=temp.mUStr;
temp.mStr=0;
temp.mOwnsBuffer=PR_FALSE;
}
return result;
}