diff options
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/inc/cfgmerge.hxx | 6 | ||||
-rw-r--r-- | l10ntools/inc/export.hxx | 11 | ||||
-rw-r--r-- | l10ntools/inc/inireader.hxx | 8 | ||||
-rw-r--r-- | l10ntools/inc/tagtest.hxx | 12 | ||||
-rw-r--r-- | l10ntools/inc/xmlparse.hxx | 11 | ||||
-rw-r--r-- | l10ntools/layout/makefile.mk | 1 | ||||
-rw-r--r-- | l10ntools/source/cfgmerge.cxx | 22 | ||||
-rw-r--r-- | l10ntools/source/directory.cxx | 5 | ||||
-rw-r--r-- | l10ntools/source/export.cxx | 54 | ||||
-rw-r--r-- | l10ntools/source/export2.cxx | 1 | ||||
-rw-r--r-- | l10ntools/source/filter/merge/makefile.mk | 13 | ||||
-rw-r--r-- | l10ntools/source/gsicheck.cxx | 1 | ||||
-rw-r--r-- | l10ntools/source/help/HelpCompiler.cxx | 4 | ||||
-rw-r--r-- | l10ntools/source/help/HelpCompiler.hxx | 6 | ||||
-rw-r--r-- | l10ntools/source/help/HelpLinker.cxx | 13 | ||||
-rw-r--r-- | l10ntools/source/helpex.cxx | 1 | ||||
-rw-r--r-- | l10ntools/source/helpmerge.cxx | 14 | ||||
-rw-r--r-- | l10ntools/source/lngex.cxx | 9 | ||||
-rw-r--r-- | l10ntools/source/localize.cxx | 1 | ||||
-rw-r--r-- | l10ntools/source/makefile.mk | 50 | ||||
-rw-r--r-- | l10ntools/source/merge.cxx | 10 | ||||
-rw-r--r-- | l10ntools/source/xmlparse.cxx | 10 | ||||
-rw-r--r-- | l10ntools/source/xrmmerge.cxx | 18 |
23 files changed, 47 insertions, 234 deletions
diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx index 62dd70c43f5d..4b13a12bb290 100644 --- a/l10ntools/inc/cfgmerge.hxx +++ b/l10ntools/inc/cfgmerge.hxx @@ -30,11 +30,10 @@ #define _CFG_MERGE_HXX #include <tools/string.hxx> -#include <tools/list.hxx> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <vector> -typedef std::hash_map<ByteString , ByteString , hashByteString,equalByteString> +typedef boost::unordered_map<ByteString , ByteString , hashByteString,equalByteString> ByteStringHashMap; @@ -194,7 +193,6 @@ private: std::vector<ByteString> aLanguages; ResData *pResData; - BOOL bGerman; ByteString sFilename; BOOL bEnglish; diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index 2881c3ab9dca..37524ac7fec6 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -35,13 +35,12 @@ #endif #include <tools/string.hxx> -#include <tools/list.hxx> #include <tools/stream.hxx> #include <tools/fsys.hxx> #include <osl/file.hxx> #include <osl/file.h> -#include <hash_map> /* std::hashmap*/ +#include <boost/unordered_map.hpp> #include <iterator> /* std::iterator*/ #include <set> /* std::set*/ #include <vector> /* std::vector*/ @@ -85,16 +84,16 @@ class PFormEntrys; class MergeData; typedef std::set<ByteString , lessByteString > ByteStringSet; -typedef std::hash_map<ByteString , ByteString , hashByteString,equalByteString> +typedef boost::unordered_map<ByteString , ByteString , hashByteString,equalByteString> ByteStringHashMap; -typedef std::hash_map<ByteString , bool , hashByteString,equalByteString> +typedef boost::unordered_map<ByteString , bool , hashByteString,equalByteString> ByteStringBoolHashMap; -typedef std::hash_map<ByteString , PFormEntrys* , hashByteString,equalByteString> +typedef boost::unordered_map<ByteString , PFormEntrys* , hashByteString,equalByteString> PFormEntrysHashMap; -typedef std::hash_map<ByteString , MergeData* , hashByteString,equalByteString> +typedef boost::unordered_map<ByteString , MergeData* , hashByteString,equalByteString> MergeDataHashMap; #define SOURCE_LANGUAGE ByteString("en-US") diff --git a/l10ntools/inc/inireader.hxx b/l10ntools/inc/inireader.hxx index d0e236ca4c33..738d4bb3232c 100644 --- a/l10ntools/inc/inireader.hxx +++ b/l10ntools/inc/inireader.hxx @@ -1,6 +1,6 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include <string> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <unicode/regex.h> using namespace std; @@ -16,8 +16,8 @@ struct eqstr } }; -typedef std::hash_map< string , string > stringmap; -typedef std::hash_map< string, stringmap* > INImap; +typedef boost::unordered_map< string , string > stringmap; +typedef boost::unordered_map< string, stringmap* > INImap; class INIreader { @@ -39,7 +39,7 @@ class INIreader delete section_match; delete parameter_match; } - // open "filename", fill hash_map with sections / paramaters + // open "filename", fill boost::unordered_map with sections / paramaters bool read( INImap& myMap , string& filename ); private: diff --git a/l10ntools/inc/tagtest.hxx b/l10ntools/inc/tagtest.hxx index f301a3539bcf..f905ec627d72 100644 --- a/l10ntools/inc/tagtest.hxx +++ b/l10ntools/inc/tagtest.hxx @@ -30,8 +30,7 @@ #define _TAGTEST_HXX_ #include <tools/string.hxx> -#include <tools/list.hxx> -#include <hash_map> /* std::hashmap*/ +#include <boost/unordered_map.hpp> #include <vector> class GSILine; @@ -58,14 +57,11 @@ struct lessByteString{ struct hashByteString{ size_t operator()( const ByteString& rName ) const{ - std::hash< const char* > myHash; - return myHash( rName.GetBuffer() ); + return rtl_str_hashCode(rName.GetBuffer()); } }; - - -typedef std::hash_map<ByteString , String , hashByteString,equalByteString> +typedef boost::unordered_map<ByteString , String , hashByteString,equalByteString> StringHashMap; class TokenInfo @@ -245,7 +241,7 @@ public: maList.clear(); } - void insert( TokenInfo p, size_t nIndex = LIST_APPEND ) + void insert( TokenInfo p, size_t nIndex = size_t(-1) ) { if ( nIndex < maList.size() ) { TokenListImpl::iterator it = maList.begin(); diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx index 65a546096966..5a25b3d65959 100644 --- a/l10ntools/inc/xmlparse.hxx +++ b/l10ntools/inc/xmlparse.hxx @@ -34,7 +34,6 @@ #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> #include "tools/string.hxx" -#include "tools/list.hxx" #define ENABLE_BYTESTRING_STREAM_OPERATORS #include "tools/stream.hxx" #include "tools/isofallback.hxx" @@ -51,7 +50,7 @@ class XMLElement; using namespace ::rtl; using namespace std; -#include <hash_map> /* std::hashmap*/ +#include <boost/unordered_map.hpp> #include <deque> /* std::deque*/ #include <iterator> /* std::iterator*/ #include <list> /* std::list*/ @@ -189,17 +188,17 @@ public: //------------------------------------------------------------------------- /// Mapping numeric Language code <-> XML Element -typedef std::hash_map< ByteString ,XMLElement* , hashByteString,equalByteString > LangHashMap; +typedef boost::unordered_map< ByteString ,XMLElement* , hashByteString,equalByteString > LangHashMap; /// Mapping XML Element string identifier <-> Language Map -typedef std::hash_map<ByteString , LangHashMap* , +typedef boost::unordered_map<ByteString , LangHashMap* , hashByteString,equalByteString> XMLHashMap; /// Mapping iso alpha string code <-> iso numeric code -typedef std::hash_map<ByteString, int, hashByteString,equalByteString> HashMap; +typedef boost::unordered_map<ByteString, int, hashByteString,equalByteString> HashMap; /// Mapping XML tag names <-> have localizable strings -typedef std::hash_map<ByteString , BOOL , +typedef boost::unordered_map<ByteString , BOOL , hashByteString,equalByteString> TagMap; /** Holds information of a XML file, is root node of tree diff --git a/l10ntools/layout/makefile.mk b/l10ntools/layout/makefile.mk index 9341e91b69a4..dee3c6e81b33 100644 --- a/l10ntools/layout/makefile.mk +++ b/l10ntools/layout/makefile.mk @@ -31,7 +31,6 @@ INCPRE=$(MISC) PRJNAME=l10ntools TARGET=tralay -#TARGETTYPE=GUI TARGETTYPE=CUI LIBTARGET=no diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index cbbe329e669b..5e55e5823a79 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -253,7 +253,7 @@ extern FILE *GetCfgFile() // create file name, beginnig with project root // (e.g.: source\ui\src\menue.src) -// printf("sFullEntry = %s\n",sFullEntry.GetBuffer()); +// printf("sFullEntry = %s\n",sFullEntry.GetBuffer()); sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); // printf("sActFileName = %s\n",sActFileName.GetBuffer()); @@ -337,7 +337,12 @@ CfgStackData *CfgStack::GetStackData( size_t nPos ) /*****************************************************************************/ { if ( nPos == LIST_APPEND ) - nPos = maList.size() - 1; + { + if (!maList.empty()) + nPos = maList.size() - 1; + else + return 0; + } return maList[ nPos ]; } @@ -578,9 +583,6 @@ int CfgParser::Execute( int nToken, char * pToken ) void CfgParser::Error( const ByteString &rError ) /*****************************************************************************/ { -// ByteString sError( rError ); -// sError.Append("Error: In file "); -// sError.Append( sActFileName ); yyerror(( char * ) rError.GetBuffer()); } @@ -657,10 +659,6 @@ void CfgExport::WorkOnRessourceEnd() pStackData->sText[ ByteString("en-US") ].Len() ))) { ByteString sFallback = pStackData->sText[ ByteString("en-US") ]; - - //if ( pStackData->sText[ ByteString("en-US") ].Len()) - // sFallback = pStackData->sText[ ByteString("en-US") ]; - ByteString sLocalId = pStackData->sIdentifier; ByteString sGroupId; if ( aStack.size() == 1 ) { @@ -695,7 +693,6 @@ void CfgExport::WorkOnRessourceEnd() sOutput += sText; sOutput += "\t\t\t\t"; sOutput += sTimeStamp; - //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sPrj ) ) ) pOutputStream->WriteLine( sOutput ); } } @@ -725,7 +722,6 @@ CfgMerge::CfgMerge( : CfgOutputParser( rOutputFile ), pMergeDataFile( NULL ), pResData( NULL ), - bGerman( FALSE ), sFilename( rFilename ), bEnglish( FALSE ) { @@ -776,8 +772,6 @@ void CfgMerge::WorkOnText( pResData->sResTyp = pStackData->sResTyp; } - //if ( nLangIndex.EqualsIgnoreCaseAscii("de") ) - // bGerman = TRUE; if (( nLangIndex.EqualsIgnoreCaseAscii("en-US") )) bEnglish = TRUE; @@ -829,7 +823,6 @@ void CfgMerge::WorkOnRessourceEnd() ByteString sContent; pEntrys->GetText( sContent, STRING_TYP_TEXT, sCur , TRUE ); if ( - // (!sCur.EqualsIgnoreCaseAscii("de") ) && ( !sCur.EqualsIgnoreCaseAscii("en-US") ) && ( sContent != "-" ) && ( sContent.Len())) @@ -869,7 +862,6 @@ void CfgMerge::WorkOnRessourceEnd() } delete pResData; pResData = NULL; - bGerman = FALSE; bEnglish = FALSE; } diff --git a/l10ntools/source/directory.cxx b/l10ntools/source/directory.cxx index bca2e399170c..dbe7f67a0b1a 100644 --- a/l10ntools/source/directory.cxx +++ b/l10ntools/source/directory.cxx @@ -102,9 +102,8 @@ void Directory::readDirectory() } #ifdef WNT -#include <tools/prewin.h> -#include <windows.h> -#include <tools/postwin.h> +#include <prewin.h> +#include <postwin.h> void Directory::readDirectory ( const rtl::OUString& sFullpath ) { diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 865065b31191..1c91379d3587 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -1193,25 +1193,15 @@ BOOL Export::WriteData( ResData *pResData, BOOL bCreateNew ) if ( bUnmerge ) return TRUE; -/* ByteStringHashMap::iterator pos3 = pResData->sText.begin(); - ByteStringHashMap::iterator end3 = pResData->sText.end(); - for(;pos3!=end3;++pos3){ - - printf("[%s]=%s\n", pos3->first.GetBuffer(), pos3->second.GetBuffer() ); - }*/ // mandatory to export: en-US - if (( //pResData->sText[ ByteString("de") ].Len() && - ( pResData->sText[ SOURCE_LANGUAGE ].Len())) + if (( pResData->sText[ SOURCE_LANGUAGE ].Len()) || - ( //pResData->sHelpText[ ByteString("de") ].Len() && - ( pResData->sHelpText[ SOURCE_LANGUAGE ].Len())) + ( pResData->sHelpText[ SOURCE_LANGUAGE ].Len()) || - ( //pResData->sQuickHelpText[ ByteString("de") ].Len() && - ( pResData->sQuickHelpText[ SOURCE_LANGUAGE ].Len())) + ( pResData->sQuickHelpText[ SOURCE_LANGUAGE ].Len()) || - ( //pResData->sTitle[ ByteString("de") ].Len() && - ( pResData->sTitle[ SOURCE_LANGUAGE ].Len()))) + ( pResData->sTitle[ SOURCE_LANGUAGE ].Len())) { FillInFallbacks( pResData ); @@ -1238,52 +1228,32 @@ BOOL Export::WriteData( ResData *pResData, BOOL bCreateNew ) sXText = pResData->sText[ sCur ]; else { sXText = pResData->sText[ SOURCE_LANGUAGE ]; - /*if ( !sXText.Len()) - sXText = pResData->sText[ ByteString("en") ]; - if ( !sXText.Len()) - sXText = pResData->sText[ ByteString("de") ];*/ } if ( pResData->sHelpText[ sCur ].Len()) sXHText = pResData->sHelpText[ sCur ]; else { sXHText = pResData->sHelpText[ SOURCE_LANGUAGE ]; - /*if ( !sXHText.Len()) - sXHText = pResData->sHelpText[ ByteString("en") ]; - if ( !sXText.Len()) - sXHText = pResData->sHelpText[ ByteString("de") ];*/ } if ( pResData->sQuickHelpText[ sCur ].Len()) sXQHText = pResData->sQuickHelpText[ sCur ]; else { sXQHText = pResData->sQuickHelpText[ SOURCE_LANGUAGE ]; - /*if ( !sXQHText.Len()) - sXQHText = pResData->sQuickHelpText[ ByteString("en") ]; - if ( !sXQHText.Len()) - sXQHText = pResData->sQuickHelpText[ ByteString("de") ];*/ } if ( pResData->sTitle[ sCur ].Len()) sXTitle = pResData->sTitle[ sCur ]; else { sXTitle = pResData->sTitle[ SOURCE_LANGUAGE ]; - /*if ( !sXTitle.Len()) - sXTitle = pResData->sTitle[ ByteString("en") ]; - if ( !sXTitle.Len()) - sXTitle = pResData->sTitle[ ByteString("de") ];*/ } if ( !sXText.Len()) sXText = "-"; if ( !sXHText.Len()) { - /*if ( pResData->sHelpText[ ByteString("de") ].Len()) - sXHText = pResData->sHelpText[ ByteString("de") ];*/ if ( pResData->sHelpText[ SOURCE_LANGUAGE ].Len()) sXHText = pResData->sHelpText[ SOURCE_LANGUAGE ]; - /*else if ( pResData->sHelpText[ ByteString("en") ].Len()) - sXHText = pResData->sHelpText[ ByteString("en") ];*/ } } else @@ -1309,7 +1279,6 @@ BOOL Export::WriteData( ResData *pResData, BOOL bCreateNew ) sOutput += sXTitle; sOutput += "\t"; sOutput += sTimeStamp; - // if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sProject ) ) ) aOutput.WriteLine( sOutput ); } @@ -1404,11 +1373,7 @@ BOOL Export::WriteExportList( ResData *pResData, ExportList *pExportList, ByteString sLID( ByteString::CreateFromInt64( i + 1 )); for( unsigned int n = 0; n < aLanguages.size(); n++ ){ sCur = aLanguages[ n ]; - if ( //1 ) - //(*pEntry)[ ByteString("de") ].Len() && - (*pEntry)[ SOURCE_LANGUAGE ].Len() ) - //|| - // (*pEntry)[ ByteString("en") ].Len())) + if ( (*pEntry)[ SOURCE_LANGUAGE ].Len() ) { if ( bEnableExport ) { @@ -1422,15 +1387,9 @@ BOOL Export::WriteExportList( ResData *pResData, ExportList *pExportList, sText = GetPairedListString( sText ); } else{ - //if ((*pEntry)[ sCur ].Len()){ - // if( sCur.EqualsIgnoreCaseAscii("de") ){ - // sText = StripList( (*pEntry)[ sCur ] ); - // } - // else sText = StripList( (*pEntry)[ sCur ] ); if( sText == "\\\"" ) sText = "\""; - //} } ByteString sOutput( sProject ); sOutput += "\t"; @@ -1446,7 +1405,6 @@ BOOL Export::WriteExportList( ResData *pResData, ExportList *pExportList, sOutput += sText; sOutput += "\t\t\t\t"; sOutput += sTimeStamp; - //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sProject ) ) ) aOutput.WriteLine( sOutput ); } @@ -1550,7 +1508,6 @@ void Export::InsertListEntry( const ByteString &rText, const ByteString &rLine ) (*pCurEntry)[ nListLang ] = rText; // Remember en-US fallback string, so each list has the same amount of elements - //if ( nListLang.EqualsIgnoreCaseAscii("en-US") ) { if ( Export::isSourceLanguage( nListLang ) ) { if( nList == LIST_PAIRED ){ const ByteString sPlist("pairedlist"); @@ -1571,7 +1528,6 @@ void Export::InsertListEntry( const ByteString &rText, const ByteString &rLine ) // new fallback } - //if ( nListLang.EqualsIgnoreCaseAscii("en-US") ) { if ( Export::isSourceLanguage( nListLang ) ) { if( nList == LIST_PAIRED ){ (*pCurEntry)[ SOURCE_LANGUAGE ] = rLine; diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx index cd34fae43d88..8dea46fe8a24 100644 --- a/l10ntools/source/export2.cxx +++ b/l10ntools/source/export2.cxx @@ -147,7 +147,6 @@ void Export::QuotHTMLXRM( ByteString &rString ) /*****************************************************************************/ { ByteString sReturn; - //BOOL bBreak = FALSE; for ( USHORT i = 0; i < rString.Len(); i++ ) { ByteString sTemp = rString.Copy( i ); if ( sTemp.Search( "<Arg n=" ) == 0 ) { diff --git a/l10ntools/source/filter/merge/makefile.mk b/l10ntools/source/filter/merge/makefile.mk index f8f8fb640249..b66e5b27e6a1 100644 --- a/l10ntools/source/filter/merge/makefile.mk +++ b/l10ntools/source/filter/merge/makefile.mk @@ -35,18 +35,10 @@ PACKAGE = com$/sun$/star$/filter$/config$/tools$/merge .INCLUDE: settings.mk #----- compile .java files ----------------------------------------- -#.IF "$(L10N_framework)"=="" OWNCOPY = \ $(MISC)$/$(TARGET)_copied.done -#JARFILES = \ -# ridl.jar \ -# unoil.jar \ -# jurt.jar \ -# juh.jar \ -# java_uno.jar - CFGFILES = \ FCFGMerge.cfg @@ -85,8 +77,3 @@ $(OWNCOPY) : $(CFGFILES) $(COPY) $? $(CLASSDIR)$/$(PACKAGE) && $(TOUCH) $@ .ENDIF # "$(SOLAR_JAVA)" != "" - -#.ELSE -#pseudo: - -#.ENDIF diff --git a/l10ntools/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx index 510ccce21c3a..62bd546fb7ac 100644 --- a/l10ntools/source/gsicheck.cxx +++ b/l10ntools/source/gsicheck.cxx @@ -31,7 +31,6 @@ #include <stdio.h> #include <tools/fsys.hxx> #include <tools/stream.hxx> -#include <tools/list.hxx> // local includes #include "tagtest.hxx" diff --git a/l10ntools/source/help/HelpCompiler.cxx b/l10ntools/source/help/HelpCompiler.cxx index 8050a58c1411..f6995fa309c9 100644 --- a/l10ntools/source/help/HelpCompiler.cxx +++ b/l10ntools/source/help/HelpCompiler.cxx @@ -36,8 +36,8 @@ #include <libxslt/transform.h> #include <libxslt/xsltutils.h> #ifdef __MINGW32__ -#include <tools/prewin.h> -#include <tools/postwin.h> +#include <prewin.h> +#include <postwin.h> #endif #include <osl/thread.hxx> diff --git a/l10ntools/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx index 5b57b7fbe680..03296d97db2f 100644 --- a/l10ntools/source/help/HelpCompiler.hxx +++ b/l10ntools/source/help/HelpCompiler.hxx @@ -30,7 +30,7 @@ #define HELPCOMPILER_HXX #include <string> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <vector> #include <list> #include <fstream> @@ -215,11 +215,11 @@ struct SuperFastHash #define pref_hash joaat_hash -typedef std::hash_map<std::string, std::string, pref_hash> Stringtable; +typedef boost::unordered_map<std::string, std::string, pref_hash> Stringtable; typedef std::list<std::string> LinkedList; typedef std::vector<std::string> HashSet; -typedef std::hash_map<std::string, LinkedList, pref_hash> Hashtable; +typedef boost::unordered_map<std::string, LinkedList, pref_hash> Hashtable; class StreamTable { diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index c483507a8f45..a8eec6909914 100644 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -200,7 +200,7 @@ void writeKeyValue_DBHelp( FILE* pFile, const std::string& aKeyStr, const std::s class HelpKeyword { private: - typedef std::hash_map<std::string, Data, pref_hash> DataHashtable; + typedef boost::unordered_map<std::string, Data, pref_hash> DataHashtable; DataHashtable _hash; public: @@ -396,7 +396,6 @@ void HelpLinker::link() throw( HelpProcessingException ) if( bExtensionMode ) { - //indexDirParentName = sourceRoot; indexDirParentName = extensionDestination; } else @@ -732,16 +731,6 @@ void HelpLinker::link() throw( HelpProcessingException ) fs::copy( fsAdditionalFileName, fsTargetName ); } } - -/* - ///////////////////////////////////////////////////////////////////////// - /// remove temprary directory for index creation - ///////////////////////////////////////////////////////////////////////// -#ifndef CMC_DEBUG - if( !bExtensionMode ) - fs::remove_all( indexDirParentName ); -#endif -*/ } diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx index abe5acd41024..2c73d36bd4cf 100644 --- a/l10ntools/source/helpex.cxx +++ b/l10ntools/source/helpex.cxx @@ -146,7 +146,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) break; case STATE_PRJ: { sPrj = argv[ i ]; -// sPrj.ToLowerAscii(); // the project } break; case STATE_ROOT: { diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index d650f3b41e28..03e303e1b8b1 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -44,9 +44,8 @@ #include "rtl/strbuf.hxx" #ifdef WNT #include <direct.h> -#include "tools/prewin.h" -#include <windows.h> -#include "tools/postwin.h" +#include <prewin.h> +#include <postwin.h> #endif /*****************************************************************************/ @@ -165,7 +164,6 @@ bool HelpParser::CreateSDF( if(file.get() == NULL){ printf("%s\n",ByteString(aParser.GetError().sMessage,RTL_TEXTENCODING_ASCII_US).GetBuffer()); exit(-1); - //return false; } file->Extract(); if( !file->CheckExportStatus() ){ @@ -185,8 +183,6 @@ bool HelpParser::CreateSDF( LangHashMap* pElem; XMLElement* pXMLElement = NULL; - //Dump(aXMLStrHM); - ByteString sTimeStamp( Export::GetTimeStamp() ); OUString sOUTimeStamp( sTimeStamp.GetBuffer() , sTimeStamp.Len() , RTL_TEXTENCODING_ASCII_US ); @@ -244,16 +240,12 @@ bool HelpParser::CreateSDF( sBuffer.append( GSI_SEQUENCE4 ); //"\t\t\t\t"; sBuffer.append( sOUTimeStamp ); ByteString sOut( sBuffer.makeStringAndClear().getStr() , RTL_TEXTENCODING_UTF8 ); - //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( rPrj_in ) ) ) - //{ if( data.getLength() > 0 ) aSDFStream.WriteLine( sOut ); - //} pXMLElement=NULL; }else fprintf(stdout,"\nDBG: NullPointer in HelpParser::CreateSDF , Language %s\n",sCur.GetBuffer() ); } } - //Dump(aXMLStrHM); aSDFStream.Close(); if( !sUsedTempFile.EqualsIgnoreCaseAscii( "" ) ){ @@ -398,7 +390,6 @@ bool HelpParser::Merge( { printf("%s\n",ByteString(aParser.GetError().sMessage,RTL_TEXTENCODING_UTF8).GetBuffer()); exit(-1); - //return false; } @@ -490,7 +481,6 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile return false; } } - //remove( sTargetFile.GetBuffer() ); FileStat aFSTest( aTar ); if( aFSTest.GetSize() < 1 ) diff --git a/l10ntools/source/lngex.cxx b/l10ntools/source/lngex.cxx index cc37c2f553ba..4efcc4c54525 100644 --- a/l10ntools/source/lngex.cxx +++ b/l10ntools/source/lngex.cxx @@ -102,14 +102,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) nState = STATE_UTF8; bUTF8 = TRUE; } -/* else if ( sSwitch == "-NOUTF8" ) { - nState = STATE_UTF8; - bUTF8 = FALSE; - }*/ -/* else if ( sSwitch == "-ULF" ) { - nState = STATE_ULF; - bULF = TRUE; - }*/ else if ( sSwitch == "-L" ) { nState = STATE_LANGUAGES; } @@ -130,7 +122,6 @@ BOOL ParseCommandLine( int argc, char* argv[]) break; case STATE_PRJ: { sPrj = argv[ i ]; -// sPrj.ToLowerAscii(); // the project } break; case STATE_ROOT: { diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 1d7836ac67a3..94c06e626e8f 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -761,7 +761,6 @@ BOOL SourceTreeLocalizer::Merge( const ByteString &rSourceFile , const ByteStrin BOOL bReturn = aSDF.IsOpen(); if ( bReturn ) { bReturn = ExecuteMerge(); -// aSDF.Close(); } aSDF.Close(); nMode = LOCALIZE_NONE; diff --git a/l10ntools/source/makefile.mk b/l10ntools/source/makefile.mk index fc4203b0d9d3..ab28ca04db7e 100644 --- a/l10ntools/source/makefile.mk +++ b/l10ntools/source/makefile.mk @@ -33,12 +33,14 @@ PRJNAME=l10ntools TARGET=transex TARGETTYPE=CUI LIBTARGET=no + # --- Settings ----------------------------------------------------- + ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk + CDEFS+= -DYY_NEVER_INTERACTIVE=1 -#CDEFS+= -pg .IF "$(SYSTEM_EXPAT)" == "YES" CFLAGS+=-DSYSTEM_EXPAT @@ -62,7 +64,6 @@ OBJFILES= \ LIB1TARGET= $(LB)$/$(TARGET).lib LIB1ARCHIV= $(LB)$/libtransex.a -#LIB1FILES= $(LB)$/transex3.lib LIB1OBJFILES= $(OBJ)$/export.obj \ $(OBJ)$/export2.obj \ $(OBJ)$/merge.obj \ @@ -76,47 +77,25 @@ APP1VERSIONMAP=exports.map # extractor and merger for *.src and *.hrc APP1TARGET= transex3 -#APP1OBJS= $(OBJ)$/src_yy.obj APP1OBJS= $(OBJ)$/src_yy_wrapper.obj - APP1STDLIBS+= \ $(TOOLSLIB) \ $(SALLIB) - -.IF "$(OS)"=="MACOSX" -# static libs at end for OS X -.ENDIF - APP1LIBS+= $(LB)$/$(TARGET).lib APP1DEPN= $(OBJ)$/src_yy_wrapper.obj $(LB)$/$(TARGET).lib APP2TARGET= helpex APP2OBJS= $(OBJ)$/helpmerge.obj $(OBJ)$/xmlparse.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj $(OBJ)$/merge.obj $(OBJ)$/helpex.obj APP2RPATH= NONE - -.IF "$(OS)"!="MACOSX" -.ENDIF - APP2STDLIBS+=$(SALLIB) $(EXPATASCII3RDLIB) $(TOOLSLIB) -.IF "$(OS)"=="MACOSX" -# static libs at end for OS X -.ENDIF - # extractor and merger for *.lng and *.lng APP3TARGET= ulfex APP3OBJS= $(OBJ)$/lngmerge.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/lngex.obj $(OBJ)$/utf8conv.obj APP3RPATH= NONE - -.IF "$(OS)"!="MACOSX" -#APP3STDLIBS+= $(BTSTRPLIB) -.ENDIF APP3STDLIBS+= \ $(TOOLSLIB) \ $(SALLIB) -.IF "$(OS)"=="MACOSX" -# static libs at end for OS X -.ENDIF # encoding converter for *.gsi APP4TARGET= gsiconv @@ -135,40 +114,18 @@ APP5STDLIBS+= \ # extractor and merger for *.cfg APP6TARGET= cfgex APP6OBJS= $(OBJ)$/cfgmerge.obj $(OBJ)$/cfg_yy_wrapper.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj - -.IF "$(OS)"!="MACOSX" -#APP6STDLIBS+= $(BTSTRPLIB) -.ENDIF - APP6STDLIBS+= \ $(TOOLSLIB) \ $(SALLIB) -.IF "$(OS)"=="MACOSX" -# static libs at end for OS X -.ENDIF - # extractor and merger for *.xrm APP7TARGET= xrmex APP7OBJS= $(OBJ)$/xrmmerge.obj $(OBJ)$/xrm_yy_wrapper.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj APP7RPATH= NONE - -.IF "$(OS)"!="MACOSX" -.ENDIF - APP7STDLIBS+= \ $(TOOLSLIB) \ $(SALLIB) -.IF "$(OS)"=="MACOSX" -# static libs at end for OS X -.ENDIF - -# -#APP8TARGET= treeconfig -#APP8OBJS= $(OBJ)$/treeconfig.obj $(OBJ)$/inireader.obj $(OBJ)$/export2.obj -#APP8STDLIBS=$(TOOLSLIB) $(SALLIB) $(ICUINLIB) $(STLPORT) - # localizer for l10n framework APP9TARGET= localize_sl EXCEPTIONSFILES= \ @@ -179,7 +136,6 @@ APP9STDLIBS+= \ $(TOOLSLIB) \ $(ICUINLIB) \ $(ICUUCLIB) \ - $(STLPORTLIB) \ $(SALLIB) DEPOBJFILES=$(APP1OBJS) $(APP2OBJS) $(APP3OBJS) $(APP4OBJS) $(APP5OBJS) $(APP6OBJS) $(APP7OBJS) $(APP8OBJS) $(APP9OBJS) diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index b85a75461926..e828f12343f8 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -205,7 +205,6 @@ BOOL MergeData::operator==( ResData *pData ) /*****************************************************************************/ MergeDataFile::MergeDataFile( const ByteString &rFileName, const ByteString& sFile ,BOOL bErrLog, -// CharSet aCharSet, BOOL bUTF8 , bool bCaseSensitive ) CharSet aCharSet, bool bCaseSensitive ) /*****************************************************************************/ @@ -230,7 +229,6 @@ MergeDataFile::MergeDataFile( const ByteString &rFileName, const ByteString& sFi if( !aInputStream.IsOpen() ) { printf("Warning : Can't open %s\n", rFileName.GetBuffer()); - //exit( -1 ); return; } while ( !aInputStream.IsEof()) { @@ -292,13 +290,6 @@ MergeDataFile::~MergeDataFile() { } -/*****************************************************************************/ -//void MergeDataFile::WriteErrorLog( const ByteString &rFileName ) -/*****************************************************************************/ -//{ -// DEAD -//} - ByteString MergeDataFile::Dump(){ ByteString sRet( "MergeDataFile\n" ); @@ -362,7 +353,6 @@ MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive //printf("DBG: Found[%s]\n",sKey.GetBuffer()); return aMap[ sKey ]; } - //Dump(); pResData->sGId = sOldG; pResData->sId = sOldL; //printf("DBG: Found[%s]\n",sKey.GetBuffer()); diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx index ca4ce009b771..bb921b4a7fc5 100644 --- a/l10ntools/source/xmlparse.cxx +++ b/l10ntools/source/xmlparse.cxx @@ -39,8 +39,8 @@ #include <osl/mutex.hxx> #include <osl/thread.hxx> #ifdef __MINGW32__ -#include <tools/prewin.h> -#include <tools/postwin.h> +#include <prewin.h> +#include <postwin.h> #endif using namespace std; using namespace osl; @@ -1341,8 +1341,6 @@ void XMLUtil::QuotHTML( String &rString ) case '>': sReturn.append( GT );i++;break; case '\\': sReturn.append( QUOT );i++;break; case '\"': sReturn.append( APOS );i++;break; - //case '\'': sReturn += "\'";i++;break; - //case '&' : sRetrun += "&";i++;break; default: sReturn.append( SLASH );break; } @@ -1361,10 +1359,6 @@ void XMLUtil::QuotHTML( String &rString ) sReturn.append( QQUOT ); break; -/* case '\'': - sReturn += "'"; - break; -*/ case '&': if ( ( ( i + 4 ) < rString.Len()) && diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index d62eacb05578..513d0f088874 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -322,9 +322,6 @@ int XRMResParser::Execute( int nToken, char * pToken ) sLID = ""; sGID += "."; sGID += GetAttribute( rToken, "id" ); - //sLocalized = "1"; - - //sLocalized = "X:"; sLocalized = true; break; @@ -336,11 +333,6 @@ int XRMResParser::Execute( int nToken, char * pToken ) sLID = ""; sGID += "."; sGID += GetAttribute( rToken, "id" ); -// if ( GetAttribute( rToken, "localized" ) == "false" ) -// sLocalized += "0"; -// sLocalized = false; -// else -// sLocalized += "1"; sLocalized = true; break; @@ -446,9 +438,7 @@ void XRMResParser::ConvertStringToDBFormat( ByteString &rString ) do { sResult = rString; rString.EraseLeadingChars( _LF ); - // rString.EraseLeadingChars( ' ' ); rString.EraseLeadingChars( '\t' ); - // rString.EraseTrailingChars( ' ' ); rString.EraseTrailingChars( '\t' ); } while ( sResult != rString ); @@ -563,9 +553,6 @@ void XRMResExport::EndOfText( char cSearch = 0x00; ByteString sSearch( cSearch ); - // if ( !pResData->sText[ ByteString("en-US") ].Len() ) - // pResData->sText[ ByteString("en-US") ] = pResData->sText[ ByteString("de") ]; - Export::FillInFallbacks( pResData ); ByteString sTimeStamp( Export::GetTimeStamp()); @@ -574,7 +561,6 @@ void XRMResExport::EndOfText( sCur = aLanguages[ n ]; ByteString sAct = pResData->sText[ sCur ]; - //Export::UnquotHTML( sAct ); sAct.EraseAllChars( 0x0A ); ByteString sOutput( sPrj ); sOutput += "\t"; @@ -594,7 +580,6 @@ void XRMResExport::EndOfText( sOutput += sTimeStamp; sOutput.SearchAndReplaceAll( sSearch, "_" ); - //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sPrj ) ) ) if( sAct.Len() > 1 ) pOutputStream->WriteLine( sOutput ); } @@ -647,7 +632,6 @@ void XRMResMerge::WorkOnText( if ( pMergeDataFile ) { if ( !pResData ) { ByteString sPlatform( "" ); -// pResData = new ResData( sPlatform, GetGID() , sFilename ); pResData = new ResData( sPlatform, GetLID() , sFilename ); pResData->sId = GetLID(); @@ -702,8 +686,6 @@ void XRMResMerge::EndOfText( ( sContent != "-" ) && ( sContent.Len())) { ByteString sText( sContent ); - //Export::QuotHTMLXRM( sText ); - ByteString sAdditionalLine( "\t" ); sAdditionalLine += rOpenTag; ByteString sSearch = "xml:lang=\""; |