summaryrefslogtreecommitdiff
path: root/rsc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-04 11:57:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-05 06:40:10 +0000
commit3d6c84f2d9683b23c14fa5bf50ca4425cf4ceb04 (patch)
treebc18d71a94b1a9015d45155ad79179e61e6aa3c0 /rsc
parentcedbc4031f26ea13b188a4ecc5b90cc9646095fb (diff)
loplugin:constantparam
Change-Id: I1996319e5b664dff95f7a9b2346aea6092d333ec Reviewed-on: https://gerrit.libreoffice.org/36070 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'rsc')
-rw-r--r--rsc/inc/rsccont.hxx4
-rw-r--r--rsc/source/res/rsccont.cxx24
2 files changed, 8 insertions, 20 deletions
diff --git a/rsc/inc/rsccont.hxx b/rsc/inc/rsccont.hxx
index 89d3b7701c63..005daa44856f 100644
--- a/rsc/inc/rsccont.hxx
+++ b/rsc/inc/rsccont.hxx
@@ -41,7 +41,6 @@ class RscBaseCont : public RscTop
{
protected:
RscTop * pTypeClass; // type of entries
- RscTop * pTypeClass1;// two different types may exist
bool bNoId; // whether there is no identifier
const sal_uInt32 nOffInstData;// offset of own instance data
const sal_uInt32 nSize; // size of this class and super classes instance data
@@ -58,10 +57,9 @@ public:
bool bNoId );
virtual ~RscBaseCont() override;
virtual RSCCLASS_TYPE GetClassType() const override;
- void SetTypeClass( RscTop * pClass, RscTop * pClass1 = nullptr )
+ void SetTypeClass( RscTop * pClass )
{
pTypeClass = pClass;
- pTypeClass1 = pClass1;
}
RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, bool bOwnClass = false ) override;
void Destroy( const RSCINST & rInst ) override;
diff --git a/rsc/source/res/rsccont.cxx b/rsc/source/res/rsccont.cxx
index 033ec345f380..636cbe4e4feb 100644
--- a/rsc/source/res/rsccont.cxx
+++ b/rsc/source/res/rsccont.cxx
@@ -38,7 +38,7 @@ void ENTRY_STRUCT::Destroy()
RscBaseCont::RscBaseCont( Atom nId, RESOURCE_TYPE nTypeId,
bool bNoIdent )
: RscTop(nId, nTypeId, nullptr)
- , pTypeClass(nullptr), pTypeClass1(nullptr)
+ , pTypeClass(nullptr)
, bNoId(bNoIdent), nOffInstData(RscTop::Size())
, nSize(nOffInstData + ALIGNED_SIZE(sizeof(RscBaseContInst)))
@@ -176,17 +176,7 @@ ERRTYPE RscBaseCont::GetElement( const RSCINST & rInst, const RscId & rEleName,
{
if( !pCreateClass->InHierarchy( pTypeClass ) )
{
- if( pTypeClass1 )
- {
- if( !pCreateClass->InHierarchy( pTypeClass1 ) )
- {
- return ERR_CONT_INVALIDTYPE;
- }
- }
- else
- {
- return ERR_CONT_INVALIDTYPE;
- }
+ return ERR_CONT_INVALIDTYPE;
}
}
else
@@ -357,7 +347,7 @@ ERRTYPE RscBaseCont::SetString( const RSCINST & rInst, const char * pStr )
{
aError.Clear();
DeletePos( rInst, pClassData->nEntries -1 );
- aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI );
+ aError = GetElement( rInst, RscId(), nullptr, RSCINST(), &aTmpI );
aError = aTmpI.pClass->GetString( aTmpI, &pTmpStr );
if( aError.IsOk() )
aError = aTmpI.pClass->SetString( aTmpI, pStr );
@@ -393,7 +383,7 @@ ERRTYPE RscBaseCont::SetNumber( const RSCINST & rInst, sal_Int32 lValue )
{
aError.Clear();
DeletePos( rInst, pClassData->nEntries -1 );
- aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI );
+ aError = GetElement( rInst, RscId(), nullptr, RSCINST(), &aTmpI );
aError = aTmpI.pClass->GetNumber( aTmpI, &lNumber );
if( aError.IsOk() )
aError = aTmpI.pClass->SetNumber( aTmpI, lValue );
@@ -429,7 +419,7 @@ ERRTYPE RscBaseCont::SetBool( const RSCINST & rInst,
{
aError.Clear();
DeletePos( rInst, pClassData->nEntries -1 );
- aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI );
+ aError = GetElement( rInst, RscId(), nullptr, RSCINST(), &aTmpI );
aError = aTmpI.pClass->GetBool( aTmpI, &bBool );
if( aError.IsOk() )
aError = aTmpI.pClass->SetBool( aTmpI, bValue );
@@ -467,7 +457,7 @@ ERRTYPE RscBaseCont::SetConst( const RSCINST & rInst,
{
aError.Clear();
DeletePos( rInst, pClassData->nEntries -1 );
- aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI );
+ aError = GetElement( rInst, RscId(), nullptr, RSCINST(), &aTmpI );
aError = aTmpI.pClass->GetConst( aTmpI, &nConst );
if( aError.IsOk() )
aError = aTmpI.pClass->SetConst( aTmpI, nValueId, lValue );
@@ -503,7 +493,7 @@ ERRTYPE RscBaseCont::SetRef( const RSCINST & rInst, const RscId & rRefId )
{
aError.Clear();
DeletePos( rInst, pClassData->nEntries -1 );
- aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI );
+ aError = GetElement( rInst, RscId(), nullptr, RSCINST(), &aTmpI );
aError = aTmpI.pClass->GetRef( aTmpI, &aId );
if( aError.IsOk() )
aError = aTmpI.pClass->SetNumber( aTmpI, rRefId.GetNumber() );