Commit 723ef7b2 authored by Clément Fauconnier's avatar Clément Fauconnier

fixed a bug where adding an existing page to the curent document resulted in a crash

parent 8a2ce951
......@@ -550,6 +550,7 @@ void UBBoardController::addScene(UBGraphicsScene* scene, bool replaceActiveIfEmp
if (replaceActiveIfEmpty && mActiveScene->isEmpty())
{
UBPersistenceManager::persistenceManager()->insertDocumentSceneAt(selectedDocument(), clone, mActiveSceneIndex);
emit addThumbnailRequired(this, mActiveSceneIndex);
setActiveDocumentScene(mActiveSceneIndex);
deleteScene(mActiveSceneIndex + 1);
}
......@@ -557,6 +558,7 @@ void UBBoardController::addScene(UBGraphicsScene* scene, bool replaceActiveIfEmp
{
persistCurrentScene(false,true);
UBPersistenceManager::persistenceManager()->insertDocumentSceneAt(selectedDocument(), clone, mActiveSceneIndex + 1);
emit addThumbnailRequired(this, mActiveSceneIndex + 1);
setActiveDocumentScene(mActiveSceneIndex + 1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment