Added ref counting on nsIContent

This commit is contained in:
rods%netscape.com 1998-08-03 22:20:41 +00:00
parent d208c7b1e3
commit 7ca2c5414e

View File

@ -59,19 +59,27 @@ void nsSelectionRange::SetRange(nsSelectionRange * aRange) {
}
void nsSelectionRange::SetStartPoint(nsSelectionPoint * aPoint) {
mStart->SetPoint(aPoint->GetContent(), aPoint->GetOffset(), aPoint->IsAnchor());
nsIContent * content = aPoint->GetContent();
mStart->SetPoint(content, aPoint->GetOffset(), aPoint->IsAnchor());
NS_IF_RELEASE(content);
}
void nsSelectionRange::SetEndPoint(nsSelectionPoint * aPoint) {
mEnd->SetPoint(aPoint->GetContent(), aPoint->GetOffset(), aPoint->IsAnchor());
nsIContent * content = aPoint->GetContent();
mEnd->SetPoint(content, aPoint->GetOffset(), aPoint->IsAnchor());
NS_IF_RELEASE(content);
}
void nsSelectionRange::GetStartPoint(nsSelectionPoint * aPoint) {
aPoint->SetPoint(mStart->GetContent(), mStart->GetOffset(), mStart->IsAnchor());
nsIContent * content = mStart->GetContent();
aPoint->SetPoint(content, mStart->GetOffset(), mStart->IsAnchor());
NS_IF_RELEASE(content);
}
void nsSelectionRange::GetEndPoint(nsSelectionPoint * aPoint) {
aPoint->SetPoint(mEnd->GetContent(), mEnd->GetOffset(), mEnd->IsAnchor());
nsIContent * content = mEnd->GetContent();
aPoint->SetPoint(content, mEnd->GetOffset(), mEnd->IsAnchor());
NS_IF_RELEASE(content);
}
void nsSelectionRange::GetRange(nsSelectionRange * aRange) {