diff options
author | Nils Fuhrmann <nf@openoffice.org> | 2000-11-28 13:53:39 +0000 |
---|---|---|
committer | Nils Fuhrmann <nf@openoffice.org> | 2000-11-28 13:53:39 +0000 |
commit | 869963a295b3923eb0e9744f6235ac62442eba6f (patch) | |
tree | a4936dfa1310d1426cd758d44dabeb9b617ceed8 /transex3 | |
parent | 73c7f91a6924e182ea6e84d25268c31a8988c9a3 (diff) |
Fix: Merging now possible, needed for #80592#
Diffstat (limited to 'transex3')
-rw-r--r-- | transex3/source/cfgmerge.cxx | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/transex3/source/cfgmerge.cxx b/transex3/source/cfgmerge.cxx index 2bad63930677..e6386b7f47a4 100644 --- a/transex3/source/cfgmerge.cxx +++ b/transex3/source/cfgmerge.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cfgmerge.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: nf $ $Date: 2000-11-22 13:56:02 $ + * last change: $Author: nf $ $Date: 2000-11-28 14:53:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -373,6 +373,9 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) { ByteString sToken( pToken ); + if ( sToken == " " || sToken == "\t" ) + sLastWhitespace += sToken; + ByteString sTokenName; ByteString sTokenId; @@ -427,7 +430,8 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) case CFG_CLOSETAG: sTokenName = sToken.GetToken( 1, '/' ).GetToken( 0, '>' ).GetToken( 0, ' ' ); if ( aStack.GetStackData() && ( aStack.GetStackData()->GetTagType() == sTokenName )) { - WorkOnRessourceEnd(); + if ( ! sCurrentText.Len()) + WorkOnRessourceEnd(); aStack.Pop(); pStackData = aStack.GetStackData(); } @@ -454,6 +458,9 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) if ( bOutput ) Output( sToken ); + if ( sToken != " " && sToken != "\t" ) + sLastWhitespace = ""; + return 1; } @@ -721,14 +728,30 @@ void CfgMerge::WorkOnRessourceEnd() Export::QuotHTML( sText ); - ByteString sAdditionalLine; - for ( ULONG i = 0; i < aStack.Count() - 1; i++ ) - sAdditionalLine += "\t"; + ByteString sAdditionalLine( "\t" ); + + ByteString sTextTag = pStackData->sTextTag; + ByteString sTemp = sTextTag.Copy( sTextTag.Search( "xml:lang=" )); + + ByteString sSearch = sTemp.GetToken( 0, '\"' ); + sSearch += "\""; + sSearch += sTemp.GetToken( 1, '\"' ); + sSearch += "\""; - sAdditionalLine += pStackData->sTextTag; + ByteString sReplace = sTemp.GetToken( 0, '\"' ); + sReplace += "\""; + sReplace += Export::GetIsoLangByIndex( nIndex ); + sReplace += "\""; + + sTextTag.SearchAndReplace( sSearch, sReplace ); + + sAdditionalLine += sTextTag; sAdditionalLine += sText; sAdditionalLine += pStackData->sEndTextTag; + sAdditionalLine += "\n"; + sAdditionalLine += sLastWhitespace; + Output( sAdditionalLine ); } } |