diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-02 16:44:45 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-03-03 08:11:02 +0200 |
commit | bd2bf6bd559163389d1e6b6b948fc29cee5f13f5 (patch) | |
tree | e17f74246d0138bcd87100b8853da96423bb3fd1 /basic | |
parent | 2b7215e6fa12cd947bdbbe195909642a850cfd69 (diff) |
loplugin:unuseddefaultparams in basic
Change-Id: I286efdac6af47a859693fccc71b445915f76945c
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 37 | ||||
-rw-r--r-- | basic/source/comp/parser.cxx | 4 | ||||
-rw-r--r-- | basic/source/comp/symtbl.cxx | 5 | ||||
-rw-r--r-- | basic/source/inc/iosys.hxx | 4 | ||||
-rw-r--r-- | basic/source/inc/parser.hxx | 2 | ||||
-rw-r--r-- | basic/source/inc/runtime.hxx | 2 | ||||
-rw-r--r-- | basic/source/inc/symtbl.hxx | 4 | ||||
-rw-r--r-- | basic/source/runtime/iosys.cxx | 8 | ||||
-rw-r--r-- | basic/source/runtime/runtime.cxx | 4 |
9 files changed, 28 insertions, 42 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 12f015aa8e73..533fb0cd78ab 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -713,7 +713,7 @@ void BasicManager::ImpCreateStdLib( StarBASIC* pParentFromStdLib ) pStdLib->SetFlag( SbxFlagBits::DontStore | SbxFlagBits::ExtSearch ); } -void BasicManager::LoadBasicManager( SotStorage& rStorage, const OUString& rBaseURL, bool bLoadLibs ) +void BasicManager::LoadBasicManager( SotStorage& rStorage, const OUString& rBaseURL ) { tools::SvRef<SotStorageStream> xManagerStream = rStorage.OpenSotStream( szManagerStream, eStreamReadMode ); @@ -793,7 +793,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const OUString& rBase mpImpl->aLibs.push_back(std::unique_ptr<BasicLibInfo>(pInfo)); // Libs from external files should be loaded only when necessary. // But references are loaded at once, otherwise some big customers get into trouble - if ( bLoadLibs && pInfo->DoLoad() && + if ( pInfo->DoLoad() && ( !pInfo->IsExtern() || pInfo->IsReference())) { ImpLoadLibrary( pInfo, &rStorage ); @@ -928,7 +928,7 @@ BasicLibInfo* BasicManager::CreateLibInfo() return pInf; } -bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStorage, bool bInfosOnly ) +bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStorage ) { try { DBG_ASSERT( pLibInfo, "LibInfo!?" ); @@ -982,29 +982,18 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora bool bLoaded = false; if ( xBasicStream->Seek( STREAM_SEEK_TO_END ) != 0 ) { - if ( !bInfosOnly ) + if ( !pLibInfo->GetLib().Is() ) { - if ( !pLibInfo->GetLib().Is() ) - { - pLibInfo->SetLib( new StarBASIC( GetStdLib(), mbDocMgr ) ); - } - xBasicStream->SetBufferSize( 1024 ); - xBasicStream->Seek( STREAM_SEEK_TO_BEGIN ); - bLoaded = ImplLoadBasic( *xBasicStream, pLibInfo->GetLibRef() ); - xBasicStream->SetBufferSize( 0 ); - StarBASICRef xStdLib = pLibInfo->GetLib(); - xStdLib->SetName( pLibInfo->GetLibName() ); - xStdLib->SetModified( false ); - xStdLib->SetFlag( SbxFlagBits::DontStore ); - } - else - { - // Skip Basic... - xBasicStream->Seek( STREAM_SEEK_TO_BEGIN ); - ImplEncryptStream( *xBasicStream ); - SbxBase::Skip( *xBasicStream ); - bLoaded = true; + pLibInfo->SetLib( new StarBASIC( GetStdLib(), mbDocMgr ) ); } + xBasicStream->SetBufferSize( 1024 ); + xBasicStream->Seek( STREAM_SEEK_TO_BEGIN ); + bLoaded = ImplLoadBasic( *xBasicStream, pLibInfo->GetLibRef() ); + xBasicStream->SetBufferSize( 0 ); + StarBASICRef xStdLib = pLibInfo->GetLib(); + xStdLib->SetName( pLibInfo->GetLibName() ); + xStdLib->SetModified( false ); + xStdLib->SetFlag( SbxFlagBits::DontStore ); } if ( !bLoaded ) { diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index 35481d63e330..f9934b07db2e 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -243,10 +243,10 @@ void SbiParser::Exit() Error( ERRCODE_BASIC_BAD_EXIT ); } -bool SbiParser::TestSymbol( bool bKwdOk ) +bool SbiParser::TestSymbol() { Peek(); - if( eCurTok == SYMBOL || ( bKwdOk && IsKwd( eCurTok ) ) ) + if( eCurTok == SYMBOL ) { Next(); return true; } diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index c75f7c6a06d7..7d9692634b26 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -52,14 +52,13 @@ const OUString& SbiStringPool::Find( sal_uInt32 n ) const return aData[n - 1]; } -short SbiStringPool::Add( const OUString& rVal, bool bNoCase ) +short SbiStringPool::Add( const OUString& rVal ) { sal_uInt32 n = aData.size(); for( sal_uInt32 i = 0; i < n; ++i ) { OUString& p = aData[i]; - if( ( bNoCase && p == rVal ) - || ( !bNoCase && p.equalsIgnoreAsciiCase( rVal ) ) ) + if( p == rVal ) return i+1; } diff --git a/basic/source/inc/iosys.hxx b/basic/source/inc/iosys.hxx index 1b9964b89671..0902407b71f8 100644 --- a/basic/source/inc/iosys.hxx +++ b/basic/source/inc/iosys.hxx @@ -100,9 +100,9 @@ public: void ResetChannel() { nChan = 0; } void Open( short, const OString&, StreamMode, SbiStreamFlags, short ); void Close(); - void Read(OString&, short = 0); + void Read(OString&); char Read(); - void Write(const OUString&, short = 0); + void Write(const OUString&); // 0 == bad channel or no SvStream (nChannel=0..CHANNELS-1) SbiStream* GetStream( short nChannel ) const; void CloseAll(); // JSM diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx index 96683f56a3f5..fa60d6d1ca4e 100644 --- a/basic/source/inc/parser.hxx +++ b/basic/source/inc/parser.hxx @@ -92,7 +92,7 @@ public: bool HasGlobalCode(); bool TestToken( SbiToken ); - bool TestSymbol( bool bKwdOk=false ); + bool TestSymbol(); bool TestComma(); void TestEoln(); diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index 5c082ee55c32..2508d9e5dcc4 100644 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -299,7 +299,7 @@ class SbiRuntime void PushVar( SbxVariable* ); SbxVariableRef PopVar(); - SbxVariable* GetTOS( short=0 ); + SbxVariable* GetTOS(); void TOSMakeTemp(); void ClearExprStack(); diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx index 2f75fa810763..cc30090bf60d 100644 --- a/basic/source/inc/symtbl.hxx +++ b/basic/source/inc/symtbl.hxx @@ -41,9 +41,7 @@ public: SbiStringPool(); ~SbiStringPool(); sal_uInt32 GetSize() const { return aData.size(); } - // From 8.4.1999: default changed to true because of #64236 - - // change it back to false when the bug is cleanly removed. - short Add( const OUString&, bool=true ); + short Add( const OUString& ); short Add( double, SbxDataType ); const OUString& Find( sal_uInt32 ) const; }; diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index a6cdf58a33d7..e7c890838888 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -852,7 +852,7 @@ void SbiIoSystem::Shutdown() } -void SbiIoSystem::Read(OString& rBuf, short n) +void SbiIoSystem::Read(OString& rBuf) { if( !nChan ) { @@ -864,7 +864,7 @@ void SbiIoSystem::Read(OString& rBuf, short n) } else { - nError = pChan[ nChan ]->Read( rBuf, n ); + nError = pChan[ nChan ]->Read( rBuf ); } } @@ -892,7 +892,7 @@ char SbiIoSystem::Read() return ch; } -void SbiIoSystem::Write(const OUString& rBuf, short n) +void SbiIoSystem::Write(const OUString& rBuf) { if( !nChan ) { @@ -904,7 +904,7 @@ void SbiIoSystem::Write(const OUString& rBuf, short n) } else { - nError = pChan[ nChan ]->Write( OUStringToOString(rBuf, osl_getThreadTextEncoding()), n ); + nError = pChan[ nChan ]->Write( OUStringToOString(rBuf, osl_getThreadTextEncoding()) ); } } diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 73807548bf23..caf5727a81cf 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -1014,9 +1014,9 @@ void SbiRuntime::ClearExprStack() // Take variable from the expression-stack without removing it // n counts from 0 -SbxVariable* SbiRuntime::GetTOS( short n ) +SbxVariable* SbiRuntime::GetTOS() { - n = nExprLvl - n - 1; + short n = nExprLvl - 1; #ifdef DBG_UTIL if( n < 0 ) { |