INTEGRATION: CWS warnings01 (1.12.8); FILE MERGED
2006/04/18 17:03:08 ihi 1.12.8.8: resync fix 2006/04/07 18:36:57 sb 1.12.8.7: RESYNC: (1.13-1.14); FILE MERGED 2006/03/09 19:26:54 ihi 1.12.8.6: #i57362# Warning free wntmsci10 2005/11/18 18:10:50 ihi 1.12.8.5: #i57362# Removed warnings 2005/11/10 12:06:12 pl 1.12.8.4: #i53898# removed warnings 2005/11/07 17:24:32 pl 1.12.8.3: RESYNC: (1.12-1.13); FILE MERGED 2005/11/07 12:46:49 ihi 1.12.8.2: #i57362# Remove warnings 2005/10/21 12:56:09 pl 1.12.8.1: #i55991# removed warnings for linux platform
This commit is contained in:
@@ -4,9 +4,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: xrmmerge.cxx,v $
|
* $RCSfile: xrmmerge.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.14 $
|
* $Revision: 1.15 $
|
||||||
*
|
*
|
||||||
* last change: $Author: obo $ $Date: 2006-03-29 13:28:15 $
|
* last change: $Author: hr $ $Date: 2006-06-19 17:26:25 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to
|
* The Contents of this file are made available subject to
|
||||||
* the terms of GNU Lesser General Public License Version 2.1.
|
* the terms of GNU Lesser General Public License Version 2.1.
|
||||||
@@ -139,7 +139,7 @@ extern char *GetOutputFile( int argc, char* argv[])
|
|||||||
case STATE_NON: {
|
case STATE_NON: {
|
||||||
return NULL; // no valid command line
|
return NULL; // no valid command line
|
||||||
}
|
}
|
||||||
break;
|
//break;
|
||||||
case STATE_INPUT: {
|
case STATE_INPUT: {
|
||||||
sInputFileName = argv[ i ];
|
sInputFileName = argv[ i ];
|
||||||
bInput = TRUE; // source file found
|
bInput = TRUE; // source file found
|
||||||
@@ -202,12 +202,13 @@ int InitXrmExport( char *pOutput , char* pFilename)
|
|||||||
Export::InitLanguages( false );
|
Export::InitLanguages( false );
|
||||||
|
|
||||||
if ( bMergeMode )
|
if ( bMergeMode )
|
||||||
pParser = new XRMResMerge( sMergeSrc, sOutputFile, bErrorLog , sFilename );
|
//pParser = new XRMResMerge( sMergeSrc, sOutputFile, bErrorLog , sFilename );
|
||||||
|
pParser = new XRMResMerge( sMergeSrc, sOutputFile, sFilename );
|
||||||
else if ( sOutputFile.Len()) {
|
else if ( sOutputFile.Len()) {
|
||||||
pParser = new XRMResExport( sOutputFile, sPrj, sActFileName );
|
pParser = new XRMResExport( sOutputFile, sPrj, sActFileName );
|
||||||
}
|
}
|
||||||
else
|
//else
|
||||||
pParser = new XRMResParser();
|
// pParser = new XRMResParser();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -225,7 +226,7 @@ int EndXrmExport()
|
|||||||
}
|
}
|
||||||
extern const char* getFilename()
|
extern const char* getFilename()
|
||||||
{
|
{
|
||||||
return sInputFileName.GetBuffer();//(*(aInputFileList.GetObject( 0 ))).GetBuffer();
|
return sInputFileName.GetBuffer();
|
||||||
}
|
}
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
extern FILE *GetXrmFile()
|
extern FILE *GetXrmFile()
|
||||||
@@ -450,7 +451,7 @@ ByteString XRMResParser::GetAttribute( const ByteString &rToken, const ByteStrin
|
|||||||
ByteString sSearch( " " );
|
ByteString sSearch( " " );
|
||||||
sSearch += rAttribute;
|
sSearch += rAttribute;
|
||||||
sSearch += "=";
|
sSearch += "=";
|
||||||
int nPos = sTmp.Search( sSearch );
|
USHORT nPos = sTmp.Search( sSearch );
|
||||||
|
|
||||||
if ( nPos != STRING_NOTFOUND ) {
|
if ( nPos != STRING_NOTFOUND ) {
|
||||||
sTmp = sTmp.Copy( nPos );
|
sTmp = sTmp.Copy( nPos );
|
||||||
@@ -461,28 +462,28 @@ ByteString XRMResParser::GetAttribute( const ByteString &rToken, const ByteStrin
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void XRMResParser::Output( const ByteString& rOutput )
|
//void XRMResParser::Output( const ByteString& rOutput )
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
{
|
//{
|
||||||
}
|
//}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void XRMResParser::WorkOnText(
|
//void XRMResParser::WorkOnText(
|
||||||
const ByteString &rOpenTag,
|
// const ByteString &rOpenTag,
|
||||||
ByteString &rText
|
// ByteString &rText
|
||||||
)
|
//)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
{
|
//{
|
||||||
}
|
//}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void XRMResParser::EndOfText(
|
//void XRMResParser::EndOfText(
|
||||||
const ByteString &rOpenTag,
|
// const ByteString &rOpenTag,
|
||||||
const ByteString &rCloseTag
|
// const ByteString &rCloseTag
|
||||||
)
|
//)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
{
|
//{
|
||||||
}
|
//}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void XRMResParser::Error( const ByteString &rError )
|
void XRMResParser::Error( const ByteString &rError )
|
||||||
@@ -575,6 +576,11 @@ XRMResExport::~XRMResExport()
|
|||||||
delete pResData;
|
delete pResData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XRMResExport::Output( const ByteString& rOutput )
|
||||||
|
{
|
||||||
|
// Dummy to suppress warnings caused by poor class design
|
||||||
|
ByteString a( rOutput );
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void XRMResExport::WorkOnText(
|
void XRMResExport::WorkOnText(
|
||||||
@@ -609,13 +615,15 @@ void XRMResExport::EndOfText(
|
|||||||
)
|
)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
{
|
{
|
||||||
|
|
||||||
|
(void) rOpenTag; // FIXME
|
||||||
|
(void) rCloseTag; // FIXME
|
||||||
|
|
||||||
if ( pResData && pOutputStream ) {
|
if ( pResData && pOutputStream ) {
|
||||||
|
|
||||||
char cSearch = 0x00;
|
char cSearch = 0x00;
|
||||||
ByteString sSearch( cSearch );
|
ByteString sSearch( cSearch );
|
||||||
|
|
||||||
/* if (( !pResData->sText[ ENGLISH_INDEX ].Len()) &&
|
|
||||||
( !pResData->sText[ ENGLISH_US_INDEX ].Len()))*/
|
|
||||||
if ( !pResData->sText[ ByteString("en-US") ].Len() )
|
if ( !pResData->sText[ ByteString("en-US") ].Len() )
|
||||||
pResData->sText[ ByteString("en-US") ] = pResData->sText[ ByteString("de") ];
|
pResData->sText[ ByteString("en-US") ] = pResData->sText[ ByteString("de") ];
|
||||||
|
|
||||||
@@ -623,19 +631,10 @@ void XRMResExport::EndOfText(
|
|||||||
|
|
||||||
ByteString sTimeStamp( Export::GetTimeStamp());
|
ByteString sTimeStamp( Export::GetTimeStamp());
|
||||||
ByteString sCur;
|
ByteString sCur;
|
||||||
for( long int n = 0; n < aLanguages.size(); n++ ){
|
for( unsigned int n = 0; n < aLanguages.size(); n++ ){
|
||||||
sCur = aLanguages[ n ];
|
sCur = aLanguages[ n ];
|
||||||
|
|
||||||
//for ( ULONG i = 0; i < LANGUAGES; i++ ) {
|
|
||||||
// if ( LANGUAGE_ALLOWED( i )) {
|
|
||||||
//ByteString sAct = pResData->sText[ i ];
|
|
||||||
ByteString sAct = pResData->sText[ sCur ];
|
ByteString sAct = pResData->sText[ sCur ];
|
||||||
/* if ( !sAct.Len() && i ) {
|
|
||||||
if ( pResData->sText[ ENGLISH_US_INDEX ].Len())
|
|
||||||
sAct = pResData->sText[ ENGLISH_US_INDEX ];
|
|
||||||
else
|
|
||||||
sAct = pResData->sText[ ENGLISH_INDEX ];
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Export::UnquotHTML( sAct );
|
Export::UnquotHTML( sAct );
|
||||||
sAct.EraseAllChars( 0x0A );
|
sAct.EraseAllChars( 0x0A );
|
||||||
@@ -646,28 +645,21 @@ void XRMResExport::EndOfText(
|
|||||||
sOutput += "readmeitem\t";
|
sOutput += "readmeitem\t";
|
||||||
sOutput += pResData->sGId; sOutput += "\t";
|
sOutput += pResData->sGId; sOutput += "\t";
|
||||||
sOutput += pResData->sId; sOutput += "\t\t\t0\t";
|
sOutput += pResData->sId; sOutput += "\t\t\t0\t";
|
||||||
//sOutput += ByteString::CreateFromInt64( Export::LangId[ i ] );
|
|
||||||
sOutput += sCur;
|
sOutput += sCur;
|
||||||
sOutput += "\t";
|
sOutput += "\t";
|
||||||
|
|
||||||
// if( sCur.EqualsIgnoreCaseAscii("de") ){
|
|
||||||
// sAct = UTF8Converter::ConvertToUTF8( sAct, RTL_TEXTENCODING_MS_1252 );
|
|
||||||
// }
|
|
||||||
|
|
||||||
sOutput += sAct; sOutput += "\t\t\t\t";
|
sOutput += sAct; sOutput += "\t\t\t\t";
|
||||||
sOutput += sTimeStamp;
|
sOutput += sTimeStamp;
|
||||||
|
|
||||||
// if ( bUTF8 )
|
|
||||||
// sOutput = UTF8Converter::ConvertToUTF8( sOutput, Export::GetCharSet( Export::LangId[ i ] ));
|
|
||||||
|
|
||||||
sOutput.SearchAndReplaceAll( sSearch, "_" );
|
sOutput.SearchAndReplaceAll( sSearch, "_" );
|
||||||
//if( sCur.EqualsIgnoreCaseAscii("de") ){
|
//if( sCur.EqualsIgnoreCaseAscii("de") ){
|
||||||
// sOutput = UTF8Converter::ConvertToUTF8( sOutput , RTL_TEXTENCODING_MS_1252 );
|
// sOutput = UTF8Converter::ConvertToUTF8( sOutput , RTL_TEXTENCODING_MS_1252 );
|
||||||
//}
|
//}
|
||||||
if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sPrj ) ) )
|
if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sPrj ) ) )
|
||||||
pOutputStream->WriteLine( sOutput );
|
pOutputStream->WriteLine( sOutput );
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
delete pResData;
|
delete pResData;
|
||||||
pResData = NULL;
|
pResData = NULL;
|
||||||
@@ -680,7 +672,7 @@ void XRMResExport::EndOfText(
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
XRMResMerge::XRMResMerge(
|
XRMResMerge::XRMResMerge(
|
||||||
const ByteString &rMergeSource, const ByteString &rOutputFile,
|
const ByteString &rMergeSource, const ByteString &rOutputFile,
|
||||||
BOOL bErrorLog , ByteString &rFilename)
|
ByteString &rFilename)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
: XRMResOutputParser( rOutputFile ),
|
: XRMResOutputParser( rOutputFile ),
|
||||||
pMergeDataFile( NULL ),
|
pMergeDataFile( NULL ),
|
||||||
@@ -689,7 +681,7 @@ XRMResMerge::XRMResMerge(
|
|||||||
{
|
{
|
||||||
if ( rMergeSource.Len())
|
if ( rMergeSource.Len())
|
||||||
pMergeDataFile = new MergeDataFile(
|
pMergeDataFile = new MergeDataFile(
|
||||||
rMergeSource, sInputFileName , bErrorLog, RTL_TEXTENCODING_MS_1252, bUTF8 );
|
rMergeSource, sInputFileName , bErrorLog, RTL_TEXTENCODING_MS_1252);//, bUTF8 );
|
||||||
if( Export::sLanguages.EqualsIgnoreCaseAscii("ALL") ){
|
if( Export::sLanguages.EqualsIgnoreCaseAscii("ALL") ){
|
||||||
Export::SetLanguages( pMergeDataFile->GetLanguages() );
|
Export::SetLanguages( pMergeDataFile->GetLanguages() );
|
||||||
aLanguages = pMergeDataFile->GetLanguages();
|
aLanguages = pMergeDataFile->GetLanguages();
|
||||||
@@ -768,13 +760,9 @@ void XRMResMerge::EndOfText(
|
|||||||
PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData );
|
PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData );
|
||||||
if ( pEntrys ) {
|
if ( pEntrys ) {
|
||||||
ByteString sCur;
|
ByteString sCur;
|
||||||
for( long int n = 0; n < aLanguages.size(); n++ ){
|
for( unsigned int n = 0; n < aLanguages.size(); n++ ){
|
||||||
sCur = aLanguages[ n ];
|
sCur = aLanguages[ n ];
|
||||||
// for ( ULONG nIndex = 0; nIndex < LANGUAGES; nIndex++ ) {
|
|
||||||
ByteString sContent;
|
ByteString sContent;
|
||||||
/* if (( nIndex != GERMAN_INDEX ) &&
|
|
||||||
( nIndex != ENGLISH_INDEX ) &&
|
|
||||||
( LANGUAGE_ALLOWED( nIndex )) && */
|
|
||||||
if ( Export::isAllowed( sCur ) && //( !sCur.EqualsIgnoreCaseAscii("de") &&
|
if ( Export::isAllowed( sCur ) && //( !sCur.EqualsIgnoreCaseAscii("de") &&
|
||||||
// !sCur.EqualsIgnoreCaseAscii("en-US") )&&
|
// !sCur.EqualsIgnoreCaseAscii("en-US") )&&
|
||||||
( pEntrys->GetText(
|
( pEntrys->GetText(
|
||||||
@@ -782,8 +770,6 @@ void XRMResMerge::EndOfText(
|
|||||||
sContent, STRING_TYP_TEXT, sCur, TRUE )) &&
|
sContent, STRING_TYP_TEXT, sCur, TRUE )) &&
|
||||||
( sContent != "-" ) && ( sContent.Len()))
|
( sContent != "-" ) && ( sContent.Len()))
|
||||||
{
|
{
|
||||||
// ByteString sText = UTF8Converter::ConvertToUTF8(
|
|
||||||
// sContent, Export::GetCharSet( Export::LangId[ nIndex ]));
|
|
||||||
ByteString sText( sContent );
|
ByteString sText( sContent );
|
||||||
Export::QuotHTML( sText );
|
Export::QuotHTML( sText );
|
||||||
|
|
||||||
@@ -793,7 +779,6 @@ void XRMResMerge::EndOfText(
|
|||||||
ByteString sReplace( sSearch );
|
ByteString sReplace( sSearch );
|
||||||
|
|
||||||
sSearch += GetAttribute( rOpenTag, "xml:lang" );
|
sSearch += GetAttribute( rOpenTag, "xml:lang" );
|
||||||
//sReplace += Export::GetIsoLangByIndex( nIndex );
|
|
||||||
sReplace += sCur;
|
sReplace += sCur;
|
||||||
|
|
||||||
sAdditionalLine.SearchAndReplace( sSearch, sReplace );
|
sAdditionalLine.SearchAndReplace( sSearch, sReplace );
|
||||||
|
Reference in New Issue
Block a user