Index: Source/WebCore/editing/InsertListCommand.cpp |
=================================================================== |
--- Source/WebCore/editing/InsertListCommand.cpp (revision 109365) |
+++ Source/WebCore/editing/InsertListCommand.cpp (working copy) |
@@ -152,11 +152,11 @@ |
// FIXME: This is an inefficient way to keep selection alive because indexForVisiblePosition walks from |
// the beginning of the document to the endOfSelection everytime this code is executed. |
// But not using index is hard because there are so many ways we can lose selection inside doApplyForSingleParagraph. |
- Element* scope = 0; |
- int indexForEndOfSelection = indexForVisiblePosition(endOfSelection, &scope); |
+ RefPtr<Element> scope; |
+ int indexForEndOfSelection = indexForVisiblePosition(endOfSelection, scope); |
doApplyForSingleParagraph(forceCreateList, listTag, currentSelection.get()); |
if (endOfSelection.isNull() || endOfSelection.isOrphan() || startOfLastParagraph.isNull() || startOfLastParagraph.isOrphan()) { |
- endOfSelection = visiblePositionForIndex(indexForEndOfSelection, scope); |
+ endOfSelection = visiblePositionForIndex(indexForEndOfSelection, scope.get()); |
// If endOfSelection is null, then some contents have been deleted from the document. |
// This should never happen and if it did, exit early immediately because we've lost the loop invariant. |
ASSERT(endOfSelection.isNotNull()); |