[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source
Zolnai Tamás
zolnaitamas2000 at gmail.com
Mon Apr 15 09:45:14 PDT 2013
l10ntools/inc/export.hxx | 3 --
l10ntools/source/export.cxx | 49 +-------------------------------------------
2 files changed, 2 insertions(+), 50 deletions(-)
New commits:
commit 10e3c7c428a7d231055d643e12f454c4267deab2
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date: Mon Apr 15 17:58:24 2013 +0200
Delete remaind code of an obsolote parameter
Past: Use "-l en-US, af, hu..." parameter for transex
and to work with this string use InitLanguages() function.
Now: Use "-l all" parameter and get langauges from po files.
So InitLanguages is unneeded.
Change-Id: Ide6b3d24fb8b483c0c31034b1ffd6aba31c5e4c9
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 719102d..35f9772 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -206,7 +206,6 @@ private:
sal_Bool bReadOver;
sal_Bool bDontWriteOutput;
OString sLastTextTyp;
- bool isInitialized;
OString sFilename;
OString sLanguages;
@@ -238,8 +237,6 @@ private:
void WriteToMerged(const OString &rText , bool bSDFContent);
void SetChildWithText();
- void InitLanguages( bool bMergeMode = false );
-
void CutComment( OString &rText );
public:
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 6a93531..bf1fbce 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -189,12 +189,10 @@ Export::Export(const OString &rOutput)
bError( sal_False ),
bReadOver( sal_False ),
bDontWriteOutput( sal_False ),
- isInitialized( false ),
sFilename( global::inputPathname ),
sLanguages( OString() ),
pParseQueue( new ParserQueue( *this ) )
{
- // open output stream
aOutput.mPo = new PoOfstream( rOutput, PoOfstream::APP );
if (!aOutput.mPo->isOpen()) {
fprintf(stderr, "ERROR : Can't open file %s\n", rOutput.getStr());
@@ -218,15 +216,10 @@ Export::Export(
bError( sal_False ),
bReadOver( sal_False ),
bDontWriteOutput( sal_False ),
- isInitialized( false ),
sFilename( global::inputPathname ),
sLanguages( rLanguage ),
pParseQueue( new ParserQueue( *this ) )
{
- InitLanguages( bMergeMode );
- // used when merge is enabled
-
- // open output stream
aOutput.mSimple = new std::ofstream();
aOutput.mSimple->open(rOutput.getStr(), std::ios_base::out | std::ios_base::trunc);
}
@@ -1442,15 +1435,7 @@ sal_Bool Export::PrepareTextToMerge(OString &rText, sal_uInt16 nTyp,
// search for merge data
if ( !pMergeDataFile ){
pMergeDataFile = new MergeDataFile( sMergeSrc, global::inputPathname, false );
-
- // Init Languages
- if( Export::sLanguages.equalsIgnoreAsciiCase("ALL") )
- {
- aLanguages = pMergeDataFile->GetLanguages();
- isInitialized = true;
- }
- else if( !isInitialized )InitLanguages();
-
+ aLanguages = pMergeDataFile->GetLanguages();
}
MergeEntrys *pEntrys = pMergeDataFile->GetMergeEntrys( pResData );
@@ -1546,14 +1531,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
{
if ( !pMergeDataFile ){
pMergeDataFile = new MergeDataFile( sMergeSrc, global::inputPathname, false );
-
- // Init Languages
- if (Export::sLanguages.equalsIgnoreAsciiCase("ALL"))
- {
- aLanguages = pMergeDataFile->GetLanguages();
- isInitialized = true;
- }
- else if( !isInitialized )InitLanguages();
+ aLanguages = pMergeDataFile->GetLanguages();
}
switch ( nMode ) {
@@ -1848,29 +1826,6 @@ void Export::SetChildWithText()
}
}
-void Export::InitLanguages( bool bMerge ){
-
- if( !isInitialized )
- {
- OString sTmp;
- OStringBoolHashMap aEnvLangs;
-
- sal_Int32 nIndex = 0;
- do
- {
- OString aToken = sLanguages.getToken(0, ',', nIndex);
- sTmp = aToken.getToken(0, '=').trim();
- if( bMerge && sTmp.equalsIgnoreAsciiCase("en-US") ){}
- else if( !( (sTmp[0]=='x' || sTmp[0]=='X') && sTmp[1]=='-' ) ){
- aLanguages.push_back( sTmp );
- }
- }
- while ( nIndex >= 0 );
-
- isInitialized = true;
- }
-}
-
void ParserQueue::Push( const QueueEntry& aEntry )
{
sal_Int32 nLen = aEntry.sLine.getLength();
More information about the Libreoffice-commits
mailing list