From b35f3dfb1afa78722a4cd8e69a625456a6dd01d6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 1 Jul 2014 15:09:23 +0100 Subject: coverity#706240 Uncaught exception Change-Id: Ie31f5e1ff74ff8b9f35d7ce08e1f02a780375890 --- basic/source/uno/namecont.cxx | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'basic') diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 71af61e43a24..de2b91a6b356 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -496,21 +496,27 @@ sal_Bool SfxLibraryContainer::isModified() for( sal_Int32 i = 0 ; i < nNameCount ; i++ ) { OUString aName = pNames[ i ]; - SfxLibrary* pImplLib = getImplLib( aName ); - if( pImplLib->isModified() ) + try { - if ( aName == "Standard" ) + SfxLibrary* pImplLib = getImplLib( aName ); + if( pImplLib->isModified() ) { - // this is a workaround that has to be implemented because - // empty standard library should stay marked as modified - // but should not be treated as modified while it is empty - if ( pImplLib->hasElements() ) + if ( aName == "Standard" ) + { + // this is a workaround that has to be implemented because + // empty standard library should stay marked as modified + // but should not be treated as modified while it is empty + if ( pImplLib->hasElements() ) + return sal_True; + } + else + { return sal_True; + } } - else - { - return sal_True; - } + } + catch(const css::container::NoSuchElementException&) + { } } -- cgit