summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/CppunitTest_sw_odfimport.mk1
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx18
-rw-r--r--sw/source/ui/inc/olmenu.hxx2
3 files changed, 20 insertions, 1 deletions
diff --git a/sw/CppunitTest_sw_odfimport.mk b/sw/CppunitTest_sw_odfimport.mk
index 1320fefac3d3..ecaf98bf5d83 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 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();
diff --git a/sw/source/ui/inc/olmenu.hxx b/sw/source/ui/inc/olmenu.hxx
index 23d1fd315500..b21e0f4643d5 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<