summaryrefslogtreecommitdiff
path: root/rsc/source/rsc/rsc.cxx
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2013-07-03 02:35:31 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-07-03 20:53:12 +0000
commitbb45bdf359c65c174fd557d615f77ceb46fa685c (patch)
tree1f87575ee1d0471b14f5078a99d3a589d955d56d /rsc/source/rsc/rsc.cxx
parent27a4d5597c0757611d0e2e682d0c05441859cc4e (diff)
module rsc: String, bool and other clean-up.
Change-Id: I2dcde42e6068631a5a643961a764df86dc63dca2 Reviewed-on: https://gerrit.libreoffice.org/4690 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'rsc/source/rsc/rsc.cxx')
-rw-r--r--rsc/source/rsc/rsc.cxx32
1 files changed, 18 insertions, 14 deletions
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index aa7a54a251f0..c88de8d1d853 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -83,7 +83,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
char ** ppStr;
RscPtrPtr aCmdLine;
sal_uInt32 i;
- sal_Bool bOutputSrsIsSet = sal_False;
+ bool bOutputSrsIsSet = false;
Init();
@@ -187,7 +187,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
else if( !rsc_strnicmp( (*ppStr) + 1, "fp=", 3 ) )
{ // define name of .srs file
aOutputSrs = (*ppStr) + 4;
- bOutputSrsIsSet = sal_True;
+ bOutputSrsIsSet = true;
}
else if( !rsc_strnicmp( (*ppStr) + 1, "oil=", 4 ) )
{
@@ -273,6 +273,7 @@ OString RscCmdLine::substitutePaths( const OString& rIn )
aRet.append( "%" );
nIndex = last_match->second.getLength();
}
+
if( rIn.match( "/", nIndex ) )
aRet.append( rIn.copy( nIndex ) );
else
@@ -360,7 +361,7 @@ ERRTYPE RscCompiler::Start()
if( aError.IsError() )
pTC->pEH->Error( ERR_ERROR, NULL, RscId() );
- return( aError );
+ return aError;
}
void RscCompiler::EndCompile()
@@ -389,7 +390,7 @@ void RscCompiler::EndCompile()
pFN = pTC->aFileTab.Get( aIndex );
if( !pFN->IsIncFile() )
{
- pTC->WriteSrc( foutput, NOFILE_INDEX, sal_False );
+ pTC->WriteSrc( foutput, NOFILE_INDEX, false );
break; // ?T 281091MM nur eine Src-Datei
}
};
@@ -424,7 +425,7 @@ ERRTYPE RscCompiler :: IncludeParser( sal_uLong lFileKey )
RscDepend * pDep;
RscFileInst aFileInst( pTC, lFileKey, lFileKey, finput );
- pFName->bScanned = sal_True;
+ pFName->bScanned = true;
::IncludeParser( &aFileInst );
fclose( finput );
@@ -455,19 +456,19 @@ ERRTYPE RscCompiler :: ParseOneFile( sal_uLong lFileKey,
const RscCmdLine::OutputFile* pOutputFile,
const WriteRcContext* pContext )
{
- FILE * finput = NULL;
- ERRTYPE aError;
- RscFile * pFName;
+ FILE * finput = NULL;
+ ERRTYPE aError;
+ RscFile * pFName;
pFName = pTC->aFileTab.Get( lFileKey );
if( !pFName )
aError = ERR_ERROR;
else if( !pFName->bLoaded )
{
- RscDepend * pDep;
+ RscDepend * pDep;
//Include-Dateien vorher lesen
- pFName->bLoaded = sal_True; //Endlos Rekursion vermeiden
+ pFName->bLoaded = true; //Endlos Rekursion vermeiden
for ( size_t i = 0; i < pFName->aDepLst.size() && aError.IsOk(); ++i )
{
@@ -476,7 +477,7 @@ ERRTYPE RscCompiler :: ParseOneFile( sal_uLong lFileKey,
}
if( aError.IsError() )
- pFName->bLoaded = sal_False; //bei Fehler nicht geladenen
+ pFName->bLoaded = false; //bei Fehler nicht geladenen
else
{
OUString aTmpPath;
@@ -518,13 +519,14 @@ ERRTYPE RscCompiler :: ParseOneFile( sal_uLong lFileKey,
};
};
- return( aError );
+ return aError;
}
namespace
{
using namespace ::osl;
class RscIoError { };
+
static inline OUString lcl_getAbsoluteUrl(const OUString& i_sBaseUrl, const OString& i_sPath)
{
OUString sRelUrl, sAbsUrl;
@@ -534,6 +536,7 @@ namespace
throw RscIoError();
return sAbsUrl;
};
+
static inline OString lcl_getSystemPath(const OUString& i_sUrl)
{
OUString sSys;
@@ -542,6 +545,7 @@ namespace
OSL_TRACE("temporary file: %s", OUStringToOString(sSys, RTL_TEXTENCODING_UTF8).getStr());
return OUStringToOString(sSys, RTL_TEXTENCODING_MS_1252);
};
+
static inline OString lcl_getTempFile(OUString& sTempDirUrl)
{
// get a temp file name for the rc file
@@ -575,7 +579,7 @@ ERRTYPE RscCompiler::Link()
{
pTC->Delete( aIndex );
aIndex = pTC->aFileTab.GetIndexOf( pFName );
- pFName->bLoaded = sal_False;
+ pFName->bLoaded = false;
}
}
@@ -732,7 +736,7 @@ ERRTYPE RscCompiler::Link()
};
}
- return( aError );
+ return aError;
}
void RscCompiler::Append( const OString& rOutputSrs,