summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-10-12 20:54:37 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-10-12 21:07:27 +0200
commit08c104a94cd4e4908f326c3e7c14aedd597665d0 (patch)
tree8d9af0272617a1e092f86de4e02462c6858f4b39 /sw/qa/extras
parente6ab992c6fee2e84da7a7a25b1a0a0df9b4c629b (diff)
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
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx18
1 files changed, 18 insertions, 0 deletions
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 <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();