Explicit conversion required for NEW_STRING_APIS. r=scc

This commit is contained in:
waterson%netscape.com 2000-04-04 06:03:20 +00:00
Родитель 5ef034810c
Коммит 9d03c4287b
6 изменённых файлов: 12 добавлений и 6 удалений

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

@ -662,7 +662,8 @@ char* nsCString::ToNewCString() const {
* @return ptr to new ascii string
*/
PRUnichar* nsCString::ToNewUnicode() const {
nsString temp(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
nsString temp;
temp.AssignWithConversion(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
temp.SetCapacity(8); //force temp to have an allocated buffer, even if this is empty.
PRUnichar* result=temp.mUStr; //steal temp's buffer
temp.mStr=0; //now clear temp's buffer to prevent deallocation

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

@ -719,7 +719,8 @@ nsString* nsString::ToNewString() const {
*/
char* nsString::ToNewCString() const {
nsCString temp(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
nsCString temp;
temp.AssignWithConversion(GetUnicode(), Length()); //construct nsCString with alloc on heap (which we'll steal in a moment)
temp.SetCapacity(8); //force it to have an allocated buffer, even if this is empty.
char* result=temp.mStr; //steal temp's buffer
temp.mStr=0; //clear temp's buffer to prevent deallocation

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

@ -662,7 +662,8 @@ char* nsCString::ToNewCString() const {
* @return ptr to new ascii string
*/
PRUnichar* nsCString::ToNewUnicode() const {
nsString temp(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
nsString temp;
temp.AssignWithConversion(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
temp.SetCapacity(8); //force temp to have an allocated buffer, even if this is empty.
PRUnichar* result=temp.mUStr; //steal temp's buffer
temp.mStr=0; //now clear temp's buffer to prevent deallocation

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

@ -719,7 +719,8 @@ nsString* nsString::ToNewString() const {
*/
char* nsString::ToNewCString() const {
nsCString temp(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
nsCString temp;
temp.AssignWithConversion(GetUnicode(), Length()); //construct nsCString with alloc on heap (which we'll steal in a moment)
temp.SetCapacity(8); //force it to have an allocated buffer, even if this is empty.
char* result=temp.mStr; //steal temp's buffer
temp.mStr=0; //clear temp's buffer to prevent deallocation

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

@ -662,7 +662,8 @@ char* nsCString::ToNewCString() const {
* @return ptr to new ascii string
*/
PRUnichar* nsCString::ToNewUnicode() const {
nsString temp(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
nsString temp;
temp.AssignWithConversion(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
temp.SetCapacity(8); //force temp to have an allocated buffer, even if this is empty.
PRUnichar* result=temp.mUStr; //steal temp's buffer
temp.mStr=0; //now clear temp's buffer to prevent deallocation

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

@ -719,7 +719,8 @@ nsString* nsString::ToNewString() const {
*/
char* nsString::ToNewCString() const {
nsCString temp(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
nsCString temp;
temp.AssignWithConversion(GetUnicode(), Length()); //construct nsCString with alloc on heap (which we'll steal in a moment)
temp.SetCapacity(8); //force it to have an allocated buffer, even if this is empty.
char* result=temp.mStr; //steal temp's buffer
temp.mStr=0; //clear temp's buffer to prevent deallocation