From ecf23123a6dcdf50d050a2215cb62ac8554644ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Mon, 14 Oct 2019 17:03:47 +0200 Subject: [PATCH] [escher/text_input] Clean TextInput::ContentView::resetSelection --- escher/src/text_input.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/escher/src/text_input.cpp b/escher/src/text_input.cpp index c76b57997..4aa6e5838 100644 --- a/escher/src/text_input.cpp +++ b/escher/src/text_input.cpp @@ -58,10 +58,10 @@ void TextInput::ContentView::addSelection(const char * left, const char * right) } bool TextInput::ContentView::resetSelection() { - const char * previousStart = m_selectionStart; - if (previousStart == nullptr) { + if (selectionIsEmpty()) { return false; } + const char * previousStart = m_selectionStart; const char * previousEnd = m_selectionEnd; m_selectionStart = nullptr; m_selectionEnd = nullptr;