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

Method createDocumentSceneAt

src/core/UBPersistenceManager.cpp:991–1014  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

989
990
991std::shared_ptr<UBGraphicsScene> UBPersistenceManager::createDocumentSceneAt(std::shared_ptr<UBDocumentProxy> proxy, int index, bool useUndoRedoStack)
992{
993 int count = proxy->pageCount();
994
995 for(int i = count - 1; i >= index; i--)
996 {
997 renamePage(proxy, i , i + 1);
998 }
999
1000 mSceneCache.shiftUpScenes(proxy, index, count -1);
1001
1002 std::shared_ptr<UBGraphicsScene> newScene = mSceneCache.createScene(proxy, index, useUndoRedoStack);
1003
1004 newScene->setBackground(UBSettings::settings()->isDarkBackground(),
1005 UBSettings::settings()->UBSettings::pageBackground());
1006
1007 newScene->setBackgroundGridSize(UBSettings::settings()->crossSize);
1008
1009 proxy->incPageCount();
1010
1011 persistDocumentScene(proxy, newScene, index);
1012
1013 return newScene;
1014}
1015
1016
1017void UBPersistenceManager::insertDocumentSceneAt(std::shared_ptr<UBDocumentProxy> proxy, std::shared_ptr<UBGraphicsScene> scene, int index, bool persist, bool deleting)

Callers 2

createNewSceneMethod · 0.80
createPageMethod · 0.80

Calls 7

shiftUpScenesMethod · 0.80
createSceneMethod · 0.80
setBackgroundGridSizeMethod · 0.80
incPageCountMethod · 0.80
pageCountMethod · 0.45
setBackgroundMethod · 0.45
isDarkBackgroundMethod · 0.45

Tested by

no test coverage detected