summaryrefslogtreecommitdiffstats
path: root/svx/source/unogallery
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-28 10:33:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-29 08:51:48 +0200
commit1ffba0e356608fb6dbf568248e2a953b4d7fb5d6 (patch)
tree5da59640441292421f2137bc85ee7291daed137e /svx/source/unogallery
parentAdapt loplugin:reservedid to Windows (diff)
downloadcore-1ffba0e356608fb6dbf568248e2a953b4d7fb5d6.tar.gz
core-1ffba0e356608fb6dbf568248e2a953b4d7fb5d6.zip
loplugin:flatten check for throw in then clause
also make the plugin ignore the case where we have var decl's in the clause we want to flatten, which could lead to problematic extension of variable lifetime Change-Id: I3061f7104e8c6a460bf74f5eac325a516ec50c59 Reviewed-on: https://gerrit.libreoffice.org/42889 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/unogallery')
-rw-r--r--svx/source/unogallery/unogaltheme.cxx12
-rw-r--r--svx/source/unogallery/unogalthemeprovider.cxx12
2 files changed, 8 insertions, 16 deletions
diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx
index f035bc174b22..f1d53c8f2aa7 100644
--- a/svx/source/unogallery/unogaltheme.cxx
+++ b/svx/source/unogallery/unogaltheme.cxx
@@ -135,13 +135,10 @@ uno::Any SAL_CALL GalleryTheme::getByIndex( ::sal_Int32 nIndex )
{
throw lang::IndexOutOfBoundsException();
}
- else
- {
- const GalleryObject* pObj = mpTheme->ImplGetGalleryObject( nIndex );
+ const GalleryObject* pObj = mpTheme->ImplGetGalleryObject( nIndex );
- if( pObj )
- aRet <<= uno::Reference< gallery::XGalleryItem >( new GalleryItem( *this, *pObj ) );
- }
+ if( pObj )
+ aRet <<= uno::Reference< gallery::XGalleryItem >( new GalleryItem( *this, *pObj ) );
}
return aRet;
@@ -291,8 +288,7 @@ void SAL_CALL GalleryTheme::removeByIndex( sal_Int32 nIndex )
{
if( ( nIndex < 0 ) || ( nIndex >= getCount() ) )
throw lang::IndexOutOfBoundsException();
- else
- mpTheme->RemoveObject( nIndex );
+ mpTheme->RemoveObject( nIndex );
}
}
diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx
index f11dcb279331..c497a86d830e 100644
--- a/svx/source/unogallery/unogalthemeprovider.cxx
+++ b/svx/source/unogallery/unogalthemeprovider.cxx
@@ -166,10 +166,8 @@ uno::Any SAL_CALL GalleryThemeProvider::getByName( const OUString& rName )
{
throw container::NoSuchElementException();
}
- else
- {
- aRet <<= uno::Reference< gallery::XGalleryTheme >( new ::unogallery::GalleryTheme( rName ) );
- }
+
+ aRet <<= uno::Reference< gallery::XGalleryTheme >( new ::unogallery::GalleryTheme( rName ) );
return aRet;
}
@@ -239,10 +237,8 @@ void SAL_CALL GalleryThemeProvider::removeByName( const OUString& rName )
{
throw container::NoSuchElementException();
}
- else
- {
- mpGallery->RemoveTheme( rName );
- }
+
+ mpGallery->RemoveTheme( rName );
}
}