Kaydet (Commit) b5a4e697 authored tarafından Caolán McNamara's avatar Caolán McNamara

add a shape resize undo test

Change-Id: I88c2d7de243660ba727f057d6a2d67726b41b982
üst f1256611
...@@ -113,6 +113,7 @@ public: ...@@ -113,6 +113,7 @@ public:
void testEmbeddedDataSource(); void testEmbeddedDataSource();
void testUnoCursorPointer(); void testUnoCursorPointer();
void testTextTableCellNames(); void testTextTableCellNames();
void testShapeAnchorUndo();
CPPUNIT_TEST_SUITE(SwUiWriterTest); CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward); CPPUNIT_TEST(testReplaceForward);
...@@ -163,6 +164,7 @@ public: ...@@ -163,6 +164,7 @@ public:
CPPUNIT_TEST(testEmbeddedDataSource); CPPUNIT_TEST(testEmbeddedDataSource);
CPPUNIT_TEST(testUnoCursorPointer); CPPUNIT_TEST(testUnoCursorPointer);
CPPUNIT_TEST(testTextTableCellNames); CPPUNIT_TEST(testTextTableCellNames);
CPPUNIT_TEST(testShapeAnchorUndo);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -1476,6 +1478,31 @@ void SwUiWriterTest::testTextTableCellNames() ...@@ -1476,6 +1478,31 @@ void SwUiWriterTest::testTextTableCellNames()
CPPUNIT_ASSERT(nCol == 105); CPPUNIT_ASSERT(nCol == 105);
} }
void SwUiWriterTest::testShapeAnchorUndo()
{
SwDoc* pDoc = createDoc("draw-anchor-undo.odt");
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
SdrObject* pObject = pPage->GetObj(0);
Rectangle aOrigLogicRect(pObject->GetLogicRect());
sw::UndoManager& rUndoManager = pDoc->GetUndoManager();
rUndoManager.StartUndo(UNDO_START, NULL);
pWrtShell->SelectObj(Point(), 0, pObject);
pWrtShell->GetDrawView()->MoveMarkedObj(Size(100, 100), false);
pWrtShell->ChgAnchor(0, true, true);
rUndoManager.EndUndo(UNDO_END, NULL);
CPPUNIT_ASSERT(aOrigLogicRect != pObject->GetLogicRect());
rUndoManager.Undo();
CPPUNIT_ASSERT(aOrigLogicRect == pObject->GetLogicRect());
}
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest); CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment