fixing some bugs in the new parser string code; changing some names

git-svn-id: svn://10.0.0.236/trunk@78621 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
scc%mozilla.org
2000-09-09 11:31:04 +00:00
parent 4e5ca44047
commit 0b82101f78
16 changed files with 143 additions and 45 deletions

View File

@@ -61,11 +61,13 @@ nsSlidingSubstring::nsSlidingSubstring( nsSlidingSharedBufferList& aBufferList,
}
nsSlidingSubstring::nsSlidingSubstring( nsSlidingSharedBufferList& aBufferList )
: /* mStart(aBufferList.First(), ...), mEnd(aEnd),*/ mBufferList(aBufferList)
: mBufferList(aBufferList)
{
mBufferList.AcquireReference();
// mStart, mEnd, mLength
mStart = nsSlidingSharedBufferList::Position(mBufferList.GetFirstBuffer(), mBufferList.GetFirstBuffer()->DataStart());
mEnd = nsSlidingSharedBufferList::Position(mBufferList.GetLastBuffer(), mBufferList.GetLastBuffer()->DataEnd());
mLength = PRUint32(Distance(mStart, mEnd));
}
nsSlidingSubstring::~nsSlidingSubstring()
@@ -115,8 +117,8 @@ nsSlidingSubstring::GetReadableFragment( nsReadableFragment<PRUnichar>& aFragmen
nsSlidingString::nsSlidingString()
: nsSlidingSubstring(*(new nsSlidingSharedBufferList))
nsSlidingString::nsSlidingString( PRUnichar* aStorageStart, PRUnichar* aDataEnd, PRUnichar* aStorageEnd )
: nsSlidingSubstring(*(new nsSlidingSharedBufferList(nsSlidingSharedBufferList::NewWrappingBuffer(aStorageStart, aDataEnd, aStorageEnd))))
{
// nothing else to do here
}