summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-12-07 10:49:55 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-12-07 11:33:12 +0000
commit6c335f5754ec1aee70cdba2d332e9cece17a7565 (patch)
tree01acd92ce6411e99e6498b11b467b41c47cd6c7f /l10ntools
parent47690422e42f5fce29b331218a2d05966c13946d (diff)
convert some archaic l10ntools code
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/inc/export.hxx12
-rw-r--r--l10ntools/inc/helpmerge.hxx3
-rw-r--r--l10ntools/inc/lngmerge.hxx21
-rw-r--r--l10ntools/source/cfgmerge.cxx9
-rw-r--r--l10ntools/source/export.cxx95
-rw-r--r--l10ntools/source/export2.cxx42
-rw-r--r--l10ntools/source/helpmerge.cxx9
-rw-r--r--l10ntools/source/lngex.cxx5
-rw-r--r--l10ntools/source/lngmerge.cxx51
-rw-r--r--l10ntools/source/merge.cxx2
-rw-r--r--l10ntools/source/xrmmerge.cxx6
11 files changed, 143 insertions, 112 deletions
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index ae6c21ed8657..a4d2f8002da7 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -148,7 +148,7 @@ class ResData
{
public:
~ResData();
- sal_Bool SetId( const ByteString &rId, sal_uInt16 nLevel );
+ sal_Bool SetId(const rtl::OString &rId, sal_uInt16 nLevel);
sal_uInt16 nWidth;
sal_uInt16 nChildIndex;
@@ -318,8 +318,8 @@ private:
public:
ParserQueue* pParseQueue; // public ?
- static ByteString sLanguages; // public ?
- static ByteString sForcedLanguages; // public ?
+ static rtl::OString sLanguages; // public ?
+ static rtl::OString sForcedLanguages; // public ?
static bool skipProject( ByteString sPrj ) ;
@@ -352,8 +352,10 @@ public:
static ByteString GetNativeFile( ByteString sSource );
static DirEntry GetTempFile();
- static void DumpExportList( ByteString& sListName , ExportList& aList );
- static ByteString DumpMap( ByteString& sMapName , ByteStringHashMap& aMap );
+ static void DumpExportList(const rtl::OString& rListName,
+ ExportList& aList);
+ static ByteString DumpMap(const rtl::OString& rMapName,
+ ByteStringHashMap& aMap);
private:
static std::vector<ByteString> aLanguages;
diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index a160b158091b..aeb61ae3e4af 100644
--- a/l10ntools/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
@@ -64,7 +64,8 @@ public:
/// Method merges the String from the SDFfile into XMLfile. Both Strings must
/// point to existing files.
- bool Merge( const ByteString &rSDFFile_in, const ByteString &rDestinationFile_in , ByteString& sLanguage , MergeDataFile& aMergeDataFile );
+ bool Merge( const ByteString &rSDFFile_in, const ByteString &rDestinationFile_in ,
+ const rtl::OString& sLanguage , MergeDataFile& aMergeDataFile );
bool Merge( const ByteString &rSDFFile, const ByteString &rPathX , const ByteString &rPathY , bool bISO
, const std::vector<ByteString>& aLanguages , MergeDataFile& aMergeDataFile , bool bCreateDir );
diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx
index e658817c3e16..285f12953f1e 100644
--- a/l10ntools/inc/lngmerge.hxx
+++ b/l10ntools/inc/lngmerge.hxx
@@ -47,23 +47,28 @@ class LngParser
private:
sal_uInt16 nError;
LngLineList *pLines;
- ByteString sSource;
+ rtl::OString sSource;
sal_Bool bDBIsUTF8;
sal_Bool bULF;
bool bQuiet;
std::vector<ByteString> aLanguages;
bool isNextGroup( ByteString &sGroup_out , ByteString &sLine_in);
- void ReadLine( const ByteString &sLine_in , ByteStringHashMap &rText_inout );
- void WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_inout ,
- const ByteString &rPrj ,
- const ByteString &rRoot , const ByteString &sActFileName , const ByteString &sID );
+ void ReadLine(const rtl::OString &rLine_in,
+ ByteStringHashMap &rText_inout);
+ void WriteSDF(SvFileStream &aSDFStream, ByteStringHashMap &rText_inout,
+ const rtl::OString &rPrj, const rtl::OString &rRoot,
+ const rtl::OString &rActFileName, const rtl::OString &rID);
public:
- LngParser( const ByteString &rLngFile, sal_Bool bUTF8, sal_Bool bULFFormat );
+ LngParser(const rtl::OString &rLngFile, sal_Bool bUTF8,
+ sal_Bool bULFFormat);
~LngParser();
- sal_Bool CreateSDF( const ByteString &rSDFFile, const ByteString &rPrj, const ByteString &rRoot );
- sal_Bool Merge( const ByteString &rSDFFile, const ByteString &rDestinationFile , const ByteString &rPrj );
+ sal_Bool CreateSDF(const rtl::OString &rSDFFile,
+ const rtl::OString &rPrj,
+ const rtl::OString &rRoot);
+ sal_Bool Merge(const rtl::OString &rSDFFile,
+ const rtl::OString &rDestinationFile);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index f44c1a8cf00d..a6fdb98611e7 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -707,15 +707,18 @@ CfgMerge::CfgMerge(
sFilename( rFilename ),
bEnglish( sal_False )
{
- if ( rMergeSource.Len()){
+ if (rMergeSource.Len())
+ {
pMergeDataFile = new MergeDataFile(
rMergeSource, sInputFileName, bErrorLog, true );
- if( Export::sLanguages.EqualsIgnoreCaseAscii("ALL") ){
+ if (Export::sLanguages.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("ALL")))
+ {
Export::SetLanguages( pMergeDataFile->GetLanguages() );
aLanguages = pMergeDataFile->GetLanguages();
}
else aLanguages = Export::GetLanguages();
- }else
+ }
+ else
aLanguages = Export::GetLanguages();
}
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 51177a669e75..bd1fbfb55509 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -64,13 +64,13 @@ sal_Bool bErrorLog;
sal_Bool bBreakWhenHelpText;
sal_Bool bUnmerge;
sal_Bool bUTF8;
-ByteString sPrj;
-ByteString sPrjRoot;
-ByteString sActFileName;
-ByteString sOutputFile;
-ByteString sMergeSrc;
-ByteString sTempFile;
-ByteString sFile;
+rtl::OString sPrj;
+rtl::OString sPrjRoot;
+rtl::OString sActFileName;
+rtl::OString sOutputFile;
+rtl::OString sMergeSrc;
+rtl::OString sTempFile;
+rtl::OString sFile;
MergeDataFile *pMergeDataFile;
FILE *pTempFile;
@@ -145,35 +145,36 @@ extern char *GetOutputFile( int argc, char* argv[])
}
break;
case STATE_OUTPUT: {
- sOutputFile = ByteString( argv[ i ]); // the dest. file
+ sOutputFile = rtl::OString(argv[i]); // the dest. file
}
break;
case STATE_PRJ: {
- sPrj = ByteString( argv[ i ]);
+ sPrj = rtl::OString(argv[i]);
}
break;
case STATE_ROOT: {
- sPrjRoot = ByteString( argv[ i ]); // path to project root
+ sPrjRoot = rtl::OString(argv[i]); // path to project root
}
break;
case STATE_MERGESRC: {
- sMergeSrc = ByteString( argv[ i ]);
+ sMergeSrc = rtl::OString(argv[i]);
bMergeMode = sal_True; // activate merge mode, cause merge database found
}
break;
case STATE_LANGUAGES: {
- Export::sLanguages = ByteString( argv[ i ]);
+ Export::sLanguages = rtl::OString(argv[i]);
}
break;
}
}
}
- if( bUnmerge ) sMergeSrc = ByteString();
+ if( bUnmerge )
+ sMergeSrc = rtl::OString();
if ( bInput ) {
// command line is valid
bEnableExport = sal_True;
- char *pReturn = new char[ sOutputFile.Len() + 1 ];
- strcpy( pReturn, sOutputFile.GetBuffer()); // #100211# - checked
+ char *pReturn = new char[ sOutputFile.getLength() + 1 ];
+ strcpy( pReturn, sOutputFile.getStr()); // #100211# - checked
return pReturn;
}
@@ -185,16 +186,21 @@ int InitExport( char *pOutput , char* pFilename )
/*****************************************************************************/
{
// instanciate Export
- ByteString sOutput( pOutput );
- ByteString sFilename( pFilename );
+ rtl::OString sOutput( pOutput );
+ rtl::OString sFilename( pFilename );
- if ( bMergeMode && !bUnmerge ) {
+ if ( bMergeMode && !bUnmerge )
+ {
// merge mode enabled, so read database
- pExport = new Export(sOutput, bEnableExport, sPrj, sPrjRoot, sMergeSrc , sFilename );
+ pExport = new Export(sOutput, bEnableExport, sPrj, sPrjRoot,
+ sMergeSrc , sFilename );
}
else
+ {
// no merge mode, only export
- pExport = new Export( sOutput, bEnableExport, sPrj, sPrjRoot , sFilename );
+ pExport = new Export(sOutput, bEnableExport, sPrj, sPrjRoot,
+ sFilename );
+ }
return 1;
}
@@ -215,17 +221,20 @@ extern FILE *GetNextFile()
/*****************************************************************************/
{
// look for next valid filename in input file list
- if ( sTempFile.Len()) {
+ if ( sTempFile.getLength())
+ {
fclose( pTempFile );
- String sTemp( sTempFile, RTL_TEXTENCODING_ASCII_US );
+ String sTemp(rtl::OStringToOUString(sTempFile,
+ RTL_TEXTENCODING_ASCII_US));
DirEntry aTemp( sTemp );
aTemp.Kill();
}
- while ( !aInputFileList.empty() ) {
+ while ( !aInputFileList.empty() )
+ {
ByteString sFileName( *(aInputFileList[ 0 ]) );
- ByteString sOrigFile( sFileName );
+ rtl::OString sOrigFile( sFileName );
sFileName = Export::GetNativeFile( sFileName );
delete aInputFileList[ 0 ];
@@ -233,7 +242,7 @@ extern FILE *GetNextFile()
if ( sFileName == "" ) {
fprintf( stderr, "ERROR: Could not precompile File %s\n",
- sOrigFile.GetBuffer());
+ sOrigFile.getStr());
return GetNextFile();
}
@@ -250,7 +259,8 @@ extern FILE *GetNextFile()
// this is a valid file which can be opened, so
// create path to project root
- DirEntry aEntry( String( sOrigFile, RTL_TEXTENCODING_ASCII_US ));
+ DirEntry aEntry(rtl::OStringToOUString(sOrigFile,
+ RTL_TEXTENCODING_ASCII_US));
aEntry.ToAbs();
rtl::OString sFullEntry(rtl::OUStringToOString(aEntry.GetFull(),
RTL_TEXTENCODING_ASCII_US));
@@ -264,7 +274,7 @@ extern FILE *GetNextFile()
sActFileName = sFullEntry.copy(sPrjEntry.getLength() + 1);
- sActFileName.SearchAndReplaceAll( "/", "\\" );
+ sActFileName = sActFileName.replace('/', '\\');
sFile = sActFileName;
if ( pExport ) {
@@ -329,12 +339,12 @@ void ResData::Dump(){
printf("sPForm = %s , sResTyp = %s , sId = %s , sGId = %s , sHelpId = %s\n",sPForm.GetBuffer()
,sResTyp.GetBuffer(),sId.GetBuffer(),sGId.GetBuffer(),sHelpId.GetBuffer());
- ByteString a("*pStringList");
- ByteString b("*pUIEntries");
- ByteString c("*pFilterList");
- ByteString d("*pItemList");
- ByteString e("*pPairedList");
- ByteString f("sText");
+ rtl::OString a("*pStringList");
+ rtl::OString b("*pUIEntries");
+ rtl::OString c("*pFilterList");
+ rtl::OString d("*pItemList");
+ rtl::OString e("*pPairedList");
+ rtl::OString f("sText");
Export::DumpMap( f , sText );
@@ -347,7 +357,7 @@ void ResData::Dump(){
}
/*****************************************************************************/
-sal_Bool ResData::SetId( const ByteString &rId, sal_uInt16 nLevel )
+sal_Bool ResData::SetId( const rtl::OString& rId, sal_uInt16 nLevel )
/*****************************************************************************/
{
if ( nLevel > nIdLevel )
@@ -380,10 +390,9 @@ sal_Bool ResData::SetId( const ByteString &rId, sal_uInt16 nLevel )
// class Export
//
-/*****************************************************************************/
-Export::Export( const ByteString &rOutput, sal_Bool bWrite,
- const ByteString &rPrj, const ByteString &rPrjRoot , const ByteString& rFile )
-/*****************************************************************************/
+Export::Export(const ByteString &rOutput, sal_Bool bWrite,
+ const ByteString &rPrj, const ByteString &rPrjRoot,
+ const ByteString& rFile)
:
pWordTransformer( NULL ),
bDefine( sal_False ),
@@ -644,8 +653,8 @@ int Export::Execute( int nToken, const char * pToken )
sToken = comphelper::string::remove(sToken, '{');
while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {};
sToken = comphelper::string::stripEnd(sToken, ' ');
- ByteString sT = getToken(sToken, 0, ' ');
- pResData->sResTyp = sT.ToLowerAscii();
+ rtl::OString sTLower = getToken(sToken, 0, ' ').toAsciiLowerCase();
+ pResData->sResTyp = sTLower;
ByteString sId( sToken.Copy( pResData->sResTyp.Len() + 1 ));
ByteString sCondition;
if ( sId.Search( "#" ) != STRING_NOTFOUND )
@@ -1316,11 +1325,9 @@ sal_Bool Export::WriteExportList( ResData *pResData, ExportList *pExportList,
ByteString sTimeStamp( Export::GetTimeStamp());
ByteString sCur;
- for ( size_t i = 0; pExportList != NULL && i < pExportList->size(); i++ ) {
+ for ( size_t i = 0; pExportList != NULL && i < pExportList->size(); i++ )
+ {
ExportListEntry *pEntry = (*pExportList)[ i ];
- // mandatory for export: german and eng. and/or enus
- // ByteString a("Export::WriteExportList::pEntry");
- // Export::DumpMap( a, *pEntry );
ByteString sLID(rtl::OString::valueOf(static_cast<sal_Int64>(i + 1)));
for (unsigned int n = 0; n < aLanguages.size(); ++n)
diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx
index fec515f2b888..873f39c9e469 100644
--- a/l10ntools/source/export2.cxx
+++ b/l10ntools/source/export2.cxx
@@ -89,12 +89,13 @@ ResData::~ResData()
//
/*****************************************************************************/
-ByteString Export::sLanguages;
-ByteString Export::sForcedLanguages;
+rtl::OString Export::sLanguages;
+rtl::OString Export::sForcedLanguages;
/*****************************************************************************/
-void Export::DumpExportList( ByteString& sListName , ExportList& aList ){
- printf( "%s\n", sListName.GetBuffer() );
+void Export::DumpExportList(const rtl::OString& rListName, ExportList& aList)
+{
+ printf( "%s\n", rListName.getStr() );
ByteString l("");
ExportListEntry* aEntry;
for( unsigned int x = 0; x < aList.size() ; x++ ){
@@ -103,12 +104,15 @@ void Export::DumpExportList( ByteString& sListName , ExportList& aList ){
}
printf("\n");
}
-ByteString Export::DumpMap( ByteString& sMapName , ByteStringHashMap& aMap ){
+
+ByteString Export::DumpMap(const rtl::OString& rMapName,
+ ByteStringHashMap& aMap)
+{
ByteStringHashMap::const_iterator idbg;
ByteString sReturn;
- if( sMapName.Len() )
- printf("MapName %s\n", sMapName.GetBuffer());
+ if( rMapName.getLength() )
+ printf("MapName %s\n", rMapName.getStr());
if( aMap.size() < 1 ) return ByteString();
for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg ){
ByteString a( idbg->first );
@@ -119,6 +123,7 @@ ByteString Export::DumpMap( ByteString& sMapName , ByteStringHashMap& aMap ){
printf("\n");
return sReturn;
}
+
/*****************************************************************************/
void Export::SetLanguages( std::vector<ByteString> val ){
/*****************************************************************************/
@@ -347,17 +352,24 @@ bool Export::isInitialized = false;
/*****************************************************************************/
void Export::InitLanguages( bool bMergeMode ){
/*****************************************************************************/
- if( !isInitialized ){
+ if( !isInitialized )
+ {
ByteString sTmp;
ByteStringBoolHashMap aEnvLangs;
- for ( sal_uInt16 x = 0; x < sLanguages.GetTokenCount( ',' ); x++ ){
- sTmp = getToken(getToken(sLanguages, x, ','), 0, '=');
+
+ sal_Int32 nIndex = 0;
+ do
+ {
+ rtl::OString aToken = sLanguages.getToken(0, ',', nIndex);
+ sTmp = getToken(aToken, 0, '=');
sTmp = comphelper::string::strip(sTmp, ' ');
if( bMergeMode && !isAllowed( sTmp ) ){}
else if( !( (sTmp.GetChar(0)=='x' || sTmp.GetChar(0)=='X') && sTmp.GetChar(1)=='-' ) ){
aLanguages.push_back( sTmp );
}
}
+ while ( nIndex >= 0 );
+
InitForcedLanguages( bMergeMode );
isInitialized = true;
}
@@ -367,13 +379,19 @@ void Export::InitForcedLanguages( bool bMergeMode ){
/*****************************************************************************/
ByteString sTmp;
ByteStringBoolHashMap aEnvLangs;
- for ( sal_uInt16 x = 0; x < sForcedLanguages.GetTokenCount( ',' ); x++ ){
- sTmp = getToken(getToken(sForcedLanguages, x, ','), 0, '=');
+
+ sal_Int32 nIndex = 0;
+ do
+ {
+ rtl::OString aToken = sForcedLanguages.getToken(0, ',', nIndex);
+
+ sTmp = getToken(aToken, 0, '=');
sTmp = comphelper::string::strip(sTmp, ' ');
if( bMergeMode && isAllowed( sTmp ) ){}
else if( !( (sTmp.GetChar(0)=='x' || sTmp.GetChar(0)=='X') && sTmp.GetChar(1)=='-' ) )
aForcedLanguages.push_back( sTmp );
}
+ while ( nIndex >= 0 );
}
/*****************************************************************************/
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index 9fae8083b2c5..8447c9c59480 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -231,7 +231,7 @@ ByteString HelpParser::makeAbsolutePath( const ByteString& sHelpFile , const Byt
}
bool HelpParser::Merge( const ByteString &rSDFFile, const ByteString &rDestinationFile ,
- ByteString& sLanguage , MergeDataFile& aMergeDataFile )
+ const rtl::OString& rLanguage , MergeDataFile& aMergeDataFile )
{
(void) rSDFFile;
@@ -261,7 +261,7 @@ bool HelpParser::Merge( const ByteString &rSDFFile, const ByteString &rDestinati
XMLFile* xmlfile = ( aParser.Execute( aFile.GetFull() , sOUHelpFile, new XMLFile( '0' ) ) );
printf("Dest file %s\n",rDestinationFile.GetBuffer());
- hasNoError = MergeSingleFile( xmlfile , aMergeDataFile , sLanguage , rDestinationFile );
+ hasNoError = MergeSingleFile( xmlfile , aMergeDataFile , rLanguage , rDestinationFile );
delete xmlfile;
if( !sUsedTempFile.EqualsIgnoreCaseAscii( "" ) ){
DirEntry aTempFile( sUsedTempFile );
@@ -281,16 +281,15 @@ void HelpParser::parse_languages( std::vector<ByteString>& aLanguages , MergeDat
std::vector<ByteString> aTmp;
const ByteString ENUS ("en-US");
- static const ByteString ALL( "ALL" );
Export::InitLanguages( false );
- if( Export::sLanguages.EqualsIgnoreCaseAscii( ALL ) )
+ if (Export::sLanguages.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("ALL")))
{
aLanguages = aMergeDataFile.GetLanguages();
aLanguages.push_back( ENUS );
- if( !Export::sForcedLanguages.Equals("") )
+ if( !Export::sForcedLanguages.isEmpty() )
{
std::vector<ByteString> aFL = Export::GetForcedLanguages();
std::copy( aFL.begin() ,
diff --git a/l10ntools/source/lngex.cxx b/l10ntools/source/lngex.cxx
index 9c568816d6c5..7ab8e52f6667 100644
--- a/l10ntools/source/lngex.cxx
+++ b/l10ntools/source/lngex.cxx
@@ -167,7 +167,8 @@ int _cdecl main( int argc, char *argv[] )
#endif
/*****************************************************************************/
{
- if ( !ParseCommandLine( argc, argv )) {
+ if ( !ParseCommandLine( argc, argv ))
+ {
Help();
return 1;
}
@@ -175,7 +176,7 @@ int _cdecl main( int argc, char *argv[] )
if ( sOutputFile.Len()) {
LngParser aParser( sInputFile, bUTF8, bULF );
if ( bMergeMode )
- aParser.Merge( sMergeSrc, sOutputFile , sPrj );
+ aParser.Merge(sMergeSrc, sOutputFile);
else
aParser.CreateSDF( sOutputFile, sPrj, sPrjRoot );
}
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index f07e13efa67b..cb59f07ee3e6 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -38,15 +38,13 @@ using comphelper::string::getToken;
//
// class LngParser
//
-/*****************************************************************************/
-LngParser::LngParser( const ByteString &rLngFile, sal_Bool bUTF8, sal_Bool bULFFormat )
-/*****************************************************************************/
- :
- nError( LNG_OK ),
- pLines( NULL ),
- sSource( rLngFile ),
- bDBIsUTF8( bUTF8 ),
- bULF( bULFFormat )
+LngParser::LngParser(const rtl::OString &rLngFile, sal_Bool bUTF8,
+ sal_Bool bULFFormat)
+ : nError( LNG_OK )
+ , pLines( NULL )
+ , sSource( rLngFile )
+ , bDBIsUTF8( bUTF8 )
+ , bULF( bULFFormat )
{
pLines = new LngLineList();
DirEntry aEntry( String( sSource, RTL_TEXTENCODING_ASCII_US ));
@@ -78,9 +76,7 @@ LngParser::LngParser( const ByteString &rLngFile, sal_Bool bUTF8, sal_Bool bULFF
nError = LNG_FILE_NOTFOUND;
}
-/*****************************************************************************/
LngParser::~LngParser()
-/*****************************************************************************/
{
for ( size_t i = 0, n = pLines->size(); i < n; i++ )
delete (*pLines)[ i ];
@@ -88,11 +84,8 @@ LngParser::~LngParser()
delete pLines;
}
-/*****************************************************************************/
-sal_Bool LngParser::CreateSDF(
- const ByteString &rSDFFile, const ByteString &rPrj,
- const ByteString &rRoot )
-/*****************************************************************************/
+sal_Bool LngParser::CreateSDF(const rtl::OString &rSDFFile,
+ const rtl::OString &rPrj, const rtl::OString &rRoot)
{
Export::InitLanguages( false );
@@ -141,9 +134,10 @@ sal_Bool LngParser::CreateSDF(
return true;
}
-void LngParser::WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_inout ,
- const ByteString &rPrj , const ByteString &rRoot ,
- const ByteString &sActFileName , const ByteString &sID )
+void LngParser::WriteSDF(SvFileStream &aSDFStream,
+ ByteStringHashMap &rText_inout, const rtl::OString &rPrj,
+ const rtl::OString &rRoot, const rtl::OString &rActFileName,
+ const rtl::OString &rID)
{
sal_Bool bExport = true;
@@ -157,11 +151,11 @@ void LngParser::WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_in
sAct = rText_inout[ ByteString("en-US") ];
ByteString sOutput( rPrj ); sOutput += "\t";
- if ( rRoot.Len())
- sOutput += sActFileName;
+ if (rRoot.getLength())
+ sOutput += rActFileName;
sOutput += "\t0\t";
sOutput += "LngText\t";
- sOutput += sID; sOutput += "\t\t\t\t0\t";
+ sOutput += rID; sOutput += "\t\t\t\t0\t";
sOutput += sCur; sOutput += "\t";
sOutput += sAct; sOutput += "\t\t\t\t";
sOutput += sTimeStamp;
@@ -185,22 +179,21 @@ bool LngParser::isNextGroup( ByteString &sGroup_out , ByteString &sLine_in )
return false;
}
-void LngParser::ReadLine( const ByteString &sLine_in , ByteStringHashMap &rText_inout)
+void LngParser::ReadLine(const rtl::OString &rLine_in,
+ ByteStringHashMap &rText_inout)
{
- rtl::OString sLang = getToken(sLine_in, 0, '=');
+ rtl::OString sLang = getToken(rLine_in, 0, '=');
sLang = comphelper::string::stripStart(sLang, ' ');
sLang = comphelper::string::stripEnd(sLang, ' ');
- rtl::OString sText = getToken(getToken(sLine_in, 1, '\"'), 0, '\"');
+ rtl::OString sText = getToken(getToken(rLine_in, 1, '\"'), 0, '\"');
if (!sLang.isEmpty())
rText_inout[ sLang ] = sText;
}
-/*****************************************************************************/
sal_Bool LngParser::Merge(
- const ByteString &rSDFFile, const ByteString &rDestinationFile , const ByteString& rPrj )
-/*****************************************************************************/
+ const rtl::OString &rSDFFile,
+ const rtl::OString &rDestinationFile)
{
- (void) rPrj;
Export::InitLanguages( true );
SvFileStream aDestination(
String( rDestinationFile, RTL_TEXTENCODING_ASCII_US ),
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index f96b48339194..5141b9bdd259 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -56,7 +56,7 @@ ByteString PFormEntrys::Dump()
{
ByteString sRet( "PFormEntrys\n" );
ByteString a("sText");
- if(sText.size())
+ if (sText.size())
Export::DumpMap(a , sText);
return sRet;
}
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index cc7d54003b63..698027de7ed1 100644
--- a/l10ntools/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -638,11 +638,13 @@ XRMResMerge::XRMResMerge(
if ( rMergeSource.Len())
pMergeDataFile = new MergeDataFile(
rMergeSource, sInputFileName, bErrorLog);
- if( Export::sLanguages.EqualsIgnoreCaseAscii("ALL") ){
+ if( Export::sLanguages.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("ALL")))
+ {
Export::SetLanguages( pMergeDataFile->GetLanguages() );
aLanguages = pMergeDataFile->GetLanguages();
}
- else aLanguages = Export::GetLanguages();
+ else
+ aLanguages = Export::GetLanguages();
}
/*****************************************************************************/