Changes necessary for fixes to bug 18843. Better handling of string implementations without an underlying buffer handle. r/sr=scc@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@95227 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -114,3 +114,33 @@ nsAFlatCString::GetWritableFragment( nsWritableFragment<char>& aFragment, nsFrag
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
PRUint32
|
||||
nsAFlatString::Length() const
|
||||
{
|
||||
const nsBufferHandle<PRUnichar>* handle = GetBufferHandle();
|
||||
return PRUint32(handle ? handle->DataLength() : 0);
|
||||
}
|
||||
|
||||
PRUint32
|
||||
nsAFlatCString::Length() const
|
||||
{
|
||||
const nsBufferHandle<char>* handle = GetBufferHandle();
|
||||
return PRUint32(handle ? handle->DataLength() : 0);
|
||||
}
|
||||
|
||||
const PRUnichar*
|
||||
nsAFlatString::get() const
|
||||
{
|
||||
const nsBufferHandle<PRUnichar>* handle = GetBufferHandle();
|
||||
NS_ASSERTION(handle, "handle is null!");
|
||||
return handle ? handle->DataStart() : 0;
|
||||
}
|
||||
|
||||
const char*
|
||||
nsAFlatCString::get() const
|
||||
{
|
||||
const nsBufferHandle<char>* handle = GetBufferHandle();
|
||||
NS_ASSERTION(handle, "handle is null!");
|
||||
return handle ? handle->DataStart() : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user