From b9de047454c2603e2f5a5108254cd3f967e8a88b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 22 Sep 2017 10:53:31 +0200 Subject: loplugin:flatten in scaddins..sd Change-Id: I190323ce910224f883c4370b2c752644a5a35edd Reviewed-on: https://gerrit.libreoffice.org/42626 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/source/ui/unoidl/unocpres.cxx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'sd/source/ui/unoidl/unocpres.cxx') diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx index b27a8a99db77..a2690534a21f 100644 --- a/sd/source/ui/unoidl/unocpres.cxx +++ b/sd/source/ui/unoidl/unocpres.cxx @@ -363,11 +363,11 @@ void SAL_CALL SdXCustomPresentationAccess::removeByName( const OUString& Name ) SdCustomShow* pShow = getSdCustomShow(Name); SdCustomShowList* pList = GetCustomShowList(); - if(pList && pShow) - delete pList->Remove( pShow ); - else + if(!pList || !pShow) throw container::NoSuchElementException(); + delete pList->Remove( pShow ); + mrModel.SetModified(); } @@ -383,20 +383,14 @@ uno::Any SAL_CALL SdXCustomPresentationAccess::getByName( const OUString& aName { SolarMutexGuard aGuard; - uno::Any aAny; - SdCustomShow* pShow = getSdCustomShow(aName); - if(pShow) - { - uno::Reference< container::XIndexContainer > xRef( pShow->getUnoCustomShow(), uno::UNO_QUERY ); - aAny <<= xRef; - } - else + if(!pShow) { throw container::NoSuchElementException(); } - return aAny; + uno::Reference< container::XIndexContainer > xRef( pShow->getUnoCustomShow(), uno::UNO_QUERY ); + return uno::Any(xRef); } uno::Sequence< OUString > SAL_CALL SdXCustomPresentationAccess::getElementNames() -- cgit