summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-05-18 15:01:28 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-05-18 22:51:45 +0200
commit6cc4aa93baed7916705b43ddce5dbb7c031e9997 (patch)
tree3488dcb8a5adde086a09d2060f598752d025a7b4 /framework
parentacc8ff577b2087fa2734b569a9606d9acac09c2e (diff)
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 <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'framework')
-rw-r--r--framework/qa/cppunit/dispatchtest.cxx69
1 files changed, 40 insertions, 29 deletions
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<frame::XDispatchProviderInterceptor, frame::XInterceptorInfo>
{
uno::Reference<frame::XDispatchProvider> m_xMaster;
uno::Reference<frame::XDispatchProvider> m_xSlave;
@@ -49,20 +45,25 @@ public:
virtual uno::Sequence<OUString> SAL_CALL getInterceptedURLs() override;
// frame::XDispatchProviderInterceptor
- virtual void SAL_CALL setMasterDispatchProvider(const uno::Reference<frame::XDispatchProvider>& xNewSupplier) override;
+ virtual void SAL_CALL setMasterDispatchProvider(
+ const uno::Reference<frame::XDispatchProvider>& xNewSupplier) override;
virtual uno::Reference<frame::XDispatchProvider> SAL_CALL getMasterDispatchProvider() override;
- virtual void SAL_CALL setSlaveDispatchProvider(const uno::Reference<frame::XDispatchProvider>& xNewSupplier) override;
+ virtual void SAL_CALL
+ setSlaveDispatchProvider(const uno::Reference<frame::XDispatchProvider>& xNewSupplier) override;
virtual uno::Reference<frame::XDispatchProvider> SAL_CALL getSlaveDispatchProvider() override;
// frame::XDispatchProvider
- virtual uno::Sequence<uno::Reference<frame::XDispatch>> SAL_CALL queryDispatches(const uno::Sequence<frame::DispatchDescriptor>& rRequests) override;
- virtual uno::Reference<frame::XDispatch> SAL_CALL queryDispatch(const util::URL& rURL, const OUString& rTargetFrameName, sal_Int32 SearchFlags) override;
+ virtual uno::Sequence<uno::Reference<frame::XDispatch>> SAL_CALL
+ queryDispatches(const uno::Sequence<frame::DispatchDescriptor>& rRequests) override;
+ virtual uno::Reference<frame::XDispatch>
+ 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<OUString> MyInterceptor::getInterceptedURLs()
-{
- return m_aDisabledCommands;
-}
+uno::Sequence<OUString> MyInterceptor::getInterceptedURLs() { return m_aDisabledCommands; }
-void MyInterceptor::setMasterDispatchProvider(const uno::Reference<frame::XDispatchProvider>& xNewSupplier)
+void MyInterceptor::setMasterDispatchProvider(
+ const uno::Reference<frame::XDispatchProvider>& xNewSupplier)
{
m_xMaster = xNewSupplier;
}
@@ -95,7 +94,8 @@ uno::Reference<frame::XDispatchProvider> MyInterceptor::getMasterDispatchProvide
return m_xMaster;
}
-void MyInterceptor::setSlaveDispatchProvider(const uno::Reference<frame::XDispatchProvider>& xNewSupplier)
+void MyInterceptor::setSlaveDispatchProvider(
+ const uno::Reference<frame::XDispatchProvider>& xNewSupplier)
{
m_xSlave = xNewSupplier;
}
@@ -105,21 +105,26 @@ uno::Reference<frame::XDispatchProvider> MyInterceptor::getSlaveDispatchProvider
return m_xSlave;
}
-uno::Sequence<uno::Reference<frame::XDispatch>> MyInterceptor::queryDispatches(const uno::Sequence<frame::DispatchDescriptor>& rRequests)
+uno::Sequence<uno::Reference<frame::XDispatch>>
+MyInterceptor::queryDispatches(const uno::Sequence<frame::DispatchDescriptor>& rRequests)
{
uno::Sequence<uno::Reference<frame::XDispatch>> 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<frame::XDispatch> MyInterceptor::queryDispatch(const util::URL& rURL, const OUString& /*rTargetFrameName*/, sal_Int32 /*SearchFlags*/)
+uno::Reference<frame::XDispatch> 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<lang::XComponent> mxComponent;
- void dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand, const uno::Sequence<beans::PropertyValue>& rPropertyValues);
+ void dispatchCommand(const uno::Reference<lang::XComponent>& xComponent,
+ const OUString& rCommand,
+ const uno::Sequence<beans::PropertyValue>& rPropertyValues);
public:
virtual void setUp() override;
@@ -154,9 +161,12 @@ void DispatchTest::tearDown()
test::BootstrapFixture::tearDown();
}
-void DispatchTest::dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand, const uno::Sequence<beans::PropertyValue>& rPropertyValues)
+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();
+ 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());
@@ -175,11 +185,13 @@ CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception)
uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
CPPUNIT_ASSERT(xModel.is());
- uno::Reference<frame::XDispatchProviderInterception> xRegistration(xModel->getCurrentController()->getFrame(), uno::UNO_QUERY);
+ uno::Reference<frame::XDispatchProviderInterception> xRegistration(
+ xModel->getCurrentController()->getFrame(), uno::UNO_QUERY);
CPPUNIT_ASSERT(xRegistration.is());
rtl::Reference<MyInterceptor> pInterceptor(new MyInterceptor());
- xRegistration->registerDispatchProviderInterceptor(uno::Reference<frame::XDispatchProviderInterceptor>(pInterceptor.get()));
+ xRegistration->registerDispatchProviderInterceptor(
+ uno::Reference<frame::XDispatchProviderInterceptor>(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();