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

Unified Diff: Source/core/layout/PendingSelection.cpp

Issue 1293593004: Introduce enum class TextAffinity as replacement of enum EAffinity (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T18:09:55 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
Index: Source/core/layout/PendingSelection.cpp
diff --git a/Source/core/layout/PendingSelection.cpp b/Source/core/layout/PendingSelection.cpp
index 2eb268bb2a12000f2512c594df59490f514e0012..7faf797afed4c752feb187ac758cc39fc503a129 100644
--- a/Source/core/layout/PendingSelection.cpp
+++ b/Source/core/layout/PendingSelection.cpp
@@ -82,7 +82,7 @@ VisibleSelection PendingSelection::calcVisibleSelectionAlgorithm() const
PositionType start = Strategy::selectionStart(m_selection);
PositionType end = Strategy::selectionEnd(m_selection);
SelectionType selectionType = VisibleSelection::selectionType(start, end);
- EAffinity affinity = m_selection.affinity();
+ TextAffinity affinity = m_selection.affinity();
bool paintBlockCursor = m_shouldShowBlockCursor && selectionType == SelectionType::CaretSelection && !isLogicalEndOfLine(VisiblePosition(end, affinity));
VisibleSelection selection;
@@ -92,13 +92,13 @@ VisibleSelection PendingSelection::calcVisibleSelectionAlgorithm() const
return selection;
}
- VisiblePosition visibleStart = VisiblePosition(start, selectionType == SelectionType::RangeSelection ? DOWNSTREAM : affinity);
+ VisiblePosition visibleStart = VisiblePosition(start, selectionType == SelectionType::RangeSelection ? TextAffinity::Downstream : affinity);
if (paintBlockCursor) {
VisiblePosition visibleExtent(end, affinity);
visibleExtent = visibleExtent.next(CanSkipOverEditingBoundary);
return VisibleSelection(visibleStart, visibleExtent);
}
- VisiblePosition visibleEnd(end, selectionType == SelectionType::RangeSelection ? UPSTREAM : affinity);
+ VisiblePosition visibleEnd(end, selectionType == SelectionType::RangeSelection ? TextAffinity::Upstream : affinity);
return VisibleSelection(visibleStart, visibleEnd);
}

Powered by Google App Engine
This is Rietveld 408576698