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

Stephan Bergmann sbergmann at kemper.freedesktop.org
Thu Feb 2 00:22:36 PST 2012


 l10ntools/inc/cfgmerge.hxx     |   29 +-
 l10ntools/inc/export.hxx       |   79 ++---
 l10ntools/inc/gsicheck.hxx     |   47 +--
 l10ntools/inc/helpmerge.hxx    |   20 -
 l10ntools/inc/lngmerge.hxx     |    4 
 l10ntools/inc/xmlparse.hxx     |   53 +--
 l10ntools/source/cfglex.l      |  100 +------
 l10ntools/source/cfgmerge.cxx  |  546 ++++++++++++++++++-----------------------
 l10ntools/source/export.cxx    |  247 +++++++++---------
 l10ntools/source/export2.cxx   |   89 ++----
 l10ntools/source/gsicheck.cxx  |  152 ++++++-----
 l10ntools/source/helper.hxx    |   70 +++++
 l10ntools/source/helpex.cxx    |    2 
 l10ntools/source/helpmerge.cxx |   42 +--
 l10ntools/source/lngmerge.cxx  |   16 -
 l10ntools/source/merge.cxx     |   14 -
 l10ntools/source/xmlparse.cxx  |   72 +----
 l10ntools/source/xrmmerge.cxx  |   12 
 18 files changed, 760 insertions(+), 834 deletions(-)

New commits:
commit e521a240601c6a2b9f9448db73c09181fed2247d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Feb 2 09:11:38 2012 +0100

    Reduced tools/string usage
    
    plus some preliminary cfgex clean up.

diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx
index d852715..bd0627e 100644
--- a/l10ntools/inc/cfgmerge.hxx
+++ b/l10ntools/inc/cfgmerge.hxx
@@ -29,11 +29,10 @@
 #ifndef _CFG_MERGE_HXX
 #define _CFG_MERGE_HXX
 
-#include <tools/string.hxx>
 #include <boost/unordered_map.hpp>
 #include <vector>
 
-typedef boost::unordered_map<rtl::OString, rtl::OString, rtl::OStringHash> ByteStringHashMap;
+typedef boost::unordered_map<rtl::OString, rtl::OString, rtl::OStringHash> OStringHashMap;
 
 
 //
@@ -54,7 +53,7 @@ private:
     rtl::OString sTextTag;
     rtl::OString sEndTextTag;
 
-    ByteStringHashMap sText;
+    OStringHashMap sText;
 public:
     CfgStackData(const rtl::OString &rTag, const rtl::OString &rId)
         : sTagType( rTag ), sIdentifier( rId )
@@ -106,7 +105,7 @@ class CfgParser
 protected:
     rtl::OString sCurrentResTyp;
     rtl::OString sCurrentIsoLang;
-    ByteString sCurrentText;
+    rtl::OString sCurrentText;
 
     rtl::OString sLastWhitespace;
 
@@ -116,7 +115,7 @@ protected:
     sal_Bool bLocalize;
 
     virtual void WorkOnText(
-        ByteString &rText,
+        rtl::OString &rText,
         const rtl::OString &rLangIndex )=0;
 
     virtual void WorkOnRessourceEnd()=0;
@@ -129,9 +128,9 @@ private:
     int ExecuteAnalyzedToken( int nToken, char *pToken );
     std::vector<rtl::OString> aLanguages;
     void AddText(
-        ByteString &rText,
-        const ByteString &rIsoLang,
-        const ByteString &rResTyp );
+        rtl::OString &rText,
+        const rtl::OString &rIsoLang,
+        const rtl::OString &rResTyp );
 
     sal_Bool IsTokenClosed(const rtl::OString &rToken);
 
@@ -162,12 +161,12 @@ public:
 class CfgExport : public CfgOutputParser
 {
 private:
-    ByteString sPrj;
-    ByteString sPath;
+    rtl::OString sPrj;
+    rtl::OString sPath;
     std::vector<rtl::OString> aLanguages;
 protected:
     virtual void WorkOnText(
-        ByteString &rText,
+        rtl::OString &rText,
         const rtl::OString &rIsoLang
         );
 
@@ -175,9 +174,9 @@ protected:
     void Output(const rtl::OString& rOutput);
 public:
     CfgExport(
-        const ByteString &rOutputFile,
-        const ByteString &rProject,
-        const ByteString &rFilePath
+        const rtl::OString &rOutputFile,
+        const rtl::OString &rProject,
+        const rtl::OString &rFilePath
     );
     ~CfgExport();
 };
@@ -197,7 +196,7 @@ private:
     sal_Bool bEnglish;
 
 protected:
-    virtual void WorkOnText(ByteString &rText, const rtl::OString &rLangIndex);
+    virtual void WorkOnText(rtl::OString &rText, const rtl::OString &rLangIndex);
 
     void WorkOnRessourceEnd();
 
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index e0fcf05..d8e3c96 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -29,6 +29,8 @@
 #ifndef _EXPORT_HXX
 #define _EXPORT_HXX
 
+#include "sal/config.h"
+
 #include <comphelper/string.hxx>
 
 #ifndef L10NTOOLS_DIRECTORY_HXX
@@ -36,7 +38,6 @@
 #include <l10ntools/directory.hxx>
 #endif
 
-#include <tools/string.hxx>
 #include <tools/stream.hxx>
 #include <tools/fsys.hxx>
 #include <osl/file.hxx>
@@ -58,13 +59,12 @@
 
 class PFormEntrys;
 class MergeData;
-typedef std::set<rtl::OString> ByteStringSet;
 
 typedef boost::unordered_map<rtl::OString, rtl::OString, rtl::OStringHash>
-    ByteStringHashMap;
+    OStringHashMap;
 
 typedef boost::unordered_map<rtl::OString, bool, rtl::OStringHash>
-    ByteStringBoolHashMap;
+    OStringBoolHashMap;
 
 typedef boost::unordered_map<rtl::OString, PFormEntrys*, rtl::OStringHash>
     PFormEntrysHashMap;
@@ -75,7 +75,7 @@ typedef boost::unordered_map<rtl::OString, MergeData*, rtl::OStringHash>
 #define SOURCE_LANGUAGE rtl::OString(RTL_CONSTASCII_STRINGPARAM("en-US"))
 #define LIST_REFID  "LIST_REFID"
 
-typedef ByteStringHashMap ExportListEntry;
+typedef OStringHashMap ExportListEntry;
 typedef ::std::vector< ExportListEntry* > ExportListBase;
 
 //
@@ -145,16 +145,16 @@ public:
     rtl::OString sHelpId;
     rtl::OString sFilename;
 
-    ByteStringHashMap sText;
+    OStringHashMap sText;
     sal_uInt16 nTextRefId;
 
-    ByteStringHashMap sHelpText;
+    OStringHashMap sHelpText;
     sal_uInt16 nHelpTextRefId;
 
-    ByteStringHashMap sQuickHelpText;
+    OStringHashMap sQuickHelpText;
     sal_uInt16 nQuickHelpTextRefId;
 
-    ByteStringHashMap sTitle;
+    OStringHashMap sTitle;
     sal_uInt16 nTitleRefId;
 
     rtl::OString sTextTyp;
@@ -267,7 +267,7 @@ private:
 
     ResStack aResStack;                 // stack for parsing recursive
 
-    ByteString sActPForm;               // hold cur. system
+    rtl::OString sActPForm;               // hold cur. system
 
     sal_Bool bDefine;                       // cur. res. in a define?
     sal_Bool bNextMustBeDefineEOL;          // define but no \ at lineend
@@ -277,18 +277,18 @@ private:
     sal_uLong nListIndex;
     sal_uLong nListLevel;
     bool bSkipFile;
-    ByteString sProject;
-    ByteString sRoot;
+    rtl::OString sProject;
+    rtl::OString sRoot;
     sal_Bool bEnableExport;
     sal_Bool bMergeMode;
-    ByteString sMergeSrc;
-    ByteString sLastListLine;
+    rtl::OString sMergeSrc;
+    rtl::OString sLastListLine;
     sal_Bool bError;                        // any errors while export?
     sal_Bool bReadOver;
     sal_Bool bDontWriteOutput;
-    ByteString sLastTextTyp;
+    rtl::OString sLastTextTyp;
     static bool isInitialized;
-    ByteString sFilename;
+    rtl::OString sFilename;
 
 
 public:
@@ -296,8 +296,6 @@ public:
     static rtl::OString sLanguages; // public ?
     static rtl::OString sForcedLanguages; // public ?
 
-
-    static bool skipProject( ByteString sPrj ) ;
     static void InitLanguages( bool bMergeMode = false );
     static void InitForcedLanguages( bool bMergeMode = false );
     static std::vector<rtl::OString> GetLanguages();
@@ -308,10 +306,10 @@ public:
     static bool hasUTF8ByteOrderMarker( const rtl::OString &rString );
     static void RemoveUTF8ByteOrderMarkerFromFile(const rtl::OString &rFilename);
     static bool fileHasUTF8ByteOrderMarker(const rtl::OString &rString);
-    static void QuotHTML( ByteString &rString );
+    static rtl::OString QuoteHTML( rtl::OString const &rString );
     static bool CopyFile(const rtl::OString& rSource , const rtl::OString& rDest);
 
-    static void UnquotHTML( ByteString &rString );
+    static rtl::OString UnquoteHTML( rtl::OString const &rString );
 
     static const char* GetEnv( const char *pVar );
 
@@ -323,14 +321,14 @@ public:
     static void getCurrentDir( std::string& dir );
 
     static rtl::OString GetTimeStamp();
-    static sal_Bool ConvertLineEnds( ByteString sSource, ByteString sDestination );
-    static ByteString GetNativeFile( ByteString sSource );
+    static sal_Bool ConvertLineEnds( rtl::OString const & sSource, rtl::OString const & sDestination );
+    static rtl::OString GetNativeFile( rtl::OString const & sSource );
     static DirEntry GetTempFile();
 
     static void DumpExportList(const rtl::OString& rListName,
         ExportList& aList);
     static void DumpMap(const rtl::OString& rMapName,
-        ByteStringHashMap& aMap);
+        OStringHashMap& aMap);
 
 private:
     static std::vector<rtl::OString> aLanguages;
@@ -340,7 +338,7 @@ private:
     sal_Bool WriteExportList( ResData *pResData, ExportList *pExportList,
                         const rtl::OString &rTyp, sal_Bool bCreateNew = sal_False );
 
-    ByteString MergePairedList( ByteString& sLine , ByteString& sText );
+    rtl::OString MergePairedList( rtl::OString const & sLine , rtl::OString const & sText );
 
     rtl::OString FullId();                    // creates cur. GID
 
@@ -349,19 +347,19 @@ private:
     rtl::OString StripList(const rtl::OString& rText);
 
     void InsertListEntry(const rtl::OString &rText, const rtl::OString &rLine);
-    void CleanValue( ByteString &rValue );
+    void CleanValue( rtl::OString &rValue );
     rtl::OString GetText(const rtl::OString &rSource, int nToken);
 
-    sal_Bool PrepareTextToMerge(ByteString &rText, sal_uInt16 nTyp,
+    sal_Bool PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp,
         rtl::OString &rLangIndex, ResData *pResData);
 
     void MergeRest( ResData *pResData, sal_uInt16 nMode = MERGE_MODE_NORMAL );
-    void ConvertMergeContent( ByteString &rText );
+    void ConvertMergeContent( rtl::OString &rText );
 
     void WriteToMerged(const rtl::OString &rText , bool bSDFContent);
     void SetChildWithText();
 
-    void CutComment( ByteString &rText );
+    void CutComment( rtl::OString &rText );
 
 public:
     Export(const rtl::OString &rOutput, sal_Bool bWrite,
@@ -386,20 +384,21 @@ public:
 * Purpose: holds information of data to merge (one pform)
 ******************************************************************************/
 
-class PFormEntrys : public ByteString
+class PFormEntrys
 {
 friend class MergeDataFile;
 private:
-    ByteString sHelpText; // empty string
-    ByteStringHashMap sText;
-    ByteStringBoolHashMap bTextFirst;
-    ByteStringHashMap sQuickHelpText;
-    ByteStringBoolHashMap bQuickHelpTextFirst;
-    ByteStringHashMap sTitle;
-    ByteStringBoolHashMap bTitleFirst;
+    rtl::OString data_; //TODO
+    rtl::OString sHelpText; // empty string
+    OStringHashMap sText;
+    OStringBoolHashMap bTextFirst;
+    OStringHashMap sQuickHelpText;
+    OStringBoolHashMap bQuickHelpTextFirst;
+    OStringHashMap sTitle;
+    OStringBoolHashMap bTitleFirst;
 
 public:
-    PFormEntrys( const ByteString &rPForm ) : ByteString( rPForm ) {};
+    PFormEntrys( const rtl::OString &rPForm ) : data_( rPForm ) {};
     rtl::OString Dump();
     void InsertEntry(const rtl::OString &rId, const rtl::OString &rText,
         const rtl::OString &rQuickHelpText, const rtl::OString &rTitle)
@@ -412,8 +411,8 @@ public:
         sTitle[ rId ] = rTitle;
         bTitleFirst[ rId ] = true;
     }
-    sal_Bool GetText( ByteString &rReturn, sal_uInt16 nTyp, const ByteString &nLangIndex, sal_Bool bDel = sal_False );
-    sal_Bool GetTransex3Text( ByteString &rReturn, sal_uInt16 nTyp, const ByteString &nLangIndex, sal_Bool bDel = sal_False );
+    sal_Bool GetText( rtl::OString &rReturn, sal_uInt16 nTyp, const rtl::OString &nLangIndex, sal_Bool bDel = sal_False );
+    sal_Bool GetTransex3Text( rtl::OString &rReturn, sal_uInt16 nTyp, const rtl::OString &nLangIndex, sal_Bool bDel = sal_False );
 
 };
 
@@ -461,7 +460,7 @@ class MergeDataFile
 {
     private:
         sal_Bool bErrorLog;
-        ByteString sErrorLog;
+        rtl::OString sErrorLog;
         SvFileStream aErrLog;
         MergeDataHashMap aMap;
         std::set<rtl::OString> aLanguageSet;
diff --git a/l10ntools/inc/gsicheck.hxx b/l10ntools/inc/gsicheck.hxx
index 2915c69..3a6fc54 100644
--- a/l10ntools/inc/gsicheck.hxx
+++ b/l10ntools/inc/gsicheck.hxx
@@ -37,20 +37,19 @@
 //
 enum LineFormat { FORMAT_SDF, FORMAT_UNKNOWN };
 
-class GSILine : public ByteString
+class GSILine
 {
 private:
-
     ParserMessageList aMessages;
     LineFormat aFormat;
     sal_uLong nLineNumber;
 
-    ByteString aUniqId;
-    ByteString aLineType;
-    ByteString aLangId;
-    ByteString aText;
-    ByteString aQuickHelpText;
-    ByteString aTitle;
+    rtl::OString aUniqId;
+    rtl::OString aLineType;
+    rtl::OString aLangId;
+    rtl::OString aText;
+    rtl::OString aQuickHelpText;
+    rtl::OString aTitle;
 
     sal_Bool bOK;
     sal_Bool bFixed;
@@ -58,22 +57,24 @@ private:
     void              ReassembleLine();
 
 public:
-    GSILine( const ByteString &rLine, sal_uLong nLine );
+    rtl::OString data_;
+
+    GSILine( const rtl::OString &rLine, sal_uLong nLine );
     LineFormat  GetLineFormat() const    { return aFormat; }
     sal_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; }
+    rtl::OString  const GetUniqId()     const    { return aUniqId; }
+    rtl::OString  const GetLineType()   const    { return aLineType; }
+    rtl::OString  const GetLanguageId() const    { return aLangId; }
+    rtl::OString  const GetText()       const    { return aText; }
+    rtl::OUString  const GetUText()      const    { return rtl::OStringToOUString( aText, RTL_TEXTENCODING_UTF8 ); }
+    rtl::OString  const GetQuickHelpText() const { return aQuickHelpText; }
+    rtl::OString  const GetTitle()      const    { return aTitle; }
 
     void SetUText( String &aNew ) { aText = rtl::OUStringToOString(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(); }
+    void        SetText( rtl::OString const &aNew ) { aText = aNew; ReassembleLine(); }
+    void        SetQuickHelpText( rtl::OString const &aNew ) { aQuickHelpText = aNew; ReassembleLine(); }
+    void        SetTitle( rtl::OString const &aNew ) { aTitle = aNew; ReassembleLine(); }
 
     ParserMessageList* GetMessageList() { return &aMessages; };
     sal_Bool HasMessages(){ return ( aMessages.size() > 0 ); };
@@ -99,7 +100,7 @@ private:
     GSIBlock_Impl maList;
     GSILine *pSourceLine;
     GSILine *pReferenceLine;
-    void PrintList( ParserMessageList *pList, ByteString aPrefix, GSILine *pLine );
+    void PrintList( ParserMessageList *pList, rtl::OString const & aPrefix, GSILine *pLine );
     sal_Bool bPrintContext;
     sal_Bool bCheckSourceLang;
     sal_Bool bCheckTranslationLang;
@@ -108,15 +109,15 @@ private:
 
     sal_Bool bHasBlockError;
 
-    sal_Bool IsUTF8( const ByteString &aTestee, sal_Bool bFixTags, sal_uInt16 &nErrorPos, ByteString &aErrorMsg, sal_Bool &bHasBeenFixed, ByteString &aFixed ) const;
+    sal_Bool IsUTF8( const rtl::OString &aTestee, sal_Bool bFixTags, sal_uInt16 &nErrorPos, rtl::OString &aErrorMsg, sal_Bool &bHasBeenFixed, rtl::OString &aFixed ) const;
     sal_Bool TestUTF8( GSILine* pTestee, sal_Bool bFixTags );
     sal_Bool HasSuspiciousChars( GSILine* pTestee, GSILine* pSource );
 
 public:
     GSIBlock( sal_Bool PbPrintContext, sal_Bool bSource, sal_Bool bTrans, sal_Bool bRef, sal_Bool bAllowSusp );
     ~GSIBlock();
-    void PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix, ByteString aContext, sal_uLong nLine, ByteString aUniqueId = ByteString() );
-    void PrintError( ByteString aMsg, ByteString aPrefix, ByteString aContext, sal_uLong nLine, ByteString aUniqueId = ByteString() );
+    void PrintMessage( rtl::OString const & aType, rtl::OString const & aMsg, rtl::OString const & aPrefix, rtl::OString const & aContext, sal_uLong nLine, rtl::OString const & aUniqueId = rtl::OString() );
+    void PrintError( rtl::OString const & aMsg, rtl::OString const & aPrefix, rtl::OString const & aContext, sal_uLong nLine, rtl::OString const & aUniqueId = rtl::OString() );
     void InsertLine( GSILine* pLine, const rtl::OString &rSourceLang);
     void SetReferenceLine( GSILine* pLine );
     sal_Bool CheckSyntax( sal_uLong nLine, sal_Bool bRequireSourceLine, sal_Bool bFixTags );
diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index 3e8383a..6a34746 100644
--- a/l10ntools/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
@@ -39,43 +39,43 @@
 class HelpParser
 {
 private:
-    ByteString sHelpFile;
+    rtl::OString sHelpFile;
     bool       bUTF8;
     bool       bHasInputList;
 
 #if OSL_DEBUG_LEVEL > 2
     /// Debugmethod, prints the content of the map to stdout
-    static void Dump(LangHashMap* rElem_in , const ByteString sKey_in);
+    static void Dump(LangHashMap* rElem_in , const rtl::OString & sKey_in);
 
     /// Debugmethod, prints the content of the map to stdout
     static void Dump(XMLHashMap* rElem_in);
 #endif
 
 public:
-    HelpParser( const ByteString &rHelpFile, bool bUTF8 , bool bHasInputList );
+    HelpParser( const rtl::OString &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 bool CreateSDF( const rtl::OString &rSDFFile_in, const rtl::OString &rPrj_in, const rtl::OString &rRoot_in,
+                           const rtl::OString &sHelpFile, XMLFile *pXmlFile, const rtl::OString &rGsi1 );
 
     static  void parse_languages( std::vector<rtl::OString>& 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 ,
+    bool Merge( const rtl::OString &rSDFFile_in, const rtl::OString &rDestinationFile_in ,
         const rtl::OString& sLanguage , MergeDataFile& aMergeDataFile );
-    bool Merge( const ByteString &rSDFFile, const ByteString &rPathX , const ByteString &rPathY , bool bISO
+    bool Merge( const rtl::OString &rSDFFile, const rtl::OString &rPathX , const rtl::OString &rPathY , bool bISO
         , const std::vector<rtl::OString>& aLanguages , MergeDataFile& aMergeDataFile , bool bCreateDir );
 
 private:
     static rtl::OString makeAbsolutePath(const rtl::OString& sHelpFile , const rtl::OString& rRoot_in);
 
-    ByteString GetOutpath( const ByteString& rPathX , const ByteString& sCur , const ByteString& rPathY );
-    bool MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const ByteString& sLanguage , ByteString sPath );
+    rtl::OString GetOutpath( const rtl::OString& rPathX , const rtl::OString& sCur , const rtl::OString& rPathY );
+    bool MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const rtl::OString& sLanguage , rtl::OString const & sPath );
 
-    void ProcessHelp( LangHashMap* aLangHM , const ByteString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile );
+    void ProcessHelp( LangHashMap* aLangHM , const rtl::OString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile );
     void MakeDir(const rtl::OString& rPath);
 };
 
diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx
index 2a4a0d3..d6a0ebd 100644
--- a/l10ntools/inc/lngmerge.hxx
+++ b/l10ntools/inc/lngmerge.hxx
@@ -55,8 +55,8 @@ private:
 
     bool isNextGroup(rtl::OString &sGroup_out, rtl::OString &sLine_in);
     void ReadLine(const rtl::OString &rLine_in,
-        ByteStringHashMap &rText_inout);
-    void WriteSDF(SvFileStream &aSDFStream, ByteStringHashMap &rText_inout,
+        OStringHashMap &rText_inout);
+    void WriteSDF(SvFileStream &aSDFStream, OStringHashMap &rText_inout,
         const rtl::OString &rPrj, const rtl::OString &rRoot,
         const rtl::OString &rActFileName, const rtl::OString &rID);
 public:
diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index c6fe740..3b3e4ba 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -64,30 +64,31 @@ using namespace std;
 
 /** Holds data of Attributes
  */
-class XMLAttribute : public String
+class XMLAttribute
 {
 private:
-    String sValue;
+    rtl::OUString sName;
+    rtl::OUString sValue;
 
 public:
     /// creates an attribute
     XMLAttribute(
-        const String &rName,    // attributes name
-        const String &rValue    // attributes data
+        const rtl::OUString &rName,    // attributes name
+        const rtl::OUString &rValue    // attributes data
     )
-                : String( rName ), sValue( rValue ) {}
+                : sName( rName ), sValue( rValue ) {}
 
-    /// getting value of an attribue
-    const String &GetValue() { return sValue; }
+    rtl::OUString GetName() const { return sName; }
+    rtl::OUString GetValue() const { return sValue; }
 
-    void setValue(const String &rValue){sValue=rValue;}
+    void setValue(const rtl::OUString &rValue){sValue=rValue;}
 
     /// returns true if two attributes are equal and have the same value
     sal_Bool IsEqual(
         const XMLAttribute &rAttribute  // the attribute which has to be equal
     )
     {
-        return (( rAttribute == *this ) && ( rAttribute.sValue == sValue ));
+        return (( rAttribute.sName == sName ) && ( rAttribute.sValue == sValue ));
     }
 };
 
@@ -172,7 +173,6 @@ public:
         XMLChildNode *pChild , size_t pos   /// the new child
     );
 
-    virtual int GetPosition( ByteString id );
     int RemoveChild( XMLElement *pRefElement );
     void RemoveAndDeleteAllChildren();
 
@@ -204,18 +204,17 @@ class XMLFile : public XMLParentNode
 {
 public:
     XMLFile(
-                const String &rFileName // the file name, empty if created from memory stream
+        const rtl::OUString &rFileName // the file name, empty if created from memory stream
     );
     XMLFile( const XMLFile& obj ) ;
     ~XMLFile();
 
-    ByteString* GetGroupID(std::deque<rtl::OString> &groupid);
     void        Print( XMLNode *pCur = NULL, sal_uInt16 nLevel = 0 );
     virtual void SearchL10NElements( XMLParentNode *pCur, int pos = 0 );
     void        Extract( XMLFile *pCur = NULL );
 
     XMLHashMap* GetStrings(){return XMLStrings;}
-    sal_Bool        Write( ByteString &rFilename );
+    sal_Bool        Write( rtl::OString const &rFilename );
     sal_Bool        Write( ofstream &rStream , XMLNode *pCur = NULL );
 
     bool        CheckExportStatus( XMLParentNode *pCur = NULL );// , int pos = 0 );
@@ -277,7 +276,7 @@ class XMLElement : public XMLParentNode
 private:
     String sElementName;
     XMLAttributeList *pAttributes;
-    ByteString   project,
+    rtl::OString   project,
                  filename,
                  id,
                  sOldRef,
@@ -332,23 +331,23 @@ public:
 
     /// returns a attribute
     XMLAttribute *GetAttribute(
-        const String &rName // the attribute name
+        const rtl::OUString &rName // the attribute name
     );
-    void SetProject         ( ByteString prj        ){ project = prj;        }
-    void SetFileName        ( ByteString fn         ){ filename = fn;        }
-    void SetId              ( ByteString theId      ){ id = theId;           }
-    void SetResourceType    ( ByteString rt         ){ resourceType = rt;    }
-    void SetLanguageId      ( ByteString lid        ){ languageId = lid;     }
+    void SetProject         ( rtl::OString const & prj        ){ project = prj;        }
+    void SetFileName        ( rtl::OString const & fn         ){ filename = fn;        }
+    void SetId              ( rtl::OString const & theId      ){ id = theId;           }
+    void SetResourceType    ( rtl::OString const & rt         ){ resourceType = rt;    }
+    void SetLanguageId      ( rtl::OString const & lid        ){ languageId = lid;     }
     void SetPos             ( int nPos_in           ){ nPos = nPos_in;       }
-    void SetOldRef          ( ByteString sOldRef_in ){ sOldRef = sOldRef_in; }
+    void SetOldRef          ( rtl::OString const & sOldRef_in ){ sOldRef = sOldRef_in; }
 
     virtual int        GetPos()         { return nPos;         }
-    ByteString GetProject()     { return project;      }
-    ByteString GetFileName()    { return filename;     }
-    ByteString GetId()          { return id;           }
-    ByteString GetOldref()      { return sOldRef;      }
-    ByteString GetResourceType(){ return resourceType; }
-    ByteString GetLanguageId()  { return languageId;   }
+    rtl::OString GetProject()     { return project;      }
+    rtl::OString GetFileName()    { return filename;     }
+    rtl::OString GetId()          { return id;           }
+    rtl::OString GetOldref()      { return sOldRef;      }
+    rtl::OString GetResourceType(){ return resourceType; }
+    rtl::OString GetLanguageId()  { return languageId;   }
 
 
 };
diff --git a/l10ntools/source/cfglex.l b/l10ntools/source/cfglex.l
index 94648a6..f1daee6 100644
--- a/l10ntools/source/cfglex.l
+++ b/l10ntools/source/cfglex.l
@@ -34,18 +34,8 @@ int yycolumn = 1;
 #define YY_USER_ACTION yycolumn += yyleng;
 
 /* external functions (C++ code, declared as extren "C" */
-extern int WorkOnTokenSet( int, char* );
-extern int InitCfgExport( char * , char *);
-extern int EndCfgExport();
-extern int GetError();
-extern int SetError();
-extern char *GetOutputFile( int argc, char* argv[]);
-extern FILE *GetCfgFile();
-extern int isQuiet();
-extern void removeTempFile();
-extern char* getFilename();
-/* forwards */
-void YYWarning();
+extern void workOnTokenSet( int, char* );
+extern FILE * init(int, char **);
 
 int bText=0;
 %}
@@ -58,28 +48,28 @@ int bText=0;
 
 \<[^\>]*"xml:lang="\""x-no-translate"\"[^\<]*\/\>	{
 	bText = 0;
-	WorkOnTokenSet( CFG_TOKEN_NO_TRANSLATE, yytext );
+	workOnTokenSet( CFG_TOKEN_NO_TRANSLATE, yytext );
 }
 
 \<.*\/\> {
 	bText = 0;
-	WorkOnTokenSet( ANYTOKEN, yytext );
+	workOnTokenSet( ANYTOKEN, yytext );
 }
 
 \<[^\>]*"xml:lang="\".*\"[^\<]*\>	{
 	bText = 1;
-	WorkOnTokenSet( CFG_TEXT_START, yytext );
+	workOnTokenSet( CFG_TEXT_START, yytext );
 }
 
 
 \<[^\/\!][^\>]*\>	{
 	bText = 0;
-	WorkOnTokenSet( CFG_TAG, yytext );
+	workOnTokenSet( CFG_TAG, yytext );
 }
 
 "<!"DOCTYPE[^\>]*\>	{
 	bText = 0;
-	WorkOnTokenSet( CFG_TAG, yytext );
+	workOnTokenSet( CFG_TAG, yytext );
 }
 
 
@@ -89,8 +79,8 @@ int bText=0;
 	pChar[1] = 0x00;
 	pChar[0] = c3;
 
-	WorkOnTokenSet( COMMEND, yytext );
-	WorkOnTokenSet( COMMEND, pChar );
+	workOnTokenSet( COMMEND, yytext );
+	workOnTokenSet( COMMEND, pChar );
 
 	for(;;) {
 		if ( c3 == EOF )
@@ -101,29 +91,29 @@ int bText=0;
 		c2 = c3;
 		c3 = input();
 		pChar[0] = c3;
-		WorkOnTokenSet( COMMEND, pChar );
+		workOnTokenSet( COMMEND, pChar );
 	}
 }
 
 \<\/[^\>]*\> {
 	bText = 0;
-	WorkOnTokenSet( CFG_CLOSETAG, yytext );
+	workOnTokenSet( CFG_CLOSETAG, yytext );
 }
 
 \<[^\>\!]*\> {
 	bText = 0;
 	if ( yytext[ 1 ] == '!' && yytext[ 2 ] == '-' && yytext[ 3 ] == '-' )
-		WorkOnTokenSet( COMMEND, yytext );
+		workOnTokenSet( COMMEND, yytext );
 	else
-		WorkOnTokenSet( CFG_UNKNOWNTAG, yytext );
+		workOnTokenSet( CFG_UNKNOWNTAG, yytext );
 }
 
 .|\n {
     yycolumn = 1;
 	if ( bText == 1 )
-		WorkOnTokenSet( CFG_TEXTCHAR, yytext );
+		workOnTokenSet( CFG_TEXTCHAR, yytext );
 	else
-		WorkOnTokenSet( UNKNOWNCHAR, yytext );
+		workOnTokenSet( UNKNOWNCHAR, yytext );
 }
 
 
@@ -156,63 +146,15 @@ void yyerror ( const char *s )
 	/* write error to stderr */
 	fprintf( stderr,
 		"Error: \"%s\" in line %d, column %d: \"%s\"\n", s, yylineno, yycolumn, yytext  );
-	SetError();
+	exit(EXIT_FAILURE);
 }
 
-/*****************************************************************************/
 int
-#ifdef WNT
+#if defined WNT
 _cdecl
 #endif
-main( int argc, char* argv[])
-/*****************************************************************************/
-{
-	/* error level */
-	int nRetValue = 0;
-	char *pOutput;
-	FILE *pFile;
-
-	pOutput = GetOutputFile( argc, argv );
-
-    if ( !pOutput ) {
-		fprintf( stdout, "Syntax: CFGEX[-p Prj][-r PrjRoot]-i FileIn [-o FileOut][-m DataBase][-e][-b][-u][-f][-d DoneFile][-g[:dtd] ][-L l1,l2,...]\n" );
-		fprintf( stdout, " Prj:      Project\n" );
-		fprintf( stdout, " PrjRoot:  Path to project root (..\\.. etc.)\n" );
-		fprintf( stdout, " FileIn:   Source files (*.src)\n" );
-		fprintf( stdout, " FileOut:  Destination file (*.*)\n" );
-		fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" );
-        fprintf( stdout, " -e: Disable writing errorlog\n" );
-		fprintf( stdout, " -b: Break when Token \"HelpText\" found in source\n" );
-		fprintf( stdout, " -u: [english] and [german] are allowed, Id is Taken from DataBase \n" );
-		fprintf( stdout, " -f: force extraction and merge even if only one language is existent\n" );
-		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 of (de,en-US...)\n" );
-		fprintf( stdout, "     f1, f2,... are also elements of (de,en-US...)\n" );
-		return 1;
-	}
-
-	pFile = GetCfgFile();
-	InitCfgExport( pOutput , getFilename() );
-	if ( !pFile )
-		return 1;
-
-   	yyin = pFile;
-
-	/* create global instance of class CfgExport */
-	//InitCfgExport( pOutput );
-
-	/* start parser */
-   	yylex();
-
-	/* get error info. and end export */
-	nRetValue = GetError();
-	EndCfgExport();
-
-    
-    removeTempFile();
-/* return error level */
-	return nRetValue;
+main(int argc, char ** argv) {
+    yyin = init(argc, argv);
+    yylex();
+    return EXIT_SUCCESS;
 }
-
-
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index 13cf715..fded669 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -26,256 +26,216 @@
  *
  ************************************************************************/
 
-#include <stdio.h>
+#include "sal/config.h"
+
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+#include "boost/scoped_ptr.hpp"
+#include "osl/process.h"
+#include "rtl/uri.hxx"
+
 #include <comphelper/string.hxx>
-#include <tools/string.hxx>
-#include <tools/fsys.hxx>
 
-// local includes
+#include "helper.hxx"
 #include "export.hxx"
 #include "cfgmerge.hxx"
 #include "tokens.h"
 
 using comphelper::string::getToken;
 
-extern "C" { int yyerror(const char *); }
-extern "C" { int YYWarning(const char *); }
-
-// defines to parse command line
-#define STATE_NON       0x0001
-#define STATE_INPUT     0x0002
-#define STATE_OUTPUT    0x0003
-#define STATE_PRJ       0x0004
-#define STATE_ROOT      0x0005
-#define STATE_MERGESRC  0x0006
-#define STATE_ERRORLOG  0x0007
-#define STATE_UTF8      0x0008
-#define STATE_LANGUAGES 0X0009
-#define STATE_FORCE     0x000B
-
-// set of global variables
-sal_Bool bEnableExport;
-sal_Bool bMergeMode;
-sal_Bool bErrorLog;
-sal_Bool bForce;
-sal_Bool bUTF8;
-ByteString sPrj;
-ByteString sPrjRoot;
-ByteString sInputFileName;
-ByteString sActFileName;
-rtl::OString sFullEntry;
-rtl::OString sOutputFile;
-rtl::OString sMergeSrc;
-String sUsedTempFile;
-
-CfgParser *pParser;
-
-extern "C" {
-// the whole interface to lexer is in this extern "C" section
-
-/*****************************************************************************/
-extern char *GetOutputFile( int argc, char* argv[])
-/*****************************************************************************/
-{
-    bEnableExport   = sal_False;
-    bMergeMode      = sal_False;
-    bErrorLog       = sal_True;
-    bForce          = sal_False;
-    bUTF8           = sal_True;
-    sPrj            = "";
-    sPrjRoot        = "";
-    sInputFileName  = "";
-    sActFileName    = "";
-
-    sal_uInt16 nState = STATE_NON;
-    sal_Bool bInput = sal_False;
-
-    // parse command line
-    for( int i = 1; i < argc; i++ ) {
-        ByteString sSwitch( argv[ i ] );
-        sSwitch.ToUpperAscii();
-
-        if ( sSwitch == "-I" ) {
-            nState = STATE_INPUT; // next token specifies source file
-        }
-        else if ( sSwitch == "-O" ) {
-            nState = STATE_OUTPUT; // next token specifies the dest file
-        }
-        else if ( sSwitch == "-P" ) {
-            nState = STATE_PRJ; // next token specifies the cur. project
-        }
-        else if ( sSwitch == "-R" ) {
-            nState = STATE_ROOT; // next token specifies path to project root
-        }
-        else if ( sSwitch == "-M" ) {
-            nState = STATE_MERGESRC; // next token specifies the merge database
-        }
-        else if ( sSwitch == "-E" ) {
-            nState = STATE_ERRORLOG;
-            bErrorLog = sal_False;
-        }
-        else if ( sSwitch == "-F" ) {
-            nState = STATE_FORCE;
-            bForce = sal_True;
-        }
-        else if ( sSwitch == "-L" ) {
-            nState = STATE_LANGUAGES;
-        }
-        else {
-            switch ( nState ) {
-                case STATE_NON: {
-                    return NULL;    // no valid command line
-                }
-                case STATE_INPUT: {
-                    sInputFileName = argv[ i ];
-                    bInput = sal_True; // source file found
-                }
+extern "C" { int yyerror(char const *); }
+
+namespace {
+
+namespace global {
+
+bool mergeMode = false;
+bool errorLog = true;
+char const * prj = 0;
+char const * prjRoot = 0;
+char const * inputPathname = 0;
+char const * outputPathname = 0;
+char const * mergeSrc;
+boost::scoped_ptr< CfgParser > parser;
+
+}
+
+void badArguments() {
+}
+
+void handleArguments(int argc, char ** argv) {
+    enum State {
+        STATE_NONE, STATE_INPUT, STATE_OUTPUT, STATE_PRJ, STATE_ROOT,
+        STATE_MERGESRC, STATE_LANGUAGES };
+    State state = STATE_NONE;
+    for (int i = 1; i < argc; ++i) {
+        if (std::strcmp(argv[i], "-i") == 0) {
+            state = STATE_INPUT;
+        } else if (std::strcmp(argv[i], "-o") == 0) {
+            state = STATE_OUTPUT;
+        } else if (std::strcmp(argv[i], "-p") == 0) {
+            state = STATE_PRJ;
+        } else if (std::strcmp(argv[i], "-r") == 0) {
+            state = STATE_ROOT;
+        } else if (std::strcmp(argv[i], "-m") == 0) {
+            state = STATE_MERGESRC;
+        } else if (std::strcmp(argv[i], "-e") == 0) {
+            state = STATE_NONE;
+            global::errorLog = false;
+        } else if (std::strcmp(argv[i], "-l") == 0) {
+            state = STATE_LANGUAGES;
+        } else {
+            switch (state) {
+            default:
+                global::inputPathname = 0; // no valid command line
+                goto done;
+            case STATE_INPUT:
+                global::inputPathname = argv[i];
                 break;
-                case STATE_OUTPUT: {
-                    sOutputFile = argv[ i ]; // the dest. file
-                }
+            case STATE_OUTPUT:
+                global::outputPathname = argv[i];
                 break;
-                case STATE_PRJ: {
-                    sPrj = ByteString( argv[ i ]);
-//                  sPrj.ToLowerAscii(); // the project
-                }
+            case STATE_PRJ:
+                global::prj = argv[i];
                 break;
-                case STATE_ROOT: {
-                    sPrjRoot = ByteString( argv[ i ]); // path to project root
-                }
+            case STATE_ROOT:
+                global::prjRoot = argv[i];
                 break;
-                case STATE_MERGESRC: {
-                    sMergeSrc = rtl::OString(argv[i]);
-                    bMergeMode = sal_True; // activate merge mode, cause merge database found
-                }
+            case STATE_MERGESRC:
+                global::mergeSrc = argv[i];
+                global::mergeMode = true;
                 break;
-                case STATE_LANGUAGES: {
-                    Export::sLanguages = ByteString( argv[ i ]);
-                }
+            case STATE_LANGUAGES:
+                Export::sLanguages = argv[i];
                 break;
             }
+            state = STATE_NONE;
         }
     }
-
-    if ( bInput ) {
-        // command line is valid
-        bEnableExport = sal_True;
-        char *pReturn = new char[ sOutputFile.getLength() + 1 ];
-        strcpy( pReturn, sOutputFile.getStr());  // #100211# - checked
-        return pReturn;
+done:
+    if (global::inputPathname == 0 || global::outputPathname == 0) {
+        std::fprintf(
+            stderr,
+            ("Syntax: cfgex [-p Prj] [-r PrjRoot] -i FileIn -o FileOut"
+             " [-m DataBase] [-e] [-l l1,l2,...]\n"
+             " Prj:      Project\n"
+             " PrjRoot:  Path to project root (../.. etc.)\n"
+             " FileIn:   Source files (*.src)\n"
+             " FileOut:  Destination file (*.*)\n"
+             " DataBase: Mergedata (*.sdf)\n"
+             " -e: Disable writing errorlog\n"
+             " -l: Restrict the handled languages; l1, l2, ... are elements of"
+             " (de, en-US, ...)\n"));
+        std::exit(EXIT_FAILURE);
     }
-
-    // command line is not valid
-    return NULL;
-}
-
-int InitCfgExport( char *pOutput , char* pFilename )
-{
-    // instanciate Export
-    rtl::OString sOutput( pOutput );
-    ByteString sFilename( pFilename );
     Export::InitLanguages();
+}
 
-    if ( bMergeMode )
-        pParser = new CfgMerge( sMergeSrc, sOutputFile, sFilename );
-    else if ( sOutputFile.getLength())
-        pParser = new CfgExport( sOutputFile, sPrj, sActFileName );
-
-    return 1;
 }
 
-/*****************************************************************************/
-int EndCfgExport()
-/*****************************************************************************/
-{
-    delete pParser;
+extern "C" {
 
-    return 1;
-}
+FILE * init(int argc, char ** argv) {
+    handleArguments(argc, argv);
 
-void removeTempFile(){
-    if( !sUsedTempFile.EqualsIgnoreCaseAscii( "" ) ){
-        DirEntry aTempFile( sUsedTempFile );
-        aTempFile.Kill();
+    FILE * pFile = std::fopen(global::inputPathname, "r");
+    if (pFile == 0) {
+        std::fprintf(
+            stderr, "Error: Cannot open file \"%s\"\n",
+            global::inputPathname);
+        std::exit(EXIT_FAILURE);
     }
-}
-extern const char* getFilename()
-{
-    return sInputFileName.GetBuffer();
-}
-/*****************************************************************************/
-extern FILE *GetCfgFile()
-/*****************************************************************************/
-{
-    FILE *pFile = 0;
-    // look for valid filename
-    if ( sInputFileName.Len()) {
-        if( Export::fileHasUTF8ByteOrderMarker( sInputFileName ) ){
-            DirEntry aTempFile = Export::GetTempFile();
-            DirEntry aSourceFile( String( sInputFileName , RTL_TEXTENCODING_ASCII_US ) );
-            aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE );
-            String sTempFile = aTempFile.GetFull();
-            Export::RemoveUTF8ByteOrderMarkerFromFile( rtl::OUStringToOString(sTempFile , RTL_TEXTENCODING_ASCII_US) );
-            pFile = fopen(rtl::OUStringToOString(sTempFile , RTL_TEXTENCODING_ASCII_US).getStr(), "r");
-            sUsedTempFile = sTempFile;
-        }else{
-            // able to open file?
-            pFile = fopen( sInputFileName.GetBuffer(), "r" );
-            sUsedTempFile = String::CreateFromAscii("");
+
+    // Skip UTF-8 BOM:
+    unsigned char buf[3];
+    if (std::fread(buf, 1, 3, pFile) != 3 ||
+        buf[0] != 0xEF || buf[1] != 0xBB || buf[2] != 0xBF)
+    {
+        std::rewind(pFile);
+    }
+
+    if (global::mergeMode) {
+        global::parser.reset(
+            new CfgMerge(
+                global::mergeSrc, global::outputPathname,
+                global::inputPathname));
+    } else {
+        rtl::OUString cwd;
+        if (osl_getProcessWorkingDir(&cwd.pData) != osl_Process_E_None) {
+            std::fprintf(stderr, "Error: Cannot determine cwd\n");
+            std::exit(EXIT_FAILURE);
+        }
+        rtl::OUString full;
+        if (!rtl_convertStringToUString(
+                &full.pData, global::inputPathname,
+                rtl_str_getLength(global::inputPathname),
+                osl_getThreadTextEncoding(),
+                (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
+                 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
+                 | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)))
+        {
+            std::fprintf(
+                stderr, "Error: Cannot convert input pathname to UTF-16\n");
+            std::exit(EXIT_FAILURE);
+        }
+        if (osl::FileBase::getAbsoluteFileURL(cwd, full, full)
+            != osl::FileBase::E_None)
+        {
+            std::fprintf(
+                stderr,
+                "Error: Cannot convert input pathname to absolute URL\n");
+            std::exit(EXIT_FAILURE);
+        }
+        if (global::prjRoot == 0) {
+            std::fprintf(stderr, "Error: No project root argument\n");
+            std::exit(EXIT_FAILURE);
+        }
+        rtl::OUString base;
+        if (!rtl_convertStringToUString(
+                &base.pData, global::prjRoot,
+                rtl_str_getLength(global::prjRoot),
+                osl_getThreadTextEncoding(),
+                (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
+                 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
+                 | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)))
+        {
+            std::fprintf(
+                stderr, "Error: Cannot convert project root to UTF-16\n");
+            std::exit(EXIT_FAILURE);
         }
-        if ( !pFile ){
-            fprintf( stderr, "Error: Could not open file %s\n",
-                sInputFileName.GetBuffer());
-            exit( -13 );
+        base = rtl::Uri::convertRelToAbs(full, base);
+        if (full.getLength() <= base.getLength() || base.isEmpty()
+            || base[base.getLength() - 1] != '/'
+            || full[base.getLength() - 1] != '/')
+        {
+            std::fprintf(
+                stderr, "Error: Cannot extract suffix from input pathname\n");
+            std::exit(EXIT_FAILURE);
         }
-        else {
-            // this is a valid file which can be opened, so
-            // create path to project root
-            DirEntry aEntry( String( sInputFileName, RTL_TEXTENCODING_ASCII_US ));
-            aEntry.ToAbs();
-            sFullEntry = rtl::OUStringToOString(aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US);
-            aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US ));
-            aEntry += DirEntry( sPrjRoot );
-            rtl::OString sPrjEntry(rtl::OUStringToOString(aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US));
-
-            // create file name, beginnig with project root
-            // (e.g.: source\ui\src\menue.src)
-//            printf("sFullEntry = %s\n",sFullEntry.getStr());
-            sActFileName = sFullEntry.copy(sPrjEntry.getLength() + 1);
-//            printf("sActFileName = %s\n",sActFileName.GetBuffer());
-
-            sActFileName.SearchAndReplaceAll( "/", "\\" );
-
-            return pFile;
+        full = full.copy(base.getLength()).replace('/', '\\');
+        rtl::OString suffix;
+        if (!full.convertToString(
+                &suffix, osl_getThreadTextEncoding(),
+                (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
+                 | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
+        {
+            std::fprintf(
+                stderr, "Error: Cannot convert suffix from UTF-16\n");
+            std::exit(EXIT_FAILURE);
         }
+        global::parser.reset(
+            new CfgExport(global::outputPathname, global::prj, suffix));
     }
-    // this means the file could not be opened
-    return NULL;
-}
 
-/*****************************************************************************/
-int WorkOnTokenSet( int nTyp, char *pTokenText )
-/*****************************************************************************/
-{
-    pParser->Execute( nTyp, pTokenText );
-
-    return 1;
+    return pFile;
 }
 
-
-/*****************************************************************************/
-int SetError()
-/*****************************************************************************/
-{
-    return 1;
+void workOnTokenSet(int nTyp, char * pTokenText) {
+    global::parser->Execute( nTyp, pTokenText );
 }
 
-/*****************************************************************************/
-int GetError()
-/*****************************************************************************/
-{
-    return 0;
-}
 }
 
 //
@@ -356,19 +316,19 @@ sal_Bool CfgParser::IsTokenClosed(const rtl::OString &rToken)
 
 /*****************************************************************************/
 void CfgParser::AddText(
-    ByteString &rText,
-    const ByteString &rIsoLang,
-    const ByteString &rResTyp
+    rtl::OString &rText,
+    const rtl::OString &rIsoLang,
+    const rtl::OString &rResTyp
 )
 /*****************************************************************************/
 {
-        sal_uInt16 nTextLen = 0;
-        while ( rText.Len() != nTextLen ) {
-            nTextLen = rText.Len();
-            rText.SearchAndReplaceAll( "\n", " " );
-            rText.SearchAndReplaceAll( "\r", " " );
-            rText.SearchAndReplaceAll( "\t", " " );
-            rText.SearchAndReplaceAll( "  ", " " );
+        sal_Int32 nTextLen = 0;
+        while ( rText.getLength() != nTextLen ) {
+            nTextLen = rText.getLength();
+            rText = rText.replace( '\n', ' ' );
+            rText = rText.replace( '\r', ' ' );
+            rText = rText.replace( '\t', ' ' );
+            while (helper::searchAndReplace(&rText, "  ", " ") != -1) {}
         }
         pStackData->sResTyp = rResTyp;
         WorkOnText( rText, rIsoLang );
@@ -380,13 +340,13 @@ void CfgParser::AddText(
 int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
 /*****************************************************************************/
 {
-    ByteString sToken( pToken );
+    rtl::OString sToken( pToken );
 
     if ( sToken == " " || sToken == "\t" )
         sLastWhitespace += sToken;
 
     rtl::OString sTokenName;
-    ByteString sTokenId;
+    rtl::OString sTokenId;
 
     sal_Bool bOutput = sal_True;
 
@@ -404,7 +364,7 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
             sTokenName = getToken(getToken(getToken(sToken, 1, '<'), 0, '>'), 0, ' ');
 
               if ( !IsTokenClosed( sToken )) {
-                ByteString sSearch;
+                rtl::OString sSearch;
                 switch ( nToken ) {
                     case CFG_TOKEN_PACKAGE:
                         sSearch = "package-id=";
@@ -428,15 +388,15 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
                     case CFG_TEXT_START: {
                         if ( sCurrentResTyp != sTokenName ) {
                             WorkOnRessourceEnd();
-                            ByteString sCur;
+                            rtl::OString sCur;
                             for( unsigned int n = 0; n < aLanguages.size(); n++ ){
                                 sCur = aLanguages[ n ];
-                                pStackData->sText[ sCur ] = ByteString("");
+                                pStackData->sText[ sCur ] = rtl::OString();
                             }
                          }
                         sCurrentResTyp = sTokenName;
 
-                        ByteString sTemp = sToken.Copy( sToken.Search( "xml:lang=" ));
+                        rtl::OString sTemp = sToken.copy( sToken.indexOf( "xml:lang=" ));
                         sCurrentIsoLang = getToken(getToken(sTemp, 1, '\"'), 0, '\"');
 
                         if ( sCurrentIsoLang == NO_TRANSLATE_ISO )
@@ -448,27 +408,26 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
                     }
                     break;
                 }
-                if ( sSearch.Len())
+                if ( !sSearch.isEmpty())
                 {
-                    rtl::OString sTemp = sToken.Copy( sToken.Search( sSearch ));
+                    rtl::OString sTemp = sToken.copy( sToken.indexOf( sSearch ));
                     sTokenId = getToken(getToken(sTemp, 1, '\"'), 0, '\"');
                 }
                 pStackData = aStack.Push( sTokenName, sTokenId );
 
                 if ( sSearch == "cfg:name=" ) {
-                    ByteString sTemp( sToken );
-                    sTemp.ToUpperAscii();
-                    bLocalize = (( sTemp.Search( "CFG:TYPE=\"STRING\"" ) != STRING_NOTFOUND ) &&
-                        ( sTemp.Search( "CFG:LOCALIZED=\"sal_True\"" ) != STRING_NOTFOUND ));
+                    rtl::OString sTemp( sToken.toAsciiUpperCase() );
+                    bLocalize = (( sTemp.indexOf( "CFG:TYPE=\"STRING\"" ) != -1 ) &&
+                        ( sTemp.indexOf( "CFG:LOCALIZED=\"sal_True\"" ) != -1 ));
                 }
             }
             else if ( sTokenName == "label" ) {
                 if ( sCurrentResTyp != sTokenName ) {
                     WorkOnRessourceEnd();
-                    ByteString sCur;
+                    rtl::OString sCur;
                     for( unsigned int n = 0; n < aLanguages.size(); n++ ){
                         sCur = aLanguages[ n ];
-                        pStackData->sText[ sCur ] = ByteString("");
+                        pStackData->sText[ sCur ] = rtl::OString();
                     }
                 }
                 sCurrentResTyp = sTokenName;
@@ -479,20 +438,20 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
             sTokenName = getToken(getToken(getToken(sToken, 1, '/'), 0, '>'), 0, ' ');
             if ( aStack.GetStackData() && ( aStack.GetStackData()->GetTagType() == sTokenName ))
             {
-                if (!sCurrentText.Len())
+                if (sCurrentText.isEmpty())
                     WorkOnRessourceEnd();
                 aStack.Pop();
                 pStackData = aStack.GetStackData();
             }
             else
             {
-                ByteString sError( "Misplaced close tag: " );
-                ByteString sInFile(" in file ");
+                rtl::OString sError( "Misplaced close tag: " );
+                rtl::OString sInFile(" in file ");
                 sError += sToken;
                 sError += sInFile;
-                sError += sFullEntry;
+                sError += global::inputPathname;
                 Error( sError );
-                exit ( 13 );
+                std::exit(EXIT_FAILURE);
             }
         break;
 
@@ -506,11 +465,11 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
         break;
     }
 
-    if ( sCurrentText.Len() && nToken != CFG_TEXTCHAR )
+    if ( !sCurrentText.isEmpty() && nToken != CFG_TEXTCHAR )
     {
         AddText( sCurrentText, sCurrentIsoLang, sCurrentResTyp );
         Output( sCurrentText );
-        sCurrentText = "";
+        sCurrentText = rtl::OString();
         pStackData->sEndTextTag = sToken;
     }
 
@@ -531,21 +490,21 @@ void CfgExport::Output(const rtl::OString&)
 int CfgParser::Execute( int nToken, char * pToken )
 /*****************************************************************************/
 {
-    ByteString sToken( pToken );
+    rtl::OString sToken( pToken );
 
     switch ( nToken ) {
         case CFG_TAG:
-            if ( sToken.Search( "package-id=" ) != STRING_NOTFOUND )
+            if ( sToken.indexOf( "package-id=" ) != -1 )
                 return ExecuteAnalyzedToken( CFG_TOKEN_PACKAGE, pToken );
-            else if ( sToken.Search( "component-id=" ) != STRING_NOTFOUND )
+            else if ( sToken.indexOf( "component-id=" ) != -1 )
                 return ExecuteAnalyzedToken( CFG_TOKEN_COMPONENT, pToken );
-            else if ( sToken.Search( "template-id=" ) != STRING_NOTFOUND )
+            else if ( sToken.indexOf( "template-id=" ) != -1 )
                 return ExecuteAnalyzedToken( CFG_TOKEN_TEMPLATE, pToken );
-            else if ( sToken.Search( "cfg:name=" ) != STRING_NOTFOUND )
+            else if ( sToken.indexOf( "cfg:name=" ) != -1 )
                 return ExecuteAnalyzedToken( CFG_TOKEN_OORNAME, pToken );
-            else if ( sToken.Search( "oor:name=" ) != STRING_NOTFOUND )
+            else if ( sToken.indexOf( "oor:name=" ) != -1 )
                 return ExecuteAnalyzedToken( CFG_TOKEN_OORNAME, pToken );
-            else if ( sToken.Search( "oor:value=" ) != STRING_NOTFOUND )
+            else if ( sToken.indexOf( "oor:value=" ) != -1 )
                 return ExecuteAnalyzedToken( CFG_TOKEN_OORVALUE, pToken );
         break;
     }
@@ -577,7 +536,7 @@ CfgOutputParser::CfgOutputParser(const rtl::OString &rOutputFile)
         Error(sError.makeStringAndClear());
         delete pOutputStream;
         pOutputStream = NULL;
-        exit( -13 );
+        std::exit(EXIT_FAILURE);
     }
 }
 
@@ -597,9 +556,9 @@ CfgOutputParser::~CfgOutputParser()
 
 /*****************************************************************************/
 CfgExport::CfgExport(
-        const ByteString &rOutputFile,
-        const ByteString &rProject,
-        const ByteString &rFilePath
+        const rtl::OString &rOutputFile,
+        const rtl::OString &rProject,
+        const rtl::OString &rFilePath
 )
 /*****************************************************************************/
                 : CfgOutputParser( rOutputFile ),
@@ -621,15 +580,11 @@ void CfgExport::WorkOnRessourceEnd()
 /*****************************************************************************/
 {
     if ( pOutputStream && bLocalize ) {
-    if (( pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("en-US"))].getLength()
-        ) ||
-            ( bForce &&
-                ( pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("de"))].getLength() ||
-                    pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("en-US"))].getLength() )))
+    if ( pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("en-US"))].getLength() )
         {
-            ByteString sFallback = pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("en-US"))];
-            ByteString sLocalId = pStackData->sIdentifier;
-            ByteString sGroupId;
+            rtl::OString sFallback = pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("en-US"))];
+            rtl::OString sLocalId = pStackData->sIdentifier;
+            rtl::OString sGroupId;
             if ( aStack.size() == 1 ) {
                 sGroupId = sLocalId;
                 sLocalId = "";
@@ -638,19 +593,19 @@ void CfgExport::WorkOnRessourceEnd()
                 sGroupId = aStack.GetAccessPath( aStack.size() - 2 );
             }
 
-            ByteString sTimeStamp( Export::GetTimeStamp());
+            rtl::OString sTimeStamp( Export::GetTimeStamp());
 
             for (size_t n = 0; n < aLanguages.size(); n++)
             {
-                ByteString sCur = aLanguages[ n ];
+                rtl::OString sCur = aLanguages[ n ];
 
-                ByteString sText = pStackData->sText[ sCur ];
-                if ( !sText.Len())
+                rtl::OString sText = pStackData->sText[ sCur ];
+                if ( sText.isEmpty())
                     sText = sFallback;
 
-                Export::UnquotHTML( sText );
+                sText = Export::UnquoteHTML( sText );
 
-                ByteString sOutput( sPrj ); sOutput += "\t";
+                rtl::OString sOutput( sPrj ); sOutput += "\t";
                 sOutput += sPath;
                 sOutput += "\t0\t";
                 sOutput += pStackData->sResTyp; sOutput += "\t";
@@ -669,11 +624,11 @@ void CfgExport::WorkOnRessourceEnd()
 }
 
 void CfgExport::WorkOnText(
-    ByteString &rText,
+    rtl::OString &rText,
     const rtl::OString &rIsoLang
 )
 {
-    if( rIsoLang.getLength() ) Export::UnquotHTML( rText );
+    if( rIsoLang.getLength() ) rText = Export::UnquoteHTML( rText );
 }
 
 
@@ -693,7 +648,7 @@ CfgMerge::CfgMerge(
     if (rMergeSource.getLength())
     {
         pMergeDataFile = new MergeDataFile(
-        rMergeSource, sInputFileName, bErrorLog, true );
+            rMergeSource, global::inputPathname, global::errorLog, true );
         if (Export::sLanguages.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("ALL")))
         {
             Export::SetLanguages( pMergeDataFile->GetLanguages() );
@@ -713,22 +668,22 @@ CfgMerge::~CfgMerge()
     delete pResData;
 }
 
-void CfgMerge::WorkOnText(ByteString &rText, const rtl::OString& rLangIndex)
+void CfgMerge::WorkOnText(rtl::OString &rText, const rtl::OString& rLangIndex)
 {
 
     if ( pMergeDataFile && bLocalize ) {
         if ( !pResData ) {
-            ByteString sLocalId = pStackData->sIdentifier;
-            ByteString sGroupId;
+            rtl::OString sLocalId = pStackData->sIdentifier;
+            rtl::OString sGroupId;
             if ( aStack.size() == 1 ) {
                 sGroupId = sLocalId;
-                sLocalId = "";
+                sLocalId = rtl::OString();
             }
             else {
                 sGroupId = aStack.GetAccessPath( aStack.size() - 2 );
             }
 
-            ByteString sPlatform( "" );
+            rtl::OString sPlatform;
 
             pResData = new ResData( sPlatform, sGroupId , sFilename );
             pResData->sId = sLocalId;
@@ -740,13 +695,13 @@ void CfgMerge::WorkOnText(ByteString &rText, const rtl::OString& rLangIndex)
 
         PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrysCaseSensitive( pResData );
         if ( pEntrys ) {
-            ByteString sContent;
+            rtl::OString sContent;
             pEntrys->GetText( sContent, STRING_TYP_TEXT, rLangIndex );
 
             if ( Export::isAllowed( rLangIndex ) &&
-                ( sContent != "-" ) && ( sContent.Len()))
+                ( sContent != "-" ) && !sContent.isEmpty())
             {
-                Export::QuotHTML( rText );
+                rText = Export::QuoteHTML( rText );
             }
         }
     }
@@ -763,41 +718,40 @@ void CfgMerge::WorkOnRessourceEnd()
 /*****************************************************************************/
 {
 
-    if ( pMergeDataFile && pResData && bLocalize && (( bEnglish ) || bForce )) {
+    if ( pMergeDataFile && pResData && bLocalize && bEnglish ) {
         PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrysCaseSensitive( pResData );
         if ( pEntrys ) {
-            ByteString sCur;
+            rtl::OString sCur;
 
             for( unsigned int n = 0; n < aLanguages.size(); n++ ){
                 sCur = aLanguages[ n ];
 
-                ByteString sContent;
+                rtl::OString sContent;
                 pEntrys->GetText( sContent, STRING_TYP_TEXT, sCur , sal_True );
                 if (
-                    ( !sCur.EqualsIgnoreCaseAscii("en-US") ) &&
+                    ( !sCur.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("en-US")) ) &&
 
-                    ( sContent != "-" ) && ( sContent.Len()))
+                    ( sContent != "-" ) && !sContent.isEmpty())
                 {
 
-                    ByteString sText = sContent;
-                    Export::QuotHTML( sText );
+                    rtl::OString sText = Export::QuoteHTML( sContent);
 
-                    ByteString sAdditionalLine( "\t" );
+                    rtl::OString sAdditionalLine( "\t" );
 
-                    ByteString sTextTag = pStackData->sTextTag;
-                    ByteString sTemp = sTextTag.Copy( sTextTag.Search( "xml:lang=" ));
+                    rtl::OString sTextTag = pStackData->sTextTag;
+                    rtl::OString sTemp = sTextTag.copy( sTextTag.indexOf( "xml:lang=" ));
 
-                    ByteString sSearch = getToken(sTemp, 0, '\"');
+                    rtl::OString sSearch = getToken(sTemp, 0, '\"');
                     sSearch += "\"";
                     sSearch += getToken(sTemp, 1, '\"');
                     sSearch += "\"";
 
-                    ByteString sReplace = getToken(sTemp, 0, '\"');
+                    rtl::OString sReplace = getToken(sTemp, 0, '\"');
                     sReplace += "\"";
                     sReplace += sCur;
                     sReplace += "\"";
 
-                    sTextTag.SearchAndReplace( sSearch, sReplace );
+                    helper::searchAndReplace(&sTextTag, sSearch, sReplace);
 
                     sAdditionalLine += sTextTag;
                     sAdditionalLine += sText;
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 8909a1e..eacba78 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <tools/fsys.hxx>
 #include "export.hxx"
+#include "helper.hxx"
 #include "tokens.h"
 #include <iostream>
 #include <vector>
@@ -514,8 +515,8 @@ int Export::Execute( int nToken, const char * pToken )
 /*****************************************************************************/
 {
 
-    ByteString sToken( pToken );
-    ByteString sOrig( sToken );
+    rtl::OString sToken( pToken );
+    rtl::OString sOrig( sToken );
     sal_Bool bWriteToMerged = bMergeMode;
 
     if ( nToken == CONDITION )
@@ -594,18 +595,18 @@ int Export::Execute( int nToken, const char * pToken )
         sal_uInt16 nClose = 0;
         sal_Bool bReadOver1 = sal_False;
         sal_uInt16 i = 0;
-        for ( i = 0; i < sToken.Len(); i++ ) {
-            if ( sToken.GetChar( i ) == '\"' )
+        for ( i = 0; i < sToken.getLength(); i++ ) {
+            if ( sToken[i] == '"' )
                 bReadOver1 = !bReadOver1;
-            if ( !bReadOver1 && ( sToken.GetChar( i ) == '{' ))
+            if ( !bReadOver1 && ( sToken[i] == '{' ))
                 nOpen++;
         }
 
         bReadOver1 = sal_False;
-        for ( i = 0; i < sToken.Len(); i++ ) {
-            if ( sToken.GetChar( i ) == '\"' )
+        for ( i = 0; i < sToken.getLength(); i++ ) {
+            if ( sToken[i] == '"' )
                 bReadOver1 = !bReadOver1;
-            if ( !bReadOver1 && ( sToken.GetChar( i ) == '}' ))
+            if ( !bReadOver1 && ( sToken[i] == '}' ))
                 nClose++;
         }
 
@@ -615,10 +616,10 @@ int Export::Execute( int nToken, const char * pToken )
     switch ( nToken ) {
 
         case NORMDEFINE:
-                        while( sToken.SearchAndReplace( "\r", " " ) != STRING_NOTFOUND ) {};
-                        while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {};
-                        while( sToken.SearchAndReplace( "  ", " " ) != STRING_NOTFOUND ) {};
-                        if( sToken.EqualsIgnoreCaseAscii( "#define NO_LOCALIZE_EXPORT" ) ){
+            while( helper::searchAndReplace(&sToken, "\r", " " ) != -1 ) {};
+            while( helper::searchAndReplace(&sToken,  "\t", " " ) != -1 ) {};
+            while( helper::searchAndReplace(&sToken, "  ", " " ) != -1 ) {};
+            if( sToken.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("#define NO_LOCALIZE_EXPORT")) ){
                             bSkipFile = true;
                             return 0;
                         }
@@ -650,13 +651,13 @@ int Export::Execute( int nToken, const char * pToken )
             sToken = comphelper::string::remove(sToken, '\n');
             sToken = comphelper::string::remove(sToken, '\r');
             sToken = comphelper::string::remove(sToken, '{');
-            while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {};
+            while( helper::searchAndReplace(&sToken, "\t", " " ) != -1 ) {};
             sToken = comphelper::string::stripEnd(sToken, ' ');
             rtl::OString sTLower = getToken(sToken, 0, ' ').toAsciiLowerCase();
             pResData->sResTyp = sTLower;
-            ByteString sId( sToken.Copy( pResData->sResTyp.getLength() + 1 ));
+            rtl::OString sId( sToken.copy( pResData->sResTyp.getLength() + 1 ));
             ByteString sCondition;
-            if ( sId.Search( "#" ) != STRING_NOTFOUND )
+            if ( sId.indexOf( '#' ) != -1 )
             {
                 // between ResTyp, Id and paranthes is a precomp. condition
                 sCondition = "#";
@@ -692,7 +693,8 @@ int Export::Execute( int nToken, const char * pToken )
             sToken = comphelper::string::remove(sToken, '\t');
             sToken = comphelper::string::remove(sToken, ' ');
             sToken = comphelper::string::remove(sToken, '\\');
-            pResData->sResTyp = sToken.ToLowerAscii();
+            sToken = sToken.toAsciiLowerCase();
+            pResData->sResTyp = sToken;
         }
         break;
         case LEVELUP: {
@@ -753,7 +755,7 @@ int Export::Execute( int nToken, const char * pToken )
             rtl::OString sKey = getToken(sToken, 0, '=');
             sKey = comphelper::string::remove(sKey, ' ');
             sKey = comphelper::string::remove(sKey, '\t');
-            ByteString sValue = getToken(sToken, 1, '=');
+            rtl::OString sValue = getToken(sToken, 1, '=');
             CleanValue( sValue );
             sKey = sKey.toAsciiUpperCase();
             if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("IDENTIFIER")))
@@ -790,7 +792,7 @@ int Export::Execute( int nToken, const char * pToken )
                 nListIndex = 0;
                 nListLevel = 0;
             }
-            if ( (sToken.Search( "{" ) != STRING_NOTFOUND) &&
+            if ( (sToken.indexOf( '{' ) != -1) &&
                 ( getTokenCount(sToken, '{') > getTokenCount(sToken, '}') ))
             {
                 Parse( LEVELUP, "" );
@@ -808,7 +810,7 @@ int Export::Execute( int nToken, const char * pToken )
                 rtl::OString sKey = sTmpToken.Copy( 0 , nPos );
                 sKey = comphelper::string::remove(sKey, ' ');
                 sKey = comphelper::string::remove(sKey, '\t');
-                ByteString sValue = getToken(sToken, 1, '=');
+                rtl::OString sValue = getToken(sToken, 1, '=');
                 CleanValue( sValue );
                 sKey = sKey.toAsciiUpperCase();
                 if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("STRINGLIST")))
@@ -871,7 +873,7 @@ int Export::Execute( int nToken, const char * pToken )
                 else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("UIENTRIES")))
                     nList = LIST_UIENTRIES;
                 if ( nList ) {
-                    ByteString sLang = getToken(getToken(sToken, 1, '['), 0, ']');
+                    rtl::OString sLang = getToken(getToken(sToken, 1, '['), 0, ']');
                     CleanValue( sLang );
                     m_sListLang = sLang;
                     nListIndex = 0;
@@ -911,7 +913,7 @@ int Export::Execute( int nToken, const char * pToken )
                 sKey = comphelper::string::remove(sKey, ' ');
                 sKey = comphelper::string::remove(sKey, '\t');
                 ByteString sText( GetText( sToken, nToken ));
-                ByteString sLang;
+                rtl::OString sLang;
                 if ( getToken(sToken, 0, '=').indexOf('[') != -1 )
                 {
                     sLang = getToken(getToken(getToken(sToken, 0, '='), 1, '['), 0, ']');
@@ -919,7 +921,7 @@ int Export::Execute( int nToken, const char * pToken )
                 }
                 rtl::OString sLangIndex = sLang;
                 ByteString sOrigKey = sKey;
-                if ( sText.Len() && sLang.Len() )
+                if ( sText.Len() && !sLang.isEmpty() )
                 {
                     sKey = sKey.toAsciiUpperCase();
                     if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("TEXT")) ||
@@ -1045,9 +1047,9 @@ int Export::Execute( int nToken, const char * pToken )
         break;
         case CONDITION: {
             bDontWriteOutput = sal_False;
-            while( sToken.SearchAndReplace( "\r", " " ) != STRING_NOTFOUND ) {};
-            while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {};
-            while( sToken.SearchAndReplace( "  ", " " ) != STRING_NOTFOUND ) {};
+            while( helper::searchAndReplace(&sToken, "\r", " " ) != -1 ) {};
+            while( helper::searchAndReplace(&sToken, "\t", " " ) != -1 ) {};
+            while( helper::searchAndReplace(&sToken, "  ", " " ) != -1 ) {};
             ByteString sCondition = getToken(sToken, 0, ' ');
             if ( sCondition == "#ifndef" ) {
                 sActPForm = "!defined ";
@@ -1058,12 +1060,12 @@ int Export::Execute( int nToken, const char * pToken )
                 sActPForm += ByteString(getToken(sToken, 1, ' '));
             }
             else if ( sCondition == "#if" ) {
-                sActPForm = sToken.Copy( 4 );
-                while ( sActPForm.SearchAndReplace( "||", "\\or" ) != STRING_NOTFOUND ) {};
+                sActPForm = sToken.copy( 4 );
+                while ( helper::searchAndReplace(&sActPForm, "||", "\\or" ) != -1 ) {};
             }
             else if ( sCondition == "#elif" ) {
-                sActPForm = sToken.Copy( 6 );
-                while ( sActPForm.SearchAndReplace( "||", "\\or" ) != STRING_NOTFOUND ) {};
+                sActPForm = sToken.copy( 6 );
+                while ( helper::searchAndReplace(&sActPForm, "||", "\\or" ) != -1 ) {};
             }
             else if ( sCondition == "#else" ) {
                 sActPForm = sCondition;
@@ -1090,7 +1092,7 @@ int Export::Execute( int nToken, const char * pToken )
         break;
         case PRAGMA : {
             bDontWriteOutput = sal_False;
-            fprintf(stderr, "ERROR: archaic PRAGMA %s\n", sToken.GetBuffer());
+            fprintf(stderr, "ERROR: archaic PRAGMA %s\n", sToken.getStr());
             exit(-1);
         }
         break;
@@ -1101,10 +1103,10 @@ int Export::Execute( int nToken, const char * pToken )
     if ( bWriteToMerged ) {
         // the current token must be written to dest. without merging
 
-        if( bDefine && sOrig.Len() > 2 ){
-            for( sal_uInt16 n = 0 ; n < sOrig.Len() ; n++ ){
-                if( sOrig.GetChar( n ) == '\n' && sOrig.GetChar( n-1 ) != '\\'){
-                    sOrig.Insert('\\' , n++ );
+        if( bDefine && sOrig.getLength() > 2 ){
+            for( sal_uInt16 n = 0 ; n < sOrig.getLength() ; n++ ){
+                if( sOrig[n] == '\n' && sOrig[n-1] != '\\'){
+                    sOrig = sOrig.replaceAt(n++, 0, "\\");
                 }
             }
         }
@@ -1119,10 +1121,10 @@ int Export::Execute( int nToken, const char * pToken )
 }
 
 /*****************************************************************************/
-void Export::CutComment( ByteString &rText )
+void Export::CutComment( rtl::OString &rText )
 /*****************************************************************************/
 {
-    if ( rText.Search( "//" ) != STRING_NOTFOUND ) {
+    if ( rText.indexOf( "//" ) != -1 ) {
         ByteString sWork( rText );
         sWork.SearchAndReplaceAll( "\\\"", "XX" );
         sal_uInt16 i = 0;
@@ -1136,7 +1138,7 @@ void Export::CutComment( ByteString &rText )
                 ( !bInner ) &&
                 ( sWork.GetChar( i + 1 ) == '/' ))
             {
-                rText.Erase( i );
+                rText = rText.copy(0, i);
                 return;
             }
             i++;
@@ -1222,7 +1224,7 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew )
 
                 if ( bEnableExport ) {
                     ByteString sOutput( sProject ); sOutput += "\t";
-                    if ( sRoot.Len())
+                    if ( !sRoot.isEmpty())
                         sOutput += sActFileName;
                     sOutput += "\t0\t";
                     sOutput += pResData->sResTyp; sOutput += "\t";
@@ -1359,7 +1361,7 @@ sal_Bool Export::WriteExportList(ResData *pResData, ExportList *pExportList,
 
                     rtl::OStringBuffer sOutput(sProject);
                     sOutput.append('\t');
-                    if ( sRoot.Len())
+                    if ( !sRoot.isEmpty())
                         sOutput.append(sActFileName);
                     sOutput.append("\t0\t");
                     sOutput.append(rTyp).append('\t');
@@ -1484,23 +1486,23 @@ void Export::InsertListEntry(const rtl::OString &rText, const rtl::OString &rLin
 }
 
 /*****************************************************************************/
-void Export::CleanValue( ByteString &rValue )
+void Export::CleanValue( rtl::OString &rValue )
 /*****************************************************************************/
 {
-    while ( rValue.Len()) {
-        if (( rValue.GetChar( 0 ) == ' ' ) || ( rValue.GetChar( 0 ) == '\t' ))
-            rValue = rValue.Copy( 1 );
+    while ( !rValue.isEmpty()) {
+        if (( rValue[0] == ' ' ) || ( rValue[0] == '\t' ))
+            rValue = rValue.copy( 1 );
         else
             break;
     }
 
-    if ( rValue.Len()) {
-        for ( sal_uInt16 i = rValue.Len() - 1; i > 0; i-- ) {
-            if (( rValue.GetChar( i ) == ' ' ) || ( rValue.GetChar( i ) == '\t' ) ||
-                ( rValue.GetChar( i ) == '\n' ) || ( rValue.GetChar( i ) == ';' ) ||
-                ( rValue.GetChar( i ) == '{' ) || ( rValue.GetChar( i ) == '\\' ) ||
-                ( rValue.GetChar( i ) == '\r' ))
-                rValue.Erase( i );
+    if ( !rValue.isEmpty()) {
+        for ( sal_Int32 i = rValue.getLength() - 1; i > 0; i-- ) {
+            if (( rValue[i] == ' ' ) || ( rValue[i] == '\t' ) ||
+                ( rValue[i] == '\n' ) || ( rValue[i] == ';' ) ||
+                ( rValue[i] == '{' ) || ( rValue[i] == '\\' ) ||
+                ( rValue[i] == '\r' ))
+                rValue = rValue.copy(0, i);
             else
                 break;
         }
@@ -1519,19 +1521,19 @@ rtl::OString Export::GetText(const rtl::OString &rSource, int nToken)
         case TEXTLINE:
         case LONGTEXTLINE:
         {
-            ByteString sTmp(rSource.copy(rSource.indexOf("=")));
+            rtl::OString sTmp(rSource.copy(rSource.indexOf("=")));
             CleanValue( sTmp );
             sTmp = comphelper::string::remove(sTmp, '\n');
             sTmp = comphelper::string::remove(sTmp, '\r');
 
-            while ( sTmp.SearchAndReplace( "\\\\\"", "-=<[BSlashBSlashHKom]>=-\"" )
-                != STRING_NOTFOUND ) {}
-            while ( sTmp.SearchAndReplace( "\\\"", "-=<[Hochkomma]>=-" )
-                != STRING_NOTFOUND ) {}
-            while ( sTmp.SearchAndReplace( "\\", "-=<[0x7F]>=-" )
-                != STRING_NOTFOUND ) {}
-            while ( sTmp.SearchAndReplace( "\\0x7F", "-=<[0x7F]>=-" )
-                != STRING_NOTFOUND ) {}
+            while ( helper::searchAndReplace(&sTmp, "\\\\\"", "-=<[BSlashBSlashHKom]>=-\"" )
+                != -1 ) {}
+            while ( helper::searchAndReplace(&sTmp, "\\\"", "-=<[Hochkomma]>=-" )
+                != -1 ) {}
+            while ( helper::searchAndReplace(&sTmp, "\\", "-=<[0x7F]>=-" )
+                != -1 ) {}
+            while ( helper::searchAndReplace(&sTmp, "\\0x7F", "-=<[0x7F]>=-" )
+                != -1 ) {}
 
             sal_uInt16 nStart = 0;
             sal_uInt16 nState = TXT_STATE_MACRO;
@@ -1638,21 +1640,20 @@ void Export::WriteToMerged(const rtl::OString &rText , bool bSDFContent)
 }
 
 /*****************************************************************************/
-void Export::ConvertMergeContent( ByteString &rText )
+void Export::ConvertMergeContent( rtl::OString &rText )
 /*****************************************************************************/
 {
-    sal_Bool bNoOpen = ( rText.Search( "\\\"" ) != 0 );
-    ByteString sClose( rText.Copy( rText.Len() - 2 ));
-    sal_Bool bNoClose = ( sClose != "\\\"" );
+    sal_Bool bNoOpen = ( rText.indexOf( "\\\"" ) != 0 );
+    sal_Bool bNoClose = !helper::endsWith(rText, "\\\"");
     rtl::OStringBuffer sNew;
-    for ( sal_uInt16 i = 0; i < rText.Len(); i++ )
+    for ( sal_Int32 i = 0; i < rText.getLength(); i++ )
     {
-        rtl::OString sChar( rText.GetChar( i ));
+        rtl::OString sChar( rText[i]);
         if (sChar.equalsL(RTL_CONSTASCII_STRINGPARAM("\\")))
         {
-            if (( i + 1 ) < rText.Len())
+            if (( i + 1 ) < rText.getLength())
             {
-                sal_Char cNext = rText.GetChar(i + 1);
+                sal_Char cNext = rText[i + 1];
                 if ( cNext == '\"' )
                 {
                     sChar = rtl::OString('\"');
@@ -1705,12 +1706,12 @@ void Export::ConvertMergeContent( ByteString &rText )
         rText += "\"";
 }
 
-sal_Bool Export::PrepareTextToMerge(ByteString &rText, sal_uInt16 nTyp,
+sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp,
     rtl::OString &rLangIndex, ResData *pResData)
 {
     // position to merge in:
-    sal_uInt16 nStart = 0;
-    sal_uInt16 nEnd = 0;
+    sal_Int32 nStart = 0;
+    sal_Int32 nEnd = 0;
     ByteString sOldId = pResData->sId;
     ByteString sOldGId = pResData->sGId;
     ByteString sOldTyp = pResData->sResTyp;
@@ -1763,15 +1764,15 @@ sal_Bool Export::PrepareTextToMerge(ByteString &rText, sal_uInt16 nTyp,
                     rText = (*pCurEntry)[ SOURCE_LANGUAGE ];
             }
 
-            nStart = rText.Search( "\"" );
-            if ( nStart == STRING_NOTFOUND ) {
+            nStart = rText.indexOf( '"' );
+            if ( nStart == -1 ) {
                 rText = sOrigText;
                 return sal_False;
             }
 
             sal_Bool bFound = sal_False;
-            for ( nEnd = nStart + 1; nEnd < rText.Len() && !bFound; nEnd++ ) {
-                if ( rText.GetChar( nEnd ) == '\"' )
+            for ( nEnd = nStart + 1; nEnd < rText.getLength() && !bFound; nEnd++ ) {
+                if ( rText[nEnd] == '\"' )
                     bFound = sal_True;
             }
             if ( !bFound ) {
@@ -1781,8 +1782,8 @@ sal_Bool Export::PrepareTextToMerge(ByteString &rText, sal_uInt16 nTyp,
 
             nEnd --;
             sLastListLine = rText;
-            if (( sLastListLine.Search( ">" ) != STRING_NOTFOUND ) &&
-                ( sLastListLine.Search( "<" ) == STRING_NOTFOUND ))
+            if (( sLastListLine.indexOf( '>' ) != -1 ) &&
+                ( sLastListLine.indexOf( '<' ) == -1 ))
             {
                 ByteString sTmp = sLastListLine;
                 sLastListLine = "<";
@@ -1805,16 +1806,16 @@ sal_Bool Export::PrepareTextToMerge(ByteString &rText, sal_uInt16 nTyp,
         case STRING_TYP_QUICKHELPTEXT :
         case STRING_TYP_TITLE :
         {
-            nStart = rText.Search( "=" );
-            if ( nStart == STRING_NOTFOUND ) {
+            nStart = rText.indexOf( "=" );
+            if ( nStart == -1 ) {
                 rText = sOrigText;
                 return sal_False;
             }
 
             nStart++;
             sal_Bool bFound = sal_False;
-            while(( nStart < rText.Len()) && !bFound ) {
-                if (( rText.GetChar( nStart ) != ' ' ) && ( rText.GetChar( nStart ) != '\t' ))
+            while(( nStart < rText.getLength()) && !bFound ) {
+                if (( rText[nStart] != ' ' ) && ( rText[nStart] != '\t' ))
                     bFound = sal_True;
                 else
                     nStart ++;
@@ -1827,13 +1828,13 @@ sal_Bool Export::PrepareTextToMerge(ByteString &rText, sal_uInt16 nTyp,
             }
 
             // position to end mergeing in
-            nEnd = rText.Len() - 1;
+            nEnd = rText.getLength() - 1;
             bFound = sal_False;
 
             while (( nEnd > nStart ) && !bFound ) {
-                if (( rText.GetChar( nEnd ) != ' ' ) && ( rText.GetChar( nEnd ) != '\t' ) &&
-                    ( rText.GetChar( nEnd ) != '\n' ) && ( rText.GetChar( nEnd ) != ';' ) &&
-                    ( rText.GetChar( nEnd ) != '{' ) && ( rText.GetChar( nEnd ) != '\\' ))
+                if (( rText[nEnd] != ' ' ) && ( rText[nEnd] != '\t' ) &&
+                    ( rText[nEnd] != '\n' ) && ( rText[nEnd] != ';' ) &&
+                    ( rText[nEnd] != '{' ) && ( rText[nEnd] != '\\' ))
                 {
                     bFound = sal_True;
                 }
@@ -1866,9 +1867,9 @@ sal_Bool Export::PrepareTextToMerge(ByteString &rText, sal_uInt16 nTyp,
         return sal_False; // no data found
     }
 
-    ByteString sContent;
+    rtl::OString sContent;
     pEntrys->GetTransex3Text(sContent, nTyp, rLangIndex);
-    if (!sContent.Len() && (!Export::isSourceLanguage(rLangIndex)))
+    if (sContent.isEmpty() && (!Export::isSourceLanguage(rLangIndex)))
     {
         rText = sOrigText;
         return sal_False; // no data found
@@ -1877,8 +1878,8 @@ sal_Bool Export::PrepareTextToMerge(ByteString &rText, sal_uInt16 nTyp,
     if (Export::isSourceLanguage(rLangIndex))
         return sal_False;
 
-    ByteString sPostFix( rText.Copy( ++nEnd ));
-    rText.Erase( nStart );
+    ByteString sPostFix( rText.copy( ++nEnd ));
+    rText = rText.copy(0, nStart);
 
     ConvertMergeContent( sContent );
 
@@ -1920,9 +1921,9 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
                 for( unsigned int n = 0; n < aLanguages.size(); n++ ){
                     sCur = aLanguages[ n ];
 
-                    ByteString sText;
+                    rtl::OString sText;
                     sal_Bool bText = pEntry->GetTransex3Text( sText, STRING_TYP_TEXT, sCur , sal_True );
-                    if ( bText && sText.Len() && sText != "-" ) {
+                    if ( bText && !sText.isEmpty() && sText != "-" ) {
                         ByteString sOutput;
                         if ( bNextMustBeDefineEOL)  {
                             if ( bFirst )
@@ -1972,9 +1973,9 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
                 for( unsigned int n = 0; n < aLanguages.size(); n++ ){
                     sCur = aLanguages[ n ];
 
-                    ByteString sText;
+                    rtl::OString sText;
                     sal_Bool bText = pEntry->GetTransex3Text( sText, STRING_TYP_QUICKHELPTEXT, sCur, sal_True );
-                    if ( bText && sText.Len() && sText != "-" ) {
+                    if ( bText && !sText.isEmpty() && sText != "-" ) {
                         ByteString sOutput;
                         if ( bNextMustBeDefineEOL)  {
                             if ( bFirst )
@@ -2018,9 +2019,9 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
                 for( unsigned int n = 0; n < aLanguages.size(); n++ ){
                     sCur = aLanguages[ n ];
 
-                ByteString sText;
+                    rtl::OString sText;
                     sal_Bool bText = pEntry->GetTransex3Text( sText, STRING_TYP_TITLE, sCur, sal_True );
-                    if ( bText && sText.Len() && sText != "-" ) {
+                    if ( bText && !sText.isEmpty() && sText != "-" ) {
                         ByteString sOutput;
                         if ( bNextMustBeDefineEOL)  {
                             if ( bFirst )
@@ -2098,13 +2099,13 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
                             nMaxIndex = pList->GetSourceLanguageListEntryCount();
                         pEntrys = pMergeDataFile->GetPFormEntrys( pResData );
                         while( pEntrys  && ( nLIndex < nMaxIndex )) {
-                            ByteString sText;
+                            rtl::OString sText;
                             sal_Bool bText;
                             bText = pEntrys->GetTransex3Text( sText, STRING_TYP_TEXT, sCur, sal_True );
                             if( !bText )
                                 bText = pEntrys->GetTransex3Text( sText , STRING_TYP_TEXT, SOURCE_LANGUAGE , sal_False );
 
-                            if ( bText && sText.Len())
+                            if ( bText && !sText.isEmpty())
                             {
                                 if ( nIdx == 1 )
                                 {
@@ -2148,31 +2149,31 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
                                     }
                                     WriteToMerged(sHead.makeStringAndClear() , true);
                                 }
-                                ByteString sLine;
+                                rtl::OString sLine;
                                 if ( pList && (*pList)[ nLIndex ] )
                                     sLine = ( *(*pList)[ nLIndex ])[ SOURCE_LANGUAGE ];
-                                if ( !sLine.Len())
+                                if ( sLine.isEmpty())
                                     sLine = sLastListLine;
 
-                                if ( sLastListLine.Search( "<" ) != STRING_NOTFOUND ) {
+                                if ( sLastListLine.indexOf( '<' ) != -1 ) {
                                     if (( nT != LIST_UIENTRIES ) &&
-                                        (( sLine.Search( "{" ) == STRING_NOTFOUND ) ||
-                                        ( sLine.Search( "{" ) >= sLine.Search( "\"" ))) &&
-                                        (( sLine.Search( "<" ) == STRING_NOTFOUND ) ||
-                                        ( sLine.Search( "<" ) >= sLine.Search( "\"" ))))
+                                        (( sLine.indexOf( '{' ) == -1 ) ||
+                                        ( sLine.indexOf( '{' ) >= sLine.indexOf( '"' ))) &&
+                                        (( sLine.indexOf( '<' ) == -1 ) ||
+                                        ( sLine.indexOf( '<' ) >= sLine.indexOf( '"' ))))
                                     {
-                                        sLine.SearchAndReplace( "\"", "< \"" );
+                                        helper::searchAndReplace(&sLine, "\"", "< \"" );
                                     }
                                 }
 
-                                sal_uInt16 nStart, nEnd;
-                                nStart = sLine.Search( "\"" );
+                                sal_Int32 nStart, nEnd;
+                                nStart = sLine.indexOf( '"' );
 
                                 ByteString sPostFix;
                                 if( !bPairedList ){
-                                    nEnd = sLine.SearchBackward( '\"' );
-                                    sPostFix = ByteString( sLine.Copy( ++nEnd ));
-                                    sLine.Erase( nStart );
+                                    nEnd = sLine.lastIndexOf( '"' );
+                                    sPostFix = sLine.copy( ++nEnd );
+                                    sLine = sLine.copy(0, nStart);
                                 }
 
 
@@ -2251,20 +2252,20 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
             sal_uLong nMaxIndex = 0;
             if ( pList )
                 nMaxIndex = pList->GetSourceLanguageListEntryCount();
-            ByteString sLine;
+            rtl::OString sLine;
             if ( pList && (*pList)[ nListIndex ] )
                 sLine = ( *(*pList)[ nListIndex ])[ SOURCE_LANGUAGE ];
-            if ( !sLine.Len())
+            if ( sLine.isEmpty())
                 sLine = sLastListLine;
 
-            if ( sLastListLine.Search( "<" ) != STRING_NOTFOUND ) {
+            if ( sLastListLine.indexOf( '<' ) != -1 ) {
                 if (( nList != LIST_UIENTRIES ) &&
-                    (( sLine.Search( "{" ) == STRING_NOTFOUND ) ||
-                    ( sLine.Search( "{" ) >= sLine.Search( "\"" ))) &&
-                    (( sLine.Search( "<" ) == STRING_NOTFOUND ) ||
-                    ( sLine.Search( "<" ) >= sLine.Search( "\"" ))))
+                    (( sLine.indexOf( '{' ) == -1 ) ||
+                    ( sLine.indexOf( '{' ) >= sLine.indexOf( '"' ))) &&
+                    (( sLine.indexOf( '<' ) == -1 ) ||
+                    ( sLine.indexOf( '<' ) >= sLine.indexOf( '"' ))))
                 {
-                    sLine.SearchAndReplace( "\"", "< \"" );
+                    helper::searchAndReplace(&sLine, "\"", "< \"" );
                 }
             }
 
@@ -2279,7 +2280,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
                 nListIndex++;
                 if ( pList && (*pList)[ nListIndex ])
                     sLine = ( *(*pList)[ nListIndex ])[ SOURCE_LANGUAGE ];
-                if ( !sLine.Len())
+                if ( sLine.isEmpty())
                     sLine = sLastListLine;
                 sLine += " ;";
             }
@@ -2289,12 +2290,12 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
     pParseQueue->bMflag = false;
 }
 
-ByteString Export::MergePairedList( ByteString& sLine , ByteString& sText ){
+rtl::OString Export::MergePairedList( rtl::OString const & sLine , rtl::OString const & sText ){
 // < "xy" ; IDENTIFIER ; >
-    ByteString sPre  = sLine.Copy( 0 , sLine.Search('\"') );
-    ByteString sPost = sLine.Copy( sLine.SearchBackward('\"') + 1 , sLine.Len() );
-    sPre.Append( sText );
-    sPre.Append( sPost );
+    rtl::OString sPre  = sLine.copy( 0 , sLine.indexOf('"') );
+    rtl::OString sPost = sLine.copy( sLine.lastIndexOf('"') + 1 );
+    sPre += sText;
+    sPre += sPost;
     return sPre;
 }
 
diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx
index 1c0af7d..ee4cb09 100644
--- a/l10ntools/source/export2.cxx
+++ b/l10ntools/source/export2.cxx
@@ -106,13 +106,13 @@ void Export::DumpExportList(const rtl::OString& rListName, ExportList& aList)
 }
 
 void Export::DumpMap(const rtl::OString& rMapName,
-    ByteStringHashMap& aMap)
+    OStringHashMap& aMap)
 {
     if( rMapName.getLength() )
         printf("MapName %s\n", rMapName.getStr());
     if( aMap.size() < 1 )
         return;
-    for(ByteStringHashMap::const_iterator idbg = aMap.begin(); idbg != aMap.end(); ++idbg)
+    for(OStringHashMap::const_iterator idbg = aMap.begin(); idbg != aMap.end(); ++idbg)
     {
         ByteString a( idbg->first );
         ByteString b( idbg->second );
@@ -143,24 +143,24 @@ std::vector<rtl::OString> Export::aLanguages       = std::vector<rtl::OString>()
 std::vector<rtl::OString> Export::aForcedLanguages = std::vector<rtl::OString>();
 
 /*****************************************************************************/
-void Export::QuotHTML( ByteString &rString )
+rtl::OString Export::QuoteHTML( rtl::OString const &rString )
 /*****************************************************************************/
 {
     rtl::OStringBuffer sReturn;
-    for ( sal_uInt16 i = 0; i < rString.Len(); i++ ) {
-        ByteString sTemp = rString.Copy( i );
-        if ( sTemp.Search( "<Arg n=" ) == 0 ) {
-            while ( i < rString.Len() && rString.GetChar( i ) != '>' ) {
-                 sReturn.append(rString.GetChar(i));
+    for ( sal_Int32 i = 0; i < rString.getLength(); i++ ) {
+        rtl::OString sTemp = rString.copy( i );
+        if ( sTemp.match( "<Arg n=" ) ) {
+            while ( i < rString.getLength() && rString[i] != '>' ) {
+                 sReturn.append(rString[i]);
                 i++;
             }
-            if ( rString.GetChar( i ) == '>' ) {
+            if ( rString[i] == '>' ) {
                 sReturn.append('>');
                 i++;
             }
         }
-        if ( i < rString.Len()) {
-            switch ( rString.GetChar( i )) {
+        if ( i < rString.getLength()) {
+            switch ( rString[i]) {
                 case '<':
                     sReturn.append("&lt;");
                 break;
@@ -178,20 +178,20 @@ void Export::QuotHTML( ByteString &rString )
                 break;
 
                 case '&':
-                    if ((( i + 4 ) < rString.Len()) &&
-                        ( rString.Copy( i, 5 ) == "&amp;" ))
-                            sReturn.append(rString.GetChar(i));
+                    if ((( i + 4 ) < rString.getLength()) &&
+                        ( rString.copy( i, 5 ) == "&amp;" ))
+                            sReturn.append(rString[i]);
                     else
                         sReturn.append("&amp;");
                 break;
 
                 default:
-                    sReturn.append(rString.GetChar(i));
+                    sReturn.append(rString[i]);
                 break;
             }
         }
     }
-    rString = sReturn.makeStringAndClear();
+    return sReturn.makeStringAndClear();
 }
 
 void Export::RemoveUTF8ByteOrderMarker( rtl::OString &rString )
@@ -298,45 +298,32 @@ bool Export::CopyFile(const rtl::OString& rSource, const rtl::OString& rDest)
 }
 
 /*****************************************************************************/
-void Export::UnquotHTML( ByteString &rString )
+rtl::OString Export::UnquoteHTML( rtl::OString const &rString )
 /*****************************************************************************/
 {
     rtl::OStringBuffer sReturn;
-
-    while ( rString.Len())
-    {
-        if ( rString.Copy( 0, 5 ) == "&amp;" )
-        {
+    for (sal_Int32 i = 0; i != rString.getLength();) {
+        if (rString.match("&amp;", i)) {
             sReturn.append('&');
-            rString.Erase( 0, 5 );
-        }
-        else if ( rString.Copy( 0, 4 ) == "&lt;" )
-        {
+            i += RTL_CONSTASCII_LENGTH("&amp;");
+        } else if (rString.match("&lt;", i)) {
             sReturn.append('<');
-            rString.Erase( 0, 4 );
-        }
-        else if ( rString.Copy( 0, 4 ) == "&gt;" )
-        {
+            i += RTL_CONSTASCII_LENGTH("&lt;");
+        } else if (rString.match("&gt;", i)) {
             sReturn.append('>');
-            rString.Erase( 0, 4 );
-        }
-        else if ( rString.Copy( 0, 6 ) == "&quot;" )
-        {
-            sReturn.append('\"');;
-            rString.Erase( 0, 6 );
-        }
-        else if ( rString.Copy( 0, 6 ) == "&apos;" )
-        {
+            i += RTL_CONSTASCII_LENGTH("&gt;");
+        } else if (rString.match("&quot;", i)) {
+            sReturn.append('"');
+            i += RTL_CONSTASCII_LENGTH("&quot;");
+        } else if (rString.match("&apos;", i)) {
             sReturn.append('\'');
-            rString.Erase( 0, 6 );
-        }
-        else
-        {
-            sReturn.append(rString.GetChar(0));
-            rString.Erase( 0, 1 );
+            i += RTL_CONSTASCII_LENGTH("&apos;");
+        } else {
+            sReturn.append(rString[i]);
+            ++i;
         }
     }
-    rString = sReturn.makeStringAndClear();
+    return sReturn.makeStringAndClear();
 }
 
 bool Export::isSourceLanguage(const rtl::OString &rLanguage)
@@ -357,7 +344,7 @@ void Export::InitLanguages( bool bMergeMode ){
     if( !isInitialized )
     {
         ByteString sTmp;
-        ByteStringBoolHashMap aEnvLangs;
+        OStringBoolHashMap aEnvLangs;
 
         sal_Int32 nIndex = 0;
         do
@@ -380,7 +367,7 @@ void Export::InitLanguages( bool bMergeMode ){
 void Export::InitForcedLanguages( bool bMergeMode ){
 /*****************************************************************************/
     ByteString sTmp;
-    ByteStringBoolHashMap aEnvLangs;
+    OStringBoolHashMap aEnvLangs;
 
     sal_Int32 nIndex = 0;
     do
@@ -409,7 +396,7 @@ rtl::OString Export::GetTimeStamp()
 
 /*****************************************************************************/
 sal_Bool Export::ConvertLineEnds(
-    ByteString sSource, ByteString sDestination )
+    rtl::OString const & sSource, rtl::OString const & sDestination )
 /*****************************************************************************/
 {
     String sSourceFile( sSource, RTL_TEXTENCODING_ASCII_US );
@@ -445,7 +432,7 @@ sal_Bool Export::ConvertLineEnds(
 }
 
 /*****************************************************************************/
-ByteString Export::GetNativeFile( ByteString sSource )
+rtl::OString Export::GetNativeFile( rtl::OString const & sSource )
 /*****************************************************************************/
 {
     DirEntry aTemp( GetTempFile());
@@ -455,7 +442,7 @@ ByteString Export::GetNativeFile( ByteString sSource )
         if ( ConvertLineEnds( sSource, sReturn ))
             return sReturn;
 
-    return "";
+    return rtl::OString();
 }
 
 const char* Export::GetEnv( const char *pVar )
diff --git a/l10ntools/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx
index 8d5544f..15ae5c5 100644
--- a/l10ntools/source/gsicheck.cxx
+++ b/l10ntools/source/gsicheck.cxx
@@ -32,6 +32,7 @@
 
 #include <rtl/strbuf.hxx>
 #include <comphelper/string.hxx>
+#include "helper.hxx"
 #include "tagtest.hxx"
 #include "gsicheck.hxx"
 
@@ -41,23 +42,23 @@ using comphelper::string::getTokenCount;
 #define MAX_GID_LID_LEN 250
 
 /*****************************************************************************/
-void PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix,
-    ByteString aContext, sal_Bool bPrintContext, sal_uLong nLine, ByteString aUniqueId = ByteString() )
+void PrintMessage( rtl::OString const & aType, rtl::OString const & aMsg, rtl::OString const & aPrefix,
+                   rtl::OString const & aContext, sal_Bool bPrintContext, sal_uLong nLine, rtl::OString aUniqueId = rtl::OString() )
 /*****************************************************************************/
 {
-    fprintf( stdout, "%s %s, Line %lu", aType.GetBuffer(), aPrefix.GetBuffer(), nLine );
-    if ( aUniqueId.Len() )
-        fprintf( stdout, ", UniqueID %s", aUniqueId.GetBuffer() );
-    fprintf( stdout, ": %s", aMsg.GetBuffer() );
+    fprintf( stdout, "%s %s, Line %lu", aType.getStr(), aPrefix.getStr(), nLine );
+    if ( !aUniqueId.isEmpty() )
+        fprintf( stdout, ", UniqueID %s", aUniqueId.getStr() );
+    fprintf( stdout, ": %s", aMsg.getStr() );
 
     if ( bPrintContext )
-        fprintf( stdout, "  \"%s\"", aContext.GetBuffer() );
+        fprintf( stdout, "  \"%s\"", aContext.getStr() );
     fprintf( stdout, "\n" );
 }
 
 /*****************************************************************************/
-void PrintError( ByteString aMsg, ByteString aPrefix,
-    ByteString aContext, sal_Bool bPrintContext, sal_uLong nLine, ByteString aUniqueId = ByteString() )
+void PrintError( rtl::OString const & aMsg, rtl::OString const & aPrefix,
+                 rtl::OString const & aContext, sal_Bool bPrintContext, sal_uLong nLine, rtl::OString const & aUniqueId = rtl::OString() )
 /*****************************************************************************/
 {
     PrintMessage( "Error:", aMsg, aPrefix, aContext, bPrintContext, nLine, aUniqueId );
@@ -139,18 +140,29 @@ void LazySvFileStream::LazyOpen()
 //
 
 /*****************************************************************************/
-GSILine::GSILine( const ByteString &rLine, sal_uLong nLine )
+GSILine::GSILine( const rtl::OString &rLine, sal_uLong nLine )
 /*****************************************************************************/
-                : ByteString( rLine )
-                , nLineNumber( nLine )
+                : nLineNumber( nLine )
                 , bOK( sal_True )
                 , bFixed ( sal_False )
+                , data_( rLine )
 {
     if ( getTokenCount(rLine, '\t') == 15 )
     {
         aFormat = FORMAT_SDF;
         aUniqId = getToken(rLine, 0, '\t');
-        aUniqId.Append("/").Append( getToken(rLine, 1, '\t') ).Append("/").Append( getToken(rLine, 3, '\t') ).Append("/").Append( getToken(rLine, 4, '\t') ).Append("/").Append( getToken(rLine, 5, '\t') ).Append("/").Append( getToken(rLine, 6, '\t') ).Append("/").Append( getToken(rLine, 7, '\t') );
+        aUniqId += "/";
+        aUniqId += getToken(rLine, 1, '\t');
+        aUniqId += "/";
+        aUniqId += getToken(rLine, 3, '\t');
+        aUniqId += "/";
+        aUniqId += getToken(rLine, 4, '\t');
+        aUniqId += "/";
+        aUniqId += getToken(rLine, 5, '\t');
+        aUniqId += "/";
+        aUniqId += getToken(rLine, 6, '\t');
+        aUniqId += "/";
+        aUniqId += getToken(rLine, 7, '\t');

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list