CppunitTest_framework_dispatch: remove duplicated dispatchCommand

it's already defined in unotest::MacrosTest

Change-Id: I2abc4bea61f55242b9cf3c7f030f5c74f8a51efe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130402
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli
2022-02-23 09:06:59 +01:00
parent 2c08104e42
commit 280c505373
-20
View File
@@ -139,9 +139,6 @@ class DispatchTest : public test::BootstrapFixture, public unotest::MacrosTest
{
protected:
uno::Reference<lang::XComponent> mxComponent;
void dispatchCommand(const uno::Reference<lang::XComponent>& xComponent,
const OUString& rCommand,
const uno::Sequence<beans::PropertyValue>& rPropertyValues);
public:
virtual void setUp() override;
@@ -163,23 +160,6 @@ void DispatchTest::tearDown()
test::BootstrapFixture::tearDown();
}
void DispatchTest::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(DispatchTest, testInterception)
{
mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");