[XSwiftBus] Fixed UTF-8 ellipsis character indicating wrapped text messages.

This commit is contained in:
Mat Sutcliffe
2019-06-17 15:41:08 +01:00
parent 4ab3e9a03b
commit eff001048c

View File

@@ -52,13 +52,11 @@ namespace XSwiftBus
void CService::addTextMessage(const std::string &text, double red, double green, double blue)
{
if (text.empty()) { return; }
static const std::string ellipsis = "...";
static const std::string ellipsis = u8"\u2026";
const int lineLength = static_cast<int>(m_messages.maxLineLength() - ellipsis.size());
std::vector<std::string> wrappedLines;
for (size_t i = 0; i < text.size(); i += lineLength)
{
// static const QChar ellipsis = 0x2026;
// wrappedLines.push_back(QString::fromStdString(text).mid(i, lineLength) + ellipsis);
wrappedLines.push_back(text.substr(i, lineLength) + ellipsis);
}
wrappedLines.back().erase(wrappedLines.back().size() - 3);