diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-01-15 12:18:11 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-01-15 13:03:09 +0100 |
commit | 9694a0edfeb3cfe20d7c1286db097ba9b7c51e37 (patch) | |
tree | 6f05fdfe019fa70045bceb59aab3c5fb57318f4f | |
parent | 80b55dcfc9754553e42625d0d6e9ebbb728200eb (diff) |
basic: coverity#1348466 checked return
Kind of unnecessary but let's hope it shuts up coverity.
Change-Id: I4903c9df788ce5fb9648c5fd68627ff21362828f
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 15 | ||||
-rw-r--r-- | include/basic/basmgr.hxx | 2 |
2 files changed, 11 insertions, 6 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index ac453835a9ad..c5f2f3ea9612 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -1343,8 +1343,9 @@ OUString BasicManager::GetLibName( sal_uInt16 nLib ) return OUString(); } -void BasicManager::LoadLib( sal_uInt16 nLib ) +bool BasicManager::LoadLib( sal_uInt16 nLib ) { + bool bDone = false; DBG_ASSERT( nLib < mpImpl->aLibs.size() , "Lib?!" ); if ( nLib < mpImpl->aLibs.size() ) { @@ -1354,11 +1355,11 @@ void BasicManager::LoadLib( sal_uInt16 nLib ) { OUString aLibName = rLibInfo.GetLibName(); xLibContainer->loadLibrary( aLibName ); - xLibContainer->isLibraryLoaded( aLibName ); + bDone = xLibContainer->isLibraryLoaded( aLibName ); } else { - ImpLoadLibrary( &rLibInfo, nullptr ); + bDone = ImpLoadLibrary( &rLibInfo, nullptr ); StarBASIC* pLib = GetLib( nLib ); if ( pLib ) { @@ -1372,6 +1373,7 @@ void BasicManager::LoadLib( sal_uInt16 nLib ) StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, OUString(), ERRCODE_BUTTON_OK ); aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::LIBNOTFOUND, OUString::number(nLib))); } + return bDone; } StarBASIC* BasicManager::CreateLib( const OUString& rLibName ) @@ -1584,8 +1586,11 @@ namespace StarBASIC* pLib = i_manager->GetLib( nLib ); if( !pLib ) { - i_manager->LoadLib( nLib ); - pLib = i_manager->GetLib( nLib ); + bool const bLoaded = i_manager->LoadLib( nLib ); + if (bLoaded) + { + pLib = i_manager->GetLib( nLib ); + } } if( pLib ) diff --git a/include/basic/basmgr.hxx b/include/basic/basmgr.hxx index dac109f7ce08..d64259a0c598 100644 --- a/include/basic/basmgr.hxx +++ b/include/basic/basmgr.hxx @@ -171,7 +171,7 @@ public: const css::uno::Reference< css::script::XPersistentLibraryContainer >& GetScriptLibraryContainer() const; - void LoadLib( sal_uInt16 nLib ); + bool LoadLib( sal_uInt16 nLib ); bool RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage ); // Modify-Flag will be reset only during save. |