[Libreoffice-commits] .: l10ntools/inc l10ntools/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Dec 9 08:20:46 PST 2012
l10ntools/inc/export.hxx | 2 ++
l10ntools/source/export.cxx | 16 +++++++++-------
2 files changed, 11 insertions(+), 7 deletions(-)
New commits:
commit e1a91a9ceda6020bb256739e83dc371a50af3b1d
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date: Sun Dec 9 17:03:56 2012 +0100
Make src lists modifiable
This work when appending elements to the end of
list or deleting elements from list.
Change-Id: Ic0b920f79c72ebc3bf70555506466660b13d2aca
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index af94c17..ecc9e2e 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 13870da..471ac10 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 )
{
More information about the Libreoffice-commits
mailing list