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

Method insertDocumentSceneAt

src/core/UBPersistenceManager.cpp:1017–1038  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1015
1016
1017void UBPersistenceManager::insertDocumentSceneAt(std::shared_ptr<UBDocumentProxy> proxy, std::shared_ptr<UBGraphicsScene> scene, int index, bool persist, bool deleting)
1018{
1019 scene->setDocument(proxy);
1020
1021 int count = proxy->pageCount();
1022
1023 for(int i = count - 1; i >= index; i--)
1024 {
1025 renamePage(proxy, i , i + 1);
1026 }
1027
1028 mSceneCache.shiftUpScenes(proxy, index, count -1);
1029
1030 mSceneCache.insert(proxy, index, scene);
1031
1032 proxy->incPageCount();
1033
1034 if (persist)
1035 {
1036 persistDocumentScene(proxy, scene, index);
1037 }
1038}
1039
1040
1041void UBPersistenceManager::moveSceneToIndex(std::shared_ptr<UBDocumentProxy> proxy, int source, int target)

Callers 2

insertPageMethod · 0.80
foreachFunction · 0.80

Calls 5

shiftUpScenesMethod · 0.80
incPageCountMethod · 0.80
setDocumentMethod · 0.45
pageCountMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected