diff --git a/src/db/db/dbShapes.h b/src/db/db/dbShapes.h index 8f072b04e..2511bef69 100644 --- a/src/db/db/dbShapes.h +++ b/src/db/db/dbShapes.h @@ -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: diff --git a/src/db/unit_tests/dbShapes.cc b/src/db/unit_tests/dbShapes.cc index 346d11402..6cebb7111 100644 --- a/src/db/unit_tests/dbShapes.cc +++ b/src/db/unit_tests/dbShapes.cc @@ -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), + "" + ); +} +