Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: Source/WebCore/editing/ApplyBlockElementCommand.cpp

Issue 9567015: Merge 108009 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/editing/ApplyBlockElementCommand.cpp
===================================================================
--- Source/WebCore/editing/ApplyBlockElementCommand.cpp (revision 109364)
+++ Source/WebCore/editing/ApplyBlockElementCommand.cpp (working copy)
@@ -80,10 +80,10 @@
VisiblePosition endOfSelection = selection.visibleEnd();
ASSERT(!startOfSelection.isNull());
ASSERT(!endOfSelection.isNull());
- Element* startScope = 0;
- int startIndex = indexForVisiblePosition(startOfSelection, &startScope);
- Element* endScope = 0;
- int endIndex = indexForVisiblePosition(endOfSelection, &endScope);
+ RefPtr<Element> startScope;
+ int startIndex = indexForVisiblePosition(startOfSelection, startScope);
+ RefPtr<Element> endScope;
+ int endIndex = indexForVisiblePosition(endOfSelection, endScope);
formatSelection(startOfSelection, endOfSelection);
@@ -93,8 +93,8 @@
ASSERT(startIndex >= 0);
ASSERT(startIndex <= endIndex);
if (startScope == endScope && startIndex >= 0 && startIndex <= endIndex) {
- VisiblePosition start(visiblePositionForIndex(startIndex, startScope));
- VisiblePosition end(visiblePositionForIndex(endIndex, endScope));
+ VisiblePosition start(visiblePositionForIndex(startIndex, startScope.get()));
+ VisiblePosition end(visiblePositionForIndex(endIndex, endScope.get()));
if (start.isNotNull() && end.isNotNull())
setEndingSelection(VisibleSelection(start, end, endingSelection().isDirectional()));
}

Powered by Google App Engine
This is Rietveld 408576698