| 453 | } |
| 454 | |
| 455 | void UBThumbnailScene::renumberThumbnails(int fromIndex, int toIndex) const |
| 456 | { |
| 457 | if (toIndex < 0 || toIndex > mThumbnailItems.size()) |
| 458 | { |
| 459 | toIndex = mThumbnailItems.size(); |
| 460 | } |
| 461 | |
| 462 | if (toIndex <= fromIndex || fromIndex >= mThumbnailItems.size()) |
| 463 | { |
| 464 | // nothing to do |
| 465 | return; |
| 466 | } |
| 467 | |
| 468 | // fix index and page number of thumbnails |
| 469 | for (int index = fromIndex; index < toIndex; ++index) |
| 470 | { |
| 471 | auto item = mThumbnailItems.at(index); |
| 472 | |
| 473 | if (item) |
| 474 | { |
| 475 | item->setSceneIndex(index); |
| 476 | } |
| 477 | } |
| 478 | } |
no test coverage detected