diff --git a/src/window_command.cpp b/src/window_command.cpp index 76bf5983972..0836a8b7a44 100644 --- a/src/window_command.cpp +++ b/src/window_command.cpp @@ -65,9 +65,9 @@ void Window_Command::EnableItem(int i) { DrawItem(i, Font::ColorDefault); } -void Window_Command::SetItemText(unsigned index, std::string const& text) { +void Window_Command::SetItemText(unsigned index, StringView text) { if (index < commands.size()) { - commands[index] = text; + commands[index] = ToString(text); DrawItem(index, Font::ColorDefault); } } diff --git a/src/window_command.h b/src/window_command.h index a9a6bec57a7..706770bbcb4 100644 --- a/src/window_command.h +++ b/src/window_command.h @@ -65,7 +65,7 @@ class Window_Command: public Window_Selectable { * @param index command index. * @param text new item text. */ - void SetItemText(unsigned index, std::string const& text); + void SetItemText(unsigned index, StringView text); protected: std::vector commands;