summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/nameuno.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-22 16:55:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-26 09:38:53 +0200
commit30b635c26d6cc07b5a84dc0d829f0b0cde3d1f5a (patch)
tree0ed53ffc7dd75bc6ca40c99453ae39fea3421462 /sc/source/ui/unoobj/nameuno.cxx
parent94c548ac6468a567aa352fc47e5d2acc34076130 (diff)
loplugin:flatten in sc
Change-Id: I40653af2d90ef123cf77d7223c520cba0e5a3aca Reviewed-on: https://gerrit.libreoffice.org/42661 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj/nameuno.cxx')
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 2a266d94dd17..864f8f5bb6db 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -601,10 +601,10 @@ uno::Any SAL_CALL ScNamedRangesObj::getByIndex( sal_Int32 nIndex )
{
SolarMutexGuard aGuard;
uno::Reference< sheet::XNamedRange > xRange(GetObjectByIndex_Impl((sal_uInt16)nIndex));
- if ( xRange.is() )
- return uno::makeAny(xRange);
- else
+ if ( !xRange.is() )
throw lang::IndexOutOfBoundsException();
+
+ return uno::makeAny(xRange);
}
uno::Type SAL_CALL ScNamedRangesObj::getElementType()
@@ -652,10 +652,10 @@ uno::Any SAL_CALL ScNamedRangesObj::getByName( const OUString& aName )
{
SolarMutexGuard aGuard;
uno::Reference< sheet::XNamedRange > xRange(GetObjectByName_Impl(aName));
- if ( xRange.is() )
- return uno::makeAny(xRange);
- else
+ if ( !xRange.is() )
throw container::NoSuchElementException();
+
+ return uno::makeAny(xRange);
}
uno::Sequence<OUString> SAL_CALL ScNamedRangesObj::getElementNames()
@@ -1144,10 +1144,10 @@ uno::Any SAL_CALL ScLabelRangesObj::getByIndex( sal_Int32 nIndex )
{
SolarMutexGuard aGuard;
uno::Reference< sheet::XLabelRange > xRange(GetObjectByIndex_Impl((sal_uInt16)nIndex));
- if ( xRange.is() )
- return uno::makeAny(xRange);
- else
+ if ( !xRange.is() )
throw lang::IndexOutOfBoundsException();
+
+ return uno::makeAny(xRange);
}
uno::Type SAL_CALL ScLabelRangesObj::getElementType()