xref: /aoo41x/main/l10ntools/source/lngmerge.cxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_l10ntools.hxx"
30*cdf0e10cSrcweir #include <tools/fsys.hxx>
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir // local includes
33*cdf0e10cSrcweir #include "lngmerge.hxx"
34*cdf0e10cSrcweir #include "utf8conv.hxx"
35*cdf0e10cSrcweir #include <iostream>
36*cdf0e10cSrcweir using namespace std;
37*cdf0e10cSrcweir //
38*cdf0e10cSrcweir // class LngParser
39*cdf0e10cSrcweir //
40*cdf0e10cSrcweir /*****************************************************************************/
41*cdf0e10cSrcweir LngParser::LngParser( const ByteString &rLngFile, sal_Bool bUTF8, sal_Bool bULFFormat )
42*cdf0e10cSrcweir /*****************************************************************************/
43*cdf0e10cSrcweir 				:
44*cdf0e10cSrcweir 				nError( LNG_OK ),
45*cdf0e10cSrcweir 				pLines( NULL ),
46*cdf0e10cSrcweir                 sSource( rLngFile ),
47*cdf0e10cSrcweir 				bDBIsUTF8( bUTF8 ),
48*cdf0e10cSrcweir 				bULF( bULFFormat )
49*cdf0e10cSrcweir {
50*cdf0e10cSrcweir 	pLines = new LngLineList( 100, 100 );
51*cdf0e10cSrcweir 	DirEntry aEntry( String( sSource, RTL_TEXTENCODING_ASCII_US ));
52*cdf0e10cSrcweir 	if ( aEntry.Exists()) {
53*cdf0e10cSrcweir 		SvFileStream aStream( String( sSource, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ );
54*cdf0e10cSrcweir 		if ( aStream.IsOpen()) {
55*cdf0e10cSrcweir 			ByteString sLine;
56*cdf0e10cSrcweir             bool bFirstLine = true;
57*cdf0e10cSrcweir             while ( !aStream.IsEof()) {
58*cdf0e10cSrcweir 				aStream.ReadLine( sLine );
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir                 if( bFirstLine ){       // Always remove UTF8 BOM from the first line
61*cdf0e10cSrcweir                     Export::RemoveUTF8ByteOrderMarker( sLine );
62*cdf0e10cSrcweir                     bFirstLine = false;
63*cdf0e10cSrcweir                 }
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir                 pLines->Insert( new ByteString( sLine ), LIST_APPEND );
66*cdf0e10cSrcweir 			}
67*cdf0e10cSrcweir 		}
68*cdf0e10cSrcweir 		else
69*cdf0e10cSrcweir 			nError = LNG_COULD_NOT_OPEN;
70*cdf0e10cSrcweir 	}
71*cdf0e10cSrcweir 	else
72*cdf0e10cSrcweir 		nError = LNG_FILE_NOTFOUND;
73*cdf0e10cSrcweir }
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir /*****************************************************************************/
76*cdf0e10cSrcweir LngParser::~LngParser()
77*cdf0e10cSrcweir /*****************************************************************************/
78*cdf0e10cSrcweir {
79*cdf0e10cSrcweir 	for ( sal_uLong i = 0; i < pLines->Count(); i++ )
80*cdf0e10cSrcweir 		delete pLines->GetObject( i );
81*cdf0e10cSrcweir 	delete pLines;
82*cdf0e10cSrcweir }
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir /*****************************************************************************/
85*cdf0e10cSrcweir void LngParser::FillInFallbacks( ByteStringHashMap Text )
86*cdf0e10cSrcweir /*****************************************************************************/
87*cdf0e10cSrcweir {
88*cdf0e10cSrcweir     ByteString sCur;
89*cdf0e10cSrcweir     for( unsigned int n = 0; n < aLanguages.size(); n++ ){
90*cdf0e10cSrcweir         sCur = aLanguages[ n ];
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir         if( Export::isAllowed( sCur ) ){
93*cdf0e10cSrcweir             ByteString sFallbackLang = Export::GetFallbackLanguage( sCur );
94*cdf0e10cSrcweir             if( sFallbackLang.Len() ){
95*cdf0e10cSrcweir                 Text[ sCur ] = Text[ sFallbackLang ];
96*cdf0e10cSrcweir             }
97*cdf0e10cSrcweir 		}
98*cdf0e10cSrcweir 	}
99*cdf0e10cSrcweir }
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir /*****************************************************************************/
102*cdf0e10cSrcweir sal_Bool LngParser::CreateSDF(
103*cdf0e10cSrcweir 	const ByteString &rSDFFile, const ByteString &rPrj,
104*cdf0e10cSrcweir 	const ByteString &rRoot )
105*cdf0e10cSrcweir /*****************************************************************************/
106*cdf0e10cSrcweir {
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir     Export::InitLanguages( false );
109*cdf0e10cSrcweir     aLanguages = Export::GetLanguages();
110*cdf0e10cSrcweir     SvFileStream aSDFStream( String( rSDFFile, RTL_TEXTENCODING_ASCII_US ),
111*cdf0e10cSrcweir 		STREAM_STD_WRITE | STREAM_TRUNC );
112*cdf0e10cSrcweir 	if ( !aSDFStream.IsOpen()) {
113*cdf0e10cSrcweir 		nError = SDF_COULD_NOT_OPEN;
114*cdf0e10cSrcweir 	}
115*cdf0e10cSrcweir     aSDFStream.SetStreamCharSet( RTL_TEXTENCODING_UTF8 );
116*cdf0e10cSrcweir     nError = SDF_OK;
117*cdf0e10cSrcweir 	DirEntry aEntry( String( sSource, RTL_TEXTENCODING_ASCII_US ));
118*cdf0e10cSrcweir 	aEntry.ToAbs();
119*cdf0e10cSrcweir 	String sFullEntry = aEntry.GetFull();
120*cdf0e10cSrcweir 	aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US ));
121*cdf0e10cSrcweir 	aEntry += DirEntry( rRoot );
122*cdf0e10cSrcweir 	ByteString sPrjEntry( aEntry.GetFull(), gsl_getSystemTextEncoding());
123*cdf0e10cSrcweir 	ByteString sActFileName(
124*cdf0e10cSrcweir 		sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding());
125*cdf0e10cSrcweir 	sActFileName.SearchAndReplaceAll( "/", "\\" );
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir 	sal_uLong nPos  = 0;
128*cdf0e10cSrcweir 	sal_Bool bStart = true;
129*cdf0e10cSrcweir 	ByteString sGroup;
130*cdf0e10cSrcweir   	ByteStringHashMap Text;
131*cdf0e10cSrcweir     ByteString sID;
132*cdf0e10cSrcweir     ByteString sLine;
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir     while( nPos < pLines->Count() ){
135*cdf0e10cSrcweir         sLine = *pLines->GetObject( nPos++ );
136*cdf0e10cSrcweir         while( nPos < pLines->Count() && !isNextGroup( sGroup , sLine ) ){
137*cdf0e10cSrcweir             ReadLine( sLine , Text );
138*cdf0e10cSrcweir             sID = sGroup;
139*cdf0e10cSrcweir             sLine = *pLines->GetObject( nPos++ );
140*cdf0e10cSrcweir         };
141*cdf0e10cSrcweir         if( bStart ){
142*cdf0e10cSrcweir             bStart = false;
143*cdf0e10cSrcweir             sID = sGroup;
144*cdf0e10cSrcweir         }
145*cdf0e10cSrcweir         else {
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir             WriteSDF( aSDFStream , Text , rPrj , rRoot , sActFileName , sID );
148*cdf0e10cSrcweir         }
149*cdf0e10cSrcweir     }
150*cdf0e10cSrcweir 	aSDFStream.Close();
151*cdf0e10cSrcweir 	return true;
152*cdf0e10cSrcweir }
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir  void LngParser::WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_inout ,
155*cdf0e10cSrcweir      const ByteString &rPrj , const ByteString &rRoot ,
156*cdf0e10cSrcweir      const ByteString &sActFileName , const ByteString &sID )
157*cdf0e10cSrcweir  {
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir     sal_Bool bExport = true;
160*cdf0e10cSrcweir     if ( bExport ) {
161*cdf0e10cSrcweir    		ByteString sTimeStamp( Export::GetTimeStamp());
162*cdf0e10cSrcweir         ByteString sCur;
163*cdf0e10cSrcweir 		FillInFallbacks( rText_inout );
164*cdf0e10cSrcweir         for( unsigned int n = 0; n < aLanguages.size(); n++ ){
165*cdf0e10cSrcweir             sCur = aLanguages[ n ];
166*cdf0e10cSrcweir             ByteString sAct = rText_inout[ sCur ];
167*cdf0e10cSrcweir             if ( !sAct.Len() && sCur.Len() )
168*cdf0e10cSrcweir                 sAct = rText_inout[ ByteString("en-US") ];
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir             ByteString sOutput( rPrj ); sOutput += "\t";
171*cdf0e10cSrcweir 			if ( rRoot.Len())
172*cdf0e10cSrcweir 			    sOutput += sActFileName;
173*cdf0e10cSrcweir 			sOutput += "\t0\t";
174*cdf0e10cSrcweir 			sOutput += "LngText\t";
175*cdf0e10cSrcweir 			sOutput += sID; sOutput += "\t\t\t\t0\t";
176*cdf0e10cSrcweir 			sOutput += sCur; sOutput += "\t";
177*cdf0e10cSrcweir 			sOutput += sAct; sOutput += "\t\t\t\t";
178*cdf0e10cSrcweir 			sOutput += sTimeStamp;
179*cdf0e10cSrcweir             //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( rPrj ) ) )
180*cdf0e10cSrcweir             aSDFStream.WriteLine( sOutput );
181*cdf0e10cSrcweir 		}
182*cdf0e10cSrcweir     }
183*cdf0e10cSrcweir  }
184*cdf0e10cSrcweir  bool LngParser::isNextGroup( ByteString &sGroup_out , ByteString &sLine_in ){
185*cdf0e10cSrcweir 	sLine_in.EraseLeadingChars( ' ' );
186*cdf0e10cSrcweir 	sLine_in.EraseTrailingChars( ' ' );
187*cdf0e10cSrcweir 	if (( sLine_in.GetChar( 0 ) == '[' ) &&
188*cdf0e10cSrcweir 			( sLine_in.GetChar( sLine_in.Len() - 1 ) == ']' )){
189*cdf0e10cSrcweir 		sGroup_out = sLine_in.GetToken( 1, '[' ).GetToken( 0, ']' );
190*cdf0e10cSrcweir 		sGroup_out.EraseLeadingChars( ' ' );
191*cdf0e10cSrcweir 		sGroup_out.EraseTrailingChars( ' ' );
192*cdf0e10cSrcweir 		return true;
193*cdf0e10cSrcweir 	}
194*cdf0e10cSrcweir     return false;
195*cdf0e10cSrcweir  }
196*cdf0e10cSrcweir  void LngParser::ReadLine( const ByteString &sLine_in , ByteStringHashMap &rText_inout){
197*cdf0e10cSrcweir     //printf("sLine -> '%s'\n",sLine_in.GetBuffer());
198*cdf0e10cSrcweir     ByteString sLang = sLine_in.GetToken( 0, '=' );
199*cdf0e10cSrcweir 	sLang.EraseLeadingChars( ' ' );
200*cdf0e10cSrcweir 	sLang.EraseTrailingChars( ' ' );
201*cdf0e10cSrcweir 	ByteString sText = sLine_in.GetToken( 1, '\"' ).GetToken( 0, '\"' );
202*cdf0e10cSrcweir 	if( sLang.Len() )
203*cdf0e10cSrcweir         rText_inout[ sLang ] = sText;
204*cdf0e10cSrcweir  }
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir /*****************************************************************************/
207*cdf0e10cSrcweir sal_Bool LngParser::Merge(
208*cdf0e10cSrcweir 	const ByteString &rSDFFile, const ByteString &rDestinationFile , const ByteString& rPrj )
209*cdf0e10cSrcweir /*****************************************************************************/
210*cdf0e10cSrcweir {
211*cdf0e10cSrcweir     (void) rPrj;
212*cdf0e10cSrcweir     Export::InitLanguages( true );
213*cdf0e10cSrcweir     SvFileStream aDestination(
214*cdf0e10cSrcweir 		String( rDestinationFile, RTL_TEXTENCODING_ASCII_US ),
215*cdf0e10cSrcweir 		STREAM_STD_WRITE | STREAM_TRUNC );
216*cdf0e10cSrcweir 	if ( !aDestination.IsOpen()) {
217*cdf0e10cSrcweir 		nError = LNG_COULD_NOT_OPEN;
218*cdf0e10cSrcweir 	}
219*cdf0e10cSrcweir 	nError = LNG_OK;
220*cdf0e10cSrcweir //    MergeDataFile( const ByteString &rFileName, const ByteString& rFile , sal_Bool bErrLog, CharSet aCharSet, sal_Bool bUTF8 );
221*cdf0e10cSrcweir 
222*cdf0e10cSrcweir 	MergeDataFile aMergeDataFile( rSDFFile, sSource , sal_False, RTL_TEXTENCODING_MS_1252);//, bDBIsUTF8 );
223*cdf0e10cSrcweir     ByteString sTmp( Export::sLanguages );
224*cdf0e10cSrcweir     if( sTmp.ToUpperAscii().Equals("ALL") )
225*cdf0e10cSrcweir         Export::SetLanguages( aMergeDataFile.GetLanguages() );
226*cdf0e10cSrcweir     aLanguages = Export::GetLanguages();
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir 	sal_uLong nPos = 0;
229*cdf0e10cSrcweir 	sal_Bool bGroup = sal_False;
230*cdf0e10cSrcweir 	ByteString sGroup;
231*cdf0e10cSrcweir 
232*cdf0e10cSrcweir 	// seek to next group
233*cdf0e10cSrcweir 	while ( nPos < pLines->Count() && !bGroup ) {
234*cdf0e10cSrcweir 		ByteString sLine( *pLines->GetObject( nPos ));
235*cdf0e10cSrcweir 		sLine.EraseLeadingChars( ' ' );
236*cdf0e10cSrcweir 		sLine.EraseTrailingChars( ' ' );
237*cdf0e10cSrcweir 		if (( sLine.GetChar( 0 ) == '[' ) &&
238*cdf0e10cSrcweir 			( sLine.GetChar( sLine.Len() - 1 ) == ']' ))
239*cdf0e10cSrcweir 		{
240*cdf0e10cSrcweir 			sGroup = sLine.GetToken( 1, '[' ).GetToken( 0, ']' );
241*cdf0e10cSrcweir 			sGroup.EraseLeadingChars( ' ' );
242*cdf0e10cSrcweir 			sGroup.EraseTrailingChars( ' ' );
243*cdf0e10cSrcweir 			bGroup = sal_True;
244*cdf0e10cSrcweir 		}
245*cdf0e10cSrcweir 		nPos ++;
246*cdf0e10cSrcweir 	}
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir 	while ( nPos < pLines->Count()) {
249*cdf0e10cSrcweir         ByteStringHashMap Text;
250*cdf0e10cSrcweir 		ByteString sID( sGroup );
251*cdf0e10cSrcweir 		sal_uLong nLastLangPos = 0;
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir 		ResData  *pResData = new ResData( "", sID , sSource );
254*cdf0e10cSrcweir         pResData->sResTyp = "LngText";
255*cdf0e10cSrcweir 		PFormEntrys *pEntrys = aMergeDataFile.GetPFormEntrys( pResData );
256*cdf0e10cSrcweir 		// read languages
257*cdf0e10cSrcweir 		bGroup = sal_False;
258*cdf0e10cSrcweir 
259*cdf0e10cSrcweir 		ByteString sLanguagesDone;
260*cdf0e10cSrcweir 
261*cdf0e10cSrcweir 		while ( nPos < pLines->Count() && !bGroup ) {
262*cdf0e10cSrcweir 			ByteString sLine( *pLines->GetObject( nPos ));
263*cdf0e10cSrcweir 			sLine.EraseLeadingChars( ' ' );
264*cdf0e10cSrcweir 			sLine.EraseTrailingChars( ' ' );
265*cdf0e10cSrcweir 			if (( sLine.GetChar( 0 ) == '[' ) &&
266*cdf0e10cSrcweir 				( sLine.GetChar( sLine.Len() - 1 ) == ']' ))
267*cdf0e10cSrcweir 			{
268*cdf0e10cSrcweir 				sGroup = sLine.GetToken( 1, '[' ).GetToken( 0, ']' );
269*cdf0e10cSrcweir 				sGroup.EraseLeadingChars( ' ' );
270*cdf0e10cSrcweir 				sGroup.EraseTrailingChars( ' ' );
271*cdf0e10cSrcweir 				bGroup = sal_True;
272*cdf0e10cSrcweir 				nPos ++;
273*cdf0e10cSrcweir 				sLanguagesDone = "";
274*cdf0e10cSrcweir 			}
275*cdf0e10cSrcweir 			else if ( sLine.GetTokenCount( '=' ) > 1 ) {
276*cdf0e10cSrcweir 				ByteString sLang = sLine.GetToken( 0, '=' );
277*cdf0e10cSrcweir 				sLang.EraseLeadingChars( ' ' );
278*cdf0e10cSrcweir 				sLang.EraseTrailingChars( ' ' );
279*cdf0e10cSrcweir 
280*cdf0e10cSrcweir 				ByteString sSearch( ";" );
281*cdf0e10cSrcweir 				sSearch += sLang;
282*cdf0e10cSrcweir 				sSearch += ";";
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir 				if (( sLanguagesDone.Search( sSearch ) != STRING_NOTFOUND )) {
285*cdf0e10cSrcweir 					pLines->Remove( nPos );
286*cdf0e10cSrcweir 				}
287*cdf0e10cSrcweir                 if( bULF && pEntrys )
288*cdf0e10cSrcweir 				{
289*cdf0e10cSrcweir 					// this is a valid text line
290*cdf0e10cSrcweir 					ByteString sText = sLine.GetToken( 1, '\"' ).GetToken( 0, '\"' );
291*cdf0e10cSrcweir                     if( sLang.Len() ){
292*cdf0e10cSrcweir 						ByteString sNewText;
293*cdf0e10cSrcweir                         pEntrys->GetText( sNewText, STRING_TYP_TEXT, sLang, sal_True );
294*cdf0e10cSrcweir 
295*cdf0e10cSrcweir 						if ( sNewText.Len()) {
296*cdf0e10cSrcweir 							ByteString *pLine = pLines->GetObject( nPos );
297*cdf0e10cSrcweir 
298*cdf0e10cSrcweir 								ByteString sText1( sLang );
299*cdf0e10cSrcweir 								sText1 += " = \"";
300*cdf0e10cSrcweir 								sText1 += sNewText;
301*cdf0e10cSrcweir 								sText1 += "\"";
302*cdf0e10cSrcweir 								*pLine = sText1;
303*cdf0e10cSrcweir 							//}
304*cdf0e10cSrcweir                             Text[ sLang ] = sNewText;
305*cdf0e10cSrcweir 						}
306*cdf0e10cSrcweir 					}
307*cdf0e10cSrcweir 					nLastLangPos = nPos;
308*cdf0e10cSrcweir 					nPos ++;
309*cdf0e10cSrcweir 					sLanguagesDone += sSearch;
310*cdf0e10cSrcweir 				}
311*cdf0e10cSrcweir 				else {
312*cdf0e10cSrcweir 					nLastLangPos = nPos;
313*cdf0e10cSrcweir 					nPos ++;
314*cdf0e10cSrcweir 					sLanguagesDone += sSearch;
315*cdf0e10cSrcweir 				}
316*cdf0e10cSrcweir 			}
317*cdf0e10cSrcweir 			else
318*cdf0e10cSrcweir 				nPos++;
319*cdf0e10cSrcweir 		}
320*cdf0e10cSrcweir 		ByteString sCur;
321*cdf0e10cSrcweir         if ( nLastLangPos ) {
322*cdf0e10cSrcweir             for( unsigned int n = 0; n < aLanguages.size(); n++ ){
323*cdf0e10cSrcweir                 sCur = aLanguages[ n ];
324*cdf0e10cSrcweir                 if(   //( !sCur.EqualsIgnoreCaseAscii("de") ||
325*cdf0e10cSrcweir                       //( sCur.EqualsIgnoreCaseAscii("de") && Export::isMergingGermanAllowed( rPrj ) ) )
326*cdf0e10cSrcweir                     !sCur.EqualsIgnoreCaseAscii("en-US") && !Text[ sCur ].Len() && pEntrys ){
327*cdf0e10cSrcweir 
328*cdf0e10cSrcweir                     ByteString sNewText;
329*cdf0e10cSrcweir                     pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur, sal_True );
330*cdf0e10cSrcweir                     if (( sNewText.Len()) &&
331*cdf0e10cSrcweir                         !(( sCur.Equals("x-comment") ) && ( sNewText == "-" )))
332*cdf0e10cSrcweir 					{
333*cdf0e10cSrcweir 						ByteString sLine;
334*cdf0e10cSrcweir                         sLine += sCur;
335*cdf0e10cSrcweir 						sLine += " = \"";
336*cdf0e10cSrcweir 						sLine += sNewText;
337*cdf0e10cSrcweir 						sLine += "\"";
338*cdf0e10cSrcweir 
339*cdf0e10cSrcweir 						nLastLangPos++;
340*cdf0e10cSrcweir 						nPos++;
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir 						pLines->Insert( new ByteString( sLine ), nLastLangPos );
343*cdf0e10cSrcweir 					}
344*cdf0e10cSrcweir 				}
345*cdf0e10cSrcweir 			}
346*cdf0e10cSrcweir 		}
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir 		delete pResData;
349*cdf0e10cSrcweir 	}
350*cdf0e10cSrcweir 
351*cdf0e10cSrcweir 	for ( sal_uLong i = 0; i < pLines->Count(); i++ )
352*cdf0e10cSrcweir 		aDestination.WriteLine( *pLines->GetObject( i ));
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir 	aDestination.Close();
355*cdf0e10cSrcweir 	return sal_True;
356*cdf0e10cSrcweir }
357