src/document.cc

changeset 619
8bfe34c6ab1a
parent 617
f5059d144438
child 622
622c49e60348
equal deleted inserted replaced
618:de0d51349f6c 619:8bfe34c6ab1a
118 } 118 }
119 } 119 }
120 120
121 // ============================================================================= 121 // =============================================================================
122 // ----------------------------------------------------------------------------- 122 // -----------------------------------------------------------------------------
123 LDDocument::LDDocument() 123 LDDocument::LDDocument() :
124 m_gldata (new LDGLData)
124 { 125 {
125 setImplicit (true); 126 setImplicit (true);
126 setSavePosition (-1); 127 setSavePosition (-1);
127 setListItem (null); 128 setListItem (null);
128 setHistory (new History); 129 setHistory (new History);
146 // Clear the cache as well 147 // Clear the cache as well
147 for (LDObject* obj : getCache()) 148 for (LDObject* obj : getCache())
148 obj->deleteSelf(); 149 obj->deleteSelf();
149 150
150 delete m_History; 151 delete m_History;
152 delete m_gldata;
151 153
152 // If we just closed the current file, we need to set the current 154 // If we just closed the current file, we need to set the current
153 // file as something else. 155 // file as something else.
154 if (this == getCurrentDocument()) 156 if (this == getCurrentDocument())
155 { 157 {
1279 1281
1280 // ============================================================================= 1282 // =============================================================================
1281 // Sets the given file as the current one on display. At some point in time this 1283 // Sets the given file as the current one on display. At some point in time this
1282 // was an operation completely unheard of. ;) 1284 // was an operation completely unheard of. ;)
1283 // 1285 //
1284 // FIXME: f can be temporarily null. This probably should not be the case. 1286 // TODO: f can be temporarily null. This probably should not be the case.
1285 // ----------------------------------------------------------------------------- 1287 // -----------------------------------------------------------------------------
1286 void LDDocument::setCurrent (LDDocument* f) 1288 void LDDocument::setCurrent (LDDocument* f)
1287 { 1289 {
1288 // Implicit files were loaded for caching purposes and must never be set 1290 // Implicit files were loaded for caching purposes and must never be set
1289 // current. 1291 // current.
1297 // A ton of stuff needs to be updated 1299 // A ton of stuff needs to be updated
1298 g_win->updateDocumentListItem (f); 1300 g_win->updateDocumentListItem (f);
1299 g_win->buildObjList(); 1301 g_win->buildObjList();
1300 g_win->updateTitle(); 1302 g_win->updateTitle();
1301 g_win->R()->setFile (f); 1303 g_win->R()->setFile (f);
1302 g_win->R()->resetAllAngles();
1303 g_win->R()->repaint(); 1304 g_win->R()->repaint();
1304 log ("Changed file to %1", f->getDisplayName()); 1305 log ("Changed file to %1", f->getDisplayName());
1305 } 1306 }
1306 } 1307 }
1307 1308

mercurial