comparison document/Document.cpp @ 84:41c491657587

* Further fix for restoring layer visibility from session file * Better handling of error state in bzip file device to avoid spurious errors * Fix #1495001 deleted layers prevail in saved session file
author Chris Cannam
date Fri, 05 Jan 2007 15:49:10 +0000
parents bedc7517b6e8
children 2678a1f132d2
comparison
equal deleted inserted replaced
83:0d2fb43b5ee5 84:41c491657587
745 745
746 if (m_mainModel) { 746 if (m_mainModel) {
747 m_mainModel->toXml(out, indent + " ", "mainModel=\"true\""); 747 m_mainModel->toXml(out, indent + " ", "mainModel=\"true\"");
748 } 748 }
749 749
750 // Models that are not used in a layer that is in a view should
751 // not be written. Get our list of required models first.
752
753 std::set<const Model *> used;
754
755 for (LayerViewMap::const_iterator i = m_layerViewMap.begin();
756 i != m_layerViewMap.end(); ++i) {
757
758 if (i->first && !i->second.empty() && i->first->getModel()) {
759 used.insert(i->first->getModel());
760 }
761 }
762
750 for (ModelMap::const_iterator i = m_models.begin(); 763 for (ModelMap::const_iterator i = m_models.begin();
751 i != m_models.end(); ++i) { 764 i != m_models.end(); ++i) {
752 765
753 const Model *model = i->first; 766 const Model *model = i->first;
754 const ModelRecord &rec = i->second; 767 const ModelRecord &rec = i->second;
755 768
769 if (used.find(model) == used.end()) continue;
770
756 // We need an intelligent way to determine which models need 771 // We need an intelligent way to determine which models need
757 // to be streamed (i.e. have been edited, or are small) and 772 // to be streamed (i.e. have been edited, or are small) and
758 // which should not be (i.e. remain as generated by a 773 // which should not be (i.e. remain as generated by a
759 // transform, and are large). 774 // transform, and are large).
760 // 775 //