sw/CppunitTest_sw_odfimport.mk | 1 + sw/qa/extras/odfimport/odfimport.cxx | 18 ++++++++++++++++++ sw/source/ui/inc/olmenu.hxx | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-)
New commits: commit 08c104a94cd4e4908f326c3e7c14aedd597665d0 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Sat Oct 12 20:54:37 2013 +0200 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 diff --git a/sw/CppunitTest_sw_odfimport.mk b/sw/CppunitTest_sw_odfimport.mk index 1320fef..ecaf98b 100644 --- a/sw/CppunitTest_sw_odfimport.mk +++ b/sw/CppunitTest_sw_odfimport.mk @@ -58,6 +58,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_odfimport,\ filter/source/config/cache/filterconfig1 \ framework/util/fwk \ i18npool/util/i18npool \ + lingucomponent/source/languageguessing/guesslang \ linguistic/source/lng \ package/util/package2 \ package/source/xstor/xstor \ diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index d661a67..d436d1a 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -17,6 +17,8 @@ #include <swdtflvr.hxx> #include <view.hxx> #include <edtwin.hxx> +#include <olmenu.hxx> +#include <cmdid.h> typedef std::map<OUString, com::sun::star::uno::Sequence< com::sun::star::table::BorderLine> > AllBordersMap; typedef std::pair<OUString, com::sun::star::uno::Sequence< com::sun::star::table::BorderLine> > 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<SwXTextDocument *>(mxComponent.get()); + SwWrtShell* pWrtShell = pTxtDoc->GetDocShell()->GetWrtShell(); + OUString aParaText; + uno::Reference<linguistic2::XSpellAlternatives> 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(); diff --git a/sw/source/ui/inc/olmenu.hxx b/sw/source/ui/inc/olmenu.hxx index 23d1fd3..b21e0f4 100644 --- a/sw/source/ui/inc/olmenu.hxx +++ b/sw/source/ui/inc/olmenu.hxx @@ -34,7 +34,7 @@ class SwWrtShell; -class SwSpellPopup : public PopupMenu +class SW_DLLPUBLIC SwSpellPopup : public PopupMenu { SwWrtShell* pSh; ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits