- Corrected get_front() issues.

- Widget tests are now working properly.



git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@990 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
matrevis 2006-09-02 01:56:00 +00:00
parent 4b3cce6bea
commit 47d4fe65b4
10 changed files with 49 additions and 30 deletions

View file

@ -122,7 +122,7 @@ ConcreteHistory::get_last_environment() const
{
// Should always be true:
assert(_snapshots.size() > 0);
return *_snapshots.back();
return get_environment_at(get_front());
}
@ -487,6 +487,16 @@ ConcreteHistory::edit_subrequest(SubRequest& subrequest,
reset(true);
}
void
ConcreteHistory::step_front(position p)
{
_front = p;
if (p > _snapshots.size())
_front = _snapshots.size();
notify_change();
}
void
ConcreteHistory::reset(bool notify)
{
@ -496,6 +506,7 @@ ConcreteHistory::reset(bool notify)
for_each(it, _snapshots.end(), deletor<ConcreteEnvironment>());
_snapshots.resize(1); // Truncate to keep only our "model"
_front = 0;
if (notify)
notify_change();