diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2012-12-09 17:03:56 +0100 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2012-12-09 17:17:59 +0100 |
commit | e1a91a9ceda6020bb256739e83dc371a50af3b1d (patch) | |
tree | 78c90d13ba525772065b1d7ce3ad946e64b2e4c5 /l10ntools | |
parent | c2e25b82f0cf43afc86126f1fb5066693cd00d07 (diff) |
Make src lists modifiable
This work when appending elements to the end of
list or deleting elements from list.
Change-Id: Ic0b920f79c72ebc3bf70555506466660b13d2aca
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/inc/export.hxx | 2 | ||||
-rw-r--r-- | l10ntools/source/export.cxx | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index af94c17b5c2b..ecc9e2e515c7 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -39,6 +39,7 @@ #include <vector> /* std::vector*/ #include <queue> #include <string> +#include <map> #include <unistd.h> #ifdef WNT @@ -329,6 +330,7 @@ public: private: static std::vector<rtl::OString> aLanguages; static std::vector<rtl::OString> aForcedLanguages; + std::map<OString,OString> aOrigListItems; sal_Bool WriteData( ResData *pResData, sal_Bool bCreateNew = sal_False );// called befor dest. cur ResData sal_Bool WriteExportList( ResData *pResData, ExportList *pExportList, diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 13870da558a2..471ac104c52a 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -988,7 +988,7 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew ) rtl::OString sList( "pairedlist" ); WriteExportList( pResData, pResData->pPairedList, sList, bCreateNew ); if ( bCreateNew ) - pResData->pItemList = 0; + pResData->pPairedList = 0; } if ( pResData->pUIEntries ) { rtl::OString sList( "uientries" ); @@ -1531,6 +1531,7 @@ sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp, } PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); + const OString sKey = pResData->sId + pResData->sGId + pResData->sResTyp; pResData->sId = sOldId; pResData->sGId = sOldGId; pResData->sResTyp = sOldTyp; @@ -1548,6 +1549,9 @@ sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp, return sal_False; // no data found } + if (rLangIndex == "en-US") + aOrigListItems.insert(std::pair<OString,OString>(sKey,rText.copy(nStart+1,nEnd-nStart-1))); + if (Export::isSourceLanguage(rLangIndex)) return sal_False; @@ -1687,14 +1691,12 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) if ( pList ) nMaxIndex = pList->GetSourceLanguageListEntryCount(); pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); - while( pEntrys && ( nLIndex < nMaxIndex )) { + while( nLIndex < nMaxIndex ) { rtl::OString sText; - sal_Bool bText; - bText = pEntrys->GetTransex3Text( sText, STRING_TYP_TEXT, sCur, sal_True ); - if( !bText ) - bText = pEntrys->GetTransex3Text( sText , STRING_TYP_TEXT, SOURCE_LANGUAGE , sal_False ); + if( !pEntrys || !pEntrys->GetTransex3Text( sText, STRING_TYP_TEXT, sCur, sal_True ) ) + sText = aOrigListItems.find(pResData->sId + pResData->sGId + pResData->sResTyp)->second; - if ( bText && !sText.isEmpty()) + if (!sText.isEmpty()) { if ( nIdx == 1 ) { |