Fixed #107 (Undo not working with shapes)

This commit is contained in:
Matthias Koefferlein 2018-04-07 16:00:37 -07:00
parent a7446dd0dc
commit da1daae1d8
2 changed files with 28 additions and 1 deletions

View File

@ -1576,7 +1576,7 @@ private:
*
* This class is used for the Op classes for the undo/redo queuing mechanism.
*/
class LayerOpBase
class DB_PUBLIC LayerOpBase
: public db::Op
{
public:

View File

@ -3264,3 +3264,30 @@ TEST(22)
EXPECT_EQ (shapes.find (*s).to_string (), "null");
}
// Bug #107
TEST(100)
{
db::Manager m;
db::Shapes shapes1 (&m, 0, true);
m.transaction ("y");
shapes1.insert (db::Box (200, -200, 100, -100));
m.commit ();
EXPECT_EQ (shapes_to_string_norm (_this, shapes1),
"box (100,-200;200,-100) #0\n"
);
m.undo ();
EXPECT_EQ (shapes_to_string_norm (_this, shapes1),
""
);
m.redo ();
EXPECT_EQ (shapes_to_string_norm (_this, shapes1),
"box (100,-200;200,-100) #0\n"
);
m.undo ();
EXPECT_EQ (shapes_to_string_norm (_this, shapes1),
""
);
}