loplugin:unusedmethods unused return value in include/basic

Change-Id: Ib1a006adaa92e257d40a20ff0d8beeb37e7c2fe0
Reviewed-on: https://gerrit.libreoffice.org/21360
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin 2016-01-11 14:31:00 +02:00 committed by Noel Grandin
parent a7198d38f0
commit bbfeab3b13
12 changed files with 42 additions and 53 deletions

View file

@ -1185,10 +1185,10 @@ bool BasicManager::IsReference( sal_uInt16 nLib )
return false;
}
bool BasicManager::RemoveLib( sal_uInt16 nLib )
void BasicManager::RemoveLib( sal_uInt16 nLib )
{
// Only physical deletion if no reference
return RemoveLib( nLib, !IsReference( nLib ) );
RemoveLib( nLib, !IsReference( nLib ) );
}
bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage )
@ -1343,9 +1343,8 @@ OUString BasicManager::GetLibName( sal_uInt16 nLib )
return OUString();
}
bool BasicManager::LoadLib( sal_uInt16 nLib )
void BasicManager::LoadLib( sal_uInt16 nLib )
{
bool bDone = false;
DBG_ASSERT( nLib < mpImpl->aLibs.size() , "Lib?!" );
if ( nLib < mpImpl->aLibs.size() )
{
@ -1355,11 +1354,11 @@ bool BasicManager::LoadLib( sal_uInt16 nLib )
{
OUString aLibName = rLibInfo.GetLibName();
xLibContainer->loadLibrary( aLibName );
bDone = xLibContainer->isLibraryLoaded( aLibName );
xLibContainer->isLibraryLoaded( aLibName );
}
else
{
bDone = ImpLoadLibrary( &rLibInfo, nullptr );
ImpLoadLibrary( &rLibInfo, nullptr );
StarBASIC* pLib = GetLib( nLib );
if ( pLib )
{
@ -1373,7 +1372,6 @@ bool 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 )

View file

@ -1696,9 +1696,9 @@ bool StarBASIC::CError( SbError code, const OUString& rMsg,
return bRet;
}
bool StarBASIC::RTError( SbError code, sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
void StarBASIC::RTError( SbError code, sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
{
return RTError( code, OUString(), l, c1, c2 );
RTError( code, OUString(), l, c1, c2 );
}
bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )

View file

@ -599,7 +599,7 @@ SbProperty* SbModule::GetProperty( const OUString& rName, SbxDataType t )
return pProp;
}
SbProcedureProperty* SbModule::GetProcedureProperty( const OUString& rName, SbxDataType t )
void SbModule::GetProcedureProperty( const OUString& rName, SbxDataType t )
{
SbxVariable* p = pProps->Find( rName, SbxCLASS_PROPERTY );
SbProcedureProperty* pProp = p ? dynamic_cast<SbProcedureProperty*>( p ) : nullptr;
@ -615,10 +615,9 @@ SbProcedureProperty* SbModule::GetProcedureProperty( const OUString& rName, SbxD
pProps->Put( pProp, pProps->Count() );
StartListening( pProp->GetBroadcaster(), true );
}
return pProp;
}
SbIfaceMapperMethod* SbModule::GetIfaceMapperMethod( const OUString& rName, SbMethod* pImplMeth )
void SbModule::GetIfaceMapperMethod( const OUString& rName, SbMethod* pImplMeth )
{
SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD );
SbIfaceMapperMethod* pMapperMethod = p ? dynamic_cast<SbIfaceMapperMethod*>( p ) : nullptr;
@ -634,7 +633,6 @@ SbIfaceMapperMethod* SbModule::GetIfaceMapperMethod( const OUString& rName, SbMe
pMethods->Put( pMapperMethod, pMethods->Count() );
}
pMapperMethod->bInvalid = false;
return pMapperMethod;
}
SbIfaceMapperMethod::~SbIfaceMapperMethod()
@ -1791,7 +1789,7 @@ bool SbModule::HasExeCode()
}
// Store only image, no source
bool SbModule::StoreBinaryData( SvStream& rStrm, sal_uInt16 nVer )
void SbModule::StoreBinaryData( SvStream& rStrm, sal_uInt16 nVer )
{
bool bRet = Compile();
if( bRet )
@ -1818,18 +1816,16 @@ bool SbModule::StoreBinaryData( SvStream& rStrm, sal_uInt16 nVer )
pImage->aOUSource = aOUSource;
}
}
return bRet;
}
// Called for >= OO 1.0 passwd protected libraries only
bool SbModule::LoadBinaryData( SvStream& rStrm )
void SbModule::LoadBinaryData( SvStream& rStrm )
{
OUString aKeepSource = aOUSource;
bool bRet = LoadData( rStrm, 2 );
LoadData( rStrm, 2 );
LoadCompleted();
aOUSource = aKeepSource;
return bRet;
}
bool SbModule::LoadCompleted()

View file

@ -329,7 +329,7 @@ const SbxParamInfo* SbxInfo::GetParam( sal_uInt16 n ) const
return m_Params[n - 1].get();
}
bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer )
void SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer )
{
m_Params.clear();
sal_uInt16 nParam;
@ -352,10 +352,9 @@ bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer )
SbxParamInfo& p(*m_Params.back());
p.nUserData = nUserData;
}
return true;
}
bool SbxInfo::StoreData( SvStream& rStrm ) const
void SbxInfo::StoreData( SvStream& rStrm ) const
{
write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aComment,
RTL_TEXTENCODING_ASCII_US );
@ -370,7 +369,6 @@ bool SbxInfo::StoreData( SvStream& rStrm ) const
.WriteUInt16( static_cast<sal_uInt16>(i->nFlags) )
.WriteUInt32( i->nUserData );
}
return true;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -466,7 +466,7 @@ OUString SbxBasicFormater::GetNullFormatString( const OUString& sFormatStrg, boo
}
// returns value <> 0 in case of an error
short SbxBasicFormater::AnalyseFormatString( const OUString& sFormatStrg,
void SbxBasicFormater::AnalyseFormatString( const OUString& sFormatStrg,
short& nNoOfDigitsLeft, short& nNoOfDigitsRight,
short& nNoOfOptionalDigitsLeft,
short& nNoOfExponentDigits, short& nNoOfOptionalExponentDigits,
@ -528,7 +528,7 @@ short SbxBasicFormater::AnalyseFormatString( const OUString& sFormatStrg,
if( c=='0' )
{
// ERROR: 0 after # in the exponent is NOT allowed!!
return -4;
return;
}
nNoOfOptionalExponentDigits++;
nNoOfExponentDigits++;
@ -538,7 +538,7 @@ short SbxBasicFormater::AnalyseFormatString( const OUString& sFormatStrg,
nState++;
if( nState>1 )
{
return -1; // ERROR: too many decimal points
return; // ERROR: too many decimal points
}
break;
case '%':
@ -577,7 +577,6 @@ short SbxBasicFormater::AnalyseFormatString( const OUString& sFormatStrg,
break;
}
}
return 0;
}
// the flag bCreateSign says that at the mantissa a leading sign

View file

@ -578,7 +578,7 @@ bool SbxValue::Put( const SbxValues& rVal )
// if Float were declared with ',' as the decimal separator or BOOl
// explicit with "TRUE" or "FALSE".
// Implementation in ImpConvStringExt (SBXSCAN.CXX)
bool SbxValue::PutStringExt( const OUString& r )
void SbxValue::PutStringExt( const OUString& r )
{
// Copy; if it is Unicode convert it immediately
OUString aStr( r );
@ -621,7 +621,6 @@ bool SbxValue::PutStringExt( const OUString& r )
ResetError();
SetFlags( nFlags_ );
return bRet;
}
bool SbxValue::PutBool( bool b )
@ -640,35 +639,31 @@ bool SbxValue::PutEmpty()
return bRet;
}
bool SbxValue::PutNull()
void SbxValue::PutNull()
{
bool bRet = SetType( SbxNULL );
if( bRet )
SetModified( true );
return bRet;
}
// Special decimal methods
bool SbxValue::PutDecimal( css::bridge::oleautomation::Decimal& rAutomationDec )
void SbxValue::PutDecimal( css::bridge::oleautomation::Decimal& rAutomationDec )
{
SbxValue::Clear();
aData.pDecimal = new SbxDecimal( rAutomationDec );
aData.pDecimal->addRef();
aData.eType = SbxDECIMAL;
return true;
}
bool SbxValue::fillAutomationDecimal
void SbxValue::fillAutomationDecimal
( css::bridge::oleautomation::Decimal& rAutomationDec ) const
{
SbxDecimal* pDecimal = GetDecimal();
if( pDecimal != nullptr )
{
pDecimal->fillAutomationDecimal( rAutomationDec );
return true;
}
return false;
}
@ -686,12 +681,15 @@ bool SbxValue::PutString( const OUString& r )
bool SbxValue::p( t n ) \
{ SbxValues aRes(e); aRes.m = n; Put( aRes ); return !IsError(); }
void SbxValue::PutDate( double n )
{ SbxValues aRes(SbxDATE); aRes.nDouble = n; Put( aRes ); }
void SbxValue::PutErr( sal_uInt16 n )
{ SbxValues aRes(SbxERROR); aRes.nUShort = n; Put( aRes ); }
PUT( PutByte, SbxBYTE, sal_uInt8, nByte )
PUT( PutChar, SbxCHAR, sal_Unicode, nChar )
PUT( PutCurrency, SbxCURRENCY, const sal_Int64&, nInt64 )
PUT( PutDate, SbxDATE, double, nDouble )
PUT( PutDouble, SbxDOUBLE, double, nDouble )
PUT( PutErr, SbxERROR, sal_uInt16, nUShort )
PUT( PutInteger, SbxINTEGER, sal_Int16, nInteger )
PUT( PutLong, SbxLONG, sal_Int32, nLong )
PUT( PutObject, SbxOBJECT, SbxBase*, pObj )

View file

@ -171,7 +171,7 @@ public:
const css::uno::Reference< css::script::XPersistentLibraryContainer >&
GetScriptLibraryContainer() const;
bool LoadLib( sal_uInt16 nLib );
void LoadLib( sal_uInt16 nLib );
bool RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage );
// Modify-Flag will be reset only during save.
@ -208,7 +208,7 @@ private:
BASIC_DLLPRIVATE StarBASIC* GetStdLib() const;
BASIC_DLLPRIVATE StarBASIC* AddLib( SotStorage& rStorage, const OUString& rLibName, bool bReference );
BASIC_DLLPRIVATE bool RemoveLib( sal_uInt16 nLib );
BASIC_DLLPRIVATE void RemoveLib( sal_uInt16 nLib );
BASIC_DLLPRIVATE bool HasLib( const OUString& rName ) const;
BASIC_DLLPRIVATE StarBASIC* CreateLibForLibContainer( const OUString& rLibName,

View file

@ -75,8 +75,8 @@ protected:
void StartDefinitions();
SbMethod* GetMethod( const OUString&, SbxDataType );
SbProperty* GetProperty( const OUString&, SbxDataType );
SbProcedureProperty* GetProcedureProperty( const OUString&, SbxDataType );
SbIfaceMapperMethod* GetIfaceMapperMethod( const OUString&, SbMethod* );
void GetProcedureProperty( const OUString&, SbxDataType );
void GetIfaceMapperMethod( const OUString&, SbMethod* );
void EndDefinitions( bool=false );
void Run( SbMethod* );
void RunInit();
@ -116,8 +116,8 @@ public:
void ClearAllBP();
// Store only image, no source (needed for new password protection)
bool StoreBinaryData( SvStream&, sal_uInt16 nVer );
bool LoadBinaryData( SvStream& );
void StoreBinaryData( SvStream&, sal_uInt16 nVer );
void LoadBinaryData( SvStream& );
bool ExceedsLegacyModuleSize();
void fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg = nullptr ) const;
bool HasExeCode();

View file

@ -71,7 +71,7 @@ class BASIC_DLLPUBLIC StarBASIC : public SbxObject
protected:
bool CError( SbError, const OUString&, sal_Int32, sal_Int32, sal_Int32 );
private:
BASIC_DLLPRIVATE bool RTError( SbError, sal_Int32, sal_Int32, sal_Int32 );
BASIC_DLLPRIVATE void RTError( SbError, sal_Int32, sal_Int32, sal_Int32 );
BASIC_DLLPRIVATE bool RTError( SbError, const OUString& rMsg, sal_Int32, sal_Int32, sal_Int32 );
BASIC_DLLPRIVATE sal_uInt16 BreakPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
BASIC_DLLPRIVATE sal_uInt16 StepPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );

View file

@ -74,8 +74,8 @@ class BASIC_DLLPUBLIC SbxInfo : public SvRefBase
void operator=(SbxInfo const&) = delete;
protected:
bool LoadData( SvStream&, sal_uInt16 );
bool StoreData( SvStream& ) const;
void LoadData( SvStream&, sal_uInt16 );
void StoreData( SvStream& ) const;
virtual ~SbxInfo();
public:
SbxInfo();

View file

@ -133,7 +133,7 @@ class BASIC_DLLPUBLIC SbxBasicFormater {
BASIC_DLLPRIVATE OUString GetNegFormatString( const OUString& sFormatStrg, bool & bFound );
BASIC_DLLPRIVATE OUString Get0FormatString( const OUString& sFormatStrg, bool & bFound );
BASIC_DLLPRIVATE OUString GetNullFormatString( const OUString& sFormatStrg, bool & bFound );
BASIC_DLLPRIVATE short AnalyseFormatString( const OUString& sFormatStrg,
BASIC_DLLPRIVATE void AnalyseFormatString( const OUString& sFormatStrg,
short& nNoOfDigitsLeft, short& nNoOfDigitsRight,
short& nNoOfOptionalDigitsLeft,
short& nNoOfExponentDigits,

View file

@ -158,10 +158,10 @@ public:
bool PutLong( sal_Int32 );
bool PutSingle( float );
bool PutDouble( double );
bool PutDate( double );
void PutDate( double );
bool PutBool( bool );
bool PutErr( sal_uInt16 );
bool PutStringExt( const OUString& ); // with extended analysis (International, "sal_True"/"sal_False")
void PutErr( sal_uInt16 );
void PutStringExt( const OUString& ); // with extended analysis (International, "sal_True"/"sal_False")
bool PutInt64( sal_Int64 );
bool PutUInt64( sal_uInt64 );
bool PutString( const OUString& );
@ -170,12 +170,12 @@ public:
bool PutUShort( sal_uInt16 );
bool PutULong( sal_uInt32 );
bool PutEmpty();
bool PutNull();
void PutNull();
// Special methods
bool PutDecimal( css::bridge::oleautomation::Decimal& rAutomationDec );
void PutDecimal( css::bridge::oleautomation::Decimal& rAutomationDec );
bool PutDecimal( SbxDecimal* pDecimal ); // This function is needed for Windows build, don't remove
bool fillAutomationDecimal( css::bridge::oleautomation::Decimal& rAutomationDec ) const;
void fillAutomationDecimal( css::bridge::oleautomation::Decimal& rAutomationDec ) const;
bool PutCurrency( const sal_Int64& );
// Interface for CDbl in Basic
static SbxError ScanNumIntnl( const OUString& rSrc, double& nVal, bool bSingle = false );