aboutsummaryrefslogtreecommitdiff
path: root/src/Entry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Entry.cpp')
-rw-r--r--src/Entry.cpp8
1 files changed, 4 insertions, 4 deletions
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) {