diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-01-17 14:32:49 +0100 |
---|---|---|
committer | Pranam Lashkari <lpranam@collabora.com> | 2021-03-16 05:46:15 +0100 |
commit | 8ff147f200e6514bbc7e7d7b5ca91694b9234bfc (patch) | |
tree | bf19842568df4965ddf8aef4a88bc722d35255fa /xmloff | |
parent | d7dcecb76b15e1df9a1f3afaf56164a8bf597b71 (diff) |
Clean up duplicated command dispatch test functionality
Used in both Writer and Calc at few different places, so host it in
unotest/.
Change-Id: I013e6df471deb8693cf4ae62f0958b12e16fda7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86972
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112395
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Pranam Lashkari <lpranam@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/qa/unit/text.cxx | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx index 73e03fa8aa8e..d64411284c6c 100644 --- a/xmloff/qa/unit/text.cxx +++ b/xmloff/qa/unit/text.cxx @@ -63,30 +63,13 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMailMergeInEditeng) CPPUNIT_ASSERT(getComponent().is()); } -static void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, - const OUString& rCommand, - const uno::Sequence<beans::PropertyValue>& rPropertyValues) -{ - uno::Reference<frame::XController> xController - = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController(); - CPPUNIT_ASSERT(xController.is()); - uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY); - CPPUNIT_ASSERT(xFrame.is()); - - uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext(); - uno::Reference<frame::XDispatchHelper> xDispatchHelper(frame::DispatchHelper::create(xContext)); - CPPUNIT_ASSERT(xDispatchHelper.is()); - - xDispatchHelper->executeDispatch(xFrame, rCommand, OUString(), 0, rPropertyValues); -} - CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCommentResolved) { getComponent() = loadFromDesktop("private:factory/swriter"); uno::Sequence<beans::PropertyValue> aCommentProps = comphelper::InitPropertySequence({ { "Text", uno::makeAny(OUString("comment")) }, }); - lcl_dispatchCommand(getComponent(), ".uno:InsertAnnotation", aCommentProps); + dispatchCommand(getComponent(), ".uno:InsertAnnotation", aCommentProps); uno::Reference<text::XTextDocument> xTextDocument(getComponent(), uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); |