Commit aaa09c99 authored by Claudio Valerio's avatar Claudio Valerio

document removed if it contains only <<structural>> QGraphicsItems

parent 6d735044
......@@ -926,6 +926,24 @@ bool UBPersistenceManager::isEmpty(UBDocumentProxy* pDocumentProxy)
mSceneCache.removeScene(pDocumentProxy,0);
delete theSoleScene;
}
else{
//the scene can contain Delegate buttons and the selection frame
// but this doesn't means that there is something useful on the frame
bool usefulItemFound = false;
foreach(QGraphicsItem* eachItem, theSoleScene->getFastAccessItems()){
if(eachItem->type() > QGraphicsItem::UserType
&& eachItem->type() != UBGraphicsItemType::DelegateButtonType
&& eachItem->type() != UBGraphicsItemType::SelectionFrameType){
usefulItemFound = true;
break;
}
}
if(!usefulItemFound){
mSceneCache.removeScene(pDocumentProxy,0);
delete theSoleScene;
empty = true;
}
}
}
else
{
......
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