Closed Bug 761299 Opened 11 years ago Closed 11 years ago

Cleanup DeleteRangeTxn::CreateTxnsToDeleteBetween

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Details

Attachments

(1 file)

Attached patch Patch v1Splinter Review
No description provided.
Attachment #629903 - Flags: review?(ehsan)
Comment on attachment 629903 [details] [diff] [review]
Patch v1

Review of attachment 629903 [details] [diff] [review]:
-----------------------------------------------------------------

::: editor/libeditor/base/DeleteRangeTxn.cpp
@@ +268,2 @@
>  
> +    child = child->GetNextSibling();

Please loop on |child|, not the child count.
Attachment #629903 - Flags: review?(ehsan) → review-
Comment on attachment 629903 [details] [diff] [review]
Patch v1

Review of attachment 629903 [details] [diff] [review]:
-----------------------------------------------------------------

::: editor/libeditor/base/DeleteRangeTxn.cpp
@@ +253,5 @@
> +  }
> +
> +  nsCOMPtr<nsINode> startParent = do_QueryInterface(aStartParent);
> +  NS_ENSURE_STATE(startParent);
> +  NS_ASSERTION(aEndOffset <= startParent->Length(), "bad aEndOffset");

This should actually be GetChildCount() (which doesn't make any difference)
Comment on attachment 629903 [details] [diff] [review]
Patch v1

Review of attachment 629903 [details] [diff] [review]:
-----------------------------------------------------------------

::: editor/libeditor/base/DeleteRangeTxn.cpp
@@ +253,5 @@
> +  }
> +
> +  nsCOMPtr<nsINode> startParent = do_QueryInterface(aStartParent);
> +  NS_ENSURE_STATE(startParent);
> +  NS_ASSERTION(aEndOffset <= startParent->Length(), "bad aEndOffset");

Right.

@@ +268,2 @@
>  
> +    child = child->GetNextSibling();

NM.
Attachment #629903 - Flags: review- → review+
https://hg.mozilla.org/mozilla-central/rev/42c17eb4789a
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in before you can comment on or make changes to this bug.