fix bug 139633 - as a part of freezing nsAString, move Left/Right/Mid back into nsString, and fix consumers to start using Substring()
r=jag, sr=darin git-svn-id: svn://10.0.0.236/trunk@120220 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -829,6 +829,18 @@ void nsString::Adopt(PRUnichar* aPtr, PRInt32 aLength) {
|
||||
nsStrPrivate::Initialize(*this, (char*)aPtr, aLength, aLength, eTwoByte, PR_TRUE);
|
||||
}
|
||||
|
||||
nsAString::size_type
|
||||
nsString::Mid( self_type& aResult, index_type aStartPos, size_type aLengthToCopy ) const
|
||||
{
|
||||
// If we're just assigning our entire self, give |aResult| the opportunity to share
|
||||
if ( aStartPos == 0 && aLengthToCopy >= Length() )
|
||||
aResult = *this;
|
||||
else
|
||||
aResult = Substring(*this, aStartPos, aLengthToCopy);
|
||||
|
||||
return aResult.Length();
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
Searching methods...
|
||||
|
||||
Reference in New Issue
Block a user