MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / renumberThumbnails

Method renumberThumbnails

src/gui/UBThumbnailScene.cpp:455–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455void 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}

Callers 1

deletePagesMethod · 0.80

Calls 2

setSceneIndexMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected