diff -r 060a13878ca0 -r be953e1621d9 sources/coloredline.cpp --- a/sources/coloredline.cpp Wed Jan 27 12:41:50 2021 +0200 +++ b/sources/coloredline.cpp Wed Jan 27 19:48:41 2021 +0200 @@ -1,5 +1,5 @@ /* - Copyright 2014 - 2016 Teemu Piippo + Copyright 2014 - 2021 Teemu Piippo All rights reserved. Redistribution and use in source and binary forms, with or without @@ -53,7 +53,7 @@ setColor(m_activeColor, false); if (m_boldActive) - m_data << RLINE_OFF_BOLD; + m_data.push_back(RLINE_OFF_BOLD); m_final = true; } @@ -103,7 +103,7 @@ setColor(m_activeColor, false); if (m_boldActive) - m_data << RLINE_OFF_BOLD; + m_data.push_back(RLINE_OFF_BOLD); m_boldActive = false; @@ -127,11 +127,11 @@ { if (ch == ']') { - String color = m_incomingColorName.toLowerCase(); + std::string color = to_lowercase(m_incomingColorName); for (const ColorCodeInfo &colorInfo : colorCodes) { - if (String(colorInfo.name).toLowerCase() == color) + if (to_lowercase(colorInfo.name) == color) { activateColor(colorInfo.color, colorInfo.bold); m_colorCodeStage = 0; @@ -151,7 +151,7 @@ if (isprint(ch)) { m_string += ch; - m_data << int(ch); + m_data.push_back(static_cast(ch)); ++m_length; } } @@ -161,20 +161,22 @@ void ColoredLine::activateColor(Color color, bool bold) { if (m_boldActive) - m_data << RLINE_OFF_BOLD; - + { + m_data.push_back(RLINE_OFF_BOLD); + } m_activeColor = color; m_boldActive = bold; assert(m_activeColor < 8); setColor(m_activeColor, true); - if (m_boldActive) - m_data << RLINE_ON_BOLD; + { + m_data.push_back(RLINE_ON_BOLD); + } } // ------------------------------------------------------------------------------------------------- // -void ColoredLine::addString(const String& text) +void ColoredLine::addString(const std::string& text) { for (char a : text) addChar(a); @@ -185,7 +187,7 @@ void ColoredLine::setColor(Color a, bool on) { assert(a < 8); - m_data << (a +(on ? RLINE_ON_COLOR : RLINE_OFF_COLOR)); + m_data.push_back(a + (on ? RLINE_ON_COLOR : RLINE_OFF_COLOR)); } // -------------------------------------------------------------------------------------------------