Anonymous avatar Anonymous committed c5e2b2a Merge

CWS-TOOLING: integrate CWS l10ntools

Comments (0)

Files changed (293)

cairo/prj/build.lst

-lcairo	cairo	: zlib soltools NULL
+lcairo	cairo	: ZLIB:zlib soltools NULL
 lcairo	cairo			    usr1	-	all	lcairo_mkout NULL
 lcairo	cairo\pixman		    nmake	-	all	lcairo_pixman NULL
 lcairo	cairo\cairo		    nmake	-	all	lcairo_cairo lcairo_pixman NULL
     { echo "$as_me:$LINENO: result: internal" >&5
 echo "${ECHO_T}internal" >&6; }
     SYSTEM_HYPH=NO
+    BUILD_TYPE="$BUILD_TYPE HYPHEN"
 fi
 
 
 else
     AC_MSG_RESULT([internal])
     SYSTEM_HYPH=NO
+    BUILD_TYPE="$BUILD_TYPE HYPHEN"
 fi
 AC_SUBST(SYSTEM_HYPH)
 AC_SUBST(HYPHEN_LIB)

desktop/source/deployment/registry/help/dp_help.cxx

 #include "svl/inettype.hxx"
 #include "unotools/pathoptions.hxx"
 
-#include <transex3/compilehelp.hxx> 
+#include <l10ntools/compilehelp.hxx> 
 #include <com/sun/star/ucb/XSimpleFileAccess.hpp>
 #include <com/sun/star/util/XMacroExpander.hpp>
 #include <com/sun/star/uri/XUriReferenceFactory.hpp>

l10n/prj/build.lst

-l10n l10n  : transex3 NULL
+l10n l10n  : l10ntools NULL
 l10n l10n\source     nmake - all l10n_source NULL
 l10n l10n\util          nmake - all l10n_util l10n_source NULL

l10ntools/inc/cfgmerge.hxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cfgmerge.hxx,v $
+ * $Revision: 1.8 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CFG_MERGE_HXX
+#define _CFG_MERGE_HXX
+
+#include <tools/string.hxx>
+#include <tools/list.hxx>
+#include <hash_map>
+
+typedef std::hash_map<ByteString , ByteString , hashByteString,equalByteString>
+                                ByteStringHashMap;
+
+
+//
+// class CfgStackData
+//
+
+class CfgStackData
+{
+friend class CfgParser;
+friend class CfgExport;
+friend class CfgMerge;
+private:
+	ByteString sTagType;
+	ByteString sIdentifier;
+
+	ByteString sResTyp;
+
+	ByteString sTextTag;
+	ByteString sEndTextTag;
+
+    ByteStringHashMap sText;
+public:
+	CfgStackData( const ByteString &rTag, const ByteString &rId ) 
+			: sTagType( rTag ), sIdentifier( rId ) {};
+
+	ByteString &GetTagType() { return sTagType; }
+	ByteString &GetIdentifier() { return sIdentifier; }
+
+};
+
+//
+// class CfgStack
+//
+
+DECLARE_LIST( CfgStackList, CfgStackData * )
+
+class CfgStack : public CfgStackList
+{
+public:
+	CfgStack() : CfgStackList( 10, 10 ) {}
+	~CfgStack();
+
+	ULONG Push( CfgStackData *pStackData );	
+    CfgStackData *Push( const ByteString &rTag, const ByteString &rId );
+	CfgStackData *Pop() { return Remove( Count() - 1 ); }
+
+	CfgStackData *GetStackData( ULONG nPos = LIST_APPEND );
+
+	ByteString GetAccessPath( ULONG nPos = LIST_APPEND );
+};
+
+//
+// class CfgParser
+//
+
+class CfgParser 
+{
+protected:
+	ByteString sCurrentResTyp;
+	ByteString sCurrentIsoLang;
+	ByteString sCurrentText;
+
+	ByteString sLastWhitespace;
+
+	CfgStack aStack;
+	CfgStackData *pStackData;
+
+	BOOL bLocalize;
+
+	virtual void WorkOnText( 
+		ByteString &rText, 
+        const ByteString &nLangIndex )=0;
+
+	virtual void WorkOnRessourceEnd()=0;
+
+	virtual void Output( const ByteString& rOutput )=0;
+
+	void Error( const ByteString &rError );
+
+private:
+	int ExecuteAnalyzedToken( int nToken, char *pToken );
+    std::vector<ByteString> aLanguages;
+	void AddText( 
+		ByteString &rText, 
+		const ByteString &rIsoLang,
+		const ByteString &rResTyp );
+	
+BOOL IsTokenClosed( const ByteString &rToken );
+
+public:
+	CfgParser();
+	virtual ~CfgParser();
+
+	int Execute( int nToken, char * pToken );
+};
+
+//
+// class CfgOutputParser
+//
+
+class CfgOutputParser : public CfgParser
+{
+protected:
+	SvFileStream *pOutputStream;
+public:
+	CfgOutputParser ( const ByteString &rOutputFile );
+	virtual ~CfgOutputParser();
+};
+
+//
+// class CfgExport
+//
+
+class CfgExport : public CfgOutputParser
+{
+private:
+	ByteString sPrj;
+	ByteString sPath;
+    std::vector<ByteString> aLanguages;
+protected:
+	void WorkOnText( 
+		ByteString &rText, 
+        const ByteString &rIsoLang
+        );
+
+    void WorkOnRessourceEnd();
+    void Output( const ByteString& rOutput );
+public:	
+    CfgExport(
+		const ByteString &rOutputFile,
+		const ByteString &rProject,
+		const ByteString &rFilePath
+	);
+	~CfgExport();
+};
+
+//
+// class CfgMerge
+//
+
+class CfgMerge : public CfgOutputParser
+{
+private:
+	MergeDataFile *pMergeDataFile;
+    std::vector<ByteString> aLanguages;
+	ResData *pResData;
+	
+	BOOL bGerman;
+    ByteString sFilename;
+	BOOL bEnglish;
+
+protected:
+	void WorkOnText( 
+		ByteString &rText, 
+        const ByteString &nLangIndex );
+
+	void WorkOnRessourceEnd();
+
+	void Output( const ByteString& rOutput );
+public:
+    CfgMerge(
+		const ByteString &rMergeSource,
+		const ByteString &rOutputFile,
+		ByteString &rFilename
+	);
+	~CfgMerge();
+};
+
+#endif

l10ntools/inc/export.hxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: export.hxx,v $
+ * $Revision: 1.27 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+ 
+#ifndef _EXPORT_HXX
+#define _EXPORT_HXX
+
+#ifndef L10NTOOLS_DIRECTORY_HXX
+#define L10NTOOLS_DIRECTORY_HXX
+#include <l10ntools/directory.hxx>
+#endif
+
+
+// #define MERGE_SOURCE_LANGUAGES <- To merge en-US and de resource 
+
+#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 <iterator> /* std::iterator*/
+#include <set>      /* std::set*/
+#include <vector>   /* std::vector*/
+#include <queue>    
+#include <string>
+
+#include <unistd.h>
+#ifdef WNT
+#include <direct.h>
+#endif
+
+#define NO_TRANSLATE_ISO		"x-no-translate"
+
+#define JAPANESE_ISO "ja"
+
+
+struct eqstr{
+  BOOL operator()(const char* s1, const char* s2) const{
+    return strcmp(s1,s2)==0;
+  }
+};
+
+struct equalByteString{
+        bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const {
+            return rKey1.CompareTo( rKey2 )==COMPARE_EQUAL;
+    }
+};
+struct lessByteString{
+        bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const {
+            return rKey1.CompareTo( rKey2 )==COMPARE_LESS;
+    }
+};
+
+struct hashByteString{
+    size_t operator()( const ByteString& rName ) const{
+                std::hash< const char* > myHash;
+                return myHash( rName.GetBuffer() );
+    }
+};
+
+class PFormEntrys;
+class MergeData;
+typedef std::set<ByteString , lessByteString > ByteStringSet;
+
+typedef std::hash_map<ByteString , ByteString , hashByteString,equalByteString>
+                                ByteStringHashMap;
+
+typedef std::hash_map<ByteString , bool , hashByteString,equalByteString>
+                                ByteStringBoolHashMap;
+
+typedef std::hash_map<ByteString , PFormEntrys* , hashByteString,equalByteString>
+                                PFormEntrysHashMap;
+
+typedef std::hash_map<ByteString , MergeData* , hashByteString,equalByteString>
+                                MergeDataHashMap;
+
+#define SOURCE_LANGUAGE ByteString("en-US")
+#define LIST_REFID  "LIST_REFID"
+
+typedef ByteStringHashMap ExportListEntry;
+
+DECLARE_LIST( ExportListBase, ExportListEntry * )
+
+//
+// class ExportList
+//
+
+class ExportList : public ExportListBase
+{
+private:
+	ULONG nSourceLanguageListEntryCount;
+
+public:
+	ExportList() : ExportListBase() { nSourceLanguageListEntryCount = 0; }
+	ULONG GetSourceLanguageListEntryCount() { return nSourceLanguageListEntryCount; }
+	void NewSourceLanguageListEntry() { nSourceLanguageListEntryCount++; }
+};
+
+#define REFID_NONE 0xFFFF
+
+//
+// struct ResData
+//
+
+/******************************************************************************
+* Purpose: holds mandatory data to export a single res (used with ResStack)
+******************************************************************************/
+
+#define ID_LEVEL_NULL		0x0000
+#define ID_LEVEL_AUTOID		0x0001
+#define ID_LEVEL_TEXT		0x0002
+#define ID_LEVEL_FIELDNAME	0x0003
+#define ID_LEVEL_ACCESSPATH	0x0004
+#define ID_LEVEL_IDENTIFIER 0x0005
+#define ID_LEVEL_LISTINDEX	0x0006
+
+class ResData
+{
+public:
+	~ResData();
+	BOOL SetId( const ByteString &rId, USHORT nLevel );
+    
+    USHORT nWidth;
+	USHORT nChildIndex;
+	USHORT nIdLevel;
+	BOOL bChild;
+	BOOL bChildWithText;
+
+	BOOL bText;
+	BOOL bHelpText;
+	BOOL bQuickHelpText;
+	BOOL bTitle;
+	BOOL bList;
+
+	BOOL bRestMerged;
+
+    ByteString sResTyp;
+	ByteString sId;
+	ByteString sGId;
+	ByteString sHelpId;
+	ByteString sFilename;
+
+    ByteStringHashMap sText;
+    USHORT nTextRefId;
+
+	ByteStringHashMap sHelpText;
+    USHORT nHelpTextRefId;
+
+	ByteStringHashMap sQuickHelpText;
+    USHORT nQuickHelpTextRefId;
+
+	ByteStringHashMap sTitle;
+    USHORT nTitleRefId;
+
+	ByteString sTextTyp;
+	ByteStringHashMap aFallbackData;
+	ByteStringHashMap aMergedLanguages;
+
+	ExportList	*pStringList;
+	ExportList	*pUIEntries;
+	ExportList	*pItemList;
+    ExportList	*pFilterList;
+    ExportList  *pPairedList;
+ 
+    ByteString sPForm;
+
+	void Dump();
+	void addFallbackData( ByteString& sId , const ByteString& sText );
+	bool getFallbackData( ByteString& sId , ByteString& sText);
+	
+	void addMergedLanguage( ByteString& sLang );
+	bool isMerged( ByteString& sLang );
+	ResData( const ByteString &rPF, const ByteString &rGId )
+			: 
+            nWidth( 0 ),
+            nChildIndex( 0 ),
+            nIdLevel( ID_LEVEL_NULL ),
+            bChild( FALSE ),
+            bChildWithText( FALSE ),
+            bText( FALSE ),
+            bHelpText( FALSE ),
+            bQuickHelpText( FALSE ),
+            bTitle( FALSE ),
+            bList( FALSE ),
+            bRestMerged( FALSE ),
+            sGId( rGId ),
+            nTextRefId( REFID_NONE ),
+            nHelpTextRefId( REFID_NONE ),
+            nQuickHelpTextRefId( REFID_NONE ),
+            nTitleRefId( REFID_NONE ),
+            sTextTyp( "Text" ),
+            pStringList( NULL ),
+            pUIEntries( NULL ),
+            pItemList( NULL ),  
+            pFilterList( NULL ),
+            pPairedList( NULL ),
+            sPForm( rPF )
+	{
+		sGId.EraseAllChars( '\r' );
+		sPForm.EraseAllChars( '\r' );
+	};
+	ResData( const ByteString &rPF, const ByteString &rGId , const ByteString &rFilename )
+			: 			
+            nChildIndex( 0 ),
+            nIdLevel( ID_LEVEL_NULL ),
+            bChild( FALSE ),
+            bChildWithText( FALSE ),
+            bText( FALSE ),
+            bHelpText( FALSE ),
+            bQuickHelpText( FALSE ),
+            bTitle( FALSE ),
+            bList( FALSE ),
+            bRestMerged( FALSE ),
+            sGId( rGId ),
+            sFilename( rFilename ),
+            nTextRefId( REFID_NONE ),
+            nHelpTextRefId( REFID_NONE ),
+            nQuickHelpTextRefId( REFID_NONE ),
+            nTitleRefId( REFID_NONE ),
+            sTextTyp( "Text" ),
+            pStringList( NULL ),
+            pUIEntries( NULL ),
+            pItemList( NULL ),  
+            pFilterList( NULL ),
+            pPairedList( NULL ),
+            sPForm( rPF )
+
+	{
+		sGId.EraseAllChars( '\r' );
+		sPForm.EraseAllChars( '\r' );
+	};
+
+
+};
+
+
+//
+// class Export
+//
+
+/******************************************************************************
+* Purpose: syntax check and export of *.src, called from lexer
+******************************************************************************/
+
+#define LIST_NON 					0x0000
+#define LIST_STRING 				0x0001
+#define LIST_FILTER					0x0002
+#define LIST_ITEM					0x0004
+#define LIST_PAIRED                 0x0005
+#define LIST_UIENTRIES				0x0008
+#define STRING_TYP_TEXT				0x0010
+#define	STRING_TYP_HELPTEXT			0x0020
+#define STRING_TYP_QUICKHELPTEXT	0x0040
+#define STRING_TYP_TITLE			0x0080
+
+#define MERGE_MODE_NORMAL			0x0000
+#define MERGE_MODE_LIST				0x0001
+
+DECLARE_LIST( ResStack, ResData * )
+// forwards
+class WordTransformer;
+class ParserQueue;
+
+class Export
+{
+private:
+	WordTransformer	*pWordTransformer;
+
+	CharSet	aCharSet;					// used charset in src
+
+	SvFileStream aOutput;
+    
+	ResStack aResStack;					// stack for parsing recursive
+
+	ByteString sActPForm;				// hold cur. system
+
+	BOOL bDefine;						// cur. res. in a define?
+	BOOL bNextMustBeDefineEOL;			// define but no \ at lineend
+	ULONG nLevel;						// res. recursiv? how deep?
+	USHORT nList;						// cur. res. is String- or FilterList
+    ByteString nListLang;
+    ULONG nListIndex;
+	ULONG nListLevel;
+    bool bSkipFile;
+	ByteString sProject;
+	ByteString sRoot;
+	BOOL bEnableExport;
+	BOOL bMergeMode;
+	ByteString sMergeSrc;
+	ByteString sLastListLine;
+	BOOL bError;						// any errors while export?
+	BOOL bReadOver;
+	BOOL bDontWriteOutput;
+	ByteString sLastTextTyp;
+    static bool isInitialized;
+	ByteString sFilename;
+    
+
+public:
+	ParserQueue* pParseQueue; // public ?
+    static ByteString sLanguages; // public ?
+    static ByteString sForcedLanguages; // public ?
+	
+    
+    static bool skipProject( ByteString sPrj ) ;
+	static void InitLanguages( bool bMergeMode = false );
+    static void InitForcedLanguages( bool bMergeMode = false );
+    static std::vector<ByteString> GetLanguages();
+    static std::vector<ByteString> GetForcedLanguages();
+
+    static void SetLanguages( std::vector<ByteString> val );
+    static void RemoveUTF8ByteOrderMarker( ByteString &rString );
+    static bool hasUTF8ByteOrderMarker( const ByteString &rString );
+    static void RemoveUTF8ByteOrderMarkerFromFile( const ByteString &rFilename );
+    static bool fileHasUTF8ByteOrderMarker( const ByteString &rString ); 
+	static ByteString GetIsoLangByIndex( USHORT nIndex );
+	static void QuotHTML( ByteString &rString );
+    static bool CopyFile( const ByteString& source , const ByteString& dest );
+
+	static void QuotHTMLXRM( ByteString &rString );
+    static void UnquotHTML( ByteString &rString );
+	
+    static const char* GetEnv( const char *pVar );
+	static int getCurrentDirectory( rtl::OUString& base_fqurl , rtl::OUString& base );
+
+    static bool isSourceLanguage( const ByteString &sLanguage );
+	static bool isAllowed( const ByteString &sLanguage );	
+
+    static bool LanguageAllowed( const ByteString &nLanguage );
+    static void Languages( std::vector<ByteString>::const_iterator& begin , std::vector<ByteString>::const_iterator& end );
+	static void getRandomName( const ByteString& sPrefix , ByteString& sRandStr , const ByteString& sPostfix  );
+    static void getRandomName( ByteString& sRandStr );
+    static void getCurrentDir( std::string& dir );
+
+    static void replaceEncoding( ByteString& rString );
+    
+	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 BOOL ConvertLineEnds( ByteString sSource, ByteString sDestination );
+	static ByteString GetNativeFile( ByteString sSource );
+	static DirEntry GetTempFile();
+	
+	static void DumpExportList( ByteString& sListName , ExportList& aList );
+	static ByteString DumpMap( ByteString& sMapName , ByteStringHashMap& aMap );
+
+private:
+    static std::vector<ByteString> aLanguages;
+    static std::vector<ByteString> aForcedLanguages;
+
+	BOOL ListExists( ResData *pResData, USHORT nLst );
+
+	BOOL WriteData( ResData *pResData, BOOL bCreateNew = FALSE );// called befor dest. cur ResData
+	BOOL WriteExportList( ResData *pResData, ExportList *pExportList,
+						const ByteString &rTyp, BOOL bCreateNew = FALSE );
+	
+	ByteString MergePairedList( ByteString& sLine , ByteString& sText );
+
+	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 );
+
+	void UnmergeUTF8( ByteString& sOrig );
+	void InsertListEntry( const ByteString &rText, const ByteString &rLine );
+	void CleanValue( ByteString &rValue );
+	ByteString GetText( const ByteString &rSource, int nToken );
+
+	BOOL PrepareTextToMerge( ByteString &rText, USHORT nTyp,
+		ByteString &nLangIndex, ResData *pResData );		
+
+	void MergeRest( ResData *pResData, USHORT nMode = MERGE_MODE_NORMAL );
+	void ConvertMergeContent( ByteString &rText );
+
+  	void WriteToMerged( const ByteString &rText , bool bSDFContent );
+	void SetChildWithText();
+
+	void CutComment( ByteString &rText );
+
+public:
+	Export( const ByteString &rOutput, BOOL bWrite,
+			const ByteString &rPrj, const ByteString &rPrjRoot , const ByteString& rFile );
+	Export( const ByteString &rOutput, BOOL bWrite,
+			const ByteString &rPrj, const ByteString &rPrjRoot,
+			const ByteString &rMergeSource , const ByteString& rFile );
+	~Export();
+
+	void Init();
+	int Execute( int nToken, const char * pToken );	// called from lexer
+	void SetError() { bError = TRUE; }
+	BOOL GetError() { return bError; }
+};
+
+
+//
+// class PFormEntrys
+//
+
+/******************************************************************************
+* Purpose: holds information of data to merge (one pform)
+******************************************************************************/
+
+class PFormEntrys : public ByteString
+{
+friend class MergeDataFile;
+private:
+	ByteString sHelpText; // empty string
+	ByteStringHashMap sText;
+	ByteStringBoolHashMap bTextFirst;
+	ByteStringHashMap sQuickHelpText;
+	ByteStringBoolHashMap bQuickHelpTextFirst;
+	ByteStringHashMap sTitle;
+	ByteStringBoolHashMap bTitleFirst;
+
+public:
+	PFormEntrys( const ByteString &rPForm ) : ByteString( rPForm ) {};
+	ByteString Dump();
+	void InsertEntry( 
+                    const ByteString &nId ,
+                    const ByteString &rText,
+					const ByteString &rQuickHelpText,
+					const ByteString &rTitle 
+                    )
+		{
+			
+			sText[ nId ] = rText;
+			bTextFirst[ nId ] = true;
+			sQuickHelpText[ nId ] = rQuickHelpText;
+			bQuickHelpTextFirst[ nId ] = true;
+			sTitle[ nId ] = rTitle;
+			bTitleFirst[ nId ] = true;
+		}
+     BOOL GetText( ByteString &rReturn, USHORT nTyp, const ByteString &nLangIndex, BOOL bDel = FALSE );
+};
+
+//
+// class MergeData
+//
+
+/******************************************************************************
+* Purpose: holds information of data to merge (one ressource)
+******************************************************************************/
+
+class MergeDataFile;
+
+class MergeData 
+{
+friend class MergeDataFile;
+private:
+	ByteString sTyp;
+	ByteString sGID;
+	ByteString sLID;
+    ByteString sFilename;
+    PFormEntrysHashMap aMap;
+public:
+	MergeData( const ByteString &rTyp, const ByteString &rGID, const ByteString &rLID , const ByteString &rFilename )
+			: sTyp( rTyp ), sGID( rGID ), sLID( rLID ) , sFilename( rFilename ) {};
+	~MergeData();
+	PFormEntrys* InsertEntry( const ByteString &rPForm );
+	PFormEntrys* GetPFormEntrys( ResData *pResData );
+    
+    void Insert( const ByteString& rPFO , PFormEntrys* pfEntrys );
+    PFormEntrys* GetPFObject( const ByteString& rPFO );
+
+	ByteString Dump();
+	BOOL operator==( ResData *pData );
+};
+
+//
+// class MergeDataFile
+//
+
+/******************************************************************************
+* Purpose: holds information of data to merge
+******************************************************************************/
+
+class MergeDataFile
+{
+private:
+	BOOL bErrorLog;
+	ByteString sErrorLog;
+	SvFileStream aErrLog;
+    ByteStringSet aLanguageSet;
+    MergeDataHashMap aMap;  
+    ByteStringHashMap aLanguageMap;
+    std::vector<ByteString> aLanguageList;
+    ByteStringHashMap aFilenames;
+    
+
+public:
+    MergeDataFile( const ByteString &rFileName, const ByteString& rFile , BOOL bErrLog, CharSet aCharSet, bool bCaseSensitive = false );
+	~MergeDataFile();
+    
+    
+	std::vector<ByteString> GetLanguages();
+	MergeData *GetMergeData( ResData *pResData , bool bCaseSensitve = false );
+	
+    PFormEntrys *GetPFormEntrys( ResData *pResData );
+    PFormEntrys *GetPFormEntrysCaseSensitive( ResData *pResData );
+
+	void InsertEntry( const ByteString &rTYP, const ByteString &rGID, const ByteString &rLID,
+				const ByteString &rPFO, 
+                const ByteString &nLang , const ByteString &rTEXT,
+				const ByteString &rQHTEXT, const ByteString &rTITLE , 
+                const ByteString &sFilename , bool bCaseSensitive 
+				);
+	static USHORT GetLangIndex( USHORT nId );
+	static ByteString CreateKey( const ByteString& rTYP , const ByteString& rGID , const ByteString& rLID , const ByteString& rFilename , bool bCaseSensitive = false );
+
+	ByteString Dump();
+	void WriteError( const ByteString &rLine );
+};
+
+
+class QueueEntry
+{
+public:
+    QueueEntry( int nTypVal , ByteString sLineVal ): nTyp( nTypVal ) , sLine( sLineVal ){};
+    int nTyp;
+    ByteString sLine;
+};
+
+class ParserQueue
+{
+public:
+    
+    ParserQueue( Export& aExportObj );
+    ~ParserQueue();
+
+    inline void Push( const QueueEntry& aEntry );
+    bool bCurrentIsM;  // public ?
+    bool bNextIsM;   // public ?
+    bool bLastWasM;   // public ?
+    bool bMflag;   // public ?
+    
+    void Close();
+private:
+    // Future / Next
+    std::queue<QueueEntry>* aQueueNext;
+    // Current 
+    std::queue<QueueEntry>* aQueueCur;
+    // Ref
+    std::queue<QueueEntry>* aQref;
+
+    Export& aExport;
+    bool bStart;
+    bool bStartNext;
+
+    inline void Pop( std::queue<QueueEntry>& aQueue );
+
+};
+#endif
+

l10ntools/inc/gsicheck.hxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: gsicheck.hxx,v $
+ * $Revision: 1.8.22.1 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _GSICHECK_HXX_
+#define _GSICHECK_HXX_
+
+#include "tagtest.hxx"
+
+//
+// class GSILine
+//
+enum LineFormat { FORMAT_GSI, FORMAT_SDF, FORMAT_UNKNOWN };
+             
+class GSILine : public ByteString
+{
+private:
+
+    ParserMessageList aMessages;
+    LineFormat aFormat;
+	ULONG nLineNumber;
+
+    ByteString aUniqId;
+    ByteString aLineType;
+    ByteString aLangId;
+	ByteString aText;
+	ByteString aQuickHelpText;
+	ByteString aTitle;
+
+    BOOL bOK;
+    BOOL bFixed;
+
+    void              ReassembleLine();
+
+public:
+    GSILine( const ByteString &rLine, ULONG nLine );
+    LineFormat  GetLineFormat() const    { return aFormat; }
+	ULONG       GetLineNumber() const    { return nLineNumber; }
+
+	ByteString  const GetUniqId()     const    { return aUniqId; }
+    ByteString  const GetLineType()   const    { return aLineType; }
+	ByteString  const GetLanguageId() const    { return aLangId; }
+	ByteString  const GetText()       const    { return aText; }
+	    String  const GetUText()      const    { return String( aText, RTL_TEXTENCODING_UTF8 ); }
+	ByteString  const GetQuickHelpText() const { return aQuickHelpText; }
+	ByteString  const GetTitle()      const    { return aTitle; }
+
+	      void        SetUText( String &aNew ) { aText = ByteString( aNew, RTL_TEXTENCODING_UTF8 ); ReassembleLine(); }
+	      void        SetText( ByteString &aNew ) { aText = aNew; ReassembleLine(); }
+	      void        SetQuickHelpText( ByteString &aNew ) { aQuickHelpText = aNew; ReassembleLine(); }
+	      void        SetTitle( ByteString &aNew ) { aTitle = aNew; ReassembleLine(); }
+
+    ParserMessageList* GetMessageList() { return &aMessages; };
+	BOOL HasMessages(){ return ( aMessages.Count() > 0 ); };
+
+	BOOL IsOK() const { return bOK; }
+	void NotOK();
+
+	BOOL IsFixed() const { return bFixed; }
+    void SetFixed() { bFixed = TRUE; };
+};
+
+//
+// class GSIBlock
+//
+
+DECLARE_LIST( GSIBlock_Impl, GSILine * )
+
+class LazySvFileStream;
+
+class GSIBlock : public GSIBlock_Impl
+{
+private:
+	GSILine *pSourceLine;
+	GSILine *pReferenceLine;
+	void PrintList( ParserMessageList *pList, ByteString aPrefix, GSILine *pLine );
+	BOOL bPrintContext;
+    BOOL bCheckSourceLang;
+    BOOL bCheckTranslationLang;
+    BOOL bReference;
+    BOOL bAllowKeyIDs;
+    BOOL bAllowSuspicious;
+
+    BOOL bHasBlockError;
+
+    BOOL IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorPos, ByteString &aErrorMsg, BOOL &bHasBeenFixed, ByteString &aFixed ) const;
+    BOOL TestUTF8( GSILine* pTestee, BOOL bFixTags );
+    BOOL HasSuspiciousChars( GSILine* pTestee, GSILine* pSource );
+
+public:
+	GSIBlock( BOOL PbPrintContext, BOOL bSource, BOOL bTrans, BOOL bRef, BOOL bAllowKID, BOOL bAllowSusp );
+	~GSIBlock();
+	void PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix, ByteString aContext, ULONG nLine, ByteString aUniqueId = ByteString() );
+	void PrintError( ByteString aMsg, ByteString aPrefix, ByteString aContext, ULONG nLine, ByteString aUniqueId = ByteString() );
+    void InsertLine( GSILine* pLine, const ByteString aSourceLang);
+    void SetReferenceLine( GSILine* pLine );
+	BOOL CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags );
+
+	void WriteError( LazySvFileStream &aErrOut, BOOL bRequireSourceLine );
+	void WriteCorrect( LazySvFileStream &aOkOut, BOOL bRequireSourceLine );
+    void WriteFixed( LazySvFileStream &aFixOut, BOOL bRequireSourceLine );
+};
+
+#endif
+

l10ntools/inc/helpmerge.hxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: helpmerge.hxx,v $
+ * $Revision: 1.12 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+// local includes
+#include "export.hxx"
+#include "xmlparse.hxx"
+#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <rtl/strbuf.hxx>
+#include <memory> /* auto_ptr */
+#include "tools/isofallback.hxx"
+
+#define MOVEFILE_REPLACE_EXISTING 0x01
+
+/// This Class is responsible for extracting/merging OpenOffice XML Helpfiles
+class HelpParser
+{
+private:
+	ByteString sHelpFile;
+    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 );
+
+/// Debugmethod, prints the content of the map to stdout
+    static  void Dump(  LangHashMap* rElem_in , const ByteString sKey_in );
+
+/// Debugmethod, prints the content of the map to stdout    
+    static  void Dump(  XMLHashMap* rElem_in ) ;
+
+
+
+public:
+	HelpParser( const ByteString &rHelpFile, bool bUTF8 , bool bHasInputList );
+    ~HelpParser(){};
+
+/// Method creates/append a SDF file with the content of a parsed XML file
+/// @PRECOND rHelpFile is valid
+    static bool CreateSDF( const ByteString &rSDFFile_in, const ByteString &rPrj_in, const ByteString &rRoot_in,
+                           const ByteString &sHelpFile, XMLFile *pXmlFile, const ByteString &rGsi1 );
+	
+	static  void parse_languages( std::vector<ByteString>& aLanguages , MergeDataFile& aMergeDataFile );
+
+/// Method merges the String from the SDFfile into XMLfile. Both Strings must 
+/// point to existing files. 
+	bool Merge( const ByteString &rSDFFile_in, const ByteString &rDestinationFile_in , ByteString& sLanguage , MergeDataFile& aMergeDataFile );
+    bool Merge( const ByteString &rSDFFile, const ByteString &rPathX , const ByteString &rPathY , bool bISO 
+		, const std::vector<ByteString>& aLanguages , MergeDataFile& aMergeDataFile , bool bCreateDir );
+
+private:
+    static ByteString makeAbsolutePath( const ByteString& sHelpFile , const ByteString& rRoot_in );
+
+    ByteString GetOutpath( const ByteString& rPathX , const ByteString& sCur , const ByteString& rPathY );
+    bool MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const ByteString& sLanguage , ByteString sPath );
+
+    void Process( LangHashMap* aLangHM , const ByteString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile );
+    void ProcessHelp( LangHashMap* aLangHM , const ByteString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile );
+    void MakeDir( const ByteString& sPath );
+};

l10ntools/inc/inireader.hxx

+#include <string>
+#include <hash_map>
+#include <unicode/regex.h>
+
+using namespace std;
+
+namespace transex3
+{
+
+struct eqstr
+{
+    bool operator()( const string s1 , const string s2) const
+    {
+        return s1.compare( s2 ) == 0;
+    }
+};
+
+typedef std::hash_map< string , string > stringmap;
+typedef std::hash_map< string, stringmap* > INImap;
+
+class INIreader
+{
+    private:
+        UErrorCode section_status;  
+        UErrorCode parameter_status; 
+        RegexMatcher* section_match;
+        RegexMatcher* parameter_match;
+
+    public: 
+        INIreader(): section_status   ( U_ZERO_ERROR ) ,
+                     parameter_status ( U_ZERO_ERROR ) 
+        {
+                     section_match   = new RegexMatcher   ( "^\\s*\\[([a-zA-Z0-9]*)\\].*" , 0 , section_status );
+                     parameter_match = new RegexMatcher   ( "^\\s*([a-zA-Z0-9]*)\\s*=\\s*([a-zA-Z0-9 ]*).*" , 0 , parameter_status ) ;
+        }
+        ~INIreader()
+        {
+            delete section_match;
+            delete parameter_match;
+        }
+        // open "filename", fill hash_map with sections / paramaters 
+        bool read( INImap& myMap , string& filename );
+       
+    private:
+        bool is_section( string& line , string& section_str );
+        bool is_parameter( string& line , string& parameter_key , string& parameter_value );
+        inline void check_status( UErrorCode status );
+        inline void toStlString ( const UnicodeString& str, string& stl_str );
+        inline void trim( string& str );
+};
+
+}

l10ntools/inc/l10ntools/directory.hxx

+#include <vector>
+#include <algorithm>
+#include <rtl/ustring.hxx>
+#include <tools/string.hxx>
+
+#ifdef WNT
+#else
+#include <dirent.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#endif
+
+#include <stdio.h>
+
+#ifndef L10NTOOLS_FILE_HXX
+#define L10NTOOLS_FILE_HXX
+#include <l10ntools/file.hxx>
+#endif
+
+namespace transex{
+
+class Directory
+{
+    private:
+    rtl::OUString sDirectoryName;
+    rtl::OUString sFullName;
+    bool bSkipLinks;
+
+    std::vector<Directory>  aDirVec;
+    std::vector<File>       aFileVec;
+
+    public:
+    std::vector<Directory>  getSubDirectories()  { return aDirVec;        }
+    std::vector<File>       getFiles()           { return aFileVec;       }
+
+    void readDirectory();
+    void readDirectory( const rtl::OUString& sFullpath );
+    void scanSubDir( int nLevels = 0 );
+
+    rtl::OUString getDirectoryName()            { return sDirectoryName; }
+    rtl::OUString getFullName()                 { return sFullName ;     }
+    void setSkipLinks( bool is_skipped );
+
+    void dump();
+    Directory(){};
+
+    Directory( const rtl::OUString sFullPath );
+    Directory( const rtl::OUString sFullPath , const rtl::OUString sEntry ) ;
+    Directory( const ByteString sFullPath );
+
+    static bool lessDir ( const Directory& rKey1, const Directory& rKey2 ) ; 
+};
+
+}

l10ntools/inc/l10ntools/file.hxx

+#include "rtl/ustring.hxx"
+
+namespace transex
+{
+
+class File
+{
+    private:
+    rtl::OUString sFileName;
+    rtl::OUString sFullName;
+
+    public:
+    rtl::OUString getFileName(){ return sFileName; }
+    rtl::OUString getFullName(){ return sFullName; }
+
+    File( const rtl::OUString sFile );
+    File( const rtl::OUString sFullName , const rtl::OUString sFile );
+
+    static bool lessFile ( const File& rKey1, const File& rKey2 );
+
+};
+
+}

l10ntools/inc/l10ntools/vosapp.hxx

+#ifndef VOSAPP_HXX
+#define VOSAPP_HXX
+
+#include <sal/main.h>
+#include <tools/solar.h>
+#include <tools/string.hxx>
+#include <vos/process.hxx>
+
+// Mininmal vcl/svapp compatibility without vcl dependence
+class Application
+{
+public:
+    USHORT GetCommandLineParamCount();
+    XubString GetCommandLineParam( USHORT nParam );
+    virtual void Main() = 0;
+};
+
+// Urg: Cut & Paste from svapp.cxx: we don't want to depend on vcl
+USHORT Application::GetCommandLineParamCount()
+{
+    vos::OStartupInfo aStartInfo;
+    return (USHORT)aStartInfo.getCommandArgCount();
+}
+
+XubString Application::GetCommandLineParam( USHORT nParam )
+{
+    vos::OStartupInfo aStartInfo;
+    rtl::OUString aParam;
+    aStartInfo.getCommandArg( nParam, aParam );
+    return XubString( aParam );
+}
+
+#endif /* VOSAPP_HXX */

l10ntools/inc/lngmerge.hxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: lngmerge.hxx,v $
+ * $Revision: 1.9 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+// local includes
+#include "export.hxx"
+
+DECLARE_LIST( LngLineList, ByteString * )
+
+#define LNG_OK				0x0000
+#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
+
+//
+// class LngParser
+//
+
+class LngParser
+{
+private:
+	USHORT nError;
+	LngLineList *pLines;
+	ByteString sSource;
+	BOOL bDBIsUTF8;
+	BOOL bULF;
+    bool bQuiet;
+    std::vector<ByteString> 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 ,	
+                    const ByteString &rPrj , 
+                    const ByteString &rRoot , const ByteString &sActFileName , const ByteString &sID );
+public:
+	LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat, bool bQuiet_in );
+	~LngParser();
+
+	BOOL CreateSDF( const ByteString &rSDFFile, const ByteString &rPrj, const ByteString &rRoot );
+	BOOL Merge( const ByteString &rSDFFile, const ByteString &rDestinationFile , const ByteString &rPrj );
+};

l10ntools/inc/makefile.mk

+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.3 $
+#
+# 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
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..
+
+PRJNAME=l10ntools
+TARGET=inc
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE :  settings.mk
+
+# --- Files --------------------------------------------------------
+# --- Targets -------------------------------------------------------
+
+.INCLUDE :  target.mk
+
+.IF "$(ENABLE_PCH)"!=""
+ALLTAR : \
+	$(SLO)$/precompiled.pch \
+	$(SLO)$/precompiled_ex.pch
+	
+.ENDIF			# "$(ENABLE_PCH)"!=""
+

l10ntools/inc/pch/precompiled_l10ntools.cxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: precompiled_transex3.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_l10ntools.hxx"
+

l10ntools/inc/pch/precompiled_l10ntools.hxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: precompiled_transex3.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): Generated on 2006-09-01 17:50:15.326479
+
+#ifdef PRECOMPILED_HEADERS
+#endif
+

l10ntools/inc/srciter.hxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: srciter.hxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef L10NTOOLS_DIRECTORY_HXX
+#define L10NTOOLS_DIRECTORY_HXX
+#include <l10ntools/directory.hxx>
+#endif
+
+// class SourceTreeIterator
+//
+
+class SourceTreeIterator
+{
+private:
+    transex::Directory aRootDirectory;
+	bool bInExecute;
+    	
+	void ExecuteDirectory( transex::Directory& pDirectory );
+
+protected:
+	bool bLocal;
+    bool bSkipLinks;
+    
+public:
+	SourceTreeIterator( const ByteString &rRootDirectory, const ByteString &rVersion , bool bLocal_in = false);
+	virtual ~SourceTreeIterator();
+
+	BOOL StartExecute();
+	void EndExecute();
+	
+	virtual void OnExecuteDirectory( const rtl::OUString &rDirectory );
+};
+
+

l10ntools/inc/tagtest.hxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tagtest.hxx,v $
+ * $Revision: 1.12 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _TAGTEST_HXX_
+#define _TAGTEST_HXX_
+
+#include <tools/string.hxx>
+#include <tools/list.hxx>
+#include <hash_map> /* std::hashmap*/
+
+class GSILine;
+
+typedef USHORT TokenId;
+
+#define TOK_INVALIDPOS  USHORT( 0xFFFF )
+
+class ParserMessage;
+
+DECLARE_LIST( Impl_ParserMessageList, ParserMessage* )
+class ParserMessageList;
+
+
+struct equalByteString{
+        bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const {
+            return rKey1.CompareTo( rKey2 )==COMPARE_EQUAL;
+    }
+};
+struct lessByteString{
+        bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const {
+            return rKey1.CompareTo( rKey2 )==COMPARE_LESS;
+    }
+};
+
+struct hashByteString{
+    size_t operator()( const ByteString& rName ) const{
+                std::hash< const char* > myHash;
+                return myHash( rName.GetBuffer() );
+    }
+};
+
+
+
+typedef std::hash_map<ByteString , String , hashByteString,equalByteString>
+                                StringHashMap;
+
+class TokenInfo
+{
+private:
+    void SplitTag( ParserMessageList &rErrorList );
+
+    String aTagName;
+    StringHashMap aProperties;
+    BOOL bClosed;    // tag is closed  <sdnf/>
+    BOOL bCloseTag;  // tag is close Tag  </sdnf>
+
+
+    BOOL bIsBroken;
+    BOOL bHasBeenFixed;
+    BOOL bDone;
+
+public:
+
+	String aTokenString;
+	TokenId nId;
+    USHORT nPos;            // Position in String
+
+    TokenInfo():bClosed(FALSE),bCloseTag(FALSE),bIsBroken(FALSE),bHasBeenFixed(FALSE),bDone(FALSE),nId( 0 ){;}
+explicit    TokenInfo( TokenId pnId, USHORT nP ):bClosed(FALSE),bCloseTag(FALSE),bIsBroken(FALSE),bHasBeenFixed(FALSE),bDone(FALSE),nId( pnId ),nPos(nP){;}
+explicit    TokenInfo( TokenId pnId, USHORT nP, String paStr ):bClosed(FALSE),bCloseTag(FALSE),bIsBroken(FALSE),bHasBeenFixed(FALSE),bDone(FALSE),aTokenString( paStr ),nId( pnId ),nPos(nP) {;}
+explicit    TokenInfo( TokenId pnId, USHORT nP, String paStr, ParserMessageList &rErrorList );
+
+	String GetTagName() const;
+
+    String MakeTag() const;
+
+    /**
+        Is the property to be ignored or does it have the default value anyways
+    **/
+    BOOL IsPropertyRelevant( const ByteString &aName, const String &aValue ) const;
+    BOOL IsPropertyValueValid( const ByteString &aName, const String &aValue ) const;
+    /**
+        Does the property contain the same value for all languages
+        e.g.: the href in a link tag
+    **/
+    BOOL IsPropertyInvariant( const ByteString &aName, const String &aValue ) const;
+    /**
+        a subset of IsPropertyInvariant but containing only those that are fixable
+        we dont wat to fix e.g.: ahelp :: visibility
+    **/
+    BOOL IsPropertyFixable( const ByteString &aName ) const;
+    BOOL MatchesTranslation( TokenInfo& rInfo, BOOL bGenErrors, ParserMessageList &rErrorList, BOOL bFixTags = FALSE ) const;
+
+    BOOL IsDone() const { return bDone; }
+    void SetDone( BOOL bNew = TRUE ) { bDone = bNew; }
+
+    BOOL HasBeenFixed() const { return bHasBeenFixed; }
+    void SetHasBeenFixed( BOOL bNew = TRUE ) { bHasBeenFixed = bNew; }
+};
+
+
+class ParserMessageList : public Impl_ParserMessageList
+{
+public:
+    void AddError( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag );
+    void AddWarning( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag );
+
+    BOOL HasErrors();
+};
+
+
+#define TAG_GROUPMASK				0xF000
+#define TAG_GROUPSHIFT				12
+
+#define TAG_GROUP( nTag )			(( nTag & TAG_GROUPMASK ) >> TAG_GROUPSHIFT )
+#define TAG_NOGROUP( nTag )			( nTag & ~TAG_GROUPMASK )	// ~ = Bitweises NOT
+
+#define TAG_NOMORETAGS				0x0
+
+#define TAG_GROUP_FORMAT			0x1
+#define TAG_ON						0x100
+#define TAG_BOLDON					( TAG_GROUP_FORMAT << TAG_GROUPSHIFT | TAG_ON | 0x001 )
+#define TAG_BOLDOFF					( TAG_GROUP_FORMAT << TAG_GROUPSHIFT |          0x001 )
+#define TAG_ITALICON				( TAG_GROUP_FORMAT << TAG_GROUPSHIFT | TAG_ON | 0x002 )
+#define TAG_ITALICOFF				( TAG_GROUP_FORMAT << TAG_GROUPSHIFT |          0x002 )
+#define TAG_UNDERLINEON				( TAG_GROUP_FORMAT << TAG_GROUPSHIFT | TAG_ON | 0x004 )
+#define TAG_UNDERLINEOFF			( TAG_GROUP_FORMAT << TAG_GROUPSHIFT |          0x004 )
+
+#define TAG_GROUP_NOTALLOWED		0x2
+#define TAG_HELPID					( TAG_GROUP_NOTALLOWED << TAG_GROUPSHIFT | 0x001 )
+#define TAG_MODIFY					( TAG_GROUP_NOTALLOWED << TAG_GROUPSHIFT | 0x002 )
+#define TAG_REFNR					( TAG_GROUP_NOTALLOWED << TAG_GROUPSHIFT | 0x004 )
+
+#define TAG_GROUP_STRUCTURE			0x3
+#define TAG_NAME					( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x001 )
+#define TAG_HREF					( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x002 )
+#define TAG_AVIS					( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x004 )
+#define TAG_AHID					( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x008 )
+
+#define TAG_TITEL					( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x020 )
+#define TAG_KEY						( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x040 )
+#define TAG_INDEX					( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x080 )
+
+#define TAG_REFSTART				( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x100 )
+
+#define TAG_GRAPHIC					( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x200 )
+#define TAG_NEXTVERSION				( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x400 )
+
+#define TAG_GROUP_SYSSWITCH			0x4
+#define TAG_WIN						( TAG_GROUP_SYSSWITCH << TAG_GROUPSHIFT | 0x001 )
+#define TAG_UNIX					( TAG_GROUP_SYSSWITCH << TAG_GROUPSHIFT | 0x002 )
+#define TAG_MAC						( TAG_GROUP_SYSSWITCH << TAG_GROUPSHIFT | 0x004 )
+#define TAG_OS2						( TAG_GROUP_SYSSWITCH << TAG_GROUPSHIFT | 0x008 )
+
+#define TAG_GROUP_PROGSWITCH		0x5
+#define TAG_WRITER					( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x001 )
+#define TAG_CALC					( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x002 )
+#define TAG_DRAW					( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x004 )
+#define TAG_IMPRESS					( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x008 )
+#define TAG_SCHEDULE				( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x010 )
+#define TAG_IMAGE					( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x020 )
+#define TAG_MATH					( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x040 )
+#define TAG_CHART					( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x080 )
+#define TAG_OFFICE					( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x100 )
+
+
+#define TAG_GROUP_META				0x6
+#define TAG_OFFICEFULLNAME			( TAG_GROUP_META << TAG_GROUPSHIFT | 0x001 )
+#define TAG_OFFICENAME				( TAG_GROUP_META << TAG_GROUPSHIFT | 0x002 )
+#define TAG_OFFICEPATH				( TAG_GROUP_META << TAG_GROUPSHIFT | 0x004 )
+#define TAG_OFFICEVERSION			( TAG_GROUP_META << TAG_GROUPSHIFT | 0x008 )
+#define TAG_PORTALNAME				( TAG_GROUP_META << TAG_GROUPSHIFT | 0x010 )
+#define TAG_PORTALFULLNAME			( TAG_GROUP_META << TAG_GROUPSHIFT | 0x020 )
+#define TAG_PORTALPATH				( TAG_GROUP_META << TAG_GROUPSHIFT | 0x040 )
+#define TAG_PORTALVERSION			( TAG_GROUP_META << TAG_GROUPSHIFT | 0x080 )
+#define TAG_PORTALSHORTNAME			( TAG_GROUP_META << TAG_GROUPSHIFT | 0x100 )
+
+
+#define TAG_GROUP_SINGLE            0x7
+#define TAG_REFINSERT               ( TAG_GROUP_SINGLE << TAG_GROUPSHIFT | 0x001 )
+
+
+#define TAG_GROUP_MULTI				0x8
+#define TAG_END						( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x010 )
+#define TAG_ELSE					( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x020 )
+#define TAG_AEND					( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x040 )
+#define TAG_VERSIONEND				( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x080 )
+#define TAG_ENDGRAPHIC				( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x100 )
+
+#define TAG_GROUP_MISC				0x9
+#define TAG_COMMONSTART				( TAG_GROUP_MISC << TAG_GROUPSHIFT | 0x001 )
+#define TAG_COMMONEND				( TAG_GROUP_MISC << TAG_GROUPSHIFT | 0x002 )
+
+#define TAG_UNKNOWN_TAG				( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x800 )
+
+DECLARE_LIST( TokenListImpl, TokenInfo* )
+
+class TokenList : private TokenListImpl
+{
+private:
+
+    TokenList&   operator =( const TokenList& rList );
+//                { TokenListImpl::operator =( rList ); return *this; }
+
+
+public:
+	using TokenListImpl::Count;
+
+
+    TokenList() : TokenListImpl(){};
+    ~TokenList(){ Clear(); };
+
+	void		Clear()
+		{
+			for ( ULONG i = 0 ; i < Count() ; i++ )
+				delete TokenListImpl::GetObject( i );
+			TokenListImpl::Clear();
+		}
+	void		Insert( TokenInfo p, ULONG nIndex = LIST_APPEND )
+		{ TokenListImpl::Insert( new TokenInfo(p), nIndex ); }
+/*    TokenInfo		Remove( ULONG nIndex )
+		{
+			TokenInfo aT = GetObject( nIndex );
+			delete TokenListImpl::GetObject( nIndex );
+			TokenListImpl::Remove( nIndex );
+			return aT;
+		}*/
+//    TokenInfo		Remove( TokenInfo p ){ return Remove( GetPos( p ) ); }
+//    TokenInfo		GetCurObject() const { return *TokenListImpl::GetCurObject(); }
+    TokenInfo&		GetObject( ULONG nIndex ) const
+		{
+//			if ( TokenListImpl::GetObject(nIndex) )
+				return *TokenListImpl::GetObject(nIndex);
+//			else
+//				return TokenInfo();
+		}
+/*    ULONG		GetPos( const TokenInfo p ) const
+		{
+			for ( ULONG i = 0 ; i < Count() ; i++ )
+				if ( p == GetObject( i ) )
+					return i;
+			return LIST_ENTRY_NOTFOUND;
+		}*/
+
+    TokenList( const TokenList& rList );
+/*		{
+			for ( ULONG i = 0 ; i < rList.Count() ; i++ )
+			{
+				Insert( rList.GetObject( i ), LIST_APPEND );
+			}
+		}*/
+};
+
+class ParserMessage
+{
+	USHORT nErrorNr;