diff options
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter8.cxx | 33 | ||||
-rw-r--r-- | sw/qa/uitest/writer_tests4/insertPageHeader.py | 18 |
2 files changed, 33 insertions, 18 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index 2bd6b415f11e..18d390ef64ce 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -842,6 +842,39 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146248) CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xPageStyle, "HeaderIsOn")); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf107427) +{ + createSwDoc(); + + dispatchCommand(mxComponent, + ".uno:InsertPageHeader?PageStyle:string=Default%20Page%20Style&On:bool=true", + {}); + uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence( + { { "Rows", uno::Any(sal_Int32(2)) }, { "Columns", uno::Any(sal_Int32(2)) } })); + + dispatchCommand(mxComponent, ".uno:InsertTable", aArgs); + Scheduler::ProcessEventsToIdle(); + + xmlDocUniquePtr pLayout = parseLayoutDump(); + assertXPath(pLayout, "/root/page[1]/header/tab/row", 2); + + SwDoc* pDoc = getSwDoc(); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + // Delete the header + pWrtShell->ChangeHeaderOrFooter(u"Default Page Style", true, false, false); + + discardDumpedLayout(); + pLayout = parseLayoutDump(); + assertXPath(pLayout, "/root/page[1]/header", 0); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + Scheduler::ProcessEventsToIdle(); + + discardDumpedLayout(); + pLayout = parseLayoutDump(); + assertXPath(pLayout, "/root/page[1]/header/tab/row", 2); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf141613) { createSwDoc(); diff --git a/sw/qa/uitest/writer_tests4/insertPageHeader.py b/sw/qa/uitest/writer_tests4/insertPageHeader.py index e71749b82931..7f965cc9040d 100644 --- a/sw/qa/uitest/writer_tests4/insertPageHeader.py +++ b/sw/qa/uitest/writer_tests4/insertPageHeader.py @@ -44,22 +44,4 @@ class WriterInsertPageHeader(UITestCase): self.delete_header() - - def test_tdf107427(self): - with self.ui_test.create_doc_in_start_center("writer") as document: - - self.insert_header() - - with self.ui_test.execute_dialog_through_command(".uno:InsertTable"): - pass - - - tables = document.getTextTables() - self.assertEqual(len(tables[0].getRows()), 2) - self.assertEqual(len(tables[0].getColumns()), 2) - - self.xUITest.executeCommand(".uno:SelectAll") - - self.delete_header() - # vim: set shiftwidth=4 softtabstop=4 expandtab: |