Bug 237085. Move string subdivision code to gfx so we can efficiently make it metrics-dependent. r=smontagu,sr=rbs

git-svn-id: svn://10.0.0.236/trunk@200963 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
roc+%cs.cmu.edu
2006-06-26 22:18:23 +00:00
parent 7f23c7b8b9
commit bd9175c940
49 changed files with 1369 additions and 1215 deletions

View File

@@ -875,20 +875,14 @@ nsFloatCacheList::nsFloatCacheList() :
nsFloatCacheList::~nsFloatCacheList()
{
DeleteAll();
MOZ_COUNT_DTOR(nsFloatCacheList);
}
void
nsFloatCacheList::DeleteAll()
{
nsFloatCache* c = mHead;
while (c) {
nsFloatCache* next = c->Next();
delete c;
c = next;
nsFloatCache* fc = mHead;
while (fc) {
nsFloatCache* next = fc->mNext;
delete fc;
fc = next;
}
mHead = nsnull;
MOZ_COUNT_DTOR(nsFloatCacheList);
}
nsFloatCache*
@@ -935,24 +929,17 @@ nsFloatCacheList::Find(nsIFrame* aOutOfFlowFrame)
return fc;
}
nsFloatCache*
nsFloatCacheList::RemoveAndReturnPrev(nsFloatCache* aElement)
void
nsFloatCacheList::Remove(nsFloatCache* aElement)
{
NS_ASSERTION(!aElement->mNext, "Can only remove a singleton element");
nsFloatCache* fc = mHead;
nsFloatCache* prev = nsnull;
while (fc) {
nsFloatCache** fcp = &mHead;
nsFloatCache* fc;
while (nsnull != (fc = *fcp)) {
if (fc == aElement) {
if (prev) {
prev->mNext = fc->mNext;
} else {
mHead = fc->mNext;
}
return prev;
*fcp = fc->mNext;
break;
}
prev = fc;
fc = fc->mNext;
fcp = &fc->mNext;
}
}
@@ -988,22 +975,6 @@ nsFloatCacheFreeList::Append(nsFloatCacheList& aList)
aList.mHead = nsnull;
}
void
nsFloatCacheFreeList::Remove(nsFloatCache* aElement)
{
nsFloatCache* prev = nsFloatCacheList::RemoveAndReturnPrev(aElement);
if (mTail == aElement) {
mTail = prev;
}
}
void
nsFloatCacheFreeList::DeleteAll()
{
nsFloatCacheList::DeleteAll();
mTail = nsnull;
}
nsFloatCache*
nsFloatCacheFreeList::Alloc()
{