fix bug 209699 r=dougt, sr=jst - move some consumers over to CopyUTF8toUTF16

This commit is contained in:
alecf%flett.org 2003-06-18 02:22:46 +00:00
Родитель ae9176bd25
Коммит 63cdbb3203
2 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -358,7 +358,7 @@ void* PermanentAtomImpl::operator new ( size_t size, AtomImpl* aAtom ) CPP_THROW
NS_IMETHODIMP
AtomImpl::ToString(nsAString& aBuf)
{
aBuf.Assign(NS_ConvertUTF8toUCS2(mString));
CopyUTF8toUTF16(nsDependentCString(mString), aBuf);
return NS_OK;
}

Просмотреть файл

@ -41,6 +41,7 @@
#include "prtypes.h"
#include "nsCRT.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsISimpleEnumerator.h"
#include "nsSupportsPrimitives.h"
@ -168,10 +169,8 @@ nsStringEnumerator::GetNext(nsACString& aResult)
{
NS_ENSURE_TRUE(mIndex < Count(), NS_ERROR_UNEXPECTED);
// XXX this needs CopyUCS2toUTF8(aResult,
// *mArray->StringAt(mIndex++));
if (mIsUnicode)
aResult = NS_ConvertUCS2toUTF8(*mArray->StringAt(mIndex++));
CopyUTF16toUTF8(*mArray->StringAt(mIndex++), aResult);
else
aResult = *mCArray->CStringAt(mIndex++);