summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-01-11 14:31:00 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-01-12 06:40:03 +0000
commitbbfeab3b13b48c99cfa2f94c8c34bc3efef7faa9 (patch)
treef039c3d27a8a2d449ef1f5c456c752d83929c8bf /basic
parenta7198d38f0294ab5db04a7f4457565ea8b2c32f1 (diff)
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>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/basmgr/basmgr.cxx12
-rw-r--r--basic/source/classes/sb.cxx4
-rw-r--r--basic/source/classes/sbxmod.cxx14
-rw-r--r--basic/source/sbx/sbxbase.cxx6
-rw-r--r--basic/source/sbx/sbxform.cxx7
-rw-r--r--basic/source/sbx/sbxvalue.cxx20
6 files changed, 26 insertions, 37 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 8b1ecedad5be..ac453835a9ad 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -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 )
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index cd713e431e3c..90f4a5050694 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -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 )
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index c025a9c80a1b..7244c8b2af8d 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -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()
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 12bb9b7b94ec..2e7532916891 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -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: */
diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx
index 26e9aa58ddde..1eff210a9258 100644
--- a/basic/source/sbx/sbxform.cxx
+++ b/basic/source/sbx/sbxform.cxx
@@ -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
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index dc1a1447781d..e8816a7c075b 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -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 )