[Libreoffice-commits] .: l10ntools/inc l10ntools/source unusedcode.easy

2012-03-27 Thread Caolán McNamara
 l10ntools/inc/xmlparse.hxx|6 
 l10ntools/source/xmlparse.cxx |   61 --
 unusedcode.easy   |2 -
 3 files changed, 69 deletions(-)

New commits:
commit a84e97e58fe0915376801f98e1c0d24470f1e1d3
Author: Santiago Martinez 
Date:   Tue Mar 27 21:16:50 2012 +0200

Remove unused code in l10ntools.

diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index cd9bc2b..0731a9f 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -169,13 +169,7 @@ public:
 XMLChildNode *pChild , size_t pos   /// the new child
 );
 
-int RemoveChild( XMLElement *pRefElement );
 void RemoveAndDeleteAllChildren();
-
-/// returns a child element which matches the given one
-XMLElement *GetChildElement(
-XMLElement *pRefElement // the reference elelement
-);
 };
 
 //-
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index e646308..5be1f0e 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -159,37 +159,6 @@ void XMLParentNode::AddChild( XMLChildNode *pChild , 
size_t pos )
 }
 
 /*/
-int XMLParentNode::RemoveChild( XMLElement *pRefElement )
-/*/
-{
-XMLElement* a;
-if ( pChildList ){
-for ( size_t i = 0; i < pChildList->size(); i++ ) {
-XMLChildNode *pChild = (*pChildList)[ i ];
-if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ){
-a = static_cast(pChild);
-rtl::OString elemid(a->GetId().toAsciiLowerCase());
-rtl::OString elemLID(a->GetLanguageId().toAsciiLowerCase());
-rtl::OString pRefLID(
-pRefElement->GetLanguageId().toAsciiLowerCase());
-if (elemid == pRefElement->GetId() && elemLID == pRefLID)
-{
-if( pRefElement->ToOString().compareTo( a->ToOString() 
)==0 ){
-XMLChildNodeList::iterator it = pChildList->begin();
-::std::advance( it, i );
-pChildList->erase( it );
-delete a; // Test
-return i;
-}
-}
-}
-
-}
-}
-return -1;
-}
-
-/*/
 void XMLParentNode::RemoveAndDeleteAllChildren(){
 /*/
 if ( pChildList ) {
@@ -199,36 +168,6 @@ void XMLParentNode::RemoveAndDeleteAllChildren(){
 }
 }
 
-/*/
-XMLElement *XMLParentNode::GetChildElement( XMLElement *pRefElement )
-/*/
-{
-for ( size_t i = 0; i < pChildList->size(); i++ ) {
-XMLChildNode *pChild = (*pChildList)[ i ];
-if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT )
-if ((( XMLElement * ) pChild )->GetName() ==
-pRefElement->GetName())
-{
-XMLAttributeList *pList = pRefElement->GetAttributeList();
-if ( !pList )
-return ( XMLElement * ) pChild;
-
-sal_Bool bMatch = sal_False;
-for ( size_t j = 0; j < pList->size() && bMatch; j++ ) {
-XMLAttribute *pAttribute = (*pList)[ j ];
-XMLAttribute *pCandidate =
-(( XMLElement * ) pChild )->GetAttribute(
-pAttribute->GetName() );
-if ( !pCandidate || !pAttribute->IsEqual( *pCandidate ))
-bMatch = sal_False;
-}
-if ( bMatch )
-return ( XMLElement * ) pChild;
-}
-}
-return NULL;
-}
-
 //
 // class XMLFile
 //
diff --git a/unusedcode.easy b/unusedcode.easy
index 54ba512..79a729f 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -341,8 +341,6 @@ XMLFontAutoStylePoolNames_Impl::Remove(rtl::OUString*)
 XMLFontAutoStylePool_Impl::GetPos(XMLFontAutoStylePoolEntry_Impl const*) const
 XMLFontAutoStylePool_Impl::Remove(XMLFontAutoStylePoolEntry_Impl*)
 XMLParentNode::AddChild(XMLChildNode*, unsigned long)
-XMLParentNode::GetChildElement(XMLElement*)
-XMLParentNode::RemoveChild(XMLElement*)
 XMLPropertyBackpatcher::XMLPropertyBackpatcher(char const*)
 XMLPropertyBackpatcher::XMLPropertyBackpatcher(char const*, 
char const*, unsigned char, rtl::OUString)
 XMLPropertyBackpatcher::XMLPropertyBackpatcher(rtl::OUString 
const&, rtl::OUString const&, unsigned char, rtl::OUString)
___

[Libreoffice-commits] .: l10ntools/inc l10ntools/source tools/inc tools/source unusedcode.easy vcl/inc vcl/source

2012-02-13 Thread Caolán McNamara
 l10ntools/inc/export.hxx   |1 
 l10ntools/source/merge.cxx |   16 -
 tools/inc/tools/multisel.hxx   |2 -
 tools/source/memtools/multisel.cxx |   45 -
 unusedcode.easy|   10 
 vcl/inc/vcl/field.hxx  |3 --
 vcl/inc/vcl/metaact.hxx|3 --
 vcl/inc/vcl/morebtn.hxx|1 
 vcl/inc/vcl/msgbox.hxx |1 
 vcl/inc/vcl/settings.hxx   |1 
 vcl/source/app/settings.cxx|   14 ---
 vcl/source/control/field.cxx   |   20 
 vcl/source/control/morebtn.cxx |   17 -
 vcl/source/gdi/metaact.cxx |   19 ---
 vcl/source/window/msgbox.cxx   |8 --
 15 files changed, 161 deletions(-)

New commits:
commit 8f1270db7d871df1a6155c1e4f51568753a54b04
Author: Alexander Bergmann 
Date:   Mon Feb 13 13:17:19 2012 +

unusedcode.easy: Removed unused code

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index ff6a960..5e08239 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -463,7 +463,6 @@ class MergeDataFile
 const rtl::OString &nLang, const rtl::OString &rTEXT,
 const rtl::OString &rQHTEXT, const rtl::OString &rTITLE,
 const rtl::OString &sFilename, bool bCaseSensitive);
-rtl::OString Dump();
 public:
 explicit MergeDataFile(const rtl::OString &rFileName,
 const rtl::OString& rFile, bool bErrLog, bool bCaseSensitive = 
false);
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 65c720a..c56bdaf 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -222,22 +222,6 @@ MergeDataFile::~MergeDataFile()
 delete aI->second;
 }
 
-rtl::OString MergeDataFile::Dump()
-{
-rtl::OString sRet(RTL_CONSTASCII_STRINGPARAM("MergeDataFile\n"));
-
-printf("MergeDataFile\n");
-MergeDataHashMap::const_iterator idbg;
-for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg )
-{
-printf("aMap[ %s ] = ",idbg->first.getStr());
-idbg->second->Dump();
-printf("\n");
-}
-printf("\n");
-return sRet;
-}
-
 std::vector MergeDataFile::GetLanguages()
 {
 return std::vector(aLanguageSet.begin(),aLanguageSet.end());
diff --git a/tools/inc/tools/multisel.hxx b/tools/inc/tools/multisel.hxx
index 20f1c63..8410019 100644
--- a/tools/inc/tools/multisel.hxx
+++ b/tools/inc/tools/multisel.hxx
@@ -91,7 +91,6 @@ public:
 voidSetTotalRange( const Range& rTotRange );
 voidInsert( long nIndex, long nCount = 1 );
 voidRemove( long nIndex );
-voidAppend( long nCount = 1 );
 
 const Range&GetTotalRange() const { return aTotRange; }
 sal_BoolIsCurValid() const { return bCurValid; }
@@ -99,7 +98,6 @@ public:
 longFirstSelected( sal_Bool bInverse = sal_False );
 longLastSelected();
 longNextSelected();
-longPrevSelected();
 
 size_t  GetRangeCount() const { return aSels.size(); }
 const Range&GetRange( size_t nRange ) const {
diff --git a/tools/source/memtools/multisel.cxx 
b/tools/source/memtools/multisel.cxx
index 3853fe4..fd61bcb 100644
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -521,21 +521,6 @@ void MultiSelection::Remove( long nIndex )
 
 // ---
 
-void MultiSelection::Append( long nCount )
-{
-long nPrevLast = aTotRange.Max();
-aTotRange.Max() += nCount;
-if ( bSelectNew )
-{
-nSelCount += nCount;
-aSels.push_back( new Range( nPrevLast+1, nPrevLast + nCount ) );
-if ( aSels.size() > 1 )
-ImplMergeSubSelections( aSels.size() - 2, aSels.size() );
-}
-}
-
-// ---
-
 long MultiSelection::ImplFwdUnselected()
 {
 if ( !bCurValid )
@@ -637,36 +622,6 @@ long MultiSelection::NextSelected()
 
 // ---
 
-long MultiSelection::PrevSelected()
-{
-if ( !bCurValid )
-return SFX_ENDOFSELECTION;
-
-if ( bInverseCur )
-{
---nCurIndex;
-return ImplBwdUnselected();
-}
-else
-{
-// is the previous index in the current sub selection too?
-if ( nCurIndex > aSels[ nCurSubSel ]->Min() )
-return --nCurIndex;
-
-// are there previous sub selections?
-if ( nCurSubSel > 0 )
-{
---nCurSubSel;
-return nCurIndex = aSels[ nCurSubSel ]->Max();
-}
-
-// we are at the beginning!
-return SFX_ENDOFSELECTION;
-}
-}
-
-// ---
-
 void MultiSelection::SetTotalRange( const 

[Libreoffice-commits] .: l10ntools/inc l10ntools/source

2012-02-10 Thread Stephan Bergmann
 l10ntools/inc/export.hxx  |   12 +-
 l10ntools/inc/lngmerge.hxx|8 -
 l10ntools/source/cfgmerge.cxx |   47 ++
 l10ntools/source/export.cxx   |   75 -
 l10ntools/source/export2.cxx  |   27 ++
 l10ntools/source/lngmerge.cxx |  184 +++---
 l10ntools/source/makefile.mk  |5 -
 l10ntools/source/merge.cxx|   58 +
 8 files changed, 198 insertions(+), 218 deletions(-)

New commits:
commit b57f88ce679bba4758db98ab130548db224b6a1f
Author: Stephan Bergmann 
Date:   Fri Feb 10 21:53:20 2012 +0100

Various more l10ntools clean up

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index e6d0057..ff6a960 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -34,8 +34,6 @@
 #include 
 #include 
 
-#include 
-
 #ifndef L10NTOOLS_DIRECTORY_HXX
 #define L10NTOOLS_DIRECTORY_HXX
 #include 
@@ -56,6 +54,8 @@
 #include 
 #endif
 
+#include "helper.hxx"
+
 #define NO_TRANSLATE_ISO"x-no-translate"
 
 class PFormEntrys;
@@ -196,8 +196,8 @@ public:
 pPairedList( NULL ),
 sPForm( rPF )
 {
-sGId = comphelper::string::remove(sGId, '\r');
-sPForm = comphelper::string::remove(sPForm, '\r');
+helper::searchAndReplaceAll(&sGId, "\r", rtl::OString());
+helper::searchAndReplaceAll(&sPForm, "\r", rtl::OString());
 }
 
 ResData(const rtl::OString &rPF, const rtl::OString &rGId , const 
rtl::OString &rFilename)
@@ -227,8 +227,8 @@ public:
 pPairedList( NULL ),
 sPForm( rPF )
 {
-sGId = comphelper::string::remove(sGId, '\r');
-sPForm = comphelper::string::remove(sPForm, '\r');
+helper::searchAndReplaceAll(&sGId, "\r", rtl::OString());
+helper::searchAndReplaceAll(&sPForm, "\r", rtl::OString());
 }
 };
 
diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx
index 99c852d..9649c34 100644
--- a/l10ntools/inc/lngmerge.hxx
+++ b/l10ntools/inc/lngmerge.hxx
@@ -36,11 +36,9 @@
 typedef std::vector< rtl::OString* > LngLineList;
 
 #define LNG_OK  0x
-#define LNG_FILE_NOTFOUND   0x0001
-#define LNG_COULD_NOT_OPEN  0x0002
-#define SDF_OK  0x0003
-#define SDF_FILE_NOTFOUND   0x0004
-#define SDF_COULD_NOT_OPEN  0x0005
+#define LNG_COULD_NOT_OPEN  0x0001
+#define SDF_OK  0x0002
+#define SDF_COULD_NOT_OPEN  0x0003
 
 //
 // class LngParser
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index 60872d8..1d15fc7 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -34,8 +34,7 @@
 #include 
 
 #include "boost/scoped_ptr.hpp"
-
-#include 
+#include "rtl/strbuf.hxx"
 
 #include "common.hxx"
 #include "helper.hxx"
@@ -43,8 +42,6 @@
 #include "cfgmerge.hxx"
 #include "tokens.h"
 
-using comphelper::string::getToken;
-
 extern "C" { int yyerror(char const *); }
 
 namespace {
@@ -277,7 +274,12 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char 
*pToken )
 case ANYTOKEN:
 case CFG_TEXT_START:
 {
-sTokenName = getToken(getToken(getToken(sToken, 1, '<'), 0, '>'), 
0, ' ');
+sal_Int32 n = 0;
+rtl::OString t(sToken.getToken(1, '<', n));
+n = 0;
+t = t.getToken(0, '>', n);
+n = 0;
+sTokenName = t.getToken(0, ' ', n);
 
   if ( !IsTokenClosed( sToken )) {
 rtl::OString sSearch;
@@ -305,15 +307,16 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char 
*pToken )
 if ( sCurrentResTyp != sTokenName ) {
 WorkOnRessourceEnd();
 rtl::OString sCur;
-for( unsigned int n = 0; n < aLanguages.size(); 
n++ ){
-sCur = aLanguages[ n ];
+for( unsigned int i = 0; i < aLanguages.size(); 
++i ){
+sCur = aLanguages[ i ];
 pStackData->sText[ sCur ] = rtl::OString();
 }
  }
 sCurrentResTyp = sTokenName;
 
 rtl::OString sTemp = sToken.copy( sToken.indexOf( 
"xml:lang=" ));
-sCurrentIsoLang = getToken(getToken(sTemp, 1, '\"'), 
0, '\"');
+n = 0;
+sCurrentIsoLang = sTemp.getToken(1, '"', n);
 
 if ( sCurrentIsoLang == NO_TRANSLATE_ISO )
 bLocalize = sal_False;
@@ -327,7 +330,8 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char 
*pToken )
 if ( !sSearch.isEmpty())
 {
 rtl::OString sTemp = sToken.copy( sToken.indexOf( sSearch 
));
-sTokenId = getToken(getToken(sTemp, 1, '\"'), 0, '\"');
+n = 0;
+sTokenId = sTemp.getToken(

[Libreoffice-commits] .: l10ntools/inc l10ntools/source

2012-02-06 Thread Ivan Timofeev
 l10ntools/inc/export.hxx|2 
 l10ntools/source/export.cxx |  199 +---
 2 files changed, 60 insertions(+), 141 deletions(-)

New commits:
commit e747a4e87e6abf581a5b0c381f706b581c2a0fbc
Author: Christina Rossmanith 
Date:   Sun Feb 5 15:03:30 2012 +0100

Reduced duplicate code (simian) / l10ntools

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index d8e3c96..ba086b5 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -352,7 +352,7 @@ private:
 
 sal_Bool PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp,
 rtl::OString &rLangIndex, ResData *pResData);
-
+void ResData2Output( PFormEntrys *pEntry, sal_uInt16 nType, const 
rtl::OString& rTextType );
 void MergeRest( ResData *pResData, sal_uInt16 nMode = MERGE_MODE_NORMAL );
 void ConvertMergeContent( rtl::OString &rText );
 
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 204214f..b41ff8a 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -1859,6 +1859,58 @@ sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, 
sal_uInt16 nTyp,
 return sal_True;
 }
 
+void Export::ResData2Output( PFormEntrys *pEntry, sal_uInt16 nType, const 
rtl::OString& rTextType )
+{
+sal_Bool bAddSemicolon = sal_False;
+sal_Bool bFirst = sal_True;
+rtl::OString sCur;
+
+for( unsigned int n = 0; n < aLanguages.size(); n++ ){
+sCur = aLanguages[ n ];
+
+rtl::OString sText;
+sal_Bool bText = pEntry->GetTransex3Text( sText, nType, sCur , 
sal_True );
+if ( bText && !sText.isEmpty() && sText != "-" ) {
+rtl::OString sOutput;
+if ( bNextMustBeDefineEOL)  {
+if ( bFirst )
+sOutput += "\t\\\n";
+else
+sOutput += ";\t\\\n";
+}
+bFirst=sal_False;
+sOutput += "\t";
+
+sOutput += rTextType;
+
+if ( ! Export::isSourceLanguage( sCur ) ) {
+sOutput += "[ ";
+sOutput += sCur;
+sOutput += " ] ";
+}
+sOutput += "= ";
+ConvertMergeContent( sText );
+sOutput += sText;
+
+if ( bDefine )
+sOutput += ";\\\n";
+else if ( !bNextMustBeDefineEOL )
+sOutput += ";\n";
+else
+bAddSemicolon = sal_True;
+for ( sal_uInt16 j = 1; j < nLevel; j++ )
+sOutput += "\t";
+WriteToMerged( sOutput , true );
+}
+}
+
+
+if ( bAddSemicolon ) {
+rtl::OString sOutput( ";" );
+WriteToMerged( sOutput , false );
+}
+}
+
 /*/
 void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
 /*/
@@ -1876,150 +1928,17 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 
nMode )
 case MERGE_MODE_NORMAL : {
 PFormEntrys *pEntry = pMergeDataFile->GetPFormEntrys( pResData );
 
-bool bWriteNoSlash = false;
-if ( pEntry && pResData->bText ) {
-
-sal_Bool bAddSemikolon = sal_False;
-sal_Bool bFirst = sal_True;
-rtl::OString sCur;
-for( unsigned int n = 0; n < aLanguages.size(); n++ ){
-sCur = aLanguages[ n ];
-
-rtl::OString sText;
-sal_Bool bText = pEntry->GetTransex3Text( sText, 
STRING_TYP_TEXT, sCur , sal_True );
-if ( bText && !sText.isEmpty() && sText != "-" ) {
-rtl::OString sOutput;
-if ( bNextMustBeDefineEOL)  {
-if ( bFirst )
-sOutput += "\t\\\n";
-else
-sOutput += ";\t\\\n";
-}
-bFirst=sal_False;
-sOutput += "\t";
-sOutput += pResData->sTextTyp;
-if ( ! Export::isSourceLanguage( sCur ) ) {
-sOutput += "[ ";
-sOutput += sCur;
-sOutput += " ] ";
-}
-sOutput += "= ";
-ConvertMergeContent( sText );
-sOutput += sText;
+if ( pEntry ) {
+if ( pResData->bText )
+ResData2Output( pEntry, STRING_TYP_TEXT, 
pResData->sTextTyp );
 
-if ( bDefine && bWriteNoSlash )
-sOutput += ";\n";
+if ( pResData->bQuickHelpText )
+ResData2Output( pEntry, STRING_TYP_QUICKHELPTEXT, 
rtl::OString("QuickHelpTe

[Libreoffice-commits] .: l10ntools/inc l10ntools/source

2011-12-11 Thread Julien Nabet
 l10ntools/inc/wtranode.hxx|  120 --
 l10ntools/source/wtranode.cxx |  108 -
 2 files changed, 228 deletions(-)

New commits:
commit 7866954ac27c15146ce76adeba5c94d147d32d94
Author: Julien Nabet 
Date:   Sun Dec 11 16:21:05 2011 +0100

Unused according to Opengrok, so drop this

diff --git a/l10ntools/inc/wtranode.hxx b/l10ntools/inc/wtranode.hxx
deleted file mode 100644
index b2c10e0..000
--- a/l10ntools/inc/wtranode.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * 
- * for a copy of the LGPLv3 License.
- *
- /
-
-
-#ifndef TX3_WTRANODE_HXX
-#define TX3_WTRANODE_HXX
-
-// USED
-// Base Classes
-// Components
-// Parameters
-#include 
-
-
-typedef UINT8 BRANCH_T;
-
-
-
-const BRANCH_T C_BR_ALPHABASE   =  4;
-const BRANCH_T C_NR_OF_BRANCHES = 34;
-
-
-
-
-/** @task
-This is a node of the parsing-tree which implements the fuctionality of
-class WordTransTree.
-WordTransTree is dependant of this class, but NOT the other way!
-**/
-class WTT_Node  // WordTransTree-Node
-{
-  public:
-enum E_TokenType
-{
-//  no_token = 0,
-token_to_keep,
-token_to_replace
-};
-
-// LIFECYCLE
-WTT_Node(
-UINT8   i_nValue,   // Own 
branch-value.
-WTT_Node *  i_pDefaultBranch,
-WTT_Node *  i_pDefaultBranchForAlphas );
-voidSetBranch(
-UINT8   i_cBranch,
-WTT_Node *  i_pNode );
-voidSetAsTokenToReplace(
-const ByteString &  i_sReplaceString );
-~WTT_Node();
-
-// OPERATIONS
-WTT_Node *  GetNextNode(
-UINT8   i_cBranch ); /// [0 .. 
C_NR_OF_BRANCHES-1], sonst GPF !!!
-
-// INQUIRY
-E_TokenType TokenType() const;
-UINT8   Value() const;
-sal_BoolIsOnDeleting() const;
-const ByteString &  ReplaceString() const;
-
-  private:
-// DATA
-UINT8   nValue;
-E_TokenType eType;
-ByteString  sReplaceString;
-WTT_Node *  aBranches[C_NR_OF_BRANCHES];// Mostly DYN pointers.
-charbIsOnDeleting;
-};
-
-
-inline WTT_Node *
-WTT_Node::GetNextNode(UINT8 i_cBranch)
-{ return aBranches[i_cBranch]; }
-inline WTT_Node::E_TokenType
-WTT_Node::TokenType() const
-{ return eType; }
-inline UINT8
-WTT_Node::Value() const
-{ return nValue; }
-inline sal_Bool
-WTT_Node::IsOnDeleting() const
-{ return bIsOnDeleting; }
-inline const ByteString &
-WTT_Node::ReplaceString() const
-{ return sReplaceString; }
-
-
-
-
-#endif
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/wtranode.cxx b/l10ntools/source/wtranode.cxx
deleted file mode 100644
index f7c2df8..000
--- a/l10ntools/source/wtranode.cxx
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but 

[Libreoffice-commits] .: l10ntools/inc l10ntools/source

2011-10-05 Thread Andras Timar
 l10ntools/inc/xrmmerge.hxx|   12 +++
 l10ntools/source/xrmmerge.cxx |  133 +++---
 2 files changed, 112 insertions(+), 33 deletions(-)

New commits:
commit a8fa695f8d327f7ae770d1fc0bb2bb27a5f2be11
Author: Andras Timar 
Date:   Wed Oct 5 21:54:56 2011 +0200

merge strings to description.xml files

diff --git a/l10ntools/inc/xrmmerge.hxx b/l10ntools/inc/xrmmerge.hxx
index f0b213a..496adc1 100644
--- a/l10ntools/inc/xrmmerge.hxx
+++ b/l10ntools/inc/xrmmerge.hxx
@@ -54,6 +54,10 @@ protected:
 void Error( const ByteString &rError );
 
 virtual void Output( const ByteString& rOutput )=0;
+virtual void WorkOnDesc(
+const ByteString &rOpenTag,
+ByteString &rText
+)=0;
 virtual void WorkOnText(
 const ByteString &rOpenTag,
 ByteString &rText
@@ -107,6 +111,10 @@ private:
 std::vector aLanguages;
 
 protected:
+void WorkOnDesc(
+const ByteString &rOpenTag,
+ByteString &rText
+);
 void WorkOnText(
 const ByteString &rOpenTag,
 ByteString &rText
@@ -139,6 +147,10 @@ private:
 std::vector aLanguages;
 
 protected:
+void WorkOnDesc(
+const ByteString &rOpenTag,
+ByteString &rText
+);
 void WorkOnText(
 const ByteString &rOpenTag,
 ByteString &rText
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index 8a0ca98..e30a3e1 100644
--- a/l10ntools/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -318,7 +318,6 @@ int XRMResParser::Execute( int nToken, char * pToken )
 sCurrentCloseTag = rToken;
 sResourceType = ByteString ( "readmeitem" );
 sLangAttribute = ByteString ( "xml:lang" );
-ByteString sLang = GetAttribute( sCurrentOpenTag, 
sLangAttribute );
 WorkOnText( sCurrentOpenTag, sCurrentText );
 Output( sCurrentText );
 EndOfText( sCurrentOpenTag, sCurrentCloseTag );
@@ -354,7 +353,6 @@ int XRMResParser::Execute( int nToken, char * pToken )
 sCurrentCloseTag = rToken;
 sResourceType = ByteString ( "description" );
 sLangAttribute = ByteString ( "lang" );
-ByteString sLang = GetAttribute( sCurrentOpenTag, 
sLangAttribute );
 WorkOnText( sCurrentOpenTag, sCurrentText );
 Output( sCurrentText );
 EndOfText( sCurrentOpenTag, sCurrentCloseTag );
@@ -383,29 +381,9 @@ int XRMResParser::Execute( int nToken, char * pToken )
 sCurrentOpenTag = rToken;
 sCurrentText  = ByteString("");
 Output( rToken );
-DirEntry aEntry( String( sInputFileName, 
RTL_TEXTENCODING_ASCII_US ));
-aEntry.ToAbs();
-ByteString sDescFileName( aEntry.GetFull(), 
RTL_TEXTENCODING_ASCII_US );
-sDescFileName.SearchAndReplaceAll( "description.xml", "" );
-sDescFileName += GetAttribute( sCurrentOpenTag, 
"xlink:href" );
-ifstream::pos_type size;
-char * memblock;
-ifstream file (sDescFileName.GetBuffer(), 
ios::in|ios::binary|ios::ate);
-if (file.is_open()) {
-size = file.tellg();
-memblock = new char [size];
-file.seekg (0, ios::beg);
-file.read (memblock, size);
-file.close();
-sCurrentText = ByteString(memblock);
-sCurrentText.SearchAndReplaceAll( "\n", "\\n" );
-delete[] memblock;
-}
-ByteString sLang = GetAttribute( sCurrentOpenTag, 
sLangAttribute );
-WorkOnText( sCurrentOpenTag, sCurrentText );
+WorkOnDesc( sCurrentOpenTag, sCurrentText );
 sCurrentCloseTag = rToken;
 Output( sCurrentText );
-EndOfText( sCurrentOpenTag, sCurrentCloseTag );
 rToken = ByteString("");
 sCurrentText  = ByteString("");
 }
@@ -543,6 +521,35 @@ void XRMResExport::Output( const ByteString& rOutput )
 }
 
 /*/
+void XRMResExport::WorkOnDesc(
+const ByteString &rOpenTag,
+ByteString &rText
+)
+/*/
+{
+DirEntry aEntry( String( sInputFileName, RTL_TEXTENCODING_ASCII_US ));
+aEntry.ToAbs();
+ByteString sDescFileName( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US );
+sDescFileName.SearchAndReplaceAll( "description.xml", "" );
+sDescFileName += GetAttribute( rOpenTag, "xlink:href" );
+ifstream::pos_type size;
+char * me

[Libreoffice-commits] .: l10ntools/inc l10ntools/source

2011-09-21 Thread Andras Timar
 l10ntools/inc/export.hxx   |8 
 l10ntools/inc/helpmerge.hxx|5 --
 l10ntools/inc/lngmerge.hxx |1 
 l10ntools/inc/xmlparse.hxx |1 
 l10ntools/source/cfglex.l  |3 -
 l10ntools/source/export.cxx|   50 -
 l10ntools/source/export2.cxx   |   79 -
 l10ntools/source/helpex.cxx|4 --
 l10ntools/source/helpmerge.cxx |   36 --
 l10ntools/source/lngex.cxx |4 --
 l10ntools/source/lngmerge.cxx  |   18 -
 l10ntools/source/srclex.l  |4 --
 l10ntools/source/xrmlex.l  |4 --
 l10ntools/source/xrmmerge.cxx  |3 -
 14 files changed, 220 deletions(-)

New commits:
commit b57f55cf23ef11d446330fbbadd18803b5cbcc98
Author: Andras Timar 
Date:   Wed Sep 21 19:27:44 2011 +0200

remove unused (and buggy) language fallback functionality

Fallback to en-US is done in translations module. Fallback to
other languages is not supported, but if we ever needed it, it
would be easier to solve the problem in a script language
instead of C++ in translations module.

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 8c42647..5206540 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -181,7 +181,6 @@ public:
 sal_uInt16 nTitleRefId;
 
 ByteString sTextTyp;
-ByteStringHashMap aFallbackData;
 ByteStringHashMap aMergedLanguages;
 
 ExportList  *pStringList;
@@ -193,8 +192,6 @@ public:
 ByteString sPForm;
 
 void Dump();
-void addFallbackData( ByteString& sId , const ByteString& sText );
-bool getFallbackData( ByteString& sId , ByteString& sText);
 
 void addMergedLanguage(rtl::OString& rLang);
 bool isMerged(rtl::OString& rLang);
@@ -353,9 +350,6 @@ public:
 static void getRandomName( const ByteString& sPrefix , ByteString& 
sRandStr , const ByteString& sPostfix  );
 static void getCurrentDir( std::string& dir );
 
-static ByteString GetFallbackLanguage( const ByteString nLanguage );
-static void FillInFallbacks( ResData *pResData );
-static void FillInListFallbacks( ExportList *pList, const ByteString 
&nSource, const ByteString &nFallback );
 static ByteString GetTimeStamp();
 static sal_Bool ConvertLineEnds( ByteString sSource, ByteString 
sDestination );
 static ByteString GetNativeFile( ByteString sSource );
@@ -376,8 +370,6 @@ private:
 
 ByteString FullId();// creates cur. GID
 
-bool PairedListFallback( ByteString& sText , ResData& aResData );
-
 ByteString GetPairedListID  ( const ByteString& sText );
 ByteString GetPairedListString  ( const ByteString& sText );
 ByteString StripList( const ByteString& sText );
diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index 2553624..a160b15 100644
--- a/l10ntools/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
@@ -32,7 +32,6 @@
 #include 
 #include 
 #include  /* auto_ptr */
-#include "tools/isofallback.hxx"
 
 #define MOVEFILE_REPLACE_EXISTING 0x01
 
@@ -44,10 +43,6 @@ private:
 bool   bUTF8;
 bool   bHasInputList;
 
-/// Copy fallback language String (ENUS,DE) into position of the numeric 
language iso code
-/// @PRECOND 0 < langIdx_in < MAX_IDX
-static void FillInFallbacks( LangHashMap& rElem_out, ByteString 
sLangIdx_in );
-
 #if OSL_DEBUG_LEVEL > 2
 /// Debugmethod, prints the content of the map to stdout
 static void Dump(LangHashMap* rElem_in , const ByteString sKey_in);
diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx
index 8aaf98d..e658817 100644
--- a/l10ntools/inc/lngmerge.hxx
+++ b/l10ntools/inc/lngmerge.hxx
@@ -53,7 +53,6 @@ private:
 bool bQuiet;
 std::vector aLanguages;
 
-void FillInFallbacks( ByteStringHashMap Text );
 bool isNextGroup(  ByteString &sGroup_out , ByteString &sLine_in);
 void ReadLine( const ByteString &sLine_in , ByteStringHashMap &rText_inout 
);
 void WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_inout ,
diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index b2603c0..1c5f0d0 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -36,7 +36,6 @@
 #include "tools/string.hxx"
 #define ENABLE_BYTESTRING_STREAM_OPERATORS
 #include "tools/stream.hxx"
-#include "tools/isofallback.hxx"
 #include "export.hxx"
 #include "xmlutil.hxx"
 
diff --git a/l10ntools/source/cfglex.l b/l10ntools/source/cfglex.l
index feb2882..94648a6 100644
--- a/l10ntools/source/cfglex.l
+++ b/l10ntools/source/cfglex.l
@@ -188,10 +188,7 @@ main( int argc, char* argv[])
fprintf( stdout, " -g[:dtd]: enables generation of properties 
(dtds if :dtd is set) - in this case FileOut is the output path\n" );
fprintf( stdout, " -d: enables generation of *.don if work is 
done\n" );
fprintf( stdout, " -L: Restrict the handled languages. 
l1,l2,... are elements