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

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

Issue 1317053004: Make VisiblePosition constructor private (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-02T12:44:47 Rebase Created 5 years, 3 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/core/editing/commands/TypingCommand.cpp
diff --git a/Source/core/editing/commands/TypingCommand.cpp b/Source/core/editing/commands/TypingCommand.cpp
index 3da0121ac8a986734c2c9a09fd32519c58b3d7be..a8755c9ef0ac7dd43dbfb2a9290e7116d994a054 100644
--- a/Source/core/editing/commands/TypingCommand.cpp
+++ b/Source/core/editing/commands/TypingCommand.cpp
@@ -302,7 +302,7 @@ void TypingCommand::markMisspellingsAfterTyping(ETypingCommand commandType)
// Since the word containing the current selection is never marked, this does a check to
// see if typing made a new word that is not in the current selection. Basically, you
// get this by being at the end of a word and typing a space.
- VisiblePosition start(endingSelection().start(), endingSelection().affinity());
+ VisiblePosition start = createVisiblePosition(endingSelection().start(), endingSelection().affinity());
VisiblePosition previous = previousPositionOf(start);
VisiblePosition p1 = startOfWord(previous, LeftWordIfOnBoundary);
@@ -453,7 +453,7 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
// If we have a caret selection at the beginning of a cell, we have nothing to do.
Node* enclosingTableCell = enclosingNodeOfType(visibleStart.deepEquivalent(), &isTableCell);
- if (enclosingTableCell && visibleStart.deepEquivalent() == VisiblePosition(firstPositionInNode(enclosingTableCell)).deepEquivalent())
+ if (enclosingTableCell && visibleStart.deepEquivalent() == createVisiblePosition(firstPositionInNode(enclosingTableCell)).deepEquivalent())
return;
// If the caret is at the start of a paragraph after a table, move content into the last table cell.
@@ -543,7 +543,7 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity, bool ki
Position downstreamEnd = mostForwardCaretPosition(endingSelection().end());
VisiblePosition visibleEnd = endingSelection().visibleEnd();
Node* enclosingTableCell = enclosingNodeOfType(visibleEnd.deepEquivalent(), &isTableCell);
- if (enclosingTableCell && visibleEnd.deepEquivalent() == VisiblePosition(lastPositionInNode(enclosingTableCell)).deepEquivalent())
+ if (enclosingTableCell && visibleEnd.deepEquivalent() == createVisiblePosition(lastPositionInNode(enclosingTableCell)).deepEquivalent())
return;
if (visibleEnd.deepEquivalent() == endOfParagraph(visibleEnd).deepEquivalent())
downstreamEnd = mostForwardCaretPosition(nextPositionOf(visibleEnd, CannotCrossEditingBoundary).deepEquivalent());
« no previous file with comments | « Source/core/editing/commands/ReplaceSelectionCommand.cpp ('k') | Source/core/editing/iterators/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698