diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-22 10:53:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-22 13:06:24 +0200 |
commit | b9de047454c2603e2f5a5108254cd3f967e8a88b (patch) | |
tree | 589c20e48bfed9c3cfe6696c24c67d49f568c6bd /sd/source/ui/unoidl/unocpres.cxx | |
parent | 448e9da1b440561441602e3a0956218b2702767e (diff) |
loplugin:flatten in scaddins..sd
Change-Id: I190323ce910224f883c4370b2c752644a5a35edd
Reviewed-on: https://gerrit.libreoffice.org/42626
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/unoidl/unocpres.cxx')
-rw-r--r-- | sd/source/ui/unoidl/unocpres.cxx | 18 |
1 files changed, 6 insertions, 12 deletions
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() |