This commit is contained in:
jfrancis%netscape.com 1999-05-26 22:28:04 +00:00
Родитель 8338dd389c
Коммит cb89b3b4db
2 изменённых файлов: 16 добавлений и 6 удалений

Просмотреть файл

@ -1427,7 +1427,12 @@ nsresult nsRange::Clone(nsIDOMRange** aReturn)
if (NS_FAILED(res))
return res;
return DoSetRange(mStartParent, mStartOffset, mEndParent, mEndOffset);
res = (*aReturn)->SetStart(mStartParent, mStartOffset);
if (NS_FAILED(res))
return res;
res = (*aReturn)->SetEnd(mEndParent, mEndOffset);
return res;
}
nsresult nsRange::InsertNode(nsIDOMNode* aN)
@ -1598,12 +1603,12 @@ nsresult nsRange::OwnerChildRemoved(nsIContent* aParentNode, PRInt32 aOffset, ns
if (theRange->mStartParent == domNode)
{
// if child deleted before start, move start offset left one
if (aOffset <= theRange->mStartOffset) theRange->mStartOffset--;
if (aOffset < theRange->mStartOffset) theRange->mStartOffset--;
}
if (theRange->mEndParent == domNode)
{
// if child deleted before end, move end offset left one
if (aOffset <= theRange->mEndOffset)
if (aOffset < theRange->mEndOffset)
{
if (theRange->mEndOffset>0) theRange->mEndOffset--;
}

Просмотреть файл

@ -1427,7 +1427,12 @@ nsresult nsRange::Clone(nsIDOMRange** aReturn)
if (NS_FAILED(res))
return res;
return DoSetRange(mStartParent, mStartOffset, mEndParent, mEndOffset);
res = (*aReturn)->SetStart(mStartParent, mStartOffset);
if (NS_FAILED(res))
return res;
res = (*aReturn)->SetEnd(mEndParent, mEndOffset);
return res;
}
nsresult nsRange::InsertNode(nsIDOMNode* aN)
@ -1598,12 +1603,12 @@ nsresult nsRange::OwnerChildRemoved(nsIContent* aParentNode, PRInt32 aOffset, ns
if (theRange->mStartParent == domNode)
{
// if child deleted before start, move start offset left one
if (aOffset <= theRange->mStartOffset) theRange->mStartOffset--;
if (aOffset < theRange->mStartOffset) theRange->mStartOffset--;
}
if (theRange->mEndParent == domNode)
{
// if child deleted before end, move end offset left one
if (aOffset <= theRange->mEndOffset)
if (aOffset < theRange->mEndOffset)
{
if (theRange->mEndOffset>0) theRange->mEndOffset--;
}