Kaydet (Commit) 9694a0ed authored tarafından Michael Stahl's avatar Michael Stahl

basic: coverity#1348466 checked return

Kind of unnecessary but let's hope it shuts up coverity.

Change-Id: I4903c9df788ce5fb9648c5fd68627ff21362828f
üst 80b55dcf
...@@ -1343,8 +1343,9 @@ OUString BasicManager::GetLibName( sal_uInt16 nLib ) ...@@ -1343,8 +1343,9 @@ OUString BasicManager::GetLibName( sal_uInt16 nLib )
return OUString(); return OUString();
} }
void BasicManager::LoadLib( sal_uInt16 nLib ) bool BasicManager::LoadLib( sal_uInt16 nLib )
{ {
bool bDone = false;
DBG_ASSERT( nLib < mpImpl->aLibs.size() , "Lib?!" ); DBG_ASSERT( nLib < mpImpl->aLibs.size() , "Lib?!" );
if ( nLib < mpImpl->aLibs.size() ) if ( nLib < mpImpl->aLibs.size() )
{ {
...@@ -1354,11 +1355,11 @@ void BasicManager::LoadLib( sal_uInt16 nLib ) ...@@ -1354,11 +1355,11 @@ void BasicManager::LoadLib( sal_uInt16 nLib )
{ {
OUString aLibName = rLibInfo.GetLibName(); OUString aLibName = rLibInfo.GetLibName();
xLibContainer->loadLibrary( aLibName ); xLibContainer->loadLibrary( aLibName );
xLibContainer->isLibraryLoaded( aLibName ); bDone = xLibContainer->isLibraryLoaded( aLibName );
} }
else else
{ {
ImpLoadLibrary( &rLibInfo, nullptr ); bDone = ImpLoadLibrary( &rLibInfo, nullptr );
StarBASIC* pLib = GetLib( nLib ); StarBASIC* pLib = GetLib( nLib );
if ( pLib ) if ( pLib )
{ {
...@@ -1372,6 +1373,7 @@ void BasicManager::LoadLib( sal_uInt16 nLib ) ...@@ -1372,6 +1373,7 @@ void BasicManager::LoadLib( sal_uInt16 nLib )
StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, OUString(), ERRCODE_BUTTON_OK ); StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, OUString(), ERRCODE_BUTTON_OK );
aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::LIBNOTFOUND, OUString::number(nLib))); aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::LIBNOTFOUND, OUString::number(nLib)));
} }
return bDone;
} }
StarBASIC* BasicManager::CreateLib( const OUString& rLibName ) StarBASIC* BasicManager::CreateLib( const OUString& rLibName )
...@@ -1584,8 +1586,11 @@ namespace ...@@ -1584,8 +1586,11 @@ namespace
StarBASIC* pLib = i_manager->GetLib( nLib ); StarBASIC* pLib = i_manager->GetLib( nLib );
if( !pLib ) if( !pLib )
{ {
i_manager->LoadLib( nLib ); bool const bLoaded = i_manager->LoadLib( nLib );
pLib = i_manager->GetLib( nLib ); if (bLoaded)
{
pLib = i_manager->GetLib( nLib );
}
} }
if( pLib ) if( pLib )
......
...@@ -171,7 +171,7 @@ public: ...@@ -171,7 +171,7 @@ public:
const css::uno::Reference< css::script::XPersistentLibraryContainer >& const css::uno::Reference< css::script::XPersistentLibraryContainer >&
GetScriptLibraryContainer() const; GetScriptLibraryContainer() const;
void LoadLib( sal_uInt16 nLib ); bool LoadLib( sal_uInt16 nLib );
bool RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage ); bool RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage );
// Modify-Flag will be reset only during save. // Modify-Flag will be reset only during save.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment