summaryrefslogtreecommitdiff
path: root/rsc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-23 09:19:06 +0200
committerNoel Grandin <noel@peralex.com>2016-03-23 10:19:42 +0200
commite73638279b3e6634b47ca77de993cf2be08ae5d5 (patch)
treeccf6701cc79543301dc1a2915ad482b75870baf6 /rsc
parent5de18e6a1fe643f1cf15b8456587208ecb11e1c5 (diff)
loplugin:constantparam in rsc
Change-Id: I54f80c9c759eec4b73d1fd194e3efc8156bd3e2d
Diffstat (limited to 'rsc')
-rw-r--r--rsc/inc/rsccont.hxx6
-rw-r--r--rsc/inc/rscdb.hxx6
-rw-r--r--rsc/source/parser/rscdb.cxx74
-rw-r--r--rsc/source/res/rscclass.cxx3
-rw-r--r--rsc/source/res/rsccont.cxx8
-rw-r--r--rsc/source/rsc/rsc.cxx2
6 files changed, 28 insertions, 71 deletions
diff --git a/rsc/inc/rsccont.hxx b/rsc/inc/rsccont.hxx
index cd1deaa595e4..0f4beced3949 100644
--- a/rsc/inc/rsccont.hxx
+++ b/rsc/inc/rsccont.hxx
@@ -117,8 +117,7 @@ class RscCont : public RscContWriteSrc
{
public:
RscCont( Atom nId, sal_uInt32 nTypId,
- RscTop * pSuper = nullptr,
- bool bNoId = true );
+ RscTop * pSuper = nullptr );
ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
RscTypCont * pTC, sal_uInt32, bool bExtra ) override;
};
@@ -127,8 +126,7 @@ class RscContExtraData : public RscContWriteSrc
{
public:
RscContExtraData( Atom nId, sal_uInt32 nTypId,
- RscTop * pSuper = nullptr,
- bool bNoId = true );
+ RscTop * pSuper = nullptr );
ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
RscTypCont * pTC, sal_uInt32, bool bExtra ) override;
};
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 9aadf3d8766b..fc04f9798abc 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -276,12 +276,10 @@ public:
// deletes all resource objects of this file
void Delete( RscFileTab::Index lFileKey );
RscTop * GetRoot() { return pRoot; }
- sal_uInt32 PutSysName( sal_uInt32 nRscTyp, char * pName, sal_uInt32 nConst,
- sal_uInt32 nId, bool bFirst );
+ sal_uInt32 PutSysName( sal_uInt32 nRscTyp, char * pName );
void ClearSysNames();
ERRTYPE WriteRc( WriteRcContext& rContext );
- void WriteSrc( FILE * fOutput, RscFileTab::Index nFileIndex,
- bool bName = true );
+ void WriteSrc( FILE * fOutput, RscFileTab::Index nFileIndex );
void PutTranslatorKey( sal_uInt64 nKey );
void IncFilePos( sal_uLong nOffset ){ nFilePos += nOffset; }
};
diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index 2c253e8736c4..ff19a3b8b100 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -254,12 +254,11 @@ RscTop * RscTypCont::SearchType( Atom nId )
return nullptr;
}
-sal_uInt32 RscTypCont::PutSysName( sal_uInt32 nRscTyp, char * pFileName,
- sal_uInt32 nConst, sal_uInt32 nId, bool bFirst )
+sal_uInt32 RscTypCont::PutSysName( sal_uInt32 nRscTyp, char * pFileName )
{
RscSysEntry *pSysEntry;
RscSysEntry *pFoundEntry = nullptr;
- bool bId1 = false;
+ bool bId1 = false;
for ( size_t i = 0, n = aSysLst.size(); i < n; ++i )
{
@@ -268,8 +267,8 @@ sal_uInt32 RscTypCont::PutSysName( sal_uInt32 nRscTyp, char * pFileName,
bId1 = true;
if( !strcmp( pSysEntry->aFileName.getStr(), pFileName ) )
if( pSysEntry->nRscTyp == nRscTyp &&
- pSysEntry->nTyp == nConst &&
- pSysEntry->nRefId == nId)
+ pSysEntry->nTyp == 0 &&
+ pSysEntry->nRefId == 0)
{
pFoundEntry = pSysEntry;
break;
@@ -277,21 +276,15 @@ sal_uInt32 RscTypCont::PutSysName( sal_uInt32 nRscTyp, char * pFileName,
}
pSysEntry = pFoundEntry;
- if ( !pSysEntry || (bFirst && !bId1) )
+ if ( !pSysEntry )
{
pSysEntry = new RscSysEntry;
pSysEntry->nKey = nUniqueId++;
pSysEntry->nRscTyp = nRscTyp;
- pSysEntry->nTyp = nConst;
- pSysEntry->nRefId = nId;
+ pSysEntry->nTyp = 0;
+ pSysEntry->nRefId = 0;
pSysEntry->aFileName = pFileName;
- if( bFirst && !bId1 )
- {
- pSysEntry->nKey = 1;
- aSysLst.insert( aSysLst.begin(), pSysEntry );
- }
- else
- aSysLst.push_back( pSysEntry );
+ aSysLst.push_back( pSysEntry );
}
return pSysEntry->nKey;
@@ -503,8 +496,7 @@ ERRTYPE RscTypCont::WriteRc( WriteRcContext& rContext )
return aError;
}
-void RscTypCont::WriteSrc( FILE * fOutput, RscFileTab::Index nFileKey,
- bool bName )
+void RscTypCont::WriteSrc( FILE * fOutput, RscFileTab::Index nFileKey )
{
RscEnumerateRef aEnumRef( this, pRoot, fOutput );
@@ -512,49 +504,19 @@ void RscTypCont::WriteSrc( FILE * fOutput, RscFileTab::Index nFileKey,
size_t nItems = SAL_N_ELEMENTS(aUTF8BOM);
bool bSuccess = (nItems == fwrite(aUTF8BOM, 1, nItems, fOutput));
SAL_WARN_IF(!bSuccess, "rsc", "short write");
- if( bName )
+ RscId::SetNames( false );
+ if( nFileKey == RscFileTab::IndexNotFound )
{
- RscFile* pFName;
- WriteInc( fOutput, nFileKey );
-
- if( nFileKey == RscFileTab::IndexNotFound )
- {
- RscFileTab::Index aIndex = aFileTab.FirstIndex();
- while( aIndex != RscFileTab::IndexNotFound )
- {
- pFName = aFileTab.Get( aIndex );
- if( !pFName->IsIncFile() )
- pFName->aDefLst.WriteAll( fOutput );
- aEnumRef.WriteSrc( aIndex );
- aIndex = aFileTab.NextIndex( aIndex );
- };
- }
- else
+ RscFileTab::Index aIndex = aFileTab.FirstIndex();
+ while( aIndex != RscFileTab::IndexNotFound )
{
- pFName = aFileTab.Get( nFileKey );
- if( pFName )
- {
- pFName->aDefLst.WriteAll( fOutput );
- aEnumRef.WriteSrc( nFileKey );
- }
- }
+ aEnumRef.WriteSrc( aIndex );
+ aIndex = aFileTab.NextIndex( aIndex );
+ };
}
else
- {
- RscId::SetNames( false );
- if( nFileKey == RscFileTab::IndexNotFound )
- {
- RscFileTab::Index aIndex = aFileTab.FirstIndex();
- while( aIndex != RscFileTab::IndexNotFound )
- {
- aEnumRef.WriteSrc( aIndex );
- aIndex = aFileTab.NextIndex( aIndex );
- };
- }
- else
- aEnumRef.WriteSrc( nFileKey );
- RscId::SetNames();
- };
+ aEnumRef.WriteSrc( nFileKey );
+ RscId::SetNames();
}
class RscDel
diff --git a/rsc/source/res/rscclass.cxx b/rsc/source/res/rscclass.cxx
index 7529de44601d..c88cf082b664 100644
--- a/rsc/source/res/rscclass.cxx
+++ b/rsc/source/res/rscclass.cxx
@@ -788,8 +788,7 @@ ERRTYPE RscSysDepend::WriteSysDependRc( const RSCINST & rInst, RscWriteRc & rMem
if( aTmpMem.Size() && pTC && (*aTmpMem.GetUTF8( 0 ) != '\0') )
{
nId = pTC->PutSysName( rInst.pClass->GetTypId(),
- aTmpMem.GetUTF8( 0 ),
- 0, 0, false/*bFirst*/ );
+ aTmpMem.GetUTF8( 0 ) );
}
rMem.Put( nId );
aError = aFileName.pClass->WriteRcHeader( aFileName, rMem, pTC,
diff --git a/rsc/source/res/rsccont.cxx b/rsc/source/res/rsccont.cxx
index d2fe2889e386..5ae59a35da14 100644
--- a/rsc/source/res/rsccont.cxx
+++ b/rsc/source/res/rsccont.cxx
@@ -749,8 +749,8 @@ void RscContWriteSrc::WriteSrc( const RSCINST & rInst, FILE * fOutput,
fprintf( fOutput, "}" );
}
-RscCont::RscCont( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper, bool bNoIdent )
- : RscContWriteSrc( nId, nTypeId, pSuper, bNoIdent )
+RscCont::RscCont( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper )
+ : RscContWriteSrc( nId, nTypeId, pSuper, true/*bNoIdent*/ )
{
}
@@ -773,8 +773,8 @@ ERRTYPE RscCont::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
}
RscContExtraData::RscContExtraData( Atom nId, sal_uInt32 nTypeId,
- RscTop * pSuper, bool bNoIdent )
- : RscContWriteSrc( nId, nTypeId, pSuper, bNoIdent )
+ RscTop * pSuper )
+ : RscContWriteSrc( nId, nTypeId, pSuper, true/*bNoIdent*/ )
{
}
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 6d663a220344..fe9107d07204 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -401,7 +401,7 @@ void RscCompiler::EndCompile()
RscFile* pFN = pTC->aFileTab.Get( aIndex );
if( !pFN->IsIncFile() )
{
- pTC->WriteSrc( foutput, RscFileTab::IndexNotFound, false );
+ pTC->WriteSrc( foutput, RscFileTab::IndexNotFound );
break; // ?T 281091MM only one source file
}
}