| 86 | } |
| 87 | |
| 88 | void appendRange (Array<AttributedString::Attribute>& atts, |
| 89 | int length, const Font* f, const Colour* c) |
| 90 | { |
| 91 | if (atts.size() == 0) |
| 92 | { |
| 93 | atts.add ({ Range<int> (0, length), f != nullptr ? *f : Font(), c != nullptr ? *c : Colour (0xff000000) }); |
| 94 | } |
| 95 | else |
| 96 | { |
| 97 | auto start = getLength (atts); |
| 98 | atts.add ({ Range<int> (start, start + length), |
| 99 | f != nullptr ? *f : atts.getReference (atts.size() - 1).font, |
| 100 | c != nullptr ? *c : atts.getReference (atts.size() - 1).colour }); |
| 101 | |
| 102 | mergeAdjacentRanges (atts); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | void applyFontAndColour (Array<AttributedString::Attribute>& atts, |
| 107 | Range<int> range, const Font* f, const Colour* c) |
no test coverage detected