Commit cb8bb767 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Get rid of unused parameter TextAffinity from TrailingWhitespacePosition()

This patch gets rid of unused parameter |TextAffinity| from
|TrailingWhitespacePosition()| for improving code health.

This patch is a preparation of renaming |VP_DEFAULT_AFFINITY| to
|TextAffinity::kDefault|.

Bug: 657237
Change-Id: I0c354cbbbe09afc757d23c23db0c8df244c6b09a
Reviewed-on: https://chromium-review.googlesource.com/701904Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506943}
parent a2195917
...@@ -1687,7 +1687,6 @@ Position LeadingWhitespacePosition(const Position& position, ...@@ -1687,7 +1687,6 @@ Position LeadingWhitespacePosition(const Position& position,
// This assumes that it starts in editable content. // This assumes that it starts in editable content.
Position TrailingWhitespacePosition(const Position& position, Position TrailingWhitespacePosition(const Position& position,
TextAffinity,
WhitespacePositionOption option) { WhitespacePositionOption option) {
DCHECK(!NeedsLayoutTreeUpdate(position)); DCHECK(!NeedsLayoutTreeUpdate(position));
DCHECK(IsEditablePosition(position)) << position; DCHECK(IsEditablePosition(position)) << position;
......
...@@ -304,9 +304,11 @@ Position LeadingWhitespacePosition( ...@@ -304,9 +304,11 @@ Position LeadingWhitespacePosition(
const Position&, const Position&,
TextAffinity, TextAffinity,
WhitespacePositionOption = kNotConsiderNonCollapsibleWhitespace); WhitespacePositionOption = kNotConsiderNonCollapsibleWhitespace);
// TDOO(editing-dev): We should move |TrailingWhitespacePosition()| to
// "DeleteSelection.cpp" since it is used only in "DeleteSelection.cpp".
Position TrailingWhitespacePosition( Position TrailingWhitespacePosition(
const Position&, const Position&,
TextAffinity,
WhitespacePositionOption = kNotConsiderNonCollapsibleWhitespace); WhitespacePositionOption = kNotConsiderNonCollapsibleWhitespace);
unsigned NumEnclosingMailBlockquotes(const Position&); unsigned NumEnclosingMailBlockquotes(const Position&);
PositionWithAffinity PositionRespectingEditingBoundary( PositionWithAffinity PositionRespectingEditingBoundary(
......
...@@ -302,8 +302,7 @@ void DeleteSelectionCommand::InitializePositionData( ...@@ -302,8 +302,7 @@ void DeleteSelectionCommand::InitializePositionData(
// to the selection // to the selection
leading_whitespace_ = LeadingWhitespacePosition( leading_whitespace_ = LeadingWhitespacePosition(
upstream_start_, selection_to_delete_.Affinity()); upstream_start_, selection_to_delete_.Affinity());
trailing_whitespace_ = trailing_whitespace_ = TrailingWhitespacePosition(downstream_end_);
TrailingWhitespacePosition(downstream_end_, VP_DEFAULT_AFFINITY);
if (smart_delete_) { if (smart_delete_) {
// skip smart delete if the selection to delete already starts or ends with // skip smart delete if the selection to delete already starts or ends with
...@@ -312,8 +311,7 @@ void DeleteSelectionCommand::InitializePositionData( ...@@ -312,8 +311,7 @@ void DeleteSelectionCommand::InitializePositionData(
CreateVisiblePosition(upstream_start_, selection_to_delete_.Affinity()) CreateVisiblePosition(upstream_start_, selection_to_delete_.Affinity())
.DeepEquivalent(); .DeepEquivalent();
bool skip_smart_delete = bool skip_smart_delete =
TrailingWhitespacePosition(pos, VP_DEFAULT_AFFINITY, TrailingWhitespacePosition(pos, kConsiderNonCollapsibleWhitespace)
kConsiderNonCollapsibleWhitespace)
.IsNotNull(); .IsNotNull();
if (!skip_smart_delete) if (!skip_smart_delete)
skip_smart_delete = skip_smart_delete =
...@@ -345,7 +343,7 @@ void DeleteSelectionCommand::InitializePositionData( ...@@ -345,7 +343,7 @@ void DeleteSelectionCommand::InitializePositionData(
// leading whitespace, as in the case where you double-click the first word // leading whitespace, as in the case where you double-click the first word
// of a paragraph. // of a paragraph.
if (!skip_smart_delete && !has_leading_whitespace_before_adjustment && if (!skip_smart_delete && !has_leading_whitespace_before_adjustment &&
TrailingWhitespacePosition(downstream_end_, VP_DEFAULT_AFFINITY, TrailingWhitespacePosition(downstream_end_,
kConsiderNonCollapsibleWhitespace) kConsiderNonCollapsibleWhitespace)
.IsNotNull()) { .IsNotNull()) {
// Expand out one character downstream for smart delete and recalculate // Expand out one character downstream for smart delete and recalculate
...@@ -355,8 +353,7 @@ void DeleteSelectionCommand::InitializePositionData( ...@@ -355,8 +353,7 @@ void DeleteSelectionCommand::InitializePositionData(
.DeepEquivalent(); .DeepEquivalent();
upstream_end_ = MostBackwardCaretPosition(pos); upstream_end_ = MostBackwardCaretPosition(pos);
downstream_end_ = MostForwardCaretPosition(pos); downstream_end_ = MostForwardCaretPosition(pos);
trailing_whitespace_ = trailing_whitespace_ = TrailingWhitespacePosition(downstream_end_);
TrailingWhitespacePosition(downstream_end_, VP_DEFAULT_AFFINITY);
SetStartingSelectionOnSmartDelete(downstream_start_, downstream_end_); SetStartingSelectionOnSmartDelete(downstream_start_, downstream_end_);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment