r=troy; fixed bug #17346 - the nsTextFormatter self test code found a bug in the nsTextFragment ctor code...

This commit is contained in:
kipp%netscape.com 1999-10-27 23:01:16 +00:00
parent 84df0919cf
commit 6ca5b769c8
3 changed files with 24 additions and 0 deletions

View File

@ -43,6 +43,8 @@ nsTextFragment::ReleaseText()
} }
nsTextFragment::nsTextFragment(const nsTextFragment& aOther) nsTextFragment::nsTextFragment(const nsTextFragment& aOther)
: m1b(nsnull),
mAllBits(0)
{ {
if (aOther.Is2b()) { if (aOther.Is2b()) {
SetTo(aOther.Get2b(), aOther.GetLength()); SetTo(aOther.Get2b(), aOther.GetLength());
@ -53,16 +55,22 @@ nsTextFragment::nsTextFragment(const nsTextFragment& aOther)
} }
nsTextFragment::nsTextFragment(const char* aString) nsTextFragment::nsTextFragment(const char* aString)
: m1b(nsnull),
mAllBits(0)
{ {
SetTo(aString, strlen(aString)); SetTo(aString, strlen(aString));
} }
nsTextFragment::nsTextFragment(const PRUnichar* aString) nsTextFragment::nsTextFragment(const PRUnichar* aString)
: m1b(nsnull),
mAllBits(0)
{ {
SetTo(aString, nsCRT::strlen(aString)); SetTo(aString, nsCRT::strlen(aString));
} }
nsTextFragment::nsTextFragment(const nsString& aString) nsTextFragment::nsTextFragment(const nsString& aString)
: m1b(nsnull),
mAllBits(0)
{ {
SetTo(aString.GetUnicode(), aString.Length()); SetTo(aString.GetUnicode(), aString.Length());
} }

View File

@ -43,6 +43,8 @@ nsTextFragment::ReleaseText()
} }
nsTextFragment::nsTextFragment(const nsTextFragment& aOther) nsTextFragment::nsTextFragment(const nsTextFragment& aOther)
: m1b(nsnull),
mAllBits(0)
{ {
if (aOther.Is2b()) { if (aOther.Is2b()) {
SetTo(aOther.Get2b(), aOther.GetLength()); SetTo(aOther.Get2b(), aOther.GetLength());
@ -53,16 +55,22 @@ nsTextFragment::nsTextFragment(const nsTextFragment& aOther)
} }
nsTextFragment::nsTextFragment(const char* aString) nsTextFragment::nsTextFragment(const char* aString)
: m1b(nsnull),
mAllBits(0)
{ {
SetTo(aString, strlen(aString)); SetTo(aString, strlen(aString));
} }
nsTextFragment::nsTextFragment(const PRUnichar* aString) nsTextFragment::nsTextFragment(const PRUnichar* aString)
: m1b(nsnull),
mAllBits(0)
{ {
SetTo(aString, nsCRT::strlen(aString)); SetTo(aString, nsCRT::strlen(aString));
} }
nsTextFragment::nsTextFragment(const nsString& aString) nsTextFragment::nsTextFragment(const nsString& aString)
: m1b(nsnull),
mAllBits(0)
{ {
SetTo(aString.GetUnicode(), aString.Length()); SetTo(aString.GetUnicode(), aString.Length());
} }

View File

@ -43,6 +43,8 @@ nsTextFragment::ReleaseText()
} }
nsTextFragment::nsTextFragment(const nsTextFragment& aOther) nsTextFragment::nsTextFragment(const nsTextFragment& aOther)
: m1b(nsnull),
mAllBits(0)
{ {
if (aOther.Is2b()) { if (aOther.Is2b()) {
SetTo(aOther.Get2b(), aOther.GetLength()); SetTo(aOther.Get2b(), aOther.GetLength());
@ -53,16 +55,22 @@ nsTextFragment::nsTextFragment(const nsTextFragment& aOther)
} }
nsTextFragment::nsTextFragment(const char* aString) nsTextFragment::nsTextFragment(const char* aString)
: m1b(nsnull),
mAllBits(0)
{ {
SetTo(aString, strlen(aString)); SetTo(aString, strlen(aString));
} }
nsTextFragment::nsTextFragment(const PRUnichar* aString) nsTextFragment::nsTextFragment(const PRUnichar* aString)
: m1b(nsnull),
mAllBits(0)
{ {
SetTo(aString, nsCRT::strlen(aString)); SetTo(aString, nsCRT::strlen(aString));
} }
nsTextFragment::nsTextFragment(const nsString& aString) nsTextFragment::nsTextFragment(const nsString& aString)
: m1b(nsnull),
mAllBits(0)
{ {
SetTo(aString.GetUnicode(), aString.Length()); SetTo(aString.GetUnicode(), aString.Length());
} }