bug 284219 addendum, missed biesi's review comment

This commit is contained in:
dveditz%cruzio.com 2006-06-22 22:21:52 +00:00
parent 894b8ab958
commit 4a2fa425a7
2 changed files with 2 additions and 8 deletions

View File

@ -1492,7 +1492,6 @@ nsTextTransformer::DoArabicShaping(PRUnichar* aText,
PRBool isVisual = mPresContext->IsVisualMode();
nsAutoString buf;
buf.SetLength(aTextLength);
if (!EnsureStringLength(buf, aTextLength)) {
// no way to signal OOM
aTextLength = 0;

View File

@ -371,13 +371,8 @@ CompareUTF8toUTF16(const nsASingleFragmentCString& aUTF8String,
NS_COM void
AppendUCS4ToUTF16(const PRUint32 aSource, nsAString& aDest);
inline PRBool EnsureStringLength(nsAString &aStr, PRUint32 aLen)
{
aStr.SetLength(aLen);
return (aStr.Length() == aLen);
}
inline PRBool EnsureStringLength(nsACString &aStr, PRUint32 aLen)
template<class T>
inline PRBool EnsureStringLength(T& aStr, PRUint32 aLen)
{
aStr.SetLength(aLen);
return (aStr.Length() == aLen);