diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2010-06-02 15:41:00 +0200 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2010-06-02 15:41:00 +0200 |
commit | ddce8641531692de3174e290e9957372f5c0eebb (patch) | |
tree | 5fc0b81904e452677471e4788b7c6729300c4e75 /l10ntools | |
parent | c5934ada09feec288519cbdfbe1c0c988a2fceec (diff) |
consolidatereadme: #i111721# parse new readme format
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/source/merge.cxx | 3 | ||||
-rw-r--r-- | l10ntools/source/xrmlex.l | 55 | ||||
-rw-r--r-- | l10ntools/source/xrmmerge.cxx | 23 |
3 files changed, 48 insertions, 33 deletions
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index 3284b7026107..f5e7e097eb7d 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -335,7 +335,7 @@ MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive sLID = pResData->sId; pResData->sGId = sGID; pResData->sId = sLID; - + //printf("MergeData:: Search gid=%s lid=%s filename=%s \n", pResData->sGId.GetBuffer(),pResData->sId.GetBuffer(),pResData->sFilename.GetBuffer() ); ByteString sKey = CreateKey( pResData->sResTyp , pResData->sGId , pResData->sId , pResData->sFilename , bCaseSensitive ); //printf("DBG: Searching [%s]\n",sKey.GetBuffer()); @@ -345,6 +345,7 @@ MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive //printf("DBG: Found[%s]\n",sKey.GetBuffer()); return aMap[ sKey ]; } + //Dump(); pResData->sGId = sOldG; pResData->sId = sOldL; //printf("DBG: Found[%s]\n",sKey.GetBuffer()); diff --git a/l10ntools/source/xrmlex.l b/l10ntools/source/xrmlex.l index c28aede4c6c1..4770a851c741 100644 --- a/l10ntools/source/xrmlex.l +++ b/l10ntools/source/xrmlex.l @@ -55,54 +55,55 @@ int bText=0; %% -"<Readme"[^\>]*\> { - WorkOnTokenSet( XRM_README_START, yytext ); +"<p "[^\>]*xml:lang[^\>]*\> { + WorkOnTokenSet( XRM_TEXT_START , yytext ); } -"</Readme>" { - WorkOnTokenSet( XRM_README_END, yytext ); +"</p>" { + WorkOnTokenSet( XRM_TEXT_END, yytext ); } -"<apochelp"[^\>]*\> { - WorkOnTokenSet( XRM_README_START, yytext ); +"<h1 "[^\>]*xml:lang[^\>]*\> { + WorkOnTokenSet( XRM_TEXT_START , yytext ); } -"</apochelp>" { - WorkOnTokenSet( XRM_README_END, yytext ); +"</h1>" { + WorkOnTokenSet( XRM_TEXT_END, yytext ); } - -"<Section"[^\>]*\> { - WorkOnTokenSet( XRM_SECTION_START, yytext ); +"<h2 "[^\>]*xml:lang[^\>]*\> { + WorkOnTokenSet( XRM_TEXT_START , yytext ); } -"</Section>" { - WorkOnTokenSet( XRM_SECTION_END, yytext ); +"</h2>" { + WorkOnTokenSet( XRM_TEXT_END, yytext ); } - -"<Paragraph"[^\>]*\> { - WorkOnTokenSet( XRM_PARAGRAPH_START, yytext ); +"<h3 "[^\>]*xml:lang[^\>]*\> { + WorkOnTokenSet( XRM_TEXT_START , yytext ); } -"</Paragraph>" { - WorkOnTokenSet( XRM_PARAGRAPH_END, yytext ); +"</h3>" { + WorkOnTokenSet( XRM_TEXT_END, yytext ); } - -"<Text"[^\>]*\> { - WorkOnTokenSet( XRM_TEXT_START, yytext ); +"<h4 "[^\>]*xml:lang[^\>]*\> { + WorkOnTokenSet( XRM_TEXT_START , yytext ); } -"</Text>" { +"</h4>" { WorkOnTokenSet( XRM_TEXT_END, yytext ); } - -"<List"[^\>]*\> { - WorkOnTokenSet( XRM_LIST_START, yytext ); +"<h5 "[^\>]*xml:lang[^\>]*\> { + WorkOnTokenSet( XRM_TEXT_START , yytext ); } -"</List>" { - WorkOnTokenSet( XRM_LIST_END, yytext ); +"</h5>" { + WorkOnTokenSet( XRM_TEXT_END, yytext ); } + + + + + "<!--" { char c1 = 0, c2 = 0, c3 = input(); char pChar[2]; diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index 149fd560fe3b..87ba9e598b83 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -268,7 +268,7 @@ extern FILE *GetXrmFile() int WorkOnTokenSet( int nTyp, char *pTokenText ) /*****************************************************************************/ { -// printf("Typ = %d , text = '%s'\n",nTyp , pTokenText ); + //printf("Typ = %d , text = '%s'\n",nTyp , pTokenText ); pParser->Execute( nTyp, pTokenText ); return 1; @@ -370,6 +370,7 @@ int XRMResParser::Execute( int nToken, char * pToken ) case XRM_TEXT_START: // if ( sLocalized.GetChar( sLocalized.Len() - 1 ) == '1' ) { + //printf("hello world\n"); if ( sLocalized ) { ByteString sNewLID = GetAttribute( rToken, "id" ); @@ -605,8 +606,12 @@ void XRMResExport::EndOfText( sOutput += sPath; sOutput += "\t0\t"; sOutput += "readmeitem\t"; - sOutput += pResData->sGId; sOutput += "\t"; - sOutput += pResData->sId; sOutput += "\t\t\t0\t"; + sOutput += pResData->sId; + // USE LID AS GID OR MERGE DON'T WORK + //sOutput += pResData->sGId; + sOutput += "\t"; + sOutput += pResData->sId; + sOutput += "\t\t\t0\t"; sOutput += sCur; sOutput += "\t"; @@ -662,17 +667,25 @@ void XRMResMerge::WorkOnText( /*****************************************************************************/ { ByteString sLang( GetAttribute( rOpenTag, "xml:lang" )); + //ByteString gid("a"); if ( pMergeDataFile ) { if ( !pResData ) { ByteString sPlatform( "" ); - pResData = new ResData( sPlatform, GetGID() , sFilename ); +// pResData = new ResData( sPlatform, GetGID() , sFilename ); + pResData = new ResData( sPlatform, GetLID() , sFilename ); pResData->sId = GetLID(); + +// pResData = new ResData( sPlatform, GetGID() , sFilename ); +// pResData->sId = GetLID(); pResData->sResTyp = "readmeitem"; } - PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); + //printf("xrmmerge:: Search gid=%s lid=%s filename=%s \n", pResData->sGId.GetBuffer(),pResData->sId.GetBuffer(),pResData->sFilename.GetBuffer() ); + //pMergeDataFile->Dump(); + PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); if ( pEntrys ) { + //printf("found!!!\n"); ByteString sContent; if ( Export::isAllowed( sLang ) && ( pEntrys->GetText( |