diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-06 10:47:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-12 10:11:34 +0200 |
commit | 992a33313046f4a4d322db9464c474e7429a019a (patch) | |
tree | 494143e3070af872027ecaca840516d3101a881c /cppu/qa | |
parent | 77c1431ee88ab04a9ff48b849acedee6d455bafb (diff) |
clang-tidy: readability-else-after-return
run it against sal,cppu,cppuhelper
I had to run this multiple times to catch all the cases in each module,
and it requires some hand-tweaking of the resulting output - clang-tidy
is not very good about cleaning up trailing spaces, and aligning
things nicely.
Change-Id: I00336345f5f036e12422b98d66526509380c497a
Reviewed-on: https://gerrit.libreoffice.org/36194
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppu/qa')
-rw-r--r-- | cppu/qa/test_any.cxx | 30 | ||||
-rw-r--r-- | cppu/qa/test_reference.cxx | 2 |
2 files changed, 18 insertions, 14 deletions
diff --git a/cppu/qa/test_any.cxx b/cppu/qa/test_any.cxx index d76ffc0c3424..38d35008513e 100644 --- a/cppu/qa/test_any.cxx +++ b/cppu/qa/test_any.cxx @@ -92,12 +92,12 @@ public: css::uno::Reference< css::uno::XInterface > ref( static_cast< css::uno::XInterface * >(this)); return css::uno::Any(&ref, type); - } else if (type == cppu::UnoType<Interface1>::get()) { + } + if (type == cppu::UnoType<Interface1>::get()) { css::uno::Reference< Interface1 > ref(this); return css::uno::Any(&ref, type); - } else { - return css::uno::Any(); } + return css::uno::Any(); } virtual void SAL_CALL acquire() throw () override { @@ -118,18 +118,20 @@ public: static_cast< css::uno::XInterface * >( static_cast< Interface2a * >(this))); return css::uno::Any(&ref, type); - } else if (type == cppu::UnoType<Interface2>::get()) { + } + if (type == cppu::UnoType<Interface2>::get()) { css::uno::Reference< Interface2 > ref(this); return css::uno::Any(&ref, type); - } else if (type == cppu::UnoType<Interface2a>::get()) { + } + if (type == cppu::UnoType<Interface2a>::get()) { css::uno::Reference< Interface2a > ref(this); return css::uno::Any(&ref, type); - } else if (type == cppu::UnoType<Interface3>::get()) { + } + if (type == cppu::UnoType<Interface3>::get()) { css::uno::Reference< Interface3 > ref(this); return css::uno::Any(&ref, type); - } else { - return css::uno::Any(); } + return css::uno::Any(); } virtual void SAL_CALL acquire() throw () override { @@ -150,18 +152,20 @@ public: static_cast< css::uno::XInterface * >( static_cast< Interface2a * >(this))); return css::uno::Any(&ref, type); - } else if (type == cppu::UnoType<Interface2>::get()) { + } + if (type == cppu::UnoType<Interface2>::get()) { css::uno::Reference< Interface2 > ref(this); return css::uno::Any(&ref, type); - } else if (type == cppu::UnoType<Interface2a>::get()) { + } + if (type == cppu::UnoType<Interface2a>::get()) { css::uno::Reference< Interface2a > ref(this); return css::uno::Any(&ref, type); - } else if (type == cppu::UnoType<Interface2b>::get()) { + } + if (type == cppu::UnoType<Interface2b>::get()) { css::uno::Reference< Interface2b > ref(this); return css::uno::Any(&ref, type); - } else { - return css::uno::Any(); } + return css::uno::Any(); } virtual void SAL_CALL acquire() throw () override { diff --git a/cppu/qa/test_reference.cxx b/cppu/qa/test_reference.cxx index 15a926f50a9a..3c6b7af1eb9e 100644 --- a/cppu/qa/test_reference.cxx +++ b/cppu/qa/test_reference.cxx @@ -56,7 +56,7 @@ public: return css::uno::makeAny<css::uno::Reference<css::uno::XInterface>>( this); } - else if (_type == cppu::UnoType<Interface1>::get()) + if (_type == cppu::UnoType<Interface1>::get()) { return css::uno::makeAny<css::uno::Reference<Interface1>>(this); } |