diff options
Diffstat (limited to 'sw/qa/extras/tiledrendering/tiledrendering.cxx')
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 3dd1335e50f9..3a9c1c6f9985 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -23,6 +23,7 @@ #include <editeng/editview.hxx> #include <editeng/outliner.hxx> #include <svl/srchitem.hxx> +#include <svl/slstitm.hxx> #include <drawdoc.hxx> #include <ndtxt.hxx> #include <wrtsh.hxx> @@ -1944,11 +1945,19 @@ namespace { void checkPageHeaderOrFooter(const SfxViewShell* pViewShell, sal_uInt16 nWhich, bool bValue) { + uno::Sequence<OUString> aSeq; const SfxPoolItem* pState = nullptr; pViewShell->GetDispatcher()->QueryState(nWhich, pState); - const SfxBoolItem* pBoolItem = dynamic_cast<const SfxBoolItem*>(pState); - CPPUNIT_ASSERT(pBoolItem); - CPPUNIT_ASSERT_EQUAL(bValue, pBoolItem->GetValue()); + const SfxStringListItem* pListItem = dynamic_cast<const SfxStringListItem*>(pState); + CPPUNIT_ASSERT(pListItem); + pListItem->GetStringList(aSeq); + if (bValue) + { + CPPUNIT_ASSERT_EQUAL(1, aSeq.getLength()); + CPPUNIT_ASSERT_EQUAL(OUString("Default Style"), aSeq[0]); + } + else + CPPUNIT_ASSERT_EQUAL(0, aSeq.getLength()); }; } @@ -1963,16 +1972,18 @@ void SwTiledRenderingTest::testPageHeader() checkPageHeaderOrFooter(pViewShell, FN_INSERT_PAGEHEADER, false); // Insert Page Header { + SfxStringItem aStyle(FN_INSERT_PAGEHEADER, "Default Style"); SfxBoolItem aItem(FN_PARAM_1, true); - pViewShell->GetDispatcher()->ExecuteList(FN_INSERT_PAGEHEADER, SfxCallMode::SYNCHRON, {&aItem}); + pViewShell->GetDispatcher()->ExecuteList(FN_INSERT_PAGEHEADER, SfxCallMode::API | SfxCallMode::SYNCHRON, {&aStyle, &aItem}); } // Check Page Header State checkPageHeaderOrFooter(pViewShell, FN_INSERT_PAGEHEADER, true); // Remove Page Header { + SfxStringItem aStyle(FN_INSERT_PAGEHEADER, "Default Style"); SfxBoolItem aItem(FN_PARAM_1, false); - pViewShell->GetDispatcher()->ExecuteList(FN_INSERT_PAGEHEADER, SfxCallMode::SYNCHRON, {&aItem}); + pViewShell->GetDispatcher()->ExecuteList(FN_INSERT_PAGEHEADER, SfxCallMode::API | SfxCallMode::SYNCHRON, {&aStyle, &aItem}); } // Check Page Header State checkPageHeaderOrFooter(pViewShell, FN_INSERT_PAGEHEADER, false); @@ -1992,16 +2003,18 @@ void SwTiledRenderingTest::testPageFooter() checkPageHeaderOrFooter(pViewShell, FN_INSERT_PAGEFOOTER, false); // Insert Page Footer { + SfxStringItem aPageStyle(FN_INSERT_PAGEFOOTER, "Default Style"); SfxBoolItem aItem(FN_PARAM_1, true); - pViewShell->GetDispatcher()->ExecuteList(FN_INSERT_PAGEFOOTER, SfxCallMode::SYNCHRON, {&aItem}); + pViewShell->GetDispatcher()->ExecuteList(FN_INSERT_PAGEFOOTER, SfxCallMode::API | SfxCallMode::SYNCHRON, {&aPageStyle, &aItem}); } // Check Page Footer State checkPageHeaderOrFooter(pViewShell, FN_INSERT_PAGEFOOTER, true); // Remove Page Footer { + SfxStringItem aPageStyle(FN_INSERT_PAGEFOOTER, "Default Style"); SfxBoolItem aItem(FN_PARAM_1, false); - pViewShell->GetDispatcher()->ExecuteList(FN_INSERT_PAGEFOOTER, SfxCallMode::SYNCHRON, {&aItem}); + pViewShell->GetDispatcher()->ExecuteList(FN_INSERT_PAGEFOOTER, SfxCallMode::API | SfxCallMode::SYNCHRON, {&aPageStyle, &aItem}); } // Check Footer State checkPageHeaderOrFooter(pViewShell, FN_INSERT_PAGEFOOTER, false); |