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

Unified Diff: Source/core/editing/IndentOutdentCommand.cpp

Issue 105483003: Editing - Code refactoring to avoid redundant function calls (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Including few more similar fixes Created 7 years 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/ApplyBlockElementCommand.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/IndentOutdentCommand.cpp
diff --git a/Source/core/editing/IndentOutdentCommand.cpp b/Source/core/editing/IndentOutdentCommand.cpp
index 940f54b5546107a2f907f135e289d3c20cea8e30..f882fe03a5e237a28d0abb9f47b0d5f5ce46b0f4 100644
--- a/Source/core/editing/IndentOutdentCommand.cpp
+++ b/Source/core/editing/IndentOutdentCommand.cpp
@@ -107,7 +107,6 @@ void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Pos
if (!nodeToSplitTo)
return;
- RefPtr<Node> nodeAfterStart = start.computeNodeAfterPosition();
RefPtr<Node> outerBlock = (start.containerNode() == nodeToSplitTo) ? start.containerNode() : splitTreeToNode(start.containerNode(), nodeToSplitTo);
VisiblePosition startOfContents = start;
@@ -194,16 +193,16 @@ void IndentOutdentCommand::outdentParagraph()
// FIXME: We should merge this function with ApplyBlockElementCommand::formatSelection
void IndentOutdentCommand::outdentRegion(const VisiblePosition& startOfSelection, const VisiblePosition& endOfSelection)
{
+ VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection);
VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection);
- if (endOfParagraph(startOfSelection) == endOfLastParagraph) {
+ if (endOfCurrentParagraph == endOfLastParagraph) {
outdentParagraph();
return;
}
Position originalSelectionEnd = endingSelection().end();
- VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection);
- VisiblePosition endAfterSelection = endOfParagraph(endOfParagraph(endOfSelection).next());
+ VisiblePosition endAfterSelection = endOfParagraph(endOfLastParagraph.next());
while (endOfCurrentParagraph != endAfterSelection) {
VisiblePosition endOfNextParagraph = endOfParagraph(endOfCurrentParagraph.next());
« no previous file with comments | « Source/core/editing/ApplyBlockElementCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698