| 121 | } |
| 122 | |
| 123 | bool TextIterator::setTagColour(const Colour& _colour) |
| 124 | { |
| 125 | if (mCurrent == mEnd) |
| 126 | return false; |
| 127 | clearTagColour(); |
| 128 | if (mCurrent == mEnd) |
| 129 | return false; |
| 130 | |
| 131 | const size_t SIZE = 16; |
| 132 | wchar_t buff[SIZE]; |
| 133 | |
| 134 | #ifdef __MINGW32__ |
| 135 | swprintf( |
| 136 | buff, |
| 137 | L"#%.2X%.2X%.2X\0", |
| 138 | (int)(_colour.red * 255), |
| 139 | (int)(_colour.green * 255), |
| 140 | (int)(_colour.blue * 255)); |
| 141 | #else |
| 142 | swprintf( |
| 143 | buff, |
| 144 | SIZE, |
| 145 | L"#%.2X%.2X%.2X\0", |
| 146 | (int)(_colour.red * 255), |
| 147 | (int)(_colour.green * 255), |
| 148 | (int)(_colour.blue * 255)); |
| 149 | #endif |
| 150 | UString tmpStr = UString(buff); |
| 151 | insert(mCurrent, tmpStr.asUTF32()); |
| 152 | |
| 153 | return true; |
| 154 | } |
| 155 | |
| 156 | bool TextIterator::setTagColour(const UString::utf32string& _colour) |
| 157 | { |
no test coverage detected