| 989 | |
| 990 | |
| 991 | std::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 | |
| 1017 | void UBPersistenceManager::insertDocumentSceneAt(std::shared_ptr<UBDocumentProxy> proxy, std::shared_ptr<UBGraphicsScene> scene, int index, bool persist, bool deleting) |
no test coverage detected