From 08c104a94cd4e4908f326c3e7c14aedd597665d0 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Sat, 12 Oct 2013 20:54:37 +0200 Subject: sw: add missing testcase for spellmenu-redline.odt There are various cases here, as a start just test that any spellcheck popup menu in a redlined document should at least contain the "go to prev/next change" menu items. Change-Id: Ic70b6dae4cac8fd970ad54e5015a61d50b024b2b --- sw/qa/extras/odfimport/odfimport.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'sw/qa') diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index d661a67ae8fa..d436d1aadc37 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -17,6 +17,8 @@ #include #include #include +#include +#include typedef std::map > AllBordersMap; typedef std::pair > StringSequencePair; @@ -38,6 +40,7 @@ public: void testFdo37606Copy(); void testFdo69862(); void testFdo69979(); + void testSpellmenuRedline(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -66,6 +69,7 @@ void Test::run() {"fdo37606.odt", &Test::testFdo37606Copy}, {"fdo69862.odt", &Test::testFdo69862}, {"fdo69979.odt", &Test::testFdo69979}, + {"spellmenu-redline.odt", &Test::testSpellmenuRedline}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -461,6 +465,20 @@ void Test::testFdo69979() CPPUNIT_ASSERT_EQUAL(OUString("Hello."), rEnd.GetTxt()); } +void Test::testSpellmenuRedline() +{ + SwXTextDocument* pTxtDoc = dynamic_cast(mxComponent.get()); + SwWrtShell* pWrtShell = pTxtDoc->GetDocShell()->GetWrtShell(); + OUString aParaText; + uno::Reference xAlt; + SwSpellPopup aPopup(pWrtShell, xAlt, aParaText); + // Make sure that if we show the spellcheck popup menu (for the current + // document, which contains redlines), then the last two entries will be + // always 'go to next/previous change'. + CPPUNIT_ASSERT_EQUAL(sal_uInt16(FN_REDLINE_NEXT_CHANGE), aPopup.GetItemId(aPopup.GetItemCount() - 2)); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(FN_REDLINE_PREV_CHANGE), aPopup.GetItemId(aPopup.GetItemCount() - 1)); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit v1.2.3