From 0f0bf1c649388c07ae6e8dd784d7402f68691b96 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 8 Jun 2021 13:39:11 +0200 Subject: Remove images that are not visible from the loading queue, prepare for inline images --- src/Entry.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Entry.cpp') diff --git a/src/Entry.cpp b/src/Entry.cpp index 7e1b6d9..8e1fbfb 100644 --- a/src/Entry.cpp +++ b/src/Entry.cpp @@ -82,8 +82,8 @@ namespace QuickMedia { text.setEditable(editable); } - void Entry::set_text(std::string new_text) { - text.setString(sf::String::fromUtf8(new_text.data(), new_text.data() + new_text.size())); + void Entry::set_text(const std::string &new_text) { + text.setString(sf::String::fromUtf8(new_text.begin(), new_text.end())); } void Entry::move_caret_to_end() { @@ -91,8 +91,8 @@ namespace QuickMedia { text.moveCaretToEnd(); } - void Entry::append_text(std::string str) { - text.appendText(std::move(str)); + void Entry::append_text(const std::string &str) { + text.appendText(sf::String::fromUtf8(str.begin(), str.end())); } void Entry::replace(size_t start_index, size_t length, const sf::String &insert_str) { -- cgit v1.2.3