Bug 116957: Put Adopt on ns{C}String, and use it in nsStandardURL. r=dbaron, rs=scc
git-svn-id: svn://10.0.0.236/trunk@111092 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -866,6 +866,14 @@ void nsString::InsertWithConversion(const char* aCString,PRUint32 anOffset,PRInt
|
||||
}
|
||||
}
|
||||
|
||||
void nsString::Adopt(PRUnichar* aPtr, PRInt32 aLength) {
|
||||
nsStr::Destroy(*this);
|
||||
if (aLength == -1)
|
||||
aLength = nsCharTraits<PRUnichar>::length(aPtr);
|
||||
// We don't know the capacity, so we'll just have to assume
|
||||
// capacity = length.
|
||||
nsStr::Initialize(*this, (char*)aPtr, aLength, aLength, eTwoByte, PR_TRUE);
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
|
||||
Reference in New Issue
Block a user