Kaydet (Commit) e1a91a9c authored tarafından Zolnai Tamás's avatar Zolnai Tamás

Make src lists modifiable

This work when appending elements to the end of
list or deleting elements from list.

Change-Id: Ic0b920f79c72ebc3bf70555506466660b13d2aca
üst c2e25b82
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <vector> /* std::vector*/ #include <vector> /* std::vector*/
#include <queue> #include <queue>
#include <string> #include <string>
#include <map>
#include <unistd.h> #include <unistd.h>
#ifdef WNT #ifdef WNT
...@@ -329,6 +330,7 @@ public: ...@@ -329,6 +330,7 @@ public:
private: private:
static std::vector<rtl::OString> aLanguages; static std::vector<rtl::OString> aLanguages;
static std::vector<rtl::OString> aForcedLanguages; 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 WriteData( ResData *pResData, sal_Bool bCreateNew = sal_False );// called befor dest. cur ResData
sal_Bool WriteExportList( ResData *pResData, ExportList *pExportList, sal_Bool WriteExportList( ResData *pResData, ExportList *pExportList,
......
...@@ -988,7 +988,7 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew ) ...@@ -988,7 +988,7 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew )
rtl::OString sList( "pairedlist" ); rtl::OString sList( "pairedlist" );
WriteExportList( pResData, pResData->pPairedList, sList, bCreateNew ); WriteExportList( pResData, pResData->pPairedList, sList, bCreateNew );
if ( bCreateNew ) if ( bCreateNew )
pResData->pItemList = 0; pResData->pPairedList = 0;
} }
if ( pResData->pUIEntries ) { if ( pResData->pUIEntries ) {
rtl::OString sList( "uientries" ); rtl::OString sList( "uientries" );
...@@ -1531,6 +1531,7 @@ sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp, ...@@ -1531,6 +1531,7 @@ sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp,
} }
PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData );
const OString sKey = pResData->sId + pResData->sGId + pResData->sResTyp;
pResData->sId = sOldId; pResData->sId = sOldId;
pResData->sGId = sOldGId; pResData->sGId = sOldGId;
pResData->sResTyp = sOldTyp; pResData->sResTyp = sOldTyp;
...@@ -1548,6 +1549,9 @@ sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp, ...@@ -1548,6 +1549,9 @@ sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp,
return sal_False; // no data found 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)) if (Export::isSourceLanguage(rLangIndex))
return sal_False; return sal_False;
...@@ -1687,14 +1691,12 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) ...@@ -1687,14 +1691,12 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
if ( pList ) if ( pList )
nMaxIndex = pList->GetSourceLanguageListEntryCount(); nMaxIndex = pList->GetSourceLanguageListEntryCount();
pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); pEntrys = pMergeDataFile->GetPFormEntrys( pResData );
while( pEntrys && ( nLIndex < nMaxIndex )) { while( nLIndex < nMaxIndex ) {
rtl::OString sText; rtl::OString sText;
sal_Bool bText; if( !pEntrys || !pEntrys->GetTransex3Text( sText, STRING_TYP_TEXT, sCur, sal_True ) )
bText = pEntrys->GetTransex3Text( sText, STRING_TYP_TEXT, sCur, sal_True ); sText = aOrigListItems.find(pResData->sId + pResData->sGId + pResData->sResTyp)->second;
if( !bText )
bText = pEntrys->GetTransex3Text( sText , STRING_TYP_TEXT, SOURCE_LANGUAGE , sal_False );
if ( bText && !sText.isEmpty()) if (!sText.isEmpty())
{ {
if ( nIdx == 1 ) if ( nIdx == 1 )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment