From 6cc4aa93baed7916705b43ddce5dbb7c031e9997 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 18 May 2020 15:01:28 +0200 Subject: comphelper, drawinglayer, framework, starmath: clang-format these files I added these files more or less recently and they have long lines. Use clang-format to break at a sane column limit. Change-Id: Id608fffbbc0673c9bc350dd696cb0a31906840d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94423 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- framework/qa/cppunit/dispatchtest.cxx | 69 ++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 29 deletions(-) (limited to 'framework/qa') diff --git a/framework/qa/cppunit/dispatchtest.cxx b/framework/qa/cppunit/dispatchtest.cxx index 2fa209e82f63..0dd6b4cfc33d 100644 --- a/framework/qa/cppunit/dispatchtest.cxx +++ b/framework/qa/cppunit/dispatchtest.cxx @@ -23,13 +23,9 @@ using namespace ::com::sun::star; namespace { - /// Sample interception implementation that asserts getInterceptedURLs() and queryDispatch() is in sync. -class MyInterceptor : public cppu::WeakImplHelper - < - frame::XDispatchProviderInterceptor, - frame::XInterceptorInfo - > +class MyInterceptor + : public cppu::WeakImplHelper { uno::Reference m_xMaster; uno::Reference m_xSlave; @@ -49,20 +45,25 @@ public: virtual uno::Sequence SAL_CALL getInterceptedURLs() override; // frame::XDispatchProviderInterceptor - virtual void SAL_CALL setMasterDispatchProvider(const uno::Reference& xNewSupplier) override; + virtual void SAL_CALL setMasterDispatchProvider( + const uno::Reference& xNewSupplier) override; virtual uno::Reference SAL_CALL getMasterDispatchProvider() override; - virtual void SAL_CALL setSlaveDispatchProvider(const uno::Reference& xNewSupplier) override; + virtual void SAL_CALL + setSlaveDispatchProvider(const uno::Reference& xNewSupplier) override; virtual uno::Reference SAL_CALL getSlaveDispatchProvider() override; // frame::XDispatchProvider - virtual uno::Sequence> SAL_CALL queryDispatches(const uno::Sequence& rRequests) override; - virtual uno::Reference SAL_CALL queryDispatch(const util::URL& rURL, const OUString& rTargetFrameName, sal_Int32 SearchFlags) override; + virtual uno::Sequence> SAL_CALL + queryDispatches(const uno::Sequence& rRequests) override; + virtual uno::Reference + SAL_CALL queryDispatch(const util::URL& rURL, const OUString& rTargetFrameName, + sal_Int32 SearchFlags) override; }; MyInterceptor::MyInterceptor() - : m_aDisabledCommands {".uno:Bold"}, - m_nExpected(0), - m_nUnexpected(0) + : m_aDisabledCommands{ ".uno:Bold" } + , m_nExpected(0) + , m_nUnexpected(0) { } @@ -80,12 +81,10 @@ int MyInterceptor::getUnexpected() return nRet; } -uno::Sequence MyInterceptor::getInterceptedURLs() -{ - return m_aDisabledCommands; -} +uno::Sequence MyInterceptor::getInterceptedURLs() { return m_aDisabledCommands; } -void MyInterceptor::setMasterDispatchProvider(const uno::Reference& xNewSupplier) +void MyInterceptor::setMasterDispatchProvider( + const uno::Reference& xNewSupplier) { m_xMaster = xNewSupplier; } @@ -95,7 +94,8 @@ uno::Reference MyInterceptor::getMasterDispatchProvide return m_xMaster; } -void MyInterceptor::setSlaveDispatchProvider(const uno::Reference& xNewSupplier) +void MyInterceptor::setSlaveDispatchProvider( + const uno::Reference& xNewSupplier) { m_xSlave = xNewSupplier; } @@ -105,21 +105,26 @@ uno::Reference MyInterceptor::getSlaveDispatchProvider return m_xSlave; } -uno::Sequence> MyInterceptor::queryDispatches(const uno::Sequence& rRequests) +uno::Sequence> +MyInterceptor::queryDispatches(const uno::Sequence& rRequests) { uno::Sequence> aResult(rRequests.getLength()); for (sal_Int32 i = 0; i < rRequests.getLength(); ++i) { - aResult[i] = queryDispatch(rRequests[i].FeatureURL, rRequests[i].FrameName, rRequests[i].SearchFlags); + aResult[i] = queryDispatch(rRequests[i].FeatureURL, rRequests[i].FrameName, + rRequests[i].SearchFlags); } return aResult; } -uno::Reference MyInterceptor::queryDispatch(const util::URL& rURL, const OUString& /*rTargetFrameName*/, sal_Int32 /*SearchFlags*/) +uno::Reference MyInterceptor::queryDispatch(const util::URL& rURL, + const OUString& /*rTargetFrameName*/, + sal_Int32 /*SearchFlags*/) { - if (std::find(m_aDisabledCommands.begin(), m_aDisabledCommands.end(), rURL.Complete) != m_aDisabledCommands.end()) + if (std::find(m_aDisabledCommands.begin(), m_aDisabledCommands.end(), rURL.Complete) + != m_aDisabledCommands.end()) ++m_nExpected; else ++m_nUnexpected; @@ -132,7 +137,9 @@ class DispatchTest : public test::BootstrapFixture, public unotest::MacrosTest { protected: uno::Reference mxComponent; - void dispatchCommand(const uno::Reference& xComponent, const OUString& rCommand, const uno::Sequence& rPropertyValues); + void dispatchCommand(const uno::Reference& xComponent, + const OUString& rCommand, + const uno::Sequence& rPropertyValues); public: virtual void setUp() override; @@ -154,9 +161,12 @@ void DispatchTest::tearDown() test::BootstrapFixture::tearDown(); } -void DispatchTest::dispatchCommand(const uno::Reference& xComponent, const OUString& rCommand, const uno::Sequence& rPropertyValues) +void DispatchTest::dispatchCommand(const uno::Reference& xComponent, + const OUString& rCommand, + const uno::Sequence& rPropertyValues) { - uno::Reference xController = uno::Reference(xComponent, uno::UNO_QUERY_THROW)->getCurrentController(); + uno::Reference xController + = uno::Reference(xComponent, uno::UNO_QUERY_THROW)->getCurrentController(); CPPUNIT_ASSERT(xController.is()); uno::Reference xFrame(xController->getFrame(), uno::UNO_QUERY); CPPUNIT_ASSERT(xFrame.is()); @@ -175,11 +185,13 @@ CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception) uno::Reference xModel(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xModel.is()); - uno::Reference xRegistration(xModel->getCurrentController()->getFrame(), uno::UNO_QUERY); + uno::Reference xRegistration( + xModel->getCurrentController()->getFrame(), uno::UNO_QUERY); CPPUNIT_ASSERT(xRegistration.is()); rtl::Reference pInterceptor(new MyInterceptor()); - xRegistration->registerDispatchProviderInterceptor(uno::Reference(pInterceptor.get())); + xRegistration->registerDispatchProviderInterceptor( + uno::Reference(pInterceptor.get())); dispatchCommand(mxComponent, ".uno:Bold", {}); CPPUNIT_ASSERT_EQUAL(1, pInterceptor->getExpected()); @@ -189,7 +201,6 @@ CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception) // This was 1: MyInterceptor::queryDispatch() was called for .uno:Italic. CPPUNIT_ASSERT_EQUAL(0, pInterceptor->getUnexpected()); } - } CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit