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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user