diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-27 20:37:42 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-28 09:55:03 +0000 |
commit | 6f33482f8f4329b6c9874397bdb67c1b958b69c2 (patch) | |
tree | ba19bc4bff6ddbd87354f90a61615cf5f4892c5a /l10ntools | |
parent | c95a10ca2079cdc33d09189aef0a8788eab274ff (diff) |
ByteString->rtl::OUStringToOString
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/inc/gsicheck.hxx | 2 | ||||
-rw-r--r-- | l10ntools/inc/xmlparse.hxx | 2 | ||||
-rw-r--r-- | l10ntools/source/cfgmerge.cxx | 10 | ||||
-rw-r--r-- | l10ntools/source/export2.cxx | 20 | ||||
-rw-r--r-- | l10ntools/source/gsicheck.cxx | 17 | ||||
-rw-r--r-- | l10ntools/source/helpmerge.cxx | 50 | ||||
-rw-r--r-- | l10ntools/source/lngmerge.cxx | 9 | ||||
-rw-r--r-- | l10ntools/source/localize.cxx | 29 | ||||
-rw-r--r-- | l10ntools/source/tagtest.cxx | 8 | ||||
-rw-r--r-- | l10ntools/source/xmlparse.cxx | 173 | ||||
-rw-r--r-- | l10ntools/source/xrmmerge.cxx | 16 |
11 files changed, 188 insertions, 148 deletions
diff --git a/l10ntools/inc/gsicheck.hxx b/l10ntools/inc/gsicheck.hxx index 971f85016fbd..da78d3994132 100644 --- a/l10ntools/inc/gsicheck.hxx +++ b/l10ntools/inc/gsicheck.hxx @@ -70,7 +70,7 @@ public: ByteString const GetQuickHelpText() const { return aQuickHelpText; } ByteString const GetTitle() const { return aTitle; } - void SetUText( String &aNew ) { aText = ByteString( aNew, RTL_TEXTENCODING_UTF8 ); ReassembleLine(); } + void SetUText( String &aNew ) { aText = rtl::OUStringToOString(aNew, RTL_TEXTENCODING_UTF8); ReassembleLine(); } void SetText( ByteString &aNew ) { aText = aNew; ReassembleLine(); } void SetQuickHelpText( ByteString &aNew ) { aQuickHelpText = aNew; ReassembleLine(); } void SetTitle( ByteString &aNew ) { aTitle = aNew; ReassembleLine(); } diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx index 75db02e77bfb..3e9906665226 100644 --- a/l10ntools/inc/xmlparse.hxx +++ b/l10ntools/inc/xmlparse.hxx @@ -245,7 +245,7 @@ protected: String sFileName; String sFullName; - const ByteString ID,OLDREF,XML_LANG; + const rtl::OString ID, OLDREF, XML_LANG; TagMap nodes_localize; XMLHashMap* XMLStrings; diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 9d513af9d878..f44c1a8cf00d 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -216,8 +216,8 @@ extern FILE *GetCfgFile() DirEntry aSourceFile( String( sInputFileName , RTL_TEXTENCODING_ASCII_US ) ); aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); String sTempFile = aTempFile.GetFull(); - Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); - pFile = fopen( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ).GetBuffer(), "r" ); + Export::RemoveUTF8ByteOrderMarkerFromFile( rtl::OUStringToOString(sTempFile , RTL_TEXTENCODING_ASCII_US) ); + pFile = fopen(rtl::OUStringToOString(sTempFile , RTL_TEXTENCODING_ASCII_US).getStr(), "r"); sUsedTempFile = sTempFile; }else{ // able to open file? @@ -234,15 +234,15 @@ extern FILE *GetCfgFile() // create path to project root DirEntry aEntry( String( sInputFileName, RTL_TEXTENCODING_ASCII_US )); aEntry.ToAbs(); - sFullEntry= ByteString( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); + sFullEntry = rtl::OUStringToOString(aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US); aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); aEntry += DirEntry( sPrjRoot ); - ByteString sPrjEntry( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); + rtl::OString sPrjEntry(rtl::OUStringToOString(aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US)); // create file name, beginnig with project root // (e.g.: source\ui\src\menue.src) // printf("sFullEntry = %s\n",sFullEntry.GetBuffer()); - sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); + sActFileName = sFullEntry.Copy( sPrjEntry.getLength() + 1 ); // printf("sActFileName = %s\n",sActFileName.GetBuffer()); sActFileName.SearchAndReplaceAll( "/", "\\" ); diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx index 37c26b67dc3f..2acbede53c4a 100644 --- a/l10ntools/source/export2.cxx +++ b/l10ntools/source/export2.cxx @@ -228,8 +228,8 @@ void Export::RemoveUTF8ByteOrderMarkerFromFile( const ByteString &rFilename ) if( hasUTF8ByteOrderMarker( sLine ) ) { DirEntry aTempFile = Export::GetTempFile(); - ByteString sTempFile = ByteString( aTempFile.GetFull() , RTL_TEXTENCODING_ASCII_US ); - SvFileStream aNewFile( String( sTempFile , RTL_TEXTENCODING_ASCII_US ) , STREAM_WRITE ); + rtl::OString sTempFile = rtl::OUStringToOString(aTempFile.GetFull() , RTL_TEXTENCODING_ASCII_US); + SvFileStream aNewFile(rtl::OStringToOUString(sTempFile , RTL_TEXTENCODING_ASCII_US) , STREAM_WRITE); // Remove header RemoveUTF8ByteOrderMarker( sLine ); aNewFile.WriteLine( sLine ); @@ -431,7 +431,7 @@ ByteString Export::GetNativeFile( ByteString sSource ) /*****************************************************************************/ { DirEntry aTemp( GetTempFile()); - ByteString sReturn( aTemp.GetFull(), RTL_TEXTENCODING_ASCII_US ); + rtl::OString sReturn(rtl::OUStringToOString(aTemp.GetFull(), RTL_TEXTENCODING_ASCII_US)); for ( sal_uInt16 i = 0; i < 10; i++ ) if ( ConvertLineEnds( sSource, sReturn )) @@ -509,20 +509,24 @@ DirEntry Export::GetTempFile() INetURLObject::DecodeMechanism eMechanism = INetURLObject::DECODE_TO_IURI; String sDecodedStr = INetURLObject::decode( strTmp , '%' , eMechanism ); - ByteString sTmp( sDecodedStr , RTL_TEXTENCODING_UTF8 ); + rtl::OString sTmp(rtl::OUStringToOString(sDecodedStr , RTL_TEXTENCODING_UTF8)); #if defined(WNT) - sTmp.SearchAndReplace("file:///",""); - sTmp.SearchAndReplaceAll('/','\\'); + sTmp = comphelper::string::replace(sTmp, + rtl::OString(RTL_CONSTASCII_STRINGPARAM("file:///")), + rtl::OString()); + sTmp = sTmp.replace('/', '\\'); #else // Set file permission to 644 - const sal_uInt64 nPerm = osl_File_Attribute_OwnRead | osl_File_Attribute_OwnWrite | + const sal_uInt64 nPerm = osl_File_Attribute_OwnRead | osl_File_Attribute_OwnWrite | osl_File_Attribute_GrpRead | osl_File_Attribute_OthRead ; nRC = osl::File::setAttributes( *sTempFilename , nPerm ); if( nRC ) printf(" osl::File::setAttributes RC = %d",nRC); - sTmp.SearchAndReplace("file://",""); + sTmp = comphelper::string::replace(sTmp, + rtl::OString(RTL_CONSTASCII_STRINGPARAM("file://")), + rtl::OString()); #endif DirEntry aDirEntry( sTmp ); delete sTempFilename; diff --git a/l10ntools/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx index 17b3d52ff940..56708290d9ad 100644 --- a/l10ntools/source/gsicheck.cxx +++ b/l10ntools/source/gsicheck.cxx @@ -124,7 +124,8 @@ void LazySvFileStream::LazyOpen() Open( aFileName, eOpenMode ); if ( !IsOpen()) { - fprintf( stderr, "\nERROR: Could not open Output-File %s!\n\n", ByteString( aFileName, RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); + fprintf( stderr, "\nERROR: Could not open Output-File %s!\n\n", + rtl::OUStringToOString(aFileName, RTL_TEXTENCODING_ASCII_US).getStr() ); exit ( 4 ); } bOpened = sal_True; @@ -403,8 +404,8 @@ void GSIBlock::PrintList( ParserMessageList *pList, ByteString aPrefix, sal_Bool GSIBlock::IsUTF8( const ByteString &aTestee, sal_Bool bFixTags, sal_uInt16 &nErrorPos, ByteString &aErrorMsg, sal_Bool &bHasBeenFixed, ByteString &aFixed ) const /*****************************************************************************/ { - String aUTF8Tester( aTestee, RTL_TEXTENCODING_UTF8 ); - if ( STRING_MATCH != (nErrorPos = ByteString( aUTF8Tester, RTL_TEXTENCODING_UTF8 ).Match( aTestee )) ) + String aUTF8Tester(rtl::OStringToOUString(aTestee, RTL_TEXTENCODING_UTF8)); + if ( STRING_MATCH != (nErrorPos = ByteString(rtl::OUStringToOString(aUTF8Tester, RTL_TEXTENCODING_UTF8)).Match( aTestee )) ) { aUTF8Tester = String( aTestee.GetBuffer(), nErrorPos, RTL_TEXTENCODING_UTF8 ); nErrorPos = aUTF8Tester.Len(); @@ -446,23 +447,23 @@ sal_Bool GSIBlock::IsUTF8( const ByteString &aTestee, sal_Bool bFixTags, sal_uIn } } - ByteString aDelimiter( (String)String( sal_Unicode(0x2016) ), RTL_TEXTENCODING_UTF8 ); + rtl::OString aDelimiter(rtl::OUStringToOString(String( sal_Unicode(0x2016) ), RTL_TEXTENCODING_UTF8)); - if ( aID.Equals( aDelimiter, 6, aDelimiter.Len() ) ) + if ( aID.Equals( aDelimiter, 6, aDelimiter.getLength() ) ) { // New KeyId 6 Letters, digits and spechial chars followed by delimiter bNewId = sal_True; nErrorPos = 1; aID = aID.Copy( 0, 6 ); nAfterID += 6; - nAfterID = nAfterID + aDelimiter.Len(); + nAfterID = nAfterID + aDelimiter.getLength(); } - else if ( ( aID.GetChar(6) == '*' ) && aID.Equals( aDelimiter, 7, aDelimiter.Len() ) ) + else if ( ( aID.GetChar(6) == '*' ) && aID.Equals( aDelimiter, 7, aDelimiter.getLength() ) ) { // New KeyId 6 Letters, digits and spechial chars followed by '*delimiter' to indicate translation in progress bNewId = sal_True; nErrorPos = 1; aID = aID.Copy( 0, 6 ); nAfterID += 7; - nAfterID = nAfterID + aDelimiter.Len(); + nAfterID = nAfterID + aDelimiter.getLength(); } else if ( aID.GetTokenCount( '.' ) > 1 ) { // test for old KeyIDs 5 to 6 digits followed by a dot '44373.' diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 8461df7abf9a..9fae8083b2c5 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -95,15 +95,18 @@ bool HelpParser::CreateSDF( String sUsedTempFile; String sXmlFile; - if( Export::fileHasUTF8ByteOrderMarker( sHelpFile ) ){ + if( Export::fileHasUTF8ByteOrderMarker( sHelpFile ) ) + { DirEntry aTempFile = Export::GetTempFile(); DirEntry aSourceFile( String( sHelpFile , RTL_TEXTENCODING_ASCII_US ) ); aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); String sTempFile = aTempFile.GetFull(); - Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); + Export::RemoveUTF8ByteOrderMarkerFromFile(rtl::OUStringToOString(sTempFile , RTL_TEXTENCODING_ASCII_US)); sUsedTempFile = sTempFile; sXmlFile = sTempFile; - }else{ + } + else + { sUsedTempFile = String::CreateFromAscii(""); sXmlFile = String( sHelpFile , RTL_TEXTENCODING_ASCII_US ); } @@ -121,8 +124,9 @@ bool HelpParser::CreateSDF( //printf( "%s\n", fullFilePath.GetBuffer() ); std::auto_ptr <XMLFile> file ( aParser.Execute( strFullPath , sXmlFile, pXmlFile ) ); - if(file.get() == NULL){ - printf("%s\n",ByteString(aParser.GetError().sMessage,RTL_TEXTENCODING_ASCII_US).GetBuffer()); + if(file.get() == NULL) + { + printf("%s\n", rtl::OUStringToOString(aParser.GetError().sMessage, RTL_TEXTENCODING_ASCII_US).getStr()); exit(-1); } file->Extract(); @@ -195,8 +199,9 @@ bool HelpParser::CreateSDF( sBuffer.append( data ); sBuffer.append( GSI_SEQUENCE4 ); //"\t\t\t\t"; sBuffer.append( sOUTimeStamp ); - ByteString sOut( sBuffer.makeStringAndClear().getStr() , RTL_TEXTENCODING_UTF8 ); - if( data.getLength() > 0 ) aSDFStream.WriteLine( sOut ); + rtl::OString sOut(rtl::OUStringToOString(sBuffer.makeStringAndClear().getStr() , RTL_TEXTENCODING_UTF8)); + if( data.getLength() > 0 ) + aSDFStream.WriteLine( sOut ); pXMLElement=NULL; }else fprintf(stdout,"\nDBG: NullPointer in HelpParser::CreateSDF , Language %s\n",sCur.GetBuffer() ); } @@ -213,18 +218,18 @@ bool HelpParser::CreateSDF( ByteString HelpParser::makeAbsolutePath( const ByteString& sHelpFile , const ByteString& rRoot_in ) { - DirEntry aEntry( String( sHelpFile, RTL_TEXTENCODING_ASCII_US )); + DirEntry aEntry( String( sHelpFile, RTL_TEXTENCODING_ASCII_US )); aEntry.ToAbs(); String sFullEntry = aEntry.GetFull(); aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); aEntry += DirEntry( rRoot_in ); - ByteString sPrjEntry( aEntry.GetFull(), osl_getThreadTextEncoding()); - ByteString sActFileName( - sFullEntry.Copy( sPrjEntry.Len() + 1 ), osl_getThreadTextEncoding()); + rtl::OString sPrjEntry(rtl::OUStringToOString(aEntry.GetFull(), osl_getThreadTextEncoding())); + rtl::OString sActFileName(rtl::OUStringToOString( + sFullEntry.Copy(sPrjEntry.getLength() + 1), osl_getThreadTextEncoding())); - sActFileName.SearchAndReplaceAll( "/", "\\" ); - return sActFileName; + return sActFileName.replace('/', '\\'); } + bool HelpParser::Merge( const ByteString &rSDFFile, const ByteString &rDestinationFile , ByteString& sLanguage , MergeDataFile& aMergeDataFile ) { @@ -242,7 +247,7 @@ bool HelpParser::Merge( const ByteString &rSDFFile, const ByteString &rDestinati DirEntry aSourceFile( String( sHelpFile , RTL_TEXTENCODING_ASCII_US ) ); aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); String sTempFile = aTempFile.GetFull(); - Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); + Export::RemoveUTF8ByteOrderMarkerFromFile(rtl::OUStringToOString(sTempFile, RTL_TEXTENCODING_ASCII_US)); sUsedTempFile = sTempFile; sXmlFile = sTempFile; }else{ @@ -322,7 +327,7 @@ bool HelpParser::Merge( DirEntry aSourceFile( String( sHelpFile , RTL_TEXTENCODING_ASCII_US ) ); aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); String sTempFile = aTempFile.GetFull(); - Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); + Export::RemoveUTF8ByteOrderMarkerFromFile(rtl::OUStringToOString(sTempFile , RTL_TEXTENCODING_ASCII_US)); sUsedTempFile = sTempFile; sXmlFile = sTempFile; } @@ -342,7 +347,7 @@ bool HelpParser::Merge( if( xmlfile == NULL) { - printf("%s\n",ByteString(aParser.GetError().sMessage,RTL_TEXTENCODING_UTF8).GetBuffer()); + printf("%s\n", rtl::OUStringToOString(aParser.GetError().sMessage, RTL_TEXTENCODING_UTF8).getStr()); exit(-1); } @@ -497,9 +502,10 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile return true; } -ByteString HelpParser::GetOutpath( const ByteString& rPathX , const ByteString& sCur , const ByteString& rPathY ){ +ByteString HelpParser::GetOutpath( const ByteString& rPathX , const ByteString& sCur , const ByteString& rPathY ) +{ ByteString testpath = rPathX; - static const ByteString sDelimiter( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); + static const rtl::OString sDelimiter(rtl::OUStringToOString(DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US)); testpath = comphelper::string::stripEnd(testpath, '/'); testpath = comphelper::string::stripEnd(testpath, '\\'); testpath += sDelimiter; @@ -512,13 +518,15 @@ ByteString HelpParser::GetOutpath( const ByteString& rPathX , const ByteString& testpath += sDelimiter; return testpath; } -void HelpParser::MakeDir( const ByteString& sPath ){ + +void HelpParser::MakeDir( const ByteString& sPath ) +{ ByteString sTPath( sPath ); - ByteString sDelimiter( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); + rtl::OString sDelimiter(rtl::OUStringToOString(DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US)); sTPath.SearchAndReplaceAll( sDelimiter , rtl::OString('/') ); sal_uInt16 cnt = sTPath.GetTokenCount( '/' ); rtl::OStringBuffer sCreateDir; - for( sal_uInt16 i = 0 ; i < cnt ; i++ ) + for (sal_uInt16 i = 0; i < cnt; ++i) { sCreateDir.append(comphelper::string::getToken(sTPath, i , '/')); sCreateDir.append(sDelimiter); diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index 0f2a5cf95c53..a641528c63fa 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -109,10 +109,11 @@ sal_Bool LngParser::CreateSDF( String sFullEntry = aEntry.GetFull(); aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); aEntry += DirEntry( rRoot ); - ByteString sPrjEntry( aEntry.GetFull(), osl_getThreadTextEncoding()); - ByteString sActFileName( - sFullEntry.Copy( sPrjEntry.Len() + 1 ), osl_getThreadTextEncoding()); - sActFileName.SearchAndReplaceAll( "/", "\\" ); + rtl::OString sPrjEntry(rtl::OUStringToOString(aEntry.GetFull(), + osl_getThreadTextEncoding())); + rtl::OString sActFileName(rtl::OUStringToOString( + sFullEntry.Copy( sPrjEntry.getLength() + 1 ), osl_getThreadTextEncoding())); + sActFileName = sActFileName.replace('/', '\\'); size_t nPos = 0; sal_Bool bStart = true; diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 7325796fc23a..4969ba9d80a5 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -247,9 +247,9 @@ const ByteString SourceTreeLocalizer::GetProjectName( sal_Bool bAbs ) if ( aTest.Exists() ) { if ( bAbs ) - return ByteString( aCur.GetFull(), RTL_TEXTENCODING_ASCII_US ); + return rtl::OUStringToOString(aCur.GetFull(), RTL_TEXTENCODING_ASCII_US); else - return ByteString( aCur.GetName(), RTL_TEXTENCODING_ASCII_US ); + return rtl::OUStringToOString(aCur.GetName(), RTL_TEXTENCODING_ASCII_US); } } @@ -268,13 +268,13 @@ const ByteString SourceTreeLocalizer::GetProjectRootRel() ByteString sProjectRoot( GetProjectName( sal_True )); DirEntry aCur; aCur.ToAbs(); - ByteString sCur( aCur.GetFull(), RTL_TEXTENCODING_ASCII_US ); + ByteString sCur(rtl::OUStringToOString(aCur.GetFull(), RTL_TEXTENCODING_ASCII_US)); if( sCur.SearchAndReplace( sProjectRoot, "" ) == STRING_NOTFOUND ) return ""; - ByteString sDelimiter( - DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); + rtl::OString sDelimiter(rtl::OUStringToOString( + DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US)); sCur.SearchAndReplaceAll( sDelimiter, "/" ); sCur = comphelper::string::stripStart(sCur, '/'); @@ -314,7 +314,7 @@ void SourceTreeLocalizer::WorkOnFile( { String sFull( rFileName, RTL_TEXTENCODING_ASCII_US ); DirEntry aEntry( sFull ); - ByteString sFileName( aEntry.GetName(), RTL_TEXTENCODING_ASCII_US ); + rtl::OString sFileName(rtl::OUStringToOString(aEntry.GetName(), RTL_TEXTENCODING_ASCII_US)); // set current working directory DirEntry aPath( aEntry.GetPath()); @@ -327,7 +327,7 @@ void SourceTreeLocalizer::WorkOnFile( ByteString sRoot( GetProjectRootRel()); DirEntry aTemp( Export::GetTempFile()); - ByteString sTempFile( aTemp.GetFull(), RTL_TEXTENCODING_ASCII_US ); + rtl::OString sTempFile(rtl::OUStringToOString(aTemp.GetFull(), RTL_TEXTENCODING_ASCII_US)); ByteString sDel; #if defined(WNT) @@ -395,8 +395,8 @@ sal_Bool SourceTreeLocalizer::CheckNegativeList( const ByteString &rFileName ) sal_uLong nIndex = 0; sal_Bool bReturn = sal_True; - ByteString sDelimiter( - DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); + rtl::OString sDelimiter(rtl::OUStringToOString( + DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US)); ByteString sFileName( rFileName ); sFileName.ToLowerAscii(); @@ -424,8 +424,8 @@ sal_Bool SourceTreeLocalizer::CheckPositiveList( const ByteString &rFileName ) sal_uLong nIndex = 0; sal_Bool bReturn = sal_False; - ByteString sDelimiter( - DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); + rtl::OString sDelimiter(rtl::OUStringToOString( + DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US)); ByteString sFileName( rFileName ); sFileName.ToLowerAscii(); @@ -462,9 +462,10 @@ void SourceTreeLocalizer::WorkOnFileType( DirEntry aEntry( sWild ); Dir aDir( sWild, FSYS_KIND_FILE ); - for ( sal_uInt16 i = 0; i < aDir.Count(); i++ ) { + for ( sal_uInt16 i = 0; i < aDir.Count(); i++ ) + { DirEntry aFile( aDir[ i ] ); - ByteString sFile( aFile.GetFull(), RTL_TEXTENCODING_ASCII_US ); + rtl::OString sFile(rtl::OUStringToOString(aFile.GetFull(), RTL_TEXTENCODING_ASCII_US)); sal_Bool bAllowed = sal_True; @@ -603,7 +604,7 @@ int _cdecl main( int argc, char *argv[] ) DirEntry aEntry( String( sFileName , RTL_TEXTENCODING_ASCII_US )); aEntry.ToAbs(); String sFullEntry = aEntry.GetFull(); - ByteString sFileABS(aEntry.GetFull(), osl_getThreadTextEncoding()); + rtl::OString sFileABS(rtl::OUStringToOString(aEntry.GetFull(), osl_getThreadTextEncoding())); sFileName = sFileABS; string pwd; diff --git a/l10ntools/source/tagtest.cxx b/l10ntools/source/tagtest.cxx index 621e552d0177..58a1299917b3 100644 --- a/l10ntools/source/tagtest.cxx +++ b/l10ntools/source/tagtest.cxx @@ -223,7 +223,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList ) { if ( !IsPropertyValueValid( aName, aValue ) ) { - rErrorList.AddError( 25, ByteString("Property '").Append(aName).Append("' has invalid value '").Append(ByteString( aValue, RTL_TEXTENCODING_UTF8 )).Append("' "), *this ); + rErrorList.AddError( 25, ByteString("Property '").Append(aName).Append("' has invalid value '").Append(rtl::OUStringToOString(aValue, RTL_TEXTENCODING_UTF8)).Append("' "), *this ); bIsBroken = sal_True; } aProperties[ aName ] = aValue; @@ -334,7 +334,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList ) } else { - aName = ByteString( aPortion, RTL_TEXTENCODING_UTF8 ); + aName = rtl::OUStringToOString(aPortion, RTL_TEXTENCODING_UTF8); // "a-zA-Z_-.0-9" xub_StrLen nCount; sal_Bool bBroken = sal_False; @@ -364,7 +364,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList ) { if ( aPortion.Len() ) { - rErrorList.AddError( 25, ByteString("Found displaced characters '").Append(ByteString( aPortion, RTL_TEXTENCODING_UTF8 )).Append("' in Tag "), *this ); + rErrorList.AddError( 25, ByteString("Found displaced characters '").Append(rtl::OUStringToOString(aPortion, RTL_TEXTENCODING_UTF8)).Append("' in Tag "), *this ); bIsBroken = sal_True; } bCheckEmpty = sal_False; @@ -1323,7 +1323,7 @@ sal_Bool TokenParser::match( const TokenInfo &aCurrentToken, const TokenInfo &rE else { sTmp += ": "; - sTmp += ByteString( aParser.GetLexem( aExpectedToken ), RTL_TEXTENCODING_UTF8 ); + sTmp += rtl::OUStringToOString(aParser.GetLexem( aExpectedToken ), RTL_TEXTENCODING_UTF8); sTmp += " near "; ParseError( 7, sTmp, aCurrentToken ); } diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx index e253a7fcf4c2..382ab42ba409 100644 --- a/l10ntools/source/xmlparse.cxx +++ b/l10ntools/source/xmlparse.cxx @@ -160,23 +160,29 @@ int XMLParentNode::GetPosition( ByteString id ){ /*****************************************************************************/ XMLElement* a; - static const ByteString sEnusStr = ByteString(String::CreateFromAscii(ENGLISH_US_ISO).ToLowerAscii() , RTL_TEXTENCODING_ASCII_US ).ToLowerAscii(); - static const ByteString sDeStr = ByteString(String::CreateFromAscii(GERMAN_ISO2).ToLowerAscii() , RTL_TEXTENCODING_ASCII_US ).ToLowerAscii(); + static const rtl::OString sEnusStr = rtl::OString(RTL_CONSTASCII_STRINGPARAM(ENGLISH_US_ISO)).toAsciiLowerCase(); + static const rtl::OString sDeStr = rtl::OString(RTL_CONSTASCII_STRINGPARAM(GERMAN_ISO2)).toAsciiLowerCase(); - if ( pChildList ){ - for ( size_t i = 0; i < pChildList->size(); i++ ) { + if ( pChildList ) + { + for (size_t i = 0; i < pChildList->size(); ++i) + { XMLChildNode *pChild = (*pChildList)[ i ]; - if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ){ + if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ) + { a = static_cast<XMLElement* >(pChild); ByteString elemid( a->GetId() ); elemid.ToLowerAscii(); - if ( elemid.Equals( id.ToLowerAscii() ) ){ + if ( elemid.Equals( id.ToLowerAscii() ) ) + { ByteString elemLID( a->GetLanguageId() ); elemLID.ToLowerAscii(); - if( elemLID.Equals( sEnusStr) ) { + if( elemLID.Equals( sEnusStr) ) + { return i; } - else if( elemLID.Equals( sDeStr) ) { + else if( elemLID.Equals( sDeStr) ) + { return i; } } @@ -318,15 +324,12 @@ sal_Bool XMLFile::Write( ByteString &aFilename ) exit( -1 ); } - - void XMLFile::WriteString( ofstream &rStream, const String &sString ) { - ByteString sText( sString, RTL_TEXTENCODING_UTF8 ); - rStream << sText.GetBuffer(); + rtl::OString sText(rtl::OUStringToOString(sString, RTL_TEXTENCODING_UTF8)); + rStream << sText.getStr(); } - sal_Bool XMLFile::Write( ofstream &rStream , XMLNode *pCur ) { if ( !pCur ) @@ -408,41 +411,46 @@ void XMLFile::Print( XMLNode *pCur, sal_uInt16 nLevel ) case XML_NODE_TYPE_ELEMENT: { XMLElement *pElement = ( XMLElement * ) pCur; - fprintf( stdout, "<%s", ByteString( pElement->GetName(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); + fprintf( stdout, "<%s", rtl::OUStringToOString(pElement->GetName(), RTL_TEXTENCODING_UTF8).getStr()); if ( pElement->GetAttributeList()) - for ( size_t j = 0; j < pElement->GetAttributeList()->size(); j++ ){ - ByteString aAttrName( *(*pElement->GetAttributeList())[ j ], RTL_TEXTENCODING_UTF8 ); - if( !aAttrName.EqualsIgnoreCaseAscii( XML_LANG ) ) { + { + for (size_t j = 0; j < pElement->GetAttributeList()->size(); ++j) + { + rtl::OString aAttrName(rtl::OUStringToOString(*(*pElement->GetAttributeList())[j], + RTL_TEXTENCODING_UTF8)); + if (!aAttrName.equalsIgnoreAsciiCase(XML_LANG)) + { fprintf( stdout, " %s=\"%s\"", - aAttrName.GetBuffer(), - ByteString( (*pElement->GetAttributeList())[ j ]->GetValue(), - RTL_TEXTENCODING_UTF8 ).GetBuffer()); + aAttrName.getStr(), + rtl::OUStringToOString( (*pElement->GetAttributeList())[ j ]->GetValue(), + RTL_TEXTENCODING_UTF8).getStr()); } } + } if ( !pElement->GetChildList()) fprintf( stdout, "/>" ); else { fprintf( stdout, ">" ); for ( size_t k = 0; k < pElement->GetChildList()->size(); k++ ) Print( (*pElement->GetChildList())[ k ], nLevel + 1 ); - fprintf( stdout, "</%s>", ByteString( pElement->GetName(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); + fprintf( stdout, "</%s>", rtl::OUStringToOString(pElement->GetName(), RTL_TEXTENCODING_UTF8).getStr()); } } break; case XML_NODE_TYPE_DATA: { XMLData *pData = ( XMLData * ) pCur; String sData = pData->GetData(); - fprintf( stdout, "%s", ByteString( sData, RTL_TEXTENCODING_UTF8 ).GetBuffer()); + fprintf( stdout, "%s", rtl::OUStringToOString(sData, RTL_TEXTENCODING_UTF8).getStr()); } break; case XML_NODE_TYPE_COMMENT: { XMLComment *pComment = ( XMLComment * ) pCur; - fprintf( stdout, "<!--%s-->", ByteString( pComment->GetComment(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); + fprintf( stdout, "<!--%s-->", rtl::OUStringToOString(pComment->GetComment(), RTL_TEXTENCODING_UTF8).getStr()); } break; case XML_NODE_TYPE_DEFAULT: { XMLDefault *pDefault = ( XMLDefault * ) pCur; - fprintf( stdout, "%s", ByteString( pDefault->GetDefault(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); + fprintf( stdout, "%s", rtl::OUStringToOString(pDefault->GetDefault(), RTL_TEXTENCODING_UTF8).getStr()); } break; } @@ -470,13 +478,13 @@ XMLFile::XMLFile( const String &rFileName ) // the file name, empty if created f XMLStrings ( NULL ) { - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("bookmark"),RTL_TEXTENCODING_ASCII_US) , sal_True) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("variable"),RTL_TEXTENCODING_ASCII_US) , sal_True) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("paragraph"),RTL_TEXTENCODING_ASCII_US) , sal_True) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("alt"),RTL_TEXTENCODING_ASCII_US) , sal_True) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("caption"),RTL_TEXTENCODING_ASCII_US) , sal_True) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("title"),RTL_TEXTENCODING_ASCII_US) , sal_True) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("link"),RTL_TEXTENCODING_ASCII_US) , sal_True) ); + nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("bookmark")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("variable")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("paragraph")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("alt")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("caption")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("title")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("link")) , sal_True) ); } /*****************************************************************************/ void XMLFile::Extract( XMLFile *pCur ) @@ -501,13 +509,14 @@ void XMLFile::InsertL10NElement( XMLElement* pElement ){ LangHashMap* elem; if( pElement->GetAttributeList() != NULL ){ - for ( size_t j = 0; j < pElement->GetAttributeList()->size(); j++ ){ - tmpStr=ByteString( *(*pElement->GetAttributeList())[ j ], RTL_TEXTENCODING_UTF8 ); + for ( size_t j = 0; j < pElement->GetAttributeList()->size(); j++ ) + { + tmpStr=rtl::OUStringToOString(*(*pElement->GetAttributeList())[ j ], RTL_TEXTENCODING_UTF8); if( tmpStr.CompareTo(ID)==COMPARE_EQUAL ){ // Get the "id" Attribute - id = ByteString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); + id = rtl::OUStringToOString((*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8); } if( tmpStr.CompareTo( XML_LANG ) == COMPARE_EQUAL ){ // Get the "xml-lang" Attribute - language = ByteString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); + language = rtl::OUStringToOString((*pElement->GetAttributeList())[j]->GetValue(),RTL_TEXTENCODING_UTF8); } } @@ -528,7 +537,7 @@ void XMLFile::InsertL10NElement( XMLElement* pElement ){ elem=pos->second; if ( (*elem)[ language ] ) { - fprintf(stdout,"Error: Duplicated entry. ID = %s LANG = %s in File %s\n", id.GetBuffer(), language.GetBuffer(), ByteString( sFullName,RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); + fprintf(stdout,"Error: Duplicated entry. ID = %s LANG = %s in File %s\n", id.GetBuffer(), language.GetBuffer(), rtl::OUStringToOString(sFullName, RTL_TEXTENCODING_ASCII_US).getStr() ); exit( -1 ); } (*elem)[ language ]=pElement; @@ -606,22 +615,24 @@ void XMLFile::SearchL10NElements( XMLParentNode *pCur , int pos) break; case XML_NODE_TYPE_ELEMENT: { XMLElement *pElement = ( XMLElement * ) pCur; - ByteString sName(pElement->GetName(),RTL_TEXTENCODING_ASCII_US); + rtl::OString sName(rtl::OUStringToOString(pElement->GetName(), RTL_TEXTENCODING_ASCII_US).toAsciiLowerCase()); ByteString language,tmpStrVal,oldref; - if ( pElement->GetAttributeList()){ - for ( size_t j = 0 , cnt = pElement->GetAttributeList()->size(); j < cnt && bInsert; j++ ){ - const ByteString tmpStr( *(*pElement->GetAttributeList())[ j ],RTL_TEXTENCODING_UTF8 ); + if ( pElement->GetAttributeList()) + { + for ( size_t j = 0 , cnt = pElement->GetAttributeList()->size(); j < cnt && bInsert; ++j ) + { + const ByteString tmpStr = rtl::OUStringToOString(*(*pElement->GetAttributeList())[j], RTL_TEXTENCODING_UTF8); if( tmpStr.CompareTo(THEID)==COMPARE_EQUAL ){ // Get the "id" Attribute - tmpStrVal=ByteString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); + tmpStrVal=rtl::OUStringToOString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); } if( tmpStr.CompareTo(LOCALIZE)==COMPARE_EQUAL ){ // Get the "localize" Attribute bInsert=false; } if( tmpStr.CompareTo(XML_LANG)==COMPARE_EQUAL ){ // Get the "xml-lang" Attribute - language=ByteString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); + language=rtl::OUStringToOString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); } if( tmpStr.CompareTo(OLDREF)==COMPARE_EQUAL ){ // Get the "oldref" Attribute - oldref=ByteString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); + oldref=rtl::OUStringToOString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); } } pElement->SetLanguageId ( language ); @@ -630,7 +641,7 @@ void XMLFile::SearchL10NElements( XMLParentNode *pCur , int pos) pElement->SetPos( pos ); } - if ( bInsert && ( nodes_localize.find( sName.ToLowerAscii() ) != nodes_localize.end() ) ) + if ( bInsert && ( nodes_localize.find( sName ) != nodes_localize.end() ) ) InsertL10NElement(pElement); else if ( bInsert && pElement->GetChildList() ){ for ( size_t k = 0; k < pElement->GetChildList()->size(); k++ ) @@ -657,11 +668,11 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) { static bool bStatusExport = true; const ByteString LOCALIZE("localize"); - const ByteString STATUS("status"); - const ByteString PUBLISH("PUBLISH"); - const ByteString DEPRECATED("DEPRECATED"); + const rtl::OString STATUS(RTL_CONSTASCII_STRINGPARAM("status")); + const rtl::OString PUBLISH(RTL_CONSTASCII_STRINGPARAM("PUBLISH")); + const rtl::OString DEPRECATED(RTL_CONSTASCII_STRINGPARAM("DEPRECATED")); + const rtl::OString TOPIC(RTL_CONSTASCII_STRINGPARAM("topic")); - const ByteString TOPIC("topic"); bool bInsert = true; if ( !pCur ) CheckExportStatus( this ); @@ -679,15 +690,22 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) break; case XML_NODE_TYPE_ELEMENT: { XMLElement *pElement = ( XMLElement * ) pCur; - ByteString sName(pElement->GetName(),RTL_TEXTENCODING_ASCII_US); - if( sName.EqualsIgnoreCaseAscii( TOPIC ) ){ - if ( pElement->GetAttributeList()){ - for ( size_t j = 0 , cnt = pElement->GetAttributeList()->size(); j < cnt && bInsert; j++ ){ - const ByteString tmpStr( *(*pElement->GetAttributeList())[ j ],RTL_TEXTENCODING_UTF8 ); - if( tmpStr.EqualsIgnoreCaseAscii( STATUS ) ){ - ByteString tmpStrVal=ByteString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); - if( !tmpStrVal.EqualsIgnoreCaseAscii( PUBLISH ) && - !tmpStrVal.EqualsIgnoreCaseAscii( DEPRECATED )){ + rtl::OString sName(rtl::OUStringToOString(pElement->GetName(), RTL_TEXTENCODING_ASCII_US)); + if (sName.equalsIgnoreAsciiCase(TOPIC)) + { + if ( pElement->GetAttributeList()) + { + for (size_t j = 0 , cnt = pElement->GetAttributeList()->size(); j < cnt && bInsert; ++j) + { + const rtl::OString tmpStr(rtl::OUStringToOString(*(*pElement->GetAttributeList())[j], + RTL_TEXTENCODING_UTF8)); + if (tmpStr.equalsIgnoreAsciiCase(STATUS)) + { + rtl::OString tmpStrVal(rtl::OUStringToOString( (*pElement->GetAttributeList())[j]->GetValue(), + RTL_TEXTENCODING_UTF8)); + if (!tmpStrVal.equalsIgnoreAsciiCase(PUBLISH) && + !tmpStrVal.equalsIgnoreAsciiCase(DEPRECATED)) + { bStatusExport = false; } } @@ -695,9 +713,10 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) } } } - else if ( pElement->GetChildList() ){ - for ( size_t k = 0; k < pElement->GetChildList()->size(); k++ ) - CheckExportStatus( (XMLParentNode*)(*pElement->GetChildList())[ k ] ); + else if ( pElement->GetChildList() ) + { + for (size_t k = 0; k < pElement->GetChildList()->size(); ++k) + CheckExportStatus( (XMLParentNode*)(*pElement->GetChildList())[k] ); } } break; @@ -774,28 +793,32 @@ void XMLElement::AddAttribute( const String &rAttribute, const String &rValue ) } /*****************************************************************************/ -void XMLElement::ChangeLanguageTag( const String &rValue ){ -/*****************************************************************************/ +void XMLElement::ChangeLanguageTag( const String &rValue ) +{ static const String rName = String::CreateFromAscii("xml-lang"); - SetLanguageId( ByteString(rValue,RTL_TEXTENCODING_UTF8) ); - if ( pAttributes ){ - for ( size_t i = 0; i < pAttributes->size(); i++ ){ - if ( *(*pAttributes)[ i ] == rName ){ + SetLanguageId(rtl::OUStringToOString(rValue, RTL_TEXTENCODING_UTF8)); + if ( pAttributes ) + { + for (size_t i = 0; i < pAttributes->size(); ++i) + { + if ( *(*pAttributes)[ i ] == rName ) (*pAttributes)[ i ]->setValue(rValue); - } } } XMLChildNode* pNode = NULL; XMLElement* pElem = NULL; XMLChildNodeList* pCList = GetChildList(); - if( pCList != NULL ){ - for ( size_t i = 0; i < pCList->size(); i++ ){ + if( pCList != NULL ) + { + for ( size_t i = 0; i < pCList->size(); i++ ) + { pNode = (*pCList)[ i ]; - if( pNode != NULL && pNode->GetNodeType() == XML_NODE_TYPE_ELEMENT ){ + if( pNode != NULL && pNode->GetNodeType() == XML_NODE_TYPE_ELEMENT ) + { pElem = static_cast< XMLElement* >(pNode); pElem->ChangeLanguageTag( rValue ); - pElem->SetLanguageId( ByteString(rValue,RTL_TEXTENCODING_UTF8) ); + pElem->SetLanguageId(rtl::OUStringToOString(rValue, RTL_TEXTENCODING_UTF8)); pElem = NULL; pNode = NULL; } @@ -1339,10 +1362,12 @@ void XMLUtil::UnQuotHTML( String &rString ){ UnQuotData( rString ); } -void XMLUtil::UnQuotData( String &rString_in ){ +void XMLUtil::UnQuotData( String &rString_in ) +{ rtl::OStringBuffer sReturn; - ByteString sString( rString_in , RTL_TEXTENCODING_UTF8 ); - while ( sString.Len()) { + ByteString sString(rtl::OUStringToOString(rString_in , RTL_TEXTENCODING_UTF8)); + while (sString.Len()) + { if ( sString.Copy( 0, 1 ) == "\\" ) { sReturn.append("\\\\"); sString.Erase( 0, 1 ); diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index fbc0017b92f8..cc7d54003b63 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -210,8 +210,8 @@ extern FILE *GetXrmFile() DirEntry aSourceFile( String( sInputFileName , RTL_TEXTENCODING_ASCII_US ) ); aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); String sTempFile = aTempFile.GetFull(); - Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); - pFile = fopen( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ).GetBuffer(), "r" ); + Export::RemoveUTF8ByteOrderMarkerFromFile(rtl::OUStringToOString(sTempFile , RTL_TEXTENCODING_ASCII_US) ); + pFile = fopen(rtl::OUStringToOString(sTempFile , RTL_TEXTENCODING_ASCII_US).getStr(), "r"); sUsedTempFile = sTempFile; }else{ // able to open file? @@ -227,14 +227,14 @@ extern FILE *GetXrmFile() // create path to project root DirEntry aEntry( String( sInputFileName, RTL_TEXTENCODING_ASCII_US )); aEntry.ToAbs(); - ByteString sFullEntry( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); + rtl::OString sFullEntry(rtl::OUStringToOString(aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US)); aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); aEntry += DirEntry( sPrjRoot ); - ByteString sPrjEntry( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); + rtl::OString sPrjEntry(rtl::OUStringToOString(aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US)); // create file name, beginnig with project root // (e.g.: source\ui\src\menue.src) - sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); + sActFileName = sFullEntry.copy(sPrjEntry.getLength() + 1); sActFileName.SearchAndReplaceAll( "/", "\\" ); @@ -529,7 +529,7 @@ void XRMResExport::WorkOnDesc( { DirEntry aEntry( String( sInputFileName, RTL_TEXTENCODING_ASCII_US )); aEntry.ToAbs(); - ByteString sDescFileName( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); + ByteString sDescFileName(rtl::OUStringToOString(aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US)); sDescFileName.SearchAndReplaceAll( "description.xml", "" ); sDescFileName += GetAttribute( rOpenTag, "xlink:href" ); int size; @@ -699,8 +699,8 @@ void XRMResMerge::WorkOnDesc( DirEntry aEntry( String( sOutputFile, RTL_TEXTENCODING_ASCII_US )); aEntry.ToAbs(); - ByteString sOutputDescFile( aEntry.GetPath().GetFull(), RTL_TEXTENCODING_ASCII_US ); - ByteString sDel( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); + ByteString sOutputDescFile(rtl::OUStringToOString(aEntry.GetPath().GetFull(), RTL_TEXTENCODING_ASCII_US)); + rtl::OString sDel(rtl::OUStringToOString(DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US)); sOutputDescFile += sDel; sOutputDescFile += sLocDescFilename; sText.SearchAndReplaceAll( "\\n", "\n" ); |