170 |
170 |
171 // ============================================================================= |
171 // ============================================================================= |
172 // |
172 // |
173 void EditHistory::undo() const |
173 void EditHistory::undo() const |
174 { |
174 { |
175 LDObject* obj = CurrentDocument()->getObject (index()); |
175 LDObject* obj = g_win->currentDocument()->getObject (index()); |
176 LDObject* newobj = ParseLine (oldCode()); |
176 LDObject* newobj = ParseLine (oldCode()); |
177 obj->replace (newobj); |
177 obj->replace (newobj); |
178 g_win->R()->compileObject (newobj); |
178 g_win->R()->compileObject (newobj); |
179 } |
179 } |
180 |
180 |
181 // ============================================================================= |
181 // ============================================================================= |
182 // |
182 // |
183 void EditHistory::redo() const |
183 void EditHistory::redo() const |
184 { |
184 { |
185 LDObject* obj = CurrentDocument()->getObject (index()); |
185 LDObject* obj = g_win->currentDocument()->getObject (index()); |
186 LDObject* newobj = ParseLine (newCode()); |
186 LDObject* newobj = ParseLine (newCode()); |
187 obj->replace (newobj); |
187 obj->replace (newobj); |
188 g_win->R()->compileObject (newobj); |
188 g_win->R()->compileObject (newobj); |
189 } |
189 } |
190 |
190 |