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

Unified Diff: Source/core/editing/commands/InsertListCommand.cpp

Issue 1313883002: Introduce firstRangeOf() as replacement of VisibleSelection::firstRange() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-25T17:47:14 Created 5 years, 4 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
« no previous file with comments | « Source/core/editing/commands/EditorCommand.cpp ('k') | Source/modules/accessibility/AXLayoutObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/commands/InsertListCommand.cpp
diff --git a/Source/core/editing/commands/InsertListCommand.cpp b/Source/core/editing/commands/InsertListCommand.cpp
index 6bdfebbca519c3107222fe8ca78fdea1abf3a7d3..74a0b91109d4a6c557bc77488227df08528b195f 100644
--- a/Source/core/editing/commands/InsertListCommand.cpp
+++ b/Source/core/editing/commands/InsertListCommand.cpp
@@ -146,7 +146,7 @@ void InsertListCommand::doApply()
VisiblePosition endOfSelection = selection.visibleEnd();
VisiblePosition startOfLastParagraph = startOfParagraph(endOfSelection, CanSkipOverEditingBoundary);
- RefPtrWillBeRawPtr<Range> currentSelection = endingSelection().firstRange();
+ RefPtrWillBeRawPtr<Range> currentSelection = firstRangeOf(endingSelection());
RefPtrWillBeRawPtr<ContainerNode> scopeForStartOfSelection = nullptr;
RefPtrWillBeRawPtr<ContainerNode> scopeForEndOfSelection = nullptr;
// FIXME: This is an inefficient way to keep selection alive because
@@ -204,8 +204,8 @@ void InsertListCommand::doApply()
return;
}
- ASSERT(endingSelection().firstRange());
- doApplyForSingleParagraph(false, listTag, *endingSelection().firstRange());
+ ASSERT(firstRangeOf(endingSelection()));
+ doApplyForSingleParagraph(false, listTag, *firstRangeOf(endingSelection()));
}
bool InsertListCommand::doApplyForSingleParagraph(bool forceCreateList, const HTMLQualifiedName& listTag, Range& currentSelection)
« no previous file with comments | « Source/core/editing/commands/EditorCommand.cpp ('k') | Source/modules/accessibility/AXLayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698