| 1391 | } |
| 1392 | |
| 1393 | std::shared_ptr<RangeMarker> ZepBuffer::FindNextMarker(GlyphIterator start, Direction dir, uint32_t markerType) { |
| 1394 | start.Clamp(); |
| 1395 | |
| 1396 | std::shared_ptr<RangeMarker> spFound; |
| 1397 | auto search = [&]() { |
| 1398 | ForEachMarker(markerType, dir, Begin(), End(), [&](const std::shared_ptr<RangeMarker>& marker) { |
| 1399 | if (dir == Direction::Forward) { |
| 1400 | if (marker->GetRange().first <= start.Index()) { |
| 1401 | return true; |
| 1402 | } |
| 1403 | } else { |
| 1404 | if (marker->GetRange().first >= start.Index()) { |
| 1405 | return true; |
| 1406 | } |
| 1407 | } |
| 1408 | |
| 1409 | spFound = marker; |
| 1410 | return false; |
| 1411 | }); |
| 1412 | }; |
| 1413 | |
| 1414 | search(); |
| 1415 | if (spFound == nullptr) { |
| 1416 | // Wrap |
| 1417 | start = (dir == Direction::Forward ? Begin() : End()); |
| 1418 | search(); |
| 1419 | } |
| 1420 | return spFound; |
| 1421 | } |
| 1422 | |
| 1423 | void ZepBuffer::SetBufferType(BufferType type) { |
| 1424 | m_bufferType = type; |
no test coverage detected