| 1302 | } |
| 1303 | |
| 1304 | std::shared_ptr<RangeMarker> ZepBuffer::FindNextMarker(GlyphIterator start, Direction dir, uint32_t markerType) |
| 1305 | { |
| 1306 | start.Clamp(); |
| 1307 | |
| 1308 | std::shared_ptr<RangeMarker> spFound; |
| 1309 | auto search = [&]() { |
| 1310 | ForEachMarker(markerType, dir, Begin(), End(), [&](const std::shared_ptr<RangeMarker>& marker) { |
| 1311 | if (dir == Direction::Forward) |
| 1312 | { |
| 1313 | if (marker->GetRange().first <= start.Index()) |
| 1314 | { |
| 1315 | return true; |
| 1316 | } |
| 1317 | } |
| 1318 | else |
| 1319 | { |
| 1320 | if (marker->GetRange().first >= start.Index()) |
| 1321 | { |
| 1322 | return true; |
| 1323 | } |
| 1324 | } |
| 1325 | |
| 1326 | spFound = marker; |
| 1327 | return false; |
| 1328 | }); |
| 1329 | }; |
| 1330 | |
| 1331 | search(); |
| 1332 | if (spFound == nullptr) |
| 1333 | { |
| 1334 | // Wrap |
| 1335 | start = (dir == Direction::Forward ? Begin() : End()); |
| 1336 | search(); |
| 1337 | } |
| 1338 | return spFound; |
| 1339 | } |
| 1340 | |
| 1341 | void ZepBuffer::SetBufferType(BufferType type) |
| 1342 | { |
no test coverage detected