From ef6cadd961e13cb02c3650a3ad503022d04df5df Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Wed, 7 Oct 2020 21:11:46 -0700 Subject: [PATCH] Make TextInputModel::selection_start/end const Neither of these methods mutate the state of the model. --- shell/platform/common/cpp/text_input_model.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/platform/common/cpp/text_input_model.h b/shell/platform/common/cpp/text_input_model.h index 27aef63cdd1c6..866969fc885a6 100644 --- a/shell/platform/common/cpp/text_input_model.h +++ b/shell/platform/common/cpp/text_input_model.h @@ -117,12 +117,12 @@ class TextInputModel { size_t selection_extent_ = 0; // Returns the left hand side of the selection. - size_t selection_start() { + size_t selection_start() const { return std::min(selection_base_, selection_extent_); } // Returns the right hand side of the selection. - size_t selection_end() { + size_t selection_end() const { return std::max(selection_base_, selection_extent_); } };