mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Added ref counting
This commit is contained in:
parent
7fca0c763b
commit
c09f6b9e1b
@ -25,19 +25,42 @@ nsSelectionPoint::nsSelectionPoint(nsIContent * aContent,
|
||||
fOffset = aOffset;
|
||||
fIsAnchor = aIsAnchor;
|
||||
fEntireContent = PR_FALSE;
|
||||
|
||||
if (fContent != nsnull)
|
||||
NS_ADDREF(fContent);
|
||||
}
|
||||
|
||||
nsSelectionPoint::~nsSelectionPoint()
|
||||
{
|
||||
NS_IF_RELEASE(fContent);
|
||||
}
|
||||
|
||||
|
||||
nsIContent * nsSelectionPoint::GetContent()
|
||||
{
|
||||
if (fContent != nsnull)
|
||||
NS_ADDREF(fContent);
|
||||
return fContent;
|
||||
}
|
||||
|
||||
void nsSelectionPoint::SetContent(nsIContent * aValue)
|
||||
{
|
||||
NS_IF_RELEASE(fContent);
|
||||
fContent = aValue;
|
||||
if (fContent != nsnull)
|
||||
NS_ADDREF(fContent);
|
||||
}
|
||||
|
||||
void nsSelectionPoint::SetPoint(nsIContent * aContent,
|
||||
PRInt32 aOffset,
|
||||
PRBool aIsAnchor)
|
||||
{
|
||||
NS_IF_RELEASE(fContent);
|
||||
fContent = aContent;
|
||||
fOffset = aOffset;
|
||||
fIsAnchor = aIsAnchor;
|
||||
if (fContent != nsnull)
|
||||
NS_ADDREF(fContent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -35,14 +35,14 @@ class nsSelectionPoint {
|
||||
|
||||
virtual ~nsSelectionPoint();
|
||||
|
||||
nsIContent * GetContent() { return fContent; }
|
||||
nsIContent * GetContent();
|
||||
PRInt32 GetOffset() { return fOffset; }
|
||||
PRBool IsAnchor() { return fIsAnchor;}
|
||||
|
||||
PRBool IsEntireContentSelected() { return fEntireContent; }
|
||||
void setEntireContentSelected(PRBool aState) { fEntireContent = aState; }
|
||||
|
||||
void SetContent(nsIContent * aValue) { fContent = aValue; }
|
||||
void SetContent(nsIContent * aValue);
|
||||
void SetOffset(PRInt32 aValue) { fOffset = aValue; }
|
||||
void SetAnchor(PRBool aValue) { fIsAnchor = aValue; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user