diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-04-07 12:06:47 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-04-07 14:23:11 +0200 |
commit | 1946794ae09ba732022fe6a74ea45e304ab70b84 (patch) | |
tree | e32bd7ba61fa021ecc7f8c85959df8ca837d6e81 /l10ntools | |
parent | Typo in comment in resmgr.hxx (diff) | |
download | core-1946794ae09ba732022fe6a74ea45e304ab70b84.tar.gz core-1946794ae09ba732022fe6a74ea45e304ab70b84.zip |
mass removal of rtl:: prefixes for O(U)String*
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk
have kept them, in order not to break external API (the automatic using declaration
is LO-internal).
Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/inc/cfgmerge.hxx | 66 | ||||
-rw-r--r-- | l10ntools/inc/export.hxx | 126 | ||||
-rw-r--r-- | l10ntools/inc/helpmerge.hxx | 14 | ||||
-rw-r--r-- | l10ntools/inc/lngmerge.hxx | 14 | ||||
-rw-r--r-- | l10ntools/inc/xmlparse.hxx | 102 | ||||
-rw-r--r-- | l10ntools/inc/xrmmerge.hxx | 76 | ||||
-rw-r--r-- | l10ntools/source/cfgmerge.cxx | 102 | ||||
-rw-r--r-- | l10ntools/source/export.cxx | 290 | ||||
-rw-r--r-- | l10ntools/source/helpmerge.cxx | 52 | ||||
-rw-r--r-- | l10ntools/source/lngmerge.cxx | 62 | ||||
-rw-r--r-- | l10ntools/source/merge.cxx | 70 | ||||
-rw-r--r-- | l10ntools/source/uimerge.cxx | 24 | ||||
-rw-r--r-- | l10ntools/source/xmlparse.cxx | 178 | ||||
-rw-r--r-- | l10ntools/source/xrmmerge.cxx | 140 |
14 files changed, 658 insertions, 658 deletions
diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx index bbe68eb14f85..c34ba06d5f9c 100644 --- a/l10ntools/inc/cfgmerge.hxx +++ b/l10ntools/inc/cfgmerge.hxx @@ -28,7 +28,7 @@ #include "boost/unordered_map.hpp" #include "po.hxx" -typedef boost::unordered_map<rtl::OString, rtl::OString, rtl::OStringHash> OStringHashMap; +typedef boost::unordered_map<OString, OString, OStringHash> OStringHashMap; // @@ -41,22 +41,22 @@ friend class CfgParser; friend class CfgExport; friend class CfgMerge; private: - rtl::OString sTagType; - rtl::OString sIdentifier; + OString sTagType; + OString sIdentifier; - rtl::OString sResTyp; + OString sResTyp; - rtl::OString sTextTag; - rtl::OString sEndTextTag; + OString sTextTag; + OString sEndTextTag; OStringHashMap sText; public: - CfgStackData(const rtl::OString &rTag, const rtl::OString &rId) + CfgStackData(const OString &rTag, const OString &rId) : sTagType( rTag ), sIdentifier( rId ) {} - const rtl::OString &GetTagType() { return sTagType; } - const rtl::OString &GetIdentifier() { return sIdentifier; } + const OString &GetTagType() { return sTagType; } + const OString &GetIdentifier() { return sIdentifier; } }; @@ -75,7 +75,7 @@ public: CfgStack() {} ~CfgStack(); - CfgStackData *Push(const rtl::OString &rTag, const rtl::OString &rId); + CfgStackData *Push(const OString &rTag, const OString &rId); CfgStackData *Pop() { if (maList.empty()) @@ -87,7 +87,7 @@ public: CfgStackData *GetStackData(); - rtl::OString GetAccessPath( size_t nPos ); + OString GetAccessPath( size_t nPos ); size_t size() const { return maList.size(); } }; @@ -99,11 +99,11 @@ public: class CfgParser { protected: - rtl::OString sCurrentResTyp; - rtl::OString sCurrentIsoLang; - rtl::OString sCurrentText; + OString sCurrentResTyp; + OString sCurrentIsoLang; + OString sCurrentText; - rtl::OString sLastWhitespace; + OString sLastWhitespace; CfgStack aStack; CfgStackData *pStackData; @@ -111,24 +111,24 @@ protected: sal_Bool bLocalize; virtual void WorkOnText( - rtl::OString &rText, - const rtl::OString &rLangIndex )=0; + OString &rText, + const OString &rLangIndex )=0; virtual void WorkOnResourceEnd()=0; - virtual void Output(const rtl::OString & rOutput)=0; + virtual void Output(const OString & rOutput)=0; - void Error(const rtl::OString &rError); + void Error(const OString &rError); private: int ExecuteAnalyzedToken( int nToken, char *pToken ); - std::vector<rtl::OString> aLanguages; + std::vector<OString> aLanguages; void AddText( - rtl::OString &rText, - const rtl::OString &rIsoLang, - const rtl::OString &rResTyp ); + OString &rText, + const OString &rIsoLang, + const OString &rResTyp ); - sal_Bool IsTokenClosed(const rtl::OString &rToken); + sal_Bool IsTokenClosed(const OString &rToken); public: CfgParser(); @@ -144,19 +144,19 @@ public: class CfgExport : public CfgParser { private: - rtl::OString sPath; - std::vector<rtl::OString> aLanguages; + OString sPath; + std::vector<OString> aLanguages; PoOfstream pOutputStream; protected: virtual void WorkOnText( - rtl::OString &rText, - const rtl::OString &rIsoLang + OString &rText, + const OString &rIsoLang ); void WorkOnResourceEnd(); - void Output(const rtl::OString& rOutput); + void Output(const OString& rOutput); public: CfgExport( const OString &rOutputFile, @@ -174,20 +174,20 @@ class CfgMerge : public CfgParser { private: MergeDataFile *pMergeDataFile; - std::vector<rtl::OString> aLanguages; + std::vector<OString> aLanguages; ResData *pResData; - rtl::OString sFilename; + OString sFilename; sal_Bool bEnglish; std::ofstream pOutputStream; protected: - virtual void WorkOnText(rtl::OString &rText, const rtl::OString &rLangIndex); + virtual void WorkOnText(OString &rText, const OString &rLangIndex); void WorkOnResourceEnd(); - void Output(const rtl::OString& rOutput); + void Output(const OString& rOutput); public: CfgMerge( const OString &rMergeSource, const OString &rOutputFile, diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index 8dc9ab8a3273..9575dcda564e 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -46,16 +46,16 @@ class PFormEntrys; class MergeData; -typedef boost::unordered_map<rtl::OString, rtl::OString, rtl::OStringHash> +typedef boost::unordered_map<OString, OString, OStringHash> OStringHashMap; -typedef boost::unordered_map<rtl::OString, bool, rtl::OStringHash> +typedef boost::unordered_map<OString, bool, OStringHash> OStringBoolHashMap; -typedef boost::unordered_map<rtl::OString, PFormEntrys*, rtl::OStringHash> +typedef boost::unordered_map<OString, PFormEntrys*, OStringHash> PFormEntrysHashMap; -typedef boost::unordered_map<rtl::OString, MergeData*, rtl::OStringHash> +typedef boost::unordered_map<OString, MergeData*, OStringHash> MergeDataHashMap; #define SOURCE_LANGUAGE "en-US" @@ -109,10 +109,10 @@ public: class ResData { public: - ResData(const rtl::OString &rPF, const rtl::OString &rGId); - ResData(const rtl::OString &rPF, const rtl::OString &rGId , const rtl::OString &rFilename); + ResData(const OString &rPF, const OString &rGId); + ResData(const OString &rPF, const OString &rGId , const OString &rFilename); ~ResData(); - sal_Bool SetId(const rtl::OString &rId, sal_uInt16 nLevel); + sal_Bool SetId(const OString &rId, sal_uInt16 nLevel); sal_Int32 nWidth; sal_uInt16 nChildIndex; @@ -128,11 +128,11 @@ public: sal_Bool bRestMerged; - rtl::OString sResTyp; - rtl::OString sId; - rtl::OString sGId; - rtl::OString sHelpId; - rtl::OString sFilename; + OString sResTyp; + OString sId; + OString sGId; + OString sHelpId; + OString sFilename; OStringHashMap sText; sal_uInt16 nTextRefId; @@ -146,7 +146,7 @@ public: OStringHashMap sTitle; sal_uInt16 nTitleRefId; - rtl::OString sTextTyp; + OString sTextTyp; ExportList *pStringList; ExportList *pUIEntries; @@ -154,7 +154,7 @@ public: ExportList *pFilterList; ExportList *pPairedList; - rtl::OString sPForm; + OString sPForm; }; @@ -196,57 +196,57 @@ private: ResStack aResStack; // stack for parsing recursive - rtl::OString sActPForm; // hold cur. system + OString sActPForm; // hold cur. system sal_Bool bDefine; // cur. res. in a define? sal_Bool bNextMustBeDefineEOL; // define but no \ at lineend std::size_t nLevel; // res. recursiv? how deep? sal_uInt16 nList; // cur. res. is String- or FilterList - rtl::OString m_sListLang; + OString m_sListLang; std::size_t nListIndex; std::size_t nListLevel; bool bSkipFile; sal_Bool bMergeMode; - rtl::OString sMergeSrc; - rtl::OString sLastListLine; + OString sMergeSrc; + OString sLastListLine; sal_Bool bError; // any errors while export? sal_Bool bReadOver; sal_Bool bDontWriteOutput; - rtl::OString sLastTextTyp; + OString sLastTextTyp; bool isInitialized; - rtl::OString sFilename; - rtl::OString sLanguages; + OString sFilename; + OString sLanguages; - std::vector<rtl::OString> aLanguages; + std::vector<OString> aLanguages; sal_Bool WriteData( ResData *pResData, sal_Bool bCreateNew = sal_False );// called befor dest. cur ResData sal_Bool WriteExportList( ResData *pResData, ExportList *pExportList, - const rtl::OString &rTyp, sal_Bool bCreateNew = sal_False ); + const OString &rTyp, sal_Bool bCreateNew = sal_False ); - rtl::OString MergePairedList( rtl::OString const & sLine , rtl::OString const & sText ); + OString MergePairedList( OString const & sLine , OString const & sText ); - rtl::OString FullId(); // creates cur. GID + OString FullId(); // creates cur. GID - rtl::OString GetPairedListID(const rtl::OString & rText); - rtl::OString GetPairedListString(const rtl::OString& rText); - rtl::OString StripList(const rtl::OString& rText); + OString GetPairedListID(const OString & rText); + OString GetPairedListString(const OString& rText); + OString StripList(const OString& rText); - void InsertListEntry(const rtl::OString &rText, const rtl::OString &rLine); - void CleanValue( rtl::OString &rValue ); - rtl::OString GetText(const rtl::OString &rSource, int nToken); + void InsertListEntry(const OString &rText, const OString &rLine); + void CleanValue( OString &rValue ); + OString GetText(const OString &rSource, int nToken); - sal_Bool PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp, - rtl::OString &rLangIndex, ResData *pResData); - void ResData2Output( PFormEntrys *pEntry, sal_uInt16 nType, const rtl::OString& rTextType ); + sal_Bool PrepareTextToMerge(OString &rText, sal_uInt16 nTyp, + OString &rLangIndex, ResData *pResData); + void ResData2Output( PFormEntrys *pEntry, sal_uInt16 nType, const OString& rTextType ); void MergeRest( ResData *pResData, sal_uInt16 nMode = MERGE_MODE_NORMAL ); - void ConvertMergeContent( rtl::OString &rText ); + void ConvertMergeContent( OString &rText ); - void WriteToMerged(const rtl::OString &rText , bool bSDFContent); + void WriteToMerged(const OString &rText , bool bSDFContent); void SetChildWithText(); void InitLanguages( bool bMergeMode = false ); - void CutComment( rtl::OString &rText ); + void CutComment( OString &rText ); public: Export(const OString &rOutput, const OString &rLanguage); @@ -273,8 +273,8 @@ class PFormEntrys { friend class MergeDataFile; private: - rtl::OString data_; //TODO - rtl::OString sHelpText; // empty string + OString data_; //TODO + OString sHelpText; // empty string OStringHashMap sText; OStringBoolHashMap bTextFirst; OStringHashMap sQuickHelpText; @@ -283,9 +283,9 @@ private: OStringBoolHashMap bTitleFirst; public: - PFormEntrys( const rtl::OString &rPForm ) : data_( rPForm ) {}; - void InsertEntry(const rtl::OString &rId, const rtl::OString &rText, - const rtl::OString &rQuickHelpText, const rtl::OString &rTitle) + PFormEntrys( const OString &rPForm ) : data_( rPForm ) {}; + void InsertEntry(const OString &rId, const OString &rText, + const OString &rQuickHelpText, const OString &rTitle) { sText[ rId ] = rText; @@ -295,8 +295,8 @@ public: sTitle[ rId ] = rTitle; bTitleFirst[ rId ] = true; } - 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 ); + sal_Bool GetText( OString &rReturn, sal_uInt16 nTyp, const OString &nLangIndex, sal_Bool bDel = sal_False ); + sal_Bool GetTransex3Text( OString &rReturn, sal_uInt16 nTyp, const OString &nLangIndex, sal_Bool bDel = sal_False ); }; @@ -313,19 +313,19 @@ class MergeDataFile; class MergeData { public: - rtl::OString sTyp; - rtl::OString sGID; - rtl::OString sLID; - rtl::OString sFilename; + OString sTyp; + OString sGID; + OString sLID; + OString sFilename; PFormEntrysHashMap aMap; public: - MergeData( const rtl::OString &rTyp, const rtl::OString &rGID, const rtl::OString &rLID , const rtl::OString &rFilename ) + MergeData( const OString &rTyp, const OString &rGID, const OString &rLID , const OString &rFilename ) : sTyp( rTyp ), sGID( rGID ), sLID( rLID ) , sFilename( rFilename ) {}; ~MergeData(); PFormEntrys* GetPFormEntries(); void Insert( PFormEntrys* pfEntrys ); - PFormEntrys* GetPFObject( const rtl::OString &rPFO ); + PFormEntrys* GetPFObject( const OString &rPFO ); sal_Bool operator==( ResData *pData ); }; @@ -341,43 +341,43 @@ public: class MergeDataFile { private: - rtl::OString sErrorLog; + OString sErrorLog; MergeDataHashMap aMap; - std::set<rtl::OString> aLanguageSet; + std::set<OString> aLanguageSet; MergeData *GetMergeData( ResData *pResData , bool bCaseSensitve = false ); - void InsertEntry(const rtl::OString &rTYP, const rtl::OString &rGID, - const rtl::OString &rLID, const rtl::OString &rPFO, - const rtl::OString &nLang, const rtl::OString &rTEXT, - const rtl::OString &rQHTEXT, const rtl::OString &rTITLE, - const rtl::OString &sFilename, bool bCaseSensitive); + void InsertEntry(const OString &rTYP, const OString &rGID, + const OString &rLID, const OString &rPFO, + const OString &nLang, const OString &rTEXT, + const OString &rQHTEXT, const OString &rTITLE, + const OString &sFilename, bool bCaseSensitive); public: explicit MergeDataFile( - const rtl::OString &rFileName, const rtl::OString& rFile, + const OString &rFileName, const OString& rFile, bool bCaseSensitive, bool bWithQtz = true ); ~MergeDataFile(); - std::vector<rtl::OString> GetLanguages() const; + std::vector<OString> GetLanguages() const; const MergeDataHashMap& getMap() const { return aMap; } PFormEntrys *GetPFormEntrys( ResData *pResData ); PFormEntrys *GetPFormEntrysCaseSensitive( ResData *pResData ); - static rtl::OString CreateKey(const rtl::OString& rTYP, const rtl::OString& rGID, - const rtl::OString& rLID, const rtl::OString& rFilename , bool bCaseSensitive = false); + static OString CreateKey(const OString& rTYP, const OString& rGID, + const OString& rLID, const OString& rFilename , bool bCaseSensitive = false); }; class QueueEntry { public: - QueueEntry(int nTypVal, const rtl::OString &rLineVal) + QueueEntry(int nTypVal, const OString &rLineVal) : nTyp(nTypVal), sLine(rLineVal) { } int nTyp; - rtl::OString sLine; + OString sLine; }; class ParserQueue diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx index 1f11726182f6..95aad6d15ab3 100644 --- a/l10ntools/inc/helpmerge.hxx +++ b/l10ntools/inc/helpmerge.hxx @@ -27,18 +27,18 @@ class HelpParser { private: - rtl::OString sHelpFile; + OString sHelpFile; #if OSL_DEBUG_LEVEL > 2 /// Debugmethod, prints the content of the map to stdout - static void Dump(LangHashMap* rElem_in , const rtl::OString & sKey_in); + static void Dump(LangHashMap* rElem_in , const OString & sKey_in); /// Debugmethod, prints the content of the map to stdout static void Dump(XMLHashMap* rElem_in); #endif public: - HelpParser( const rtl::OString &rHelpFile ); + HelpParser( const OString &rHelpFile ); ~HelpParser(){}; /// Method append a PO file with the content of a parsed XML file @@ -48,13 +48,13 @@ public: /// Method merges the String from the POfile into XMLfile. Both Strings must /// point to existing files. - bool Merge( const rtl::OString &rPOFile_in, const rtl::OString &rDestinationFile_in , - const rtl::OString& sLanguage , MergeDataFile& aMergeDataFile ); + bool Merge( const OString &rPOFile_in, const OString &rDestinationFile_in , + const OString& sLanguage , MergeDataFile& aMergeDataFile ); private: - bool MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const rtl::OString& sLanguage , rtl::OString const & sPath ); + bool MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const OString& sLanguage , OString const & sPath ); - void ProcessHelp( LangHashMap* aLangHM , const rtl::OString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ); + void ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx index 8c5940cbdfee..8441824339ba 100644 --- a/l10ntools/inc/lngmerge.hxx +++ b/l10ntools/inc/lngmerge.hxx @@ -25,7 +25,7 @@ #include "common.hxx" #include "export.hxx" -typedef std::vector< rtl::OString* > LngLineList; +typedef std::vector< OString* > LngLineList; #define LNG_OK 0x0000 #define LNG_COULD_NOT_OPEN 0x0001 @@ -39,17 +39,17 @@ class LngParser private: sal_uInt16 nError; LngLineList *pLines; - rtl::OString sSource; + OString sSource; sal_Bool bULF; - std::vector<rtl::OString> aLanguages; + std::vector<OString> aLanguages; - bool isNextGroup(rtl::OString &sGroup_out, const rtl::OString &sLine_in); - void ReadLine(const rtl::OString &rLine_in, + bool isNextGroup(OString &sGroup_out, const OString &sLine_in); + void ReadLine(const OString &rLine_in, OStringHashMap &rText_inout); void WritePO(PoOfstream &aPOStream, OStringHashMap &rText_inout, - const rtl::OString &rActFileName, const rtl::OString &rID); + const OString &rActFileName, const OString &rID); public: - LngParser(const rtl::OString &rLngFile, + LngParser(const OString &rLngFile, sal_Bool bULFFormat); ~LngParser(); diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx index 55867d3f70ab..8daf546fcc7f 100644 --- a/l10ntools/inc/xmlparse.hxx +++ b/l10ntools/inc/xmlparse.hxx @@ -56,21 +56,21 @@ using namespace std; class XMLAttribute { private: - rtl::OUString sName; - rtl::OUString sValue; + OUString sName; + OUString sValue; public: /// creates an attribute XMLAttribute( - const rtl::OUString &rName, // attributes name - const rtl::OUString &rValue // attributes data + const OUString &rName, // attributes name + const OUString &rValue // attributes data ) : sName( rName ), sValue( rValue ) {} - rtl::OUString GetName() const { return sName; } - rtl::OUString GetValue() const { return sValue; } + OUString GetName() const { return sName; } + OUString GetValue() const { return sValue; } - void setValue(const rtl::OUString &rValue){sValue=rValue;} + void setValue(const OUString &rValue){sValue=rValue;} /// returns true if two attributes are equal and have the same value sal_Bool IsEqual( @@ -164,16 +164,16 @@ public: //------------------------------------------------------------------------- /// Mapping numeric Language code <-> XML Element -typedef boost::unordered_map<rtl::OString, XMLElement*, rtl::OStringHash> LangHashMap; +typedef boost::unordered_map<OString, XMLElement*, OStringHash> LangHashMap; /// Mapping XML Element string identifier <-> Language Map -typedef boost::unordered_map<rtl::OString, LangHashMap*, rtl::OStringHash> XMLHashMap; +typedef boost::unordered_map<OString, LangHashMap*, OStringHash> XMLHashMap; /// Mapping iso alpha string code <-> iso numeric code -typedef boost::unordered_map<rtl::OString, int, rtl::OStringHash> HashMap; +typedef boost::unordered_map<OString, int, OStringHash> HashMap; /// Mapping XML tag names <-> have localizable strings -typedef boost::unordered_map<rtl::OString, sal_Bool, rtl::OStringHash> TagMap; +typedef boost::unordered_map<OString, sal_Bool, OStringHash> TagMap; /** Holds information of a XML file, is root node of tree */ @@ -183,7 +183,7 @@ class XMLFile : public XMLParentNode { public: XMLFile( - const rtl::OUString &rFileName // the file name, empty if created from memory stream + const OUString &rFileName // the file name, empty if created from memory stream ); XMLFile( const XMLFile& obj ) ; ~XMLFile(); @@ -193,7 +193,7 @@ public: void Extract( XMLFile *pCur = NULL ); XMLHashMap* GetStrings(){return XMLStrings;} - void Write( rtl::OString const &rFilename ); + void Write( OString const &rFilename ); sal_Bool Write( ofstream &rStream , XMLNode *pCur = NULL ); bool CheckExportStatus( XMLParentNode *pCur = NULL );// , int pos = 0 ); @@ -203,25 +203,25 @@ public: virtual sal_uInt16 GetNodeType(); /// returns file name - rtl::OUString GetName() { return sFileName; } - void SetName( const rtl::OUString &rFilename ) { sFileName = rFilename; } - const std::vector<rtl::OString> getOrder(){ return order; } + OUString GetName() { return sFileName; } + void SetName( const OUString &rFilename ) { sFileName = rFilename; } + const std::vector<OString> getOrder(){ return order; } protected: // writes a string as UTF8 with dos line ends to a given stream - void WriteString( ofstream &rStream, const rtl::OUString &sString ); + void WriteString( ofstream &rStream, const OUString &sString ); void InsertL10NElement( XMLElement* pElement); // DATA - rtl::OUString sFileName; + OUString sFileName; - const rtl::OString ID, OLDREF, XML_LANG; + const OString ID, OLDREF, XML_LANG; TagMap nodes_localize; XMLHashMap* XMLStrings; - std::vector <rtl::OString> order; + std::vector <OString> order; }; /// An Utility class for XML @@ -245,9 +245,9 @@ public: class XMLElement : public XMLParentNode { private: - rtl::OUString sElementName; + OUString sElementName; XMLAttributeList *pAttributes; - rtl::OString project, + OString project, filename, id, sOldRef, @@ -261,7 +261,7 @@ public: /// create a element node XMLElement(){} XMLElement( - const rtl::OUString &rName, // the element name + const OUString &rName, // the element name XMLParentNode *Parent // parent node of this element ): XMLParentNode( Parent ), sElementName( rName ), @@ -283,34 +283,34 @@ public: virtual sal_uInt16 GetNodeType(); /// returns element name - rtl::OUString GetName() { return sElementName; } + OUString GetName() { return sElementName; } /// returns list of attributes of this element XMLAttributeList *GetAttributeList() { return pAttributes; } /// adds a new attribute to this element, typically used by parser - void AddAttribute( const rtl::OUString &rAttribute, const rtl::OUString &rValue ); + void AddAttribute( const OUString &rAttribute, const OUString &rValue ); - void ChangeLanguageTag( const rtl::OUString &rValue ); + void ChangeLanguageTag( const OUString &rValue ); // Return a Unicode String representation of this object OUString ToOUString(); - 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 SetProject ( OString const & prj ){ project = prj; } + void SetFileName ( OString const & fn ){ filename = fn; } + void SetId ( OString const & theId ){ id = theId; } + void SetResourceType ( OString const & rt ){ resourceType = rt; } + void SetLanguageId ( OString const & lid ){ languageId = lid; } void SetPos ( int nPos_in ){ nPos = nPos_in; } - void SetOldRef ( rtl::OString const & sOldRef_in ){ sOldRef = sOldRef_in; } + void SetOldRef ( OString const & sOldRef_in ){ sOldRef = sOldRef_in; } virtual int GetPos() { return nPos; } - 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; } + OString GetProject() { return project; } + OString GetFileName() { return filename; } + OString GetId() { return id; } + OString GetOldref() { return sOldRef; } + OString GetResourceType(){ return resourceType; } + OString GetLanguageId() { return languageId; } }; @@ -322,18 +322,18 @@ public: class XMLData : public XMLChildNode { private: - rtl::OUString sData; + OUString sData; bool isNewCreated; public: /// create a data node XMLData( - const rtl::OUString &rData, // the initial data + const OUString &rData, // the initial data XMLParentNode *Parent // the parent node of this data, typically a element node ) : XMLChildNode( Parent ), sData( rData ) , isNewCreated ( false ){} XMLData( - const rtl::OUString &rData, // the initial data + const OUString &rData, // the initial data XMLParentNode *Parent, // the parent node of this data, typically a element node bool newCreated ) @@ -345,12 +345,12 @@ public: virtual sal_uInt16 GetNodeType(); /// returns the data - rtl::OUString GetData() { return sData; } + OUString GetData() { return sData; } bool isNew() { return isNewCreated; } /// adds new character data to the existing one void AddData( - const rtl::OUString &rData // the new data + const OUString &rData // the new data ); @@ -364,12 +364,12 @@ public: class XMLComment : public XMLChildNode { private: - rtl::OUString sComment; + OUString sComment; public: /// create a comment node XMLComment( - const rtl::OUString &rComment, // the comment + const OUString &rComment, // the comment XMLParentNode *Parent // the parent node of this comemnt, typically a element node ) : XMLChildNode( Parent ), sComment( rComment ) {} @@ -381,7 +381,7 @@ public: XMLComment& operator=(const XMLComment& obj); /// returns the comment - rtl::OUString GetComment() { return sComment; } + OUString GetComment() { return sComment; } }; //------------------------------------------------------------------------- @@ -391,12 +391,12 @@ public: class XMLDefault : public XMLChildNode { private: - rtl::OUString sDefault; + OUString sDefault; public: /// create a comment node XMLDefault( - const rtl::OUString &rDefault, // the comment + const OUString &rDefault, // the comment XMLParentNode *Parent // the parent node of this comemnt, typically a element node ) : XMLChildNode( Parent ), sDefault( rDefault ) {} @@ -409,7 +409,7 @@ public: virtual sal_uInt16 GetNodeType(); /// returns the comment - rtl::OUString GetDefault() { return sDefault; } + OUString GetDefault() { return sDefault; } }; //------------------------------------------------------------------------- @@ -420,7 +420,7 @@ struct XMLError { XML_Error eCode; // the error code std::size_t nLine; // error line number std::size_t nColumn; // error column number - rtl::OUString sMessage; // readable error message + OUString sMessage; // readable error message }; //------------------------------------------------------------------------- @@ -460,7 +460,7 @@ public: /// parse a file, returns NULL on criticall errors XMLFile *Execute( - const rtl::OUString &rFileName, // the file name + const OUString &rFileName, // the file name XMLFile *pXMLFileIn // the XMLFile ); diff --git a/l10ntools/inc/xrmmerge.hxx b/l10ntools/inc/xrmmerge.hxx index 8659fe1f4f19..ca6a820c4dc4 100644 --- a/l10ntools/inc/xrmmerge.hxx +++ b/l10ntools/inc/xrmmerge.hxx @@ -28,39 +28,39 @@ class XRMResParser { private: - rtl::OString sGID; - rtl::OString sLID; + OString sGID; + OString sLID; sal_Bool bError; sal_Bool bText; - rtl::OString sCurrentOpenTag; - rtl::OString sCurrentCloseTag; - rtl::OString sCurrentText; + OString sCurrentOpenTag; + OString sCurrentCloseTag; + OString sCurrentText; protected: - std::vector<rtl::OString> aLanguages; - rtl::OString GetAttribute( const rtl::OString &rToken, const rtl::OString &rAttribute ); - void Error( const rtl::OString &rError ); + std::vector<OString> aLanguages; + OString GetAttribute( const OString &rToken, const OString &rAttribute ); + void Error( const OString &rError ); - virtual void Output( const rtl::OString& rOutput )=0; + virtual void Output( const OString& rOutput )=0; virtual void WorkOnDesc( - const rtl::OString &rOpenTag, - rtl::OString &rText + const OString &rOpenTag, + OString &rText )=0; virtual void WorkOnText( - const rtl::OString &rOpenTag, - rtl::OString &rText + const OString &rOpenTag, + OString &rText )=0; virtual void EndOfText( - const rtl::OString &rOpenTag, - const rtl::OString &rCloseTag + const OString &rOpenTag, + const OString &rCloseTag )=0; - rtl::OString GetGID() { return sGID; } - rtl::OString GetLID() { return sLID; } + OString GetGID() { return sGID; } + OString GetLID() { return sLID; } - void ConvertStringToDBFormat( rtl::OString &rString ); - void ConvertStringToXMLFormat( rtl::OString &rString ); + void ConvertStringToDBFormat( OString &rString ); + void ConvertStringToXMLFormat( OString &rString ); public: XRMResParser(); @@ -80,22 +80,22 @@ class XRMResExport : public XRMResParser { private: ResData *pResData; - rtl::OString sPath; + OString sPath; PoOfstream pOutputStream; protected: void WorkOnDesc( - const rtl::OString &rOpenTag, - rtl::OString &rText + const OString &rOpenTag, + OString &rText ); void WorkOnText( - const rtl::OString &rOpenTag, - rtl::OString &rText + const OString &rOpenTag, + OString &rText ); void EndOfText( - const rtl::OString &rOpenTag, - const rtl::OString &rCloseTag + const OString &rOpenTag, + const OString &rCloseTag ); - void Output( const rtl::OString& rOutput ); + void Output( const OString& rOutput ); public: XRMResExport( @@ -113,29 +113,29 @@ class XRMResMerge : public XRMResParser { private: MergeDataFile *pMergeDataFile; - rtl::OString sFilename; + OString sFilename; ResData *pResData; std::ofstream pOutputStream; protected: void WorkOnDesc( - const rtl::OString &rOpenTag, - rtl::OString &rText + const OString &rOpenTag, + OString &rText ); void WorkOnText( - const rtl::OString &rOpenTag, - rtl::OString &rText + const OString &rOpenTag, + OString &rText ); void EndOfText( - const rtl::OString &rOpenTag, - const rtl::OString &rCloseTag + const OString &rOpenTag, + const OString &rCloseTag ); - void Output( const rtl::OString& rOutput ); + void Output( const OString& rOutput ); public: XRMResMerge( - const rtl::OString &rMergeSource, - const rtl::OString &rOutputFile, - const rtl::OString &rFilename + const OString &rMergeSource, + const OString &rOutputFile, + const OString &rFilename ); virtual ~XRMResMerge(); }; diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 0aa53f875c25..311af52ae33a 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -88,7 +88,7 @@ void workOnTokenSet(int nTyp, char * pTokenText) { // class CfgStackData // -CfgStackData* CfgStack::Push(const rtl::OString &rTag, const rtl::OString &rId) +CfgStackData* CfgStack::Push(const OString &rTag, const OString &rId) { CfgStackData *pD = new CfgStackData( rTag, rId ); maList.push_back( pD ); @@ -108,9 +108,9 @@ CfgStack::~CfgStack() maList.clear(); } -rtl::OString CfgStack::GetAccessPath( size_t nPos ) +OString CfgStack::GetAccessPath( size_t nPos ) { - rtl::OStringBuffer sReturn; + OStringBuffer sReturn; for (size_t i = 0; i <= nPos; ++i) { if (i) @@ -147,22 +147,22 @@ CfgParser::~CfgParser() { } -sal_Bool CfgParser::IsTokenClosed(const rtl::OString &rToken) +sal_Bool CfgParser::IsTokenClosed(const OString &rToken) { return rToken[rToken.getLength() - 2] == '/'; } /*****************************************************************************/ void CfgParser::AddText( - rtl::OString &rText, - const rtl::OString &rIsoLang, - const rtl::OString &rResTyp + OString &rText, + const OString &rIsoLang, + const OString &rResTyp ) /*****************************************************************************/ { - rText = rText.replaceAll(rtl::OString('\n'), rtl::OString()). - replaceAll(rtl::OString('\r'), rtl::OString()). - replaceAll(rtl::OString('\t'), rtl::OString()); + rText = rText.replaceAll(OString('\n'), OString()). + replaceAll(OString('\r'), OString()). + replaceAll(OString('\t'), OString()); pStackData->sResTyp = rResTyp; WorkOnText( rText, rIsoLang ); pStackData->sText[ rIsoLang ] = rText; @@ -172,13 +172,13 @@ void CfgParser::AddText( int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) /*****************************************************************************/ { - rtl::OString sToken( pToken ); + OString sToken( pToken ); if ( sToken == " " || sToken == "\t" ) sLastWhitespace += sToken; - rtl::OString sTokenName; - rtl::OString sTokenId; + OString sTokenName; + OString sTokenId; sal_Bool bOutput = sal_True; @@ -197,7 +197,7 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) getToken(0, ' '); if ( !IsTokenClosed( sToken )) { - rtl::OString sSearch; + OString sSearch; switch ( nToken ) { case CFG_TOKEN_PACKAGE: sSearch = "package-id="; @@ -221,15 +221,15 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) case CFG_TEXT_START: { if ( sCurrentResTyp != sTokenName ) { WorkOnResourceEnd(); - rtl::OString sCur; + OString sCur; for( unsigned int i = 0; i < aLanguages.size(); ++i ){ sCur = aLanguages[ i ]; - pStackData->sText[ sCur ] = rtl::OString(); + pStackData->sText[ sCur ] = OString(); } } sCurrentResTyp = sTokenName; - rtl::OString sTemp = sToken.copy( sToken.indexOf( "xml:lang=" )); + OString sTemp = sToken.copy( sToken.indexOf( "xml:lang=" )); sCurrentIsoLang = sTemp.getToken(1, '"'); if ( sCurrentIsoLang == NO_TRANSLATE_ISO ) @@ -243,13 +243,13 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) } if ( !sSearch.isEmpty()) { - rtl::OString sTemp = sToken.copy( sToken.indexOf( sSearch )); + OString sTemp = sToken.copy( sToken.indexOf( sSearch )); sTokenId = sTemp.getToken(1, '"'); } pStackData = aStack.Push( sTokenName, sTokenId ); if ( sSearch == "cfg:name=" ) { - rtl::OString sTemp( sToken.toAsciiUpperCase() ); + OString sTemp( sToken.toAsciiUpperCase() ); bLocalize = (( sTemp.indexOf( "CFG:TYPE=\"STRING\"" ) != -1 ) && ( sTemp.indexOf( "CFG:LOCALIZED=\"sal_True\"" ) != -1 )); } @@ -257,10 +257,10 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) else if ( sTokenName == "label" ) { if ( sCurrentResTyp != sTokenName ) { WorkOnResourceEnd(); - rtl::OString sCur; + OString sCur; for( unsigned int i = 0; i < aLanguages.size(); ++i ){ sCur = aLanguages[ i ]; - pStackData->sText[ sCur ] = rtl::OString(); + pStackData->sText[ sCur ] = OString(); } } sCurrentResTyp = sTokenName; @@ -280,8 +280,8 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) } else { - rtl::OString sError( "Misplaced close tag: " ); - rtl::OString sInFile(" in file "); + OString sError( "Misplaced close tag: " ); + OString sInFile(" in file "); sError += sToken; sError += sInFile; sError += global::inputPathname; @@ -305,7 +305,7 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) { AddText( sCurrentText, sCurrentIsoLang, sCurrentResTyp ); Output( sCurrentText ); - sCurrentText = rtl::OString(); + sCurrentText = OString(); pStackData->sEndTextTag = sToken; } @@ -318,7 +318,7 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) return 1; } -void CfgExport::Output(const rtl::OString&) +void CfgExport::Output(const OString&) { } @@ -326,7 +326,7 @@ void CfgExport::Output(const rtl::OString&) int CfgParser::Execute( int nToken, char * pToken ) /*****************************************************************************/ { - rtl::OString sToken( pToken ); + OString sToken( pToken ); switch ( nToken ) { case CFG_TAG: @@ -347,7 +347,7 @@ int CfgParser::Execute( int nToken, char * pToken ) return ExecuteAnalyzedToken( nToken, pToken ); } -void CfgParser::Error(const rtl::OString& rError) +void CfgParser::Error(const OString& rError) { yyerror(rError.getStr()); } @@ -386,12 +386,12 @@ void CfgExport::WorkOnResourceEnd() /*****************************************************************************/ { if ( bLocalize ) { - if ( pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("en-US"))].getLength() ) + if ( pStackData->sText[OString(RTL_CONSTASCII_STRINGPARAM("en-US"))].getLength() ) { - rtl::OString sFallback = pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("en-US"))]; - rtl::OString sXComment = pStackData->sText[rtl::OString(RTL_CONSTASCII_STRINGPARAM("x-comment"))]; - rtl::OString sLocalId = pStackData->sIdentifier; - rtl::OString sGroupId; + OString sFallback = pStackData->sText[OString(RTL_CONSTASCII_STRINGPARAM("en-US"))]; + OString sXComment = pStackData->sText[OString(RTL_CONSTASCII_STRINGPARAM("x-comment"))]; + OString sLocalId = pStackData->sIdentifier; + OString sGroupId; if ( aStack.size() == 1 ) { sGroupId = sLocalId; sLocalId = ""; @@ -402,9 +402,9 @@ void CfgExport::WorkOnResourceEnd() for (size_t n = 0; n < aLanguages.size(); n++) { - rtl::OString sCur = aLanguages[ n ]; + OString sCur = aLanguages[ n ]; - rtl::OString sText = pStackData->sText[ sCur ]; + OString sText = pStackData->sText[ sCur ]; if ( sText.isEmpty()) sText = sFallback; @@ -419,8 +419,8 @@ void CfgExport::WorkOnResourceEnd() } void CfgExport::WorkOnText( - rtl::OString &rText, - const rtl::OString &rIsoLang + OString &rText, + const OString &rIsoLang ) { if( rIsoLang.getLength() ) rText = helper::UnQuotHTML( rText ); @@ -470,22 +470,22 @@ CfgMerge::~CfgMerge() delete pResData; } -void CfgMerge::WorkOnText(rtl::OString &rText, const rtl::OString& rLangIndex) +void CfgMerge::WorkOnText(OString &rText, const OString& rLangIndex) { if ( pMergeDataFile && bLocalize ) { if ( !pResData ) { - rtl::OString sLocalId = pStackData->sIdentifier; - rtl::OString sGroupId; + OString sLocalId = pStackData->sIdentifier; + OString sGroupId; if ( aStack.size() == 1 ) { sGroupId = sLocalId; - sLocalId = rtl::OString(); + sLocalId = OString(); } else { sGroupId = aStack.GetAccessPath( aStack.size() - 2 ); } - rtl::OString sPlatform; + OString sPlatform; pResData = new ResData( sPlatform, sGroupId , sFilename ); pResData->sId = sLocalId; @@ -497,7 +497,7 @@ void CfgMerge::WorkOnText(rtl::OString &rText, const rtl::OString& rLangIndex) PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrysCaseSensitive( pResData ); if ( pEntrys ) { - rtl::OString sContent; + OString sContent; pEntrys->GetText( sContent, STRING_TYP_TEXT, rLangIndex ); if ( !rLangIndex.equalsIgnoreAsciiCase("en-US") && @@ -509,7 +509,7 @@ void CfgMerge::WorkOnText(rtl::OString &rText, const rtl::OString& rLangIndex) } } -void CfgMerge::Output(const rtl::OString& rOutput) +void CfgMerge::Output(const OString& rOutput) { pOutputStream << rOutput.getStr(); } @@ -522,12 +522,12 @@ void CfgMerge::WorkOnResourceEnd() if ( pMergeDataFile && pResData && bLocalize && bEnglish ) { PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrysCaseSensitive( pResData ); if ( pEntrys ) { - rtl::OString sCur; + OString sCur; for( unsigned int i = 0; i < aLanguages.size(); ++i ){ sCur = aLanguages[ i ]; - rtl::OString sContent; + OString sContent; pEntrys->GetText( sContent, STRING_TYP_TEXT, sCur , sal_True ); if ( ( !sCur.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("en-US")) ) && @@ -535,20 +535,20 @@ void CfgMerge::WorkOnResourceEnd() ( sContent != "-" ) && !sContent.isEmpty()) { - rtl::OString sText = helper::QuotHTML( sContent); + OString sText = helper::QuotHTML( sContent); - rtl::OString sAdditionalLine( "\t" ); + OString sAdditionalLine( "\t" ); - rtl::OString sTextTag = pStackData->sTextTag; - rtl::OString sTemp = sTextTag.copy( sTextTag.indexOf( "xml:lang=" )); + OString sTextTag = pStackData->sTextTag; + OString sTemp = sTextTag.copy( sTextTag.indexOf( "xml:lang=" )); sal_Int32 n = 0; - rtl::OString sSearch = sTemp.getToken(0, '"', n); + OString sSearch = sTemp.getToken(0, '"', n); sSearch += "\""; sSearch += sTemp.getToken(0, '"', n); sSearch += "\""; - rtl::OString sReplace = sTemp.getToken(0, '"'); + OString sReplace = sTemp.getToken(0, '"'); sReplace += "\""; sReplace += sCur; sReplace += "\""; diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index adce9e85e983..d5ee143954e8 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -92,7 +92,7 @@ void Close(){ int WorkOnTokenSet( int nTyp, char *pTokenText ) { - global::exporter->pParseQueue->Push( QueueEntry( nTyp , rtl::OString(pTokenText) ) ); + global::exporter->pParseQueue->Push( QueueEntry( nTyp , OString(pTokenText) ) ); return 1; } @@ -126,7 +126,7 @@ int GetError() // /*****************************************************************************/ -sal_Bool ResData::SetId( const rtl::OString& rId, sal_uInt16 nLevel ) +sal_Bool ResData::SetId( const OString& rId, sal_uInt16 nLevel ) /*****************************************************************************/ { if ( nLevel > nIdLevel ) @@ -136,7 +136,7 @@ sal_Bool ResData::SetId( const rtl::OString& rId, sal_uInt16 nLevel ) if ( bChild && bChildWithText ) { - rtl::OString sError(RTL_CONSTASCII_STRINGPARAM("ResId after child definition")); + OString sError(RTL_CONSTASCII_STRINGPARAM("ResId after child definition")); yyerror(sError.getStr()); SetError(); } @@ -243,7 +243,7 @@ void Export::Init() bNextMustBeDefineEOL = sal_False; nLevel = 0; nList = LIST_NON; - m_sListLang = rtl::OString(); + m_sListLang = OString(); nListIndex = 0; for ( size_t i = 0, n = aResStack.size(); i < n; ++i ) delete aResStack[ i ]; @@ -283,15 +283,15 @@ int Export::Execute( int nToken, const char * pToken ) /*****************************************************************************/ { - rtl::OString sToken( pToken ); - rtl::OString sOrig( sToken ); + OString sToken( pToken ); + OString sOrig( sToken ); sal_Bool bWriteToMerged = bMergeMode; if ( nToken == CONDITION ) { - rtl::OString sTestToken(pToken); - sTestToken = sTestToken.replaceAll("\t", rtl::OString()). - replaceAll(" ", rtl::OString()); + OString sTestToken(pToken); + sTestToken = sTestToken.replaceAll("\t", OString()). + replaceAll(" ", OString()); if (( !bReadOver ) && ( sTestToken.indexOf("#ifndef__RSC_PARSER") == 0 )) bReadOver = sal_True; else if (( bReadOver ) && ( sTestToken.indexOf("#endif") == 0 )) @@ -417,14 +417,14 @@ int Export::Execute( int nToken, const char * pToken ) pResData = new ResData( sActPForm, FullId() , sFilename ); aResStack.push_back( pResData ); - sToken = sToken.replaceAll("\n", rtl::OString()). - replaceAll("\r", rtl::OString()). - replaceAll("{", rtl::OString()).replace('\t', ' '); + sToken = sToken.replaceAll("\n", OString()). + replaceAll("\r", OString()). + replaceAll("{", OString()).replace('\t', ' '); sToken = sToken.trim(); - rtl::OString sTLower = sToken.getToken(0, ' ').toAsciiLowerCase(); + OString sTLower = sToken.getToken(0, ' ').toAsciiLowerCase(); pResData->sResTyp = sTLower; - rtl::OString sId( sToken.copy( pResData->sResTyp.getLength() + 1 )); - rtl::OString sCondition; + OString sId( sToken.copy( pResData->sResTyp.getLength() + 1 )); + OString sCondition; if ( sId.indexOf( '#' ) != -1 ) { // between ResTyp, Id and paranthes is a precomp. condition @@ -435,7 +435,7 @@ int Export::Execute( int nToken, const char * pToken ) } sId = sId.getToken(0, '/'); CleanValue( sId ); - sId = sId.replaceAll("\t", rtl::OString()); + sId = sId.replaceAll("\t", OString()); pResData->SetId( sId, ID_LEVEL_IDENTIFIER ); if (!sCondition.isEmpty()) { @@ -456,12 +456,12 @@ int Export::Execute( int nToken, const char * pToken ) pResData = new ResData( sActPForm, FullId() , sFilename ); aResStack.push_back( pResData ); - sToken = sToken.replaceAll("\n", rtl::OString()). - replaceAll("\r", rtl::OString()). - replaceAll("{", rtl::OString()). - replaceAll("\t", rtl::OString()). - replaceAll(" ", rtl::OString()). - replaceAll("\\", rtl::OString()).toAsciiLowerCase(); + sToken = sToken.replaceAll("\n", OString()). + replaceAll("\r", OString()). + replaceAll("{", OString()). + replaceAll("\t", OString()). + replaceAll(" ", OString()). + replaceAll("\\", OString()).toAsciiLowerCase(); pResData->sResTyp = sToken; } break; @@ -473,7 +473,7 @@ int Export::Execute( int nToken, const char * pToken ) break; bDontWriteOutput = sal_False; - rtl::OString sLowerTyp; + OString sLowerTyp; if ( pResData ) sLowerTyp = "unknown"; nLevel++; @@ -521,17 +521,17 @@ int Export::Execute( int nToken, const char * pToken ) bDontWriteOutput = sal_False; // interpret different types of assignement sal_Int32 n = 0; - rtl::OString sKey = sToken.getToken(0, '=', n). - replaceAll(" ", rtl::OString()). - replaceAll("\t", rtl::OString()); - rtl::OString sValue = sToken.getToken(0, '=', n); + OString sKey = sToken.getToken(0, '=', n). + replaceAll(" ", OString()). + replaceAll("\t", OString()); + OString sValue = sToken.getToken(0, '=', n); CleanValue( sValue ); sKey = sKey.toAsciiUpperCase(); if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("IDENTIFIER"))) { - rtl::OString sId( - sValue.replaceAll("\t", rtl::OString()). - replaceAll(" ", rtl::OString())); + OString sId( + sValue.replaceAll("\t", OString()). + replaceAll(" ", OString())); pResData->SetId(sId, ID_LEVEL_IDENTIFIER); } else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("HELPID"))) @@ -574,14 +574,14 @@ int Export::Execute( int nToken, const char * pToken ) case LISTASSIGNMENT: { bDontWriteOutput = sal_False; - rtl::OString sTmpToken( - sToken.replaceAll(" ", rtl::OString()).toAsciiLowerCase()); + OString sTmpToken( + sToken.replaceAll(" ", OString()).toAsciiLowerCase()); sal_Int32 nPos = sTmpToken.indexOf("[en-us]="); if (nPos != -1) { - rtl::OString sKey( - sTmpToken.copy(0 , nPos).replaceAll(" ", rtl::OString()). - replaceAll("\t", rtl::OString())); - rtl::OString sValue = sToken.getToken(1, '='); + OString sKey( + sTmpToken.copy(0 , nPos).replaceAll(" ", OString()). + replaceAll("\t", OString())); + OString sValue = sToken.getToken(1, '='); CleanValue( sValue ); sKey = sKey.toAsciiUpperCase(); if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("STRINGLIST"))) @@ -630,9 +630,9 @@ int Export::Execute( int nToken, const char * pToken ) { // new res. is a String- or FilterList sal_Int32 n = 0; - rtl::OString sKey( - sToken.getToken(0, '[', n).replaceAll(" ", rtl::OString()). - replaceAll("\t", rtl::OString()).toAsciiUpperCase()); + OString sKey( + sToken.getToken(0, '[', n).replaceAll(" ", OString()). + replaceAll("\t", OString()).toAsciiUpperCase()); if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("STRINGLIST"))) nList = LIST_STRING; else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("FILTERLIST"))) @@ -644,7 +644,7 @@ int Export::Execute( int nToken, const char * pToken ) else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("UIENTRIES"))) nList = LIST_UIENTRIES; if ( nList ) { - rtl::OString sLang = sToken.getToken(0, ']', n); + OString sLang = sToken.getToken(0, ']', n); CleanValue( sLang ); m_sListLang = sLang; nListIndex = 0; @@ -660,7 +660,7 @@ int Export::Execute( int nToken, const char * pToken ) if ( nList ) { SetChildWithText(); sal_Int32 n = 0; - rtl::OString sEntry(sToken.getToken(1, '"', n)); + OString sEntry(sToken.getToken(1, '"', n)); if ( lcl_countOccurrences(sToken, '"') > 2 ) sEntry += "\""; if ( sEntry == "\\\"" ) @@ -681,20 +681,20 @@ int Export::Execute( int nToken, const char * pToken ) CutComment( sToken ); // this is a text line!!! - rtl::OString t(sToken.getToken(0, '=')); - rtl::OString sKey( - t.getToken(0, '[').replaceAll(" ", rtl::OString()). - replaceAll("\t", rtl::OString())); - rtl::OString sText( GetText( sToken, nToken )); - rtl::OString sLang; + OString t(sToken.getToken(0, '=')); + OString sKey( + t.getToken(0, '[').replaceAll(" ", OString()). + replaceAll("\t", OString())); + OString sText( GetText( sToken, nToken )); + OString sLang; if ( sToken.getToken(0, '=').indexOf('[') != -1 ) { sLang = sToken.getToken(0, '=').getToken(1, '['). getToken(0, ']'); CleanValue( sLang ); } - rtl::OString sLangIndex = sLang; - rtl::OString sOrigKey = sKey; + OString sLangIndex = sLang; + OString sOrigKey = sKey; if ( !sText.isEmpty() && !sLang.isEmpty() ) { sKey = sKey.toAsciiUpperCase(); @@ -717,7 +717,7 @@ int Export::Execute( int nToken, const char * pToken ) { if (!pResData->sText[ sLangIndex ].isEmpty()) { - rtl::OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("Language ")); + OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("Language ")); sError.append(sLangIndex); sError.append(RTL_CONSTASCII_STRINGPARAM("defined twice")); yyerror(sError.getStr()); @@ -734,7 +734,7 @@ int Export::Execute( int nToken, const char * pToken ) { if (!pResData->sHelpText[ sLangIndex ].isEmpty()) { - rtl::OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("Language ")); + OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("Language ")); sError.append(sLangIndex); sError.append(" defined twice"); YYWarning(sError.getStr()); @@ -751,7 +751,7 @@ int Export::Execute( int nToken, const char * pToken ) { if (!pResData->sQuickHelpText[ sLangIndex ].isEmpty()) { - rtl::OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("Language ")); + OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("Language ")); sError.append(sLangIndex); sError.append(RTL_CONSTASCII_STRINGPARAM(" defined twice")); YYWarning(sError.getStr()); @@ -768,7 +768,7 @@ int Export::Execute( int nToken, const char * pToken ) { if ( !pResData->sTitle[ sLangIndex ].isEmpty()) { - rtl::OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("Language ")); + OStringBuffer sError(RTL_CONSTASCII_STRINGPARAM("Language ")); sError.append(sLangIndex); sError.append(RTL_CONSTASCII_STRINGPARAM(" defined twice")); YYWarning(sError.getStr()); @@ -795,14 +795,14 @@ int Export::Execute( int nToken, const char * pToken ) // this is a AppfontMapping, so look if its a definition // of field size sal_Int32 n = 0; - rtl::OString sKey( - sToken.getToken(0, '=', n).replaceAll(" ", rtl::OString()). - replaceAll("\t", rtl::OString())); - rtl::OString sMapping = sToken.getToken(0, '=', n); + OString sKey( + sToken.getToken(0, '=', n).replaceAll(" ", OString()). + replaceAll("\t", OString())); + OString sMapping = sToken.getToken(0, '=', n); sMapping = sMapping.getToken(1, '('); sMapping = sMapping.getToken(0, ')'). - replaceAll(rtl::OString(' '), rtl::OString()). - replaceAll(rtl::OString('\t'), rtl::OString()). + replaceAll(OString(' '), OString()). + replaceAll(OString('\t'), OString()). toAsciiUpperCase(); if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("SIZE"))) { pResData->nWidth = sMapping.getToken(0, ',').toInt32(); @@ -825,7 +825,7 @@ int Export::Execute( int nToken, const char * pToken ) } } sal_Int32 n = 0; - rtl::OString sCondition(sToken.getToken(0, ' ', n)); + OString sCondition(sToken.getToken(0, ' ', n)); if ( sCondition == "#ifndef" ) { sActPForm = "!defined "; sActPForm += sToken.getToken(0, ' ', n); @@ -894,11 +894,11 @@ int Export::Execute( int nToken, const char * pToken ) } /*****************************************************************************/ -void Export::CutComment( rtl::OString &rText ) +void Export::CutComment( OString &rText ) /*****************************************************************************/ { if (rText.indexOf("//") != -1) { - rtl::OString sWork(rText.replaceAll("\\\"", "XX")); + OString sWork(rText.replaceAll("\\\"", "XX")); bool bInner = false; for (sal_Int32 i = 0; i < sWork.getLength() - 1; ++i) { if (sWork[i] == '"') { @@ -931,17 +931,17 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew ) ( !pResData->sTitle[ SOURCE_LANGUAGE ].isEmpty())) { - rtl::OString sGID = pResData->sGId; - rtl::OString sLID; + OString sGID = pResData->sGId; + OString sLID; if (sGID.isEmpty()) sGID = pResData->sId; else sLID = pResData->sId; - rtl::OString sXText; - rtl::OString sXHText; - rtl::OString sXQHText; - rtl::OString sXTitle; + OString sXText; + OString sXHText; + OString sXQHText; + OString sXTitle; sXText = pResData->sText[ SOURCE_LANGUAGE ]; if (!pResData->sText[ X_COMMENT ].isEmpty()) @@ -975,31 +975,31 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew ) } } if ( pResData->pStringList ) { - rtl::OString sList( "stringlist" ); + OString sList( "stringlist" ); WriteExportList( pResData, pResData->pStringList, sList, bCreateNew ); if ( bCreateNew ) pResData->pStringList = 0; } if ( pResData->pFilterList ) { - rtl::OString sList( "filterlist" ); + OString sList( "filterlist" ); WriteExportList( pResData, pResData->pFilterList, sList, bCreateNew ); if ( bCreateNew ) pResData->pFilterList = 0; } if ( pResData->pItemList ) { - rtl::OString sList( "itemlist" ); + OString sList( "itemlist" ); WriteExportList( pResData, pResData->pItemList, sList, bCreateNew ); if ( bCreateNew ) pResData->pItemList = 0; } if ( pResData->pPairedList ) { - rtl::OString sList( "pairedlist" ); + OString sList( "pairedlist" ); WriteExportList( pResData, pResData->pPairedList, sList, bCreateNew ); if ( bCreateNew ) pResData->pPairedList = 0; } if ( pResData->pUIEntries ) { - rtl::OString sList( "uientries" ); + OString sList( "uientries" ); WriteExportList( pResData, pResData->pUIEntries, sList, bCreateNew ); if ( bCreateNew ) pResData->pUIEntries = 0; @@ -1007,32 +1007,32 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew ) return sal_True; } -rtl::OString Export::GetPairedListID(const rtl::OString& rText) +OString Export::GetPairedListID(const OString& rText) { // < "STRING" ; IDENTIFIER ; > ; return rText.getToken(1, ';').toAsciiUpperCase().replace('\t', ' ').trim(); } -rtl::OString Export::GetPairedListString(const rtl::OString& rText) +OString Export::GetPairedListString(const OString& rText) { // < "STRING" ; IDENTIFIER ; > ; - rtl::OString sString(rText.getToken(0, ';').replace('\t', ' ')); + OString sString(rText.getToken(0, ';').replace('\t', ' ')); sString = sString.trim(); - rtl::OString s1(sString.copy(sString.indexOf('"') + 1)); + OString s1(sString.copy(sString.indexOf('"') + 1)); sString = s1.copy(0, s1.lastIndexOf('"')); return sString.trim(); } -rtl::OString Export::StripList(const rtl::OString & rText) +OString Export::StripList(const OString & rText) { - rtl::OString s1 = rText.copy( rText.indexOf('\"') + 1); + OString s1 = rText.copy( rText.indexOf('\"') + 1); return s1.copy( 0 , s1.lastIndexOf('\"')); } sal_Bool Export::WriteExportList(ResData *pResData, ExportList *pExportList, - const rtl::OString &rTyp, sal_Bool bCreateNew) + const OString &rTyp, sal_Bool bCreateNew) { - rtl::OString sGID(pResData->sGId); + OString sGID(pResData->sGId); if (sGID.isEmpty()) sGID = pResData->sId; else { @@ -1043,18 +1043,18 @@ sal_Bool Export::WriteExportList(ResData *pResData, ExportList *pExportList, } } - rtl::OString sCur; + OString sCur; for ( size_t i = 0; pExportList != NULL && i < pExportList->size(); i++ ) { ExportListEntry *pEntry = (*pExportList)[ i ]; - rtl::OString sLID(rtl::OString::valueOf(static_cast<sal_Int64>(i + 1))); + OString sLID(OString::valueOf(static_cast<sal_Int64>(i + 1))); for (unsigned int n = 0; n < aLanguages.size(); ++n) { sCur = aLanguages[ n ]; if (!(*pEntry)[ SOURCE_LANGUAGE ].isEmpty()) { - rtl::OString sText((*pEntry)[ SOURCE_LANGUAGE ] ); + OString sText((*pEntry)[ SOURCE_LANGUAGE ] ); // Strip PairList Line String if (rTyp.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("pairedlist"))) @@ -1084,22 +1084,22 @@ sal_Bool Export::WriteExportList(ResData *pResData, ExportList *pExportList, return sal_True; } -rtl::OString Export::FullId() +OString Export::FullId() { - rtl::OStringBuffer sFull; + OStringBuffer sFull; if ( nLevel > 1 ) { sFull.append(aResStack[ 0 ]->sId); for ( size_t i = 1; i < nLevel - 1; ++i ) { - rtl::OString sToAdd = aResStack[ i ]->sId; + OString sToAdd = aResStack[ i ]->sId; if (!sToAdd.isEmpty()) sFull.append('.').append(sToAdd); } } if (sFull.getLength() > 255) { - rtl::OString sError(RTL_CONSTASCII_STRINGPARAM("GroupId > 255 chars")); + OString sError(RTL_CONSTASCII_STRINGPARAM("GroupId > 255 chars")); printf("GroupID = %s\n", sFull.getStr()); yyerror(sError.getStr()); } @@ -1107,7 +1107,7 @@ rtl::OString Export::FullId() return sFull.makeStringAndClear(); } -void Export::InsertListEntry(const rtl::OString &rText, const rtl::OString &rLine) +void Export::InsertListEntry(const OString &rText, const OString &rLine) { ResData *pResData = ( nLevel-1 < aResStack.size() ) ? aResStack[ nLevel-1 ] : NULL; @@ -1179,7 +1179,7 @@ void Export::InsertListEntry(const rtl::OString &rText, const rtl::OString &rLin } /*****************************************************************************/ -void Export::CleanValue( rtl::OString &rValue ) +void Export::CleanValue( OString &rValue ) /*****************************************************************************/ { while ( !rValue.isEmpty()) { @@ -1205,18 +1205,18 @@ void Export::CleanValue( rtl::OString &rValue ) #define TXT_STATE_TEXT 0x001 #define TXT_STATE_MACRO 0x002 -rtl::OString Export::GetText(const rtl::OString &rSource, int nToken) +OString Export::GetText(const OString &rSource, int nToken) { - rtl::OString sReturn; + OString sReturn; switch ( nToken ) { case TEXTLINE: case LONGTEXTLINE: { - rtl::OString sTmp(rSource.copy(rSource.indexOf('='))); + OString sTmp(rSource.copy(rSource.indexOf('='))); CleanValue( sTmp ); - sTmp = sTmp.replaceAll("\n", rtl::OString()). - replaceAll("\r", rtl::OString()). + sTmp = sTmp.replaceAll("\n", OString()). + replaceAll("\r", OString()). replaceAll("\\\\\"", "-=<[BSlashBSlashHKom]>=-\""). replaceAll("\\\"", "-=<[Hochkomma]>=-"). replaceAll("\\", "-=<[0x7F]>=-"). @@ -1225,7 +1225,7 @@ rtl::OString Export::GetText(const rtl::OString &rSource, int nToken) sal_uInt16 nState = TXT_STATE_TEXT; for (sal_Int32 i = 1; i <= lcl_countOccurrences(sTmp, '"'); ++i) { - rtl::OString sToken(sTmp.getToken(i, '"')); + OString sToken(sTmp.getToken(i, '"')); if (!sToken.isEmpty()) { if ( nState == TXT_STATE_TEXT ) { sReturn += sToken; @@ -1262,9 +1262,9 @@ rtl::OString Export::GetText(const rtl::OString &rSource, int nToken) return sReturn; } -void Export::WriteToMerged(const rtl::OString &rText , bool bSDFContent) +void Export::WriteToMerged(const OString &rText , bool bSDFContent) { - rtl::OString sText(rText); + OString sText(rText); for (;;) { sal_Int32 n = 0; sText = sText.replaceFirst(" \n", "\n", &n); @@ -1312,15 +1312,15 @@ void Export::WriteToMerged(const rtl::OString &rText , bool bSDFContent) } /*****************************************************************************/ -void Export::ConvertMergeContent( rtl::OString &rText ) +void Export::ConvertMergeContent( OString &rText ) /*****************************************************************************/ { sal_Bool bNoOpen = ( rText.indexOf( "\\\"" ) != 0 ); sal_Bool bNoClose = !rText.endsWithL(RTL_CONSTASCII_STRINGPARAM("\\\"")); - rtl::OStringBuffer sNew; + OStringBuffer sNew; for ( sal_Int32 i = 0; i < rText.getLength(); i++ ) { - rtl::OString sChar( rText[i]); + OString sChar( rText[i]); if (sChar.equalsL(RTL_CONSTASCII_STRINGPARAM("\\"))) { if (( i + 1 ) < rText.getLength()) @@ -1328,41 +1328,41 @@ void Export::ConvertMergeContent( rtl::OString &rText ) sal_Char cNext = rText[i + 1]; if ( cNext == '\"' ) { - sChar = rtl::OString('\"'); + sChar = OString('\"'); i++; } else if ( cNext == 'n' ) { - sChar = rtl::OString(RTL_CONSTASCII_STRINGPARAM("\\n")); + sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\n")); i++; } else if ( cNext == 't' ) { - sChar = rtl::OString(RTL_CONSTASCII_STRINGPARAM("\\t")); + sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\t")); i++; } else if ( cNext == '\'' ) { - sChar = rtl::OString(RTL_CONSTASCII_STRINGPARAM("\\\'")); + sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\\'")); i++; } else { - sChar = rtl::OString(RTL_CONSTASCII_STRINGPARAM("\\\\")); + sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\\\")); } } else { - sChar = rtl::OString(RTL_CONSTASCII_STRINGPARAM("\\\\")); + sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\\\")); } } else if (sChar.equalsL(RTL_CONSTASCII_STRINGPARAM("\""))) { - sChar = rtl::OString(RTL_CONSTASCII_STRINGPARAM("\\\"")); + sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\\"")); } else if (sChar.equalsL(RTL_CONSTASCII_STRINGPARAM(""))) { - sChar = rtl::OString(RTL_CONSTASCII_STRINGPARAM("\\0x7F")); + sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\0x7F")); } sNew.append(sChar); } @@ -1370,7 +1370,7 @@ void Export::ConvertMergeContent( rtl::OString &rText ) rText = sNew.makeStringAndClear(); if ( bNoOpen ) { - rtl::OString sTmp( rText ); + OString sTmp( rText ); rText = "\""; rText += sTmp; } @@ -1378,17 +1378,17 @@ void Export::ConvertMergeContent( rtl::OString &rText ) rText += "\""; } -sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp, - rtl::OString &rLangIndex, ResData *pResData) +sal_Bool Export::PrepareTextToMerge(OString &rText, sal_uInt16 nTyp, + OString &rLangIndex, ResData *pResData) { // position to merge in: sal_Int32 nStart = 0; sal_Int32 nEnd = 0; - rtl::OString sOldId = pResData->sId; - rtl::OString sOldGId = pResData->sGId; - rtl::OString sOldTyp = pResData->sResTyp; + OString sOldId = pResData->sId; + OString sOldGId = pResData->sGId; + OString sOldTyp = pResData->sResTyp; - rtl::OString sOrigText( rText ); + OString sOrigText( rText ); switch ( nTyp ) { case LIST_STRING : @@ -1454,7 +1454,7 @@ sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp, if (( sLastListLine.indexOf( '>' ) != -1 ) && ( sLastListLine.indexOf( '<' ) == -1 )) { - rtl::OString sTmp = sLastListLine; + OString sTmp = sLastListLine; sLastListLine = "<"; sLastListLine += sTmp; } @@ -1465,7 +1465,7 @@ sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp, else pResData->sId = OString::number(nListIndex); if (!pResData->sGId.isEmpty()) - pResData->sGId = pResData->sGId + rtl::OString('.'); + pResData->sGId = pResData->sGId + OString('.'); pResData->sGId = pResData->sGId + sOldId; nTyp = STRING_TYP_TEXT; } @@ -1538,7 +1538,7 @@ sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp, return sal_False; // no data found } - rtl::OString sContent; + OString sContent; pEntrys->GetTransex3Text(sContent, nTyp, rLangIndex); if (sContent.isEmpty() && !rLangIndex.equalsIgnoreAsciiCase("en-US")) { @@ -1549,7 +1549,7 @@ sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp, if (rLangIndex.equalsIgnoreAsciiCase("en-US")) return sal_False; - rtl::OString sPostFix( rText.copy( ++nEnd )); + OString sPostFix( rText.copy( ++nEnd )); rText = rText.copy(0, nStart); ConvertMergeContent( sContent ); @@ -1563,19 +1563,19 @@ sal_Bool Export::PrepareTextToMerge(rtl::OString &rText, sal_uInt16 nTyp, return sal_True; } -void Export::ResData2Output( PFormEntrys *pEntry, sal_uInt16 nType, const rtl::OString& rTextType ) +void Export::ResData2Output( PFormEntrys *pEntry, sal_uInt16 nType, const OString& rTextType ) { sal_Bool bAddSemicolon = sal_False; sal_Bool bFirst = sal_True; - rtl::OString sCur; + OString sCur; for( unsigned int n = 0; n < aLanguages.size(); n++ ){ sCur = aLanguages[ n ]; - rtl::OString sText; + OString sText; sal_Bool bText = pEntry->GetTransex3Text( sText, nType, sCur , sal_True ); if ( bText && !sText.isEmpty() && sText != "-" ) { - rtl::OString sOutput; + OString sOutput; if ( bNextMustBeDefineEOL) { if ( bFirst ) sOutput += "\t\\\n"; @@ -1610,7 +1610,7 @@ void Export::ResData2Output( PFormEntrys *pEntry, sal_uInt16 nType, const rtl::O if ( bAddSemicolon ) { - rtl::OString sOutput( ";" ); + OString sOutput( ";" ); WriteToMerged( sOutput , false ); } } @@ -1640,23 +1640,23 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) ResData2Output( pEntry, STRING_TYP_TEXT, pResData->sTextTyp ); if ( pResData->bQuickHelpText ) - ResData2Output( pEntry, STRING_TYP_QUICKHELPTEXT, rtl::OString("QuickHelpText") ); + ResData2Output( pEntry, STRING_TYP_QUICKHELPTEXT, OString("QuickHelpText") ); if ( pResData->bTitle ) - ResData2Output( pEntry, STRING_TYP_TITLE, rtl::OString("Title") ); + ResData2Output( pEntry, STRING_TYP_TITLE, OString("Title") ); } // Merge Lists if ( pResData->bList ) { bool bPairedList = false; - rtl::OString sOldId = pResData->sId; - rtl::OString sOldGId = pResData->sGId; - rtl::OString sOldTyp = pResData->sResTyp; + OString sOldId = pResData->sId; + OString sOldGId = pResData->sGId; + OString sOldTyp = pResData->sResTyp; if (!pResData->sGId.isEmpty()) - pResData->sGId = pResData->sGId + rtl::OString('.'); + pResData->sGId = pResData->sGId + OString('.'); pResData->sGId = pResData->sGId + sOldId; - rtl::OString sSpace; + OString sSpace; for ( sal_uInt16 i = 1; i < nLevel-1; i++ ) sSpace += "\t"; for ( sal_uInt16 nT = LIST_STRING; nT <= LIST_UIENTRIES; nT++ ) { @@ -1668,7 +1668,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) case LIST_ITEM : pResData->sResTyp = "itemlist"; pList = pResData->pItemList; bPairedList = false; break; case LIST_PAIRED : pResData->sResTyp = "pairedlist"; pList = pResData->pPairedList; bPairedList = true; break; } - rtl::OString sCur; + OString sCur; for( unsigned int n = 0; n < aLanguages.size(); n++ ) { sCur = aLanguages[ n ]; @@ -1711,7 +1711,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) while(( nLIndex < nMaxIndex )) { if ( nIdx == 1 ) { - rtl::OStringBuffer sHead; + OStringBuffer sHead; if ( bNextMustBeDefineEOL ) sHead.append(RTL_CONSTASCII_STRINGPARAM("\\\n\t")); sHead.append(sSpace); @@ -1750,7 +1750,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) } WriteToMerged(sHead.makeStringAndClear() , true); } - rtl::OString sLine; + OString sLine; if ( pList && (*pList)[ nLIndex ] ) sLine = ( *(*pList)[ nLIndex ])[ SOURCE_LANGUAGE ]; if ( sLine.isEmpty()) @@ -1778,7 +1778,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) sal_Int32 nStart, nEnd; nStart = sLine.indexOf( '"' ); - rtl::OString sPostFix; + OString sPostFix; if( !bPairedList ){ nEnd = sLine.lastIndexOf( '"' ); sPostFix = sLine.copy( ++nEnd ); @@ -1799,7 +1799,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) } } - rtl::OString sText1( "\t" ); + OString sText1( "\t" ); sText1 += sLine; if ( bDefine || bNextMustBeDefineEOL ) sText1 += " ;\\\n"; @@ -1828,7 +1828,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) nLIndex++; } if ( nIdx > 1 ) { - rtl::OString sFooter; + OString sFooter; if (!sSpace.isEmpty()) { sFooter = sSpace.copy(1); } @@ -1865,7 +1865,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) std::size_t nMaxIndex = 0; if ( pList ) nMaxIndex = pList->GetSourceLanguageListEntryCount(); - rtl::OString sLine; + OString sLine; if ( pList && (*pList)[ nListIndex ] ) sLine = ( *(*pList)[ nListIndex ])[ SOURCE_LANGUAGE ]; if ( sLine.isEmpty()) @@ -1883,7 +1883,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) } while( PrepareTextToMerge( sLine, nList, m_sListLang, pResData ) && ( nListIndex <= nMaxIndex )) { - rtl::OString sText( "\t" ); + OString sText( "\t" ); sText += sLine; sText += " ;"; sText += "\n"; @@ -1903,10 +1903,10 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) pParseQueue->bMflag = false; } -rtl::OString Export::MergePairedList( rtl::OString const & sLine , rtl::OString const & sText ){ +OString Export::MergePairedList( OString const & sLine , OString const & sText ){ // < "xy" ; IDENTIFIER ; > - rtl::OString sPre = sLine.copy( 0 , sLine.indexOf('"') ); - rtl::OString sPost = sLine.copy( sLine.lastIndexOf('"') + 1 ); + OString sPre = sLine.copy( 0 , sLine.indexOf('"') ); + OString sPost = sLine.copy( sLine.lastIndexOf('"') + 1 ); sPre += sText; sPre += sPost; return sPre; @@ -1927,13 +1927,13 @@ void Export::InitLanguages( bool bMerge ){ if( !isInitialized ) { - rtl::OString sTmp; + OString sTmp; OStringBoolHashMap aEnvLangs; sal_Int32 nIndex = 0; do { - rtl::OString aToken = sLanguages.getToken(0, ',', nIndex); + OString aToken = sLanguages.getToken(0, ',', nIndex); sTmp = aToken.getToken(0, '=').trim(); if( bMerge && sTmp.equalsIgnoreAsciiCase("en-US") ){} else if( !( (sTmp[0]=='x' || sTmp[0]=='X') && sTmp[1]=='-' ) ){ diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 98e81651569f..904aae7d058f 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -54,9 +54,9 @@ void HelpParser::Dump(XMLHashMap* rElem_in) } } -void HelpParser::Dump(LangHashMap* rElem_in,const rtl::OString & sKey_in) +void HelpParser::Dump(LangHashMap* rElem_in,const OString & sKey_in) { - rtl::OString x; + OString x; OString y; fprintf(stdout,"+------------%s-----------+\n",sKey_in.getStr() ); for(LangHashMap::iterator posn=rElem_in->begin();posn!=rElem_in->end();++posn) @@ -69,7 +69,7 @@ void HelpParser::Dump(LangHashMap* rElem_in,const rtl::OString & sKey_in) } #endif -HelpParser::HelpParser( const rtl::OString &rHelpFile ) +HelpParser::HelpParser( const OString &rHelpFile ) : sHelpFile( rHelpFile ) {}; @@ -79,8 +79,8 @@ bool HelpParser::CreatePO( const OString &rPOFile_in, const OString &sHelpFile, const OString &rLanguage, XMLFile *pXmlFile, const OString &rGsi1){ SimpleXMLParser aParser; - rtl::OUString sXmlFile( - rtl::OStringToOUString(sHelpFile, RTL_TEXTENCODING_ASCII_US)); + OUString sXmlFile( + OStringToOUString(sHelpFile, RTL_TEXTENCODING_ASCII_US)); //TODO: explicit BOM handling? std::auto_ptr <XMLFile> file ( aParser.Execute( sXmlFile, pXmlFile ) ); @@ -90,7 +90,7 @@ bool HelpParser::CreatePO( printf( "%s: %s\n", sHelpFile.getStr(), - (rtl::OUStringToOString( + (OUStringToOString( aParser.GetError().sMessage, RTL_TEXTENCODING_ASCII_US). getStr())); exit(-1); @@ -111,18 +111,18 @@ bool HelpParser::CreatePO( LangHashMap* pElem; XMLElement* pXMLElement = NULL; - std::vector<rtl::OString> aLanguages; + std::vector<OString> aLanguages; aLanguages.push_back( rLanguage ); - std::vector<rtl::OString> order = file->getOrder(); - std::vector<rtl::OString>::iterator pos; + std::vector<OString> order = file->getOrder(); + std::vector<OString>::iterator pos; XMLHashMap::iterator posm; for( pos = order.begin(); pos != order.end() ; ++pos ) { posm = aXMLStrHM->find( *pos ); pElem = posm->second; - rtl::OString sCur; + OString sCur; for( unsigned int n = 0; n < aLanguages.size(); n++ ) { @@ -153,26 +153,26 @@ bool HelpParser::CreatePO( return sal_True; } -bool HelpParser::Merge( const rtl::OString &rPOFile, const rtl::OString &rDestinationFile, - const rtl::OString& rLanguage , MergeDataFile& aMergeDataFile ) +bool HelpParser::Merge( const OString &rPOFile, const OString &rDestinationFile, + const OString& rLanguage , MergeDataFile& aMergeDataFile ) { (void) rPOFile; SimpleXMLParser aParser; - rtl::OUString sXmlFile( - rtl::OStringToOUString(sHelpFile, RTL_TEXTENCODING_ASCII_US)); + OUString sXmlFile( + OStringToOUString(sHelpFile, RTL_TEXTENCODING_ASCII_US)); //TODO: explicit BOM handling? - XMLFile* xmlfile = ( aParser.Execute( sXmlFile, new XMLFile( rtl::OUString('0') ) ) ); + XMLFile* xmlfile = ( aParser.Execute( sXmlFile, new XMLFile( OUString('0') ) ) ); bool hasNoError = MergeSingleFile( xmlfile , aMergeDataFile , rLanguage , rDestinationFile ); delete xmlfile; return hasNoError; } -bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const rtl::OString& sLanguage , - rtl::OString const & sPath ) +bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const OString& sLanguage , + OString const & sPath ) { file->Extract(); @@ -202,12 +202,12 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile } /* ProcessHelp Methode: search for en-US entry and replace it with the current language*/ -void HelpParser::ProcessHelp( LangHashMap* aLangHM , const rtl::OString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ){ +void HelpParser::ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ){ XMLElement* pXMLElement = NULL; PFormEntrys *pEntrys = NULL; - rtl::OString sLId; + OString sLId; pEntrys = NULL; @@ -225,15 +225,15 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const rtl::OString& sCur , pEntrys = aMergeDataFile.GetPFormEntrys( pResData ); if( pEntrys != NULL) { - rtl::OString sNewText; - rtl::OUString sSourceText( + OString sNewText; + OUString sSourceText( pXMLElement->ToOUString(). replaceAll( - rtl::OUString("\n"), - rtl::OUString()). + OUString("\n"), + OUString()). replaceAll( - rtl::OUString("\t"), - rtl::OUString())); + OUString("\t"), + OUString())); // re-add spaces to the beginning of translated string, // important for indentation of Basic code examples sal_Int32 nPreSpaces = 0; @@ -269,7 +269,7 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const rtl::OString& sCur , pResData->sResTyp.getStr()); } pXMLElement->ChangeLanguageTag( - rtl::OStringToOUString(sCur, RTL_TEXTENCODING_ASCII_US)); + OStringToOUString(sCur, RTL_TEXTENCODING_ASCII_US)); } } diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index 364087d4e9e3..4d8cb0d668b7 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -29,7 +29,7 @@ namespace { -rtl::OString getBracketedContent(rtl::OString text) { +OString getBracketedContent(OString text) { return text.getToken(1, '[').getToken(0, ']'); } @@ -47,7 +47,7 @@ static void lcl_RemoveUTF8ByteOrderMarker( OString &rString ) // // class LngParser // -LngParser::LngParser(const rtl::OString &rLngFile, +LngParser::LngParser(const OString &rLngFile, sal_Bool bULFFormat) : nError( LNG_OK ) , pLines( NULL ) @@ -63,7 +63,7 @@ LngParser::LngParser(const rtl::OString &rLngFile, std::getline(aStream, s); while (!aStream.eof()) { - rtl::OString sLine(s.data(), s.length()); + OString sLine(s.data(), s.length()); if( bFirstLine ) { @@ -72,10 +72,10 @@ LngParser::LngParser(const rtl::OString &rLngFile, bFirstLine = false; } - pLines->push_back( new rtl::OString(sLine) ); + pLines->push_back( new OString(sLine) ); std::getline(aStream, s); } - pLines->push_back( new rtl::OString() ); + pLines->push_back( new OString() ); } else nError = LNG_COULD_NOT_OPEN; @@ -101,9 +101,9 @@ sal_Bool LngParser::CreatePO( size_t nPos = 0; sal_Bool bStart = true; - rtl::OString sGroup, sLine; + OString sGroup, sLine; OStringHashMap Text; - rtl::OString sID; + OString sID; while( nPos < pLines->size() ) { sLine = *(*pLines)[ nPos++ ]; @@ -125,18 +125,18 @@ sal_Bool LngParser::CreatePO( } void LngParser::WritePO(PoOfstream &aPOStream, - OStringHashMap &rText_inout, const rtl::OString &rActFileName, - const rtl::OString &rID) + OStringHashMap &rText_inout, const OString &rActFileName, + const OString &rID) { sal_Bool bExport = true; if ( bExport ) { - rtl::OString sCur; + OString sCur; for( unsigned int n = 0; n < aLanguages.size(); n++ ){ sCur = aLanguages[ n ]; - rtl::OString sAct = rText_inout[ sCur ]; + OString sAct = rText_inout[ sCur ]; if ( sAct.isEmpty() && !sCur.isEmpty() ) - sAct = rText_inout[ rtl::OString("en-US") ]; + sAct = rText_inout[ OString("en-US") ]; common::writePoEntry( "Ulfex", aPOStream, rActFileName, "LngText", @@ -145,7 +145,7 @@ void LngParser::WritePO(PoOfstream &aPOStream, } } -bool LngParser::isNextGroup(rtl::OString &sGroup_out, const rtl::OString &sLine_in) +bool LngParser::isNextGroup(OString &sGroup_out, const OString &sLine_in) { const OString sLineTrim = sLine_in.trim(); if ((sLineTrim[0] == '[') && (sLineTrim[sLineTrim.getLength() - 1] == ']')) @@ -156,14 +156,14 @@ bool LngParser::isNextGroup(rtl::OString &sGroup_out, const rtl::OString &sLine_ return false; } -void LngParser::ReadLine(const rtl::OString &rLine_in, +void LngParser::ReadLine(const OString &rLine_in, OStringHashMap &rText_inout) { if (!rLine_in.match(" *") && !rLine_in.match("/*")) { - rtl::OString sLang(rLine_in.getToken(0, '=').trim()); + OString sLang(rLine_in.getToken(0, '=').trim()); if (!sLang.isEmpty()) { - rtl::OString sText(rLine_in.getToken(1, '"')); + OString sText(rLine_in.getToken(1, '"')); rText_inout[sLang] = sText; } } @@ -187,12 +187,12 @@ sal_Bool LngParser::Merge( size_t nPos = 0; sal_Bool bGroup = sal_False; - rtl::OString sGroup; + OString sGroup; // seek to next group while ( nPos < pLines->size() && !bGroup ) { - rtl::OString sLine( *(*pLines)[ nPos ] ); + OString sLine( *(*pLines)[ nPos ] ); sLine = sLine.trim(); if (!sLine.isEmpty() && ( sLine[0] == '[' ) && @@ -206,7 +206,7 @@ sal_Bool LngParser::Merge( while ( nPos < pLines->size()) { OStringHashMap Text; - rtl::OString sID( sGroup ); + OString sID( sGroup ); std::size_t nLastLangPos = 0; ResData *pResData = new ResData( "", sID , sSource ); @@ -215,11 +215,11 @@ sal_Bool LngParser::Merge( // read languages bGroup = sal_False; - rtl::OString sLanguagesDone; + OString sLanguagesDone; while ( nPos < pLines->size() && !bGroup ) { - rtl::OString sLine( *(*pLines)[ nPos ] ); + OString sLine( *(*pLines)[ nPos ] ); sLine = sLine.trim(); if (!sLine.isEmpty() && ( sLine[0] == '[' ) && @@ -233,7 +233,7 @@ sal_Bool LngParser::Merge( else { sal_Int32 n = 0; - rtl::OString sLang(sLine.getToken(0, '=', n)); + OString sLang(sLine.getToken(0, '=', n)); if (n == -1 || static_cast<bool>(sLine.match("/*"))) { ++nPos; @@ -242,7 +242,7 @@ sal_Bool LngParser::Merge( { sLang = sLang.trim(); - rtl::OString sSearch( ";" ); + OString sSearch( ";" ); sSearch += sLang; sSearch += ";"; @@ -255,15 +255,15 @@ sal_Bool LngParser::Merge( { if( !sLang.isEmpty() ) { - rtl::OString sNewText; + OString sNewText; pEntrys->GetText( sNewText, STRING_TYP_TEXT, sLang, sal_True ); if( sLang == "qtz" ) sNewText = sNewText.copy(sNewText.indexOf("|") + 2); if ( !sNewText.isEmpty()) { - rtl::OString *pLine = (*pLines)[ nPos ]; + OString *pLine = (*pLines)[ nPos ]; - rtl::OString sText1( sLang ); + OString sText1( sLang ); sText1 += " = \""; // escape quotes, unescape double escaped quotes fdo#56648 sText1 += sNewText.replaceAll("\"","\\\"").replaceAll("\\\\\"","\\\""); @@ -284,7 +284,7 @@ sal_Bool LngParser::Merge( } } } - rtl::OString sCur; + OString sCur; if ( nLastLangPos ) { for(size_t n = 0; n < aLanguages.size(); ++n) @@ -293,14 +293,14 @@ sal_Bool LngParser::Merge( if( !sCur.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("en-US")) && Text[sCur].isEmpty() && pEntrys ) { - rtl::OString sNewText; + OString sNewText; pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur, sal_True ); if( sCur == "qtz" ) sNewText = sNewText.copy(sNewText.indexOf("|") + 2); if (( !sNewText.isEmpty()) && !(( sCur.equalsL(RTL_CONSTASCII_STRINGPARAM("x-comment"))) && ( sNewText == "-" ))) { - rtl::OString sLine; + OString sLine; sLine += sCur; sLine += " = \""; // escape quotes, unescape double escaped quotes fdo#56648 @@ -313,9 +313,9 @@ sal_Bool LngParser::Merge( if ( nLastLangPos < pLines->size() ) { LngLineList::iterator it = pLines->begin(); std::advance( it, nLastLangPos ); - pLines->insert( it, new rtl::OString(sLine) ); + pLines->insert( it, new OString(sLine) ); } else { - pLines->push_back( new rtl::OString(sLine) ); + pLines->push_back( new OString(sLine) ); } } } diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index 46c7828d969c..d3bd71b04196 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -29,7 +29,7 @@ namespace { - static ::rtl::OString lcl_NormalizeFilename(const ::rtl::OString& rFilename) + static OString lcl_NormalizeFilename(const OString& rFilename) { return rFilename.copy( std::max( @@ -63,7 +63,7 @@ namespace // class ResData // -ResData::ResData(const rtl::OString &rPF, const rtl::OString &rGId) +ResData::ResData(const OString &rPF, const OString &rGId) : nWidth( 0 ), nChildIndex( 0 ), @@ -89,11 +89,11 @@ ResData::ResData(const rtl::OString &rPF, const rtl::OString &rGId) pPairedList( NULL ), sPForm( rPF ) { - sGId = sGId.replaceAll("\r", rtl::OString()); - sPForm = sPForm.replaceAll("\r", rtl::OString()); + sGId = sGId.replaceAll("\r", OString()); + sPForm = sPForm.replaceAll("\r", OString()); } -ResData::ResData(const rtl::OString &rPF, const rtl::OString &rGId , const rtl::OString &rFilename) +ResData::ResData(const OString &rPF, const OString &rGId , const OString &rFilename) : nWidth( 0 ), nChildIndex( 0 ), @@ -120,8 +120,8 @@ ResData::ResData(const rtl::OString &rPF, const rtl::OString &rGId , const rtl:: pPairedList( NULL ), sPForm( rPF ) { - sGId = sGId.replaceAll("\r", rtl::OString()); - sPForm = sPForm.replaceAll("\r", rtl::OString()); + sGId = sGId.replaceAll("\r", OString()); + sPForm = sPForm.replaceAll("\r", OString()); } @@ -165,22 +165,22 @@ ResData::~ResData() // class PFormEntrys // -sal_Bool PFormEntrys::GetTransex3Text( rtl::OString &rReturn, - sal_uInt16 nTyp, const rtl::OString &nLangIndex, sal_Bool bDel ) +sal_Bool PFormEntrys::GetTransex3Text( OString &rReturn, + sal_uInt16 nTyp, const OString &nLangIndex, sal_Bool bDel ) { sal_Bool rc = GetText( rReturn , nTyp , nLangIndex , bDel ); for( sal_Int32 idx = 0; idx < rReturn.getLength(); idx++ ) { if( rReturn[idx] == '\"' && ( idx >= 1 ) && rReturn[idx-1] == '\\' ) { - rReturn = rReturn.replaceAt( idx-1, 1, rtl::OString() ); + rReturn = rReturn.replaceAt( idx-1, 1, OString() ); } } return rc; } /*****************************************************************************/ -sal_Bool PFormEntrys::GetText( rtl::OString &rReturn, - sal_uInt16 nTyp, const rtl::OString &nLangIndex, sal_Bool bDel ) +sal_Bool PFormEntrys::GetText( OString &rReturn, + sal_uInt16 nTyp, const OString &nLangIndex, sal_Bool bDel ) { sal_Bool bReturn=sal_True; @@ -224,19 +224,19 @@ MergeData::~MergeData() PFormEntrys* MergeData::GetPFormEntries() { - if( aMap.find( rtl::OString(RTL_CONSTASCII_STRINGPARAM("HACK")) ) != aMap.end() ) - return aMap[rtl::OString(RTL_CONSTASCII_STRINGPARAM("HACK"))]; + if( aMap.find( OString(RTL_CONSTASCII_STRINGPARAM("HACK")) ) != aMap.end() ) + return aMap[OString(RTL_CONSTASCII_STRINGPARAM("HACK"))]; return NULL; } void MergeData::Insert(PFormEntrys* pfEntrys ) { - aMap.insert( PFormEntrysHashMap::value_type( rtl::OString(RTL_CONSTASCII_STRINGPARAM("HACK")) , pfEntrys ) ); + aMap.insert( PFormEntrysHashMap::value_type( OString(RTL_CONSTASCII_STRINGPARAM("HACK")) , pfEntrys ) ); } -PFormEntrys* MergeData::GetPFObject( const rtl::OString& rPFO ) +PFormEntrys* MergeData::GetPFObject( const OString& rPFO ) { - if( aMap.find( rtl::OString(RTL_CONSTASCII_STRINGPARAM("HACK")) ) != aMap.end() ) + if( aMap.find( OString(RTL_CONSTASCII_STRINGPARAM("HACK")) ) != aMap.end() ) return aMap[ rPFO ]; return NULL; } @@ -252,7 +252,7 @@ sal_Bool MergeData::operator==( ResData *pData ) // MergeDataFile::MergeDataFile( - const rtl::OString &rFileName, const rtl::OString &rFile, + const OString &rFileName, const OString &rFile, bool bCaseSensitive, bool bWithQtz ) { std::ifstream aInputStream( rFileName.getStr() ); @@ -373,17 +373,17 @@ MergeDataFile::~MergeDataFile() delete aI->second; } -std::vector<rtl::OString> MergeDataFile::GetLanguages() const +std::vector<OString> MergeDataFile::GetLanguages() const { - return std::vector<rtl::OString>(aLanguageSet.begin(),aLanguageSet.end()); + return std::vector<OString>(aLanguageSet.begin(),aLanguageSet.end()); } MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive ) { - rtl::OString sOldG = pResData->sGId; - rtl::OString sOldL = pResData->sId; - rtl::OString sGID = pResData->sGId; - rtl::OString sLID; + OString sOldG = pResData->sGId; + OString sOldL = pResData->sId; + OString sGID = pResData->sGId; + OString sLID; if (sGID.isEmpty()) sGID = pResData->sId; else @@ -391,7 +391,7 @@ MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive pResData->sGId = sGID; pResData->sId = sLID; - rtl::OString sKey = CreateKey( pResData->sResTyp , pResData->sGId , pResData->sId , pResData->sFilename , bCaseSensitive ); + OString sKey = CreateKey( pResData->sResTyp , pResData->sGId , pResData->sId , pResData->sFilename , bCaseSensitive ); if(aMap.find( sKey ) != aMap.end()) { @@ -424,17 +424,17 @@ PFormEntrys *MergeDataFile::GetPFormEntrysCaseSensitive( ResData *pResData ) } void MergeDataFile::InsertEntry( - const rtl::OString &rTYP, const rtl::OString &rGID, - const rtl::OString &rLID, const rtl::OString &rPFO, - const rtl::OString &nLANG, const rtl::OString &rTEXT, - const rtl::OString &rQHTEXT, const rtl::OString &rTITLE , - const rtl::OString &rInFilename , bool bCaseSensitive + const OString &rTYP, const OString &rGID, + const OString &rLID, const OString &rPFO, + const OString &nLANG, const OString &rTEXT, + const OString &rQHTEXT, const OString &rTITLE , + const OString &rInFilename , bool bCaseSensitive ) { MergeData *pData; // search for MergeData - rtl::OString sKey = CreateKey(rTYP , rGID , rLID , rInFilename , bCaseSensitive); + OString sKey = CreateKey(rTYP , rGID , rLID , rInFilename , bCaseSensitive); MergeDataHashMap::const_iterator mit; mit = aMap.find( sKey ); if( mit != aMap.end() ) @@ -462,11 +462,11 @@ void MergeDataFile::InsertEntry( pFEntrys->InsertEntry( nLANG , rTEXT, rQHTEXT, rTITLE ); } -rtl::OString MergeDataFile::CreateKey(const rtl::OString& rTYP, const rtl::OString& rGID, - const rtl::OString& rLID, const rtl::OString& rFilename, bool bCaseSensitive) +OString MergeDataFile::CreateKey(const OString& rTYP, const OString& rGID, + const OString& rLID, const OString& rFilename, bool bCaseSensitive) { - static const ::rtl::OString sStroke('-'); - ::rtl::OString sKey( rTYP ); + static const OString sStroke('-'); + OString sKey( rTYP ); sKey += sStroke; sKey += rGID; sKey += sStroke; diff --git a/l10ntools/source/uimerge.cxx b/l10ntools/source/uimerge.cxx index 7bebc61293cc..ce4d757aaebe 100644 --- a/l10ntools/source/uimerge.cxx +++ b/l10ntools/source/uimerge.cxx @@ -29,8 +29,8 @@ #include <fstream> #include <vector> -rtl::OString sInputFileName; -rtl::OString sOutputFile; +OString sInputFileName; +OString sOutputFile; int extractTranslations() { @@ -43,7 +43,7 @@ int extractTranslations() exsltRegisterAll(); - rtl::OString sStyleSheet = rtl::OString(getenv("SRC_ROOT")) + rtl::OString("/solenv/bin/uilangfilter.xslt"); + OString sStyleSheet = OString(getenv("SRC_ROOT")) + OString("/solenv/bin/uilangfilter.xslt"); xsltStylesheetPtr stylesheet = xsltParseStylesheetFile ((const xmlChar *)sStyleSheet.getStr()); @@ -89,8 +89,8 @@ namespace { bool lcl_MergeLang( const MergeDataHashMap &rMap, - const rtl::OString &rLanguage, - const rtl::OString &rDestinationFile) + const OString &rLanguage, + const OString &rDestinationFile) { std::ofstream aDestination( rDestinationFile.getStr(), std::ios_base::out | std::ios_base::trunc); @@ -107,7 +107,7 @@ namespace continue; PFormEntrys* pFoo = aI->second->GetPFormEntries(); - rtl::OString sOut; + OString sOut; pFoo->GetText( sOut, STRING_TYP_TEXT, rLanguage ); if (sOut.isEmpty()) @@ -136,8 +136,8 @@ bool Merge( { bool bDestinationIsDir(false); - const rtl::OUString aDestDir(rtl::OStringToOUString(rDestinationDir, RTL_TEXTENCODING_UTF8)); - rtl::OUString aDestDirUrl; + const OUString aDestDir(OStringToOUString(rDestinationDir, RTL_TEXTENCODING_UTF8)); + OUString aDestDirUrl; if (osl::FileBase::E_None == osl::FileBase::getFileURLFromSystemPath(aDestDir, aDestDirUrl)) { osl::DirectoryItem aTmp; @@ -157,22 +157,22 @@ bool Merge( } MergeDataFile aMergeDataFile( rPOFile, rSourceFile, sal_False ); - std::vector<rtl::OString> aLanguages; + std::vector<OString> aLanguages; if( rLanguage.equalsIgnoreAsciiCase("ALL") ) aLanguages = aMergeDataFile.GetLanguages(); else aLanguages.push_back(rLanguage); const MergeDataHashMap& rMap = aMergeDataFile.getMap(); - const rtl::OString aDestinationDir(rDestinationDir + "/"); + const OString aDestinationDir(rDestinationDir + "/"); bool bResult = true; for(size_t n = 0; n < aLanguages.size(); ++n) { - rtl::OString sCur = aLanguages[ n ]; + OString sCur = aLanguages[ n ]; if (sCur.isEmpty() || sCur.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("en-US"))) continue; - const rtl::OString aDestinationFile(aDestinationDir + sCur + ".ui"); + const OString aDestinationFile(aDestinationDir + sCur + ".ui"); if (!lcl_MergeLang(rMap, sCur, aDestinationFile)) bResult = false; } diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx index 954aed0bc40c..55bf4bc7688f 100644 --- a/l10ntools/source/xmlparse.cxx +++ b/l10ntools/source/xmlparse.cxx @@ -158,7 +158,7 @@ sal_uInt16 XMLFile::GetNodeType() return XML_NODE_TYPE_FILE; } -void XMLFile::Write( rtl::OString const &aFilename ) +void XMLFile::Write( OString const &aFilename ) { std::ofstream s( aFilename.getStr(), std::ios_base::out | std::ios_base::trunc); @@ -172,9 +172,9 @@ void XMLFile::Write( rtl::OString const &aFilename ) s.close(); } -void XMLFile::WriteString( ofstream &rStream, const rtl::OUString &sString ) +void XMLFile::WriteString( ofstream &rStream, const OUString &sString ) { - rtl::OString sText(rtl::OUStringToOString(sString, RTL_TEXTENCODING_UTF8)); + OString sText(OUStringToOString(sString, RTL_TEXTENCODING_UTF8)); rStream << sText.getStr(); } @@ -197,7 +197,7 @@ sal_Bool XMLFile::Write( ofstream &rStream , XMLNode *pCur ) if ( pElement->GetAttributeList()) for ( size_t j = 0; j < pElement->GetAttributeList()->size(); j++ ) { rStream << " "; - rtl::OUString sData( (*pElement->GetAttributeList())[ j ]->GetName() ); + OUString sData( (*pElement->GetAttributeList())[ j ]->GetName() ); WriteString( rStream , XMLUtil::QuotHTML( sData ) ); rStream << "=\""; sData = (*pElement->GetAttributeList())[ j ]->GetValue(); @@ -218,7 +218,7 @@ sal_Bool XMLFile::Write( ofstream &rStream , XMLNode *pCur ) break; case XML_NODE_TYPE_DATA: { XMLData *pData = ( XMLData * ) pCur; - rtl::OUString sData( pData->GetData()); + OUString sData( pData->GetData()); WriteString( rStream, XMLUtil::QuotHTML( sData ) ); } break; @@ -256,18 +256,18 @@ void XMLFile::Print( XMLNode *pCur, sal_uInt16 nLevel ) case XML_NODE_TYPE_ELEMENT: { XMLElement *pElement = ( XMLElement * ) pCur; - fprintf( stdout, "<%s", rtl::OUStringToOString(pElement->GetName(), RTL_TEXTENCODING_UTF8).getStr()); + fprintf( stdout, "<%s", OUStringToOString(pElement->GetName(), RTL_TEXTENCODING_UTF8).getStr()); if ( pElement->GetAttributeList()) { for (size_t j = 0; j < pElement->GetAttributeList()->size(); ++j) { - rtl::OString aAttrName(rtl::OUStringToOString((*pElement->GetAttributeList())[j]->GetName(), + OString aAttrName(OUStringToOString((*pElement->GetAttributeList())[j]->GetName(), RTL_TEXTENCODING_UTF8)); if (!aAttrName.equalsIgnoreAsciiCase(XML_LANG)) { fprintf( stdout, " %s=\"%s\"", aAttrName.getStr(), - rtl::OUStringToOString( (*pElement->GetAttributeList())[ j ]->GetValue(), + OUStringToOString( (*pElement->GetAttributeList())[ j ]->GetValue(), RTL_TEXTENCODING_UTF8).getStr()); } } @@ -278,24 +278,24 @@ void XMLFile::Print( XMLNode *pCur, sal_uInt16 nLevel ) fprintf( stdout, ">" ); for ( size_t k = 0; k < pElement->GetChildList()->size(); k++ ) Print( (*pElement->GetChildList())[ k ], nLevel + 1 ); - fprintf( stdout, "</%s>", rtl::OUStringToOString(pElement->GetName(), RTL_TEXTENCODING_UTF8).getStr()); + fprintf( stdout, "</%s>", OUStringToOString(pElement->GetName(), RTL_TEXTENCODING_UTF8).getStr()); } } break; case XML_NODE_TYPE_DATA: { XMLData *pData = ( XMLData * ) pCur; - rtl::OUString sData = pData->GetData(); - fprintf( stdout, "%s", rtl::OUStringToOString(sData, RTL_TEXTENCODING_UTF8).getStr()); + OUString sData = pData->GetData(); + fprintf( stdout, "%s", OUStringToOString(sData, RTL_TEXTENCODING_UTF8).getStr()); } break; case XML_NODE_TYPE_COMMENT: { XMLComment *pComment = ( XMLComment * ) pCur; - fprintf( stdout, "<!--%s-->", rtl::OUStringToOString(pComment->GetComment(), RTL_TEXTENCODING_UTF8).getStr()); + fprintf( stdout, "<!--%s-->", OUStringToOString(pComment->GetComment(), RTL_TEXTENCODING_UTF8).getStr()); } break; case XML_NODE_TYPE_DEFAULT: { XMLDefault *pDefault = ( XMLDefault * ) pCur; - fprintf( stdout, "%s", rtl::OUStringToOString(pDefault->GetDefault(), RTL_TEXTENCODING_UTF8).getStr()); + fprintf( stdout, "%s", OUStringToOString(pDefault->GetDefault(), RTL_TEXTENCODING_UTF8).getStr()); } break; } @@ -313,7 +313,7 @@ XMLFile::~XMLFile() } } /*****************************************************************************/ -XMLFile::XMLFile( const rtl::OUString &rFileName ) // the file name, empty if created from memory stream +XMLFile::XMLFile( const OUString &rFileName ) // the file name, empty if created from memory stream /*****************************************************************************/ : XMLParentNode( NULL ), sFileName ( rFileName ), @@ -323,13 +323,13 @@ XMLFile::XMLFile( const rtl::OUString &rFileName ) // the file name, empty if cr XMLStrings ( NULL ) { - nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("bookmark")) , sal_True) ); - nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("variable")) , sal_True) ); - nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("paragraph")) , sal_True) ); - nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("alt")) , sal_True) ); - nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("caption")) , sal_True) ); - nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("title")) , sal_True) ); - nodes_localize.insert( TagMap::value_type(rtl::OString(RTL_CONSTASCII_STRINGPARAM("link")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(OString(RTL_CONSTASCII_STRINGPARAM("bookmark")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(OString(RTL_CONSTASCII_STRINGPARAM("variable")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(OString(RTL_CONSTASCII_STRINGPARAM("paragraph")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(OString(RTL_CONSTASCII_STRINGPARAM("alt")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(OString(RTL_CONSTASCII_STRINGPARAM("caption")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(OString(RTL_CONSTASCII_STRINGPARAM("title")) , sal_True) ); + nodes_localize.insert( TagMap::value_type(OString(RTL_CONSTASCII_STRINGPARAM("link")) , sal_True) ); } /*****************************************************************************/ void XMLFile::Extract( XMLFile *pCur ) @@ -350,18 +350,18 @@ void XMLFile::Extract( XMLFile *pCur ) /*****************************************************************************/ void XMLFile::InsertL10NElement( XMLElement* pElement ){ /*****************************************************************************/ - rtl::OString tmpStr,id,language(""); + OString tmpStr,id,language(""); LangHashMap* elem; if( pElement->GetAttributeList() != NULL ){ for ( size_t j = 0; j < pElement->GetAttributeList()->size(); j++ ) { - tmpStr=rtl::OUStringToOString((*pElement->GetAttributeList())[ j ]->GetName(), RTL_TEXTENCODING_UTF8); + tmpStr=OUStringToOString((*pElement->GetAttributeList())[ j ]->GetName(), RTL_TEXTENCODING_UTF8); if (tmpStr == ID) { // Get the "id" Attribute - id = rtl::OUStringToOString((*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8); + id = OUStringToOString((*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8); } if (tmpStr == XML_LANG) { // Get the "xml-lang" Attribute - language = rtl::OUStringToOString((*pElement->GetAttributeList())[j]->GetValue(),RTL_TEXTENCODING_UTF8); + language = OUStringToOString((*pElement->GetAttributeList())[j]->GetValue(),RTL_TEXTENCODING_UTF8); } } @@ -382,7 +382,7 @@ void XMLFile::InsertL10NElement( XMLElement* pElement ){ elem=pos->second; if ( (*elem)[ language ] ) { - fprintf(stdout,"Error: Duplicated entry. ID = %s LANG = %s in File %s\n", id.getStr(), language.getStr(), rtl::OUStringToOString(sFileName, RTL_TEXTENCODING_ASCII_US).getStr() ); + fprintf(stdout,"Error: Duplicated entry. ID = %s LANG = %s in File %s\n", id.getStr(), language.getStr(), OUStringToOString(sFileName, RTL_TEXTENCODING_ASCII_US).getStr() ); exit( -1 ); } (*elem)[ language ]=pElement; @@ -439,8 +439,8 @@ XMLFile& XMLFile::operator=(const XMLFile& obj){ void XMLFile::SearchL10NElements( XMLParentNode *pCur , int pos) /*****************************************************************************/ { - static const rtl::OString LOCALIZE("localize"); - static const rtl::OString THEID("id"); + static const OString LOCALIZE("localize"); + static const OString THEID("id"); bool bInsert = true; if ( !pCur ) SearchL10NElements( this ); @@ -458,24 +458,24 @@ void XMLFile::SearchL10NElements( XMLParentNode *pCur , int pos) break; case XML_NODE_TYPE_ELEMENT: { XMLElement *pElement = ( XMLElement * ) pCur; - rtl::OString sName(rtl::OUStringToOString(pElement->GetName(), RTL_TEXTENCODING_ASCII_US).toAsciiLowerCase()); - rtl::OString language,tmpStrVal,oldref; + OString sName(OUStringToOString(pElement->GetName(), RTL_TEXTENCODING_ASCII_US).toAsciiLowerCase()); + OString language,tmpStrVal,oldref; if ( pElement->GetAttributeList()) { for ( size_t j = 0 , cnt = pElement->GetAttributeList()->size(); j < cnt && bInsert; ++j ) { - const rtl::OString tmpStr = rtl::OUStringToOString((*pElement->GetAttributeList())[j]->GetName(), RTL_TEXTENCODING_UTF8); + const OString tmpStr = OUStringToOString((*pElement->GetAttributeList())[j]->GetName(), RTL_TEXTENCODING_UTF8); if (tmpStr == THEID) { // Get the "id" Attribute - tmpStrVal=rtl::OUStringToOString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); + tmpStrVal=OUStringToOString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); } if (tmpStr == LOCALIZE) { // Get the "localize" Attribute bInsert=false; } if (tmpStr == XML_LANG) { // Get the "xml-lang" Attribute - language=rtl::OUStringToOString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); + language=OUStringToOString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); } if (tmpStr == OLDREF) { // Get the "oldref" Attribute - oldref=rtl::OUStringToOString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); + oldref=OUStringToOString( (*pElement->GetAttributeList())[ j ]->GetValue(),RTL_TEXTENCODING_UTF8 ); } } pElement->SetLanguageId ( language ); @@ -510,10 +510,10 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) /*****************************************************************************/ { static bool bStatusExport = true; - const rtl::OString STATUS(RTL_CONSTASCII_STRINGPARAM("status")); - const rtl::OString PUBLISH(RTL_CONSTASCII_STRINGPARAM("PUBLISH")); - const rtl::OString DEPRECATED(RTL_CONSTASCII_STRINGPARAM("DEPRECATED")); - const rtl::OString TOPIC(RTL_CONSTASCII_STRINGPARAM("topic")); + const OString STATUS(RTL_CONSTASCII_STRINGPARAM("status")); + const OString PUBLISH(RTL_CONSTASCII_STRINGPARAM("PUBLISH")); + const OString DEPRECATED(RTL_CONSTASCII_STRINGPARAM("DEPRECATED")); + const OString TOPIC(RTL_CONSTASCII_STRINGPARAM("topic")); bool bInsert = true; if ( !pCur ) @@ -532,18 +532,18 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) break; case XML_NODE_TYPE_ELEMENT: { XMLElement *pElement = ( XMLElement * ) pCur; - rtl::OString sName(rtl::OUStringToOString(pElement->GetName(), RTL_TEXTENCODING_ASCII_US)); + OString sName(OUStringToOString(pElement->GetName(), RTL_TEXTENCODING_ASCII_US)); if (sName.equalsIgnoreAsciiCase(TOPIC)) { if ( pElement->GetAttributeList()) { for (size_t j = 0 , cnt = pElement->GetAttributeList()->size(); j < cnt && bInsert; ++j) { - const rtl::OString tmpStr(rtl::OUStringToOString((*pElement->GetAttributeList())[j]->GetName(), + const OString tmpStr(OUStringToOString((*pElement->GetAttributeList())[j]->GetName(), RTL_TEXTENCODING_UTF8)); if (tmpStr.equalsIgnoreAsciiCase(STATUS)) { - rtl::OString tmpStrVal(rtl::OUStringToOString( (*pElement->GetAttributeList())[j]->GetValue(), + OString tmpStrVal(OUStringToOString( (*pElement->GetAttributeList())[j]->GetValue(), RTL_TEXTENCODING_UTF8)); if (!tmpStrVal.equalsIgnoreAsciiCase(PUBLISH) && !tmpStrVal.equalsIgnoreAsciiCase(DEPRECATED)) @@ -626,7 +626,7 @@ XMLElement& XMLElement::operator=(const XMLElement& obj){ } /*****************************************************************************/ -void XMLElement::AddAttribute( const rtl::OUString &rAttribute, const rtl::OUString &rValue ) +void XMLElement::AddAttribute( const OUString &rAttribute, const OUString &rValue ) /*****************************************************************************/ { if ( !pAttributes ) @@ -635,9 +635,9 @@ void XMLElement::AddAttribute( const rtl::OUString &rAttribute, const rtl::OUStr } /*****************************************************************************/ -void XMLElement::ChangeLanguageTag( const rtl::OUString &rValue ) +void XMLElement::ChangeLanguageTag( const OUString &rValue ) { - SetLanguageId(rtl::OUStringToOString(rValue, RTL_TEXTENCODING_UTF8)); + SetLanguageId(OUStringToOString(rValue, RTL_TEXTENCODING_UTF8)); if ( pAttributes ) { for (size_t i = 0; i < pAttributes->size(); ++i) @@ -659,7 +659,7 @@ void XMLElement::ChangeLanguageTag( const rtl::OUString &rValue ) { pElem = static_cast< XMLElement* >(pNode); pElem->ChangeLanguageTag( rValue ); - pElem->SetLanguageId(rtl::OUStringToOString(rValue, RTL_TEXTENCODING_UTF8)); + pElem->SetLanguageId(OUStringToOString(rValue, RTL_TEXTENCODING_UTF8)); pElem = NULL; pNode = NULL; } @@ -687,7 +687,7 @@ OUString XMLElement::ToOUString(){ OUStringBuffer* buffer = new OUStringBuffer(); Print(this,*buffer,true); OUString result=buffer->makeStringAndClear(); - rtl::OUString xy(result.getStr()); + OUString xy(result.getStr()); result=OUString(xy); delete buffer; return result; @@ -751,7 +751,7 @@ void XMLElement::Print(XMLNode *pCur, OUStringBuffer& buffer , bool rootelement break; case XML_NODE_TYPE_DATA: { XMLData *pData = ( XMLData * ) pCur; - rtl::OUString sData = pData->GetData(); + OUString sData = pData->GetData(); buffer.append( sData ); } break; @@ -797,7 +797,7 @@ XMLData& XMLData::operator=(const XMLData& obj){ return *this; } /*****************************************************************************/ -void XMLData::AddData( const rtl::OUString &rData) { +void XMLData::AddData( const OUString &rData) { /*****************************************************************************/ sData += rData; } @@ -962,7 +962,7 @@ void SimpleXMLParser::StartElement( const XML_Char *name, const XML_Char **atts ) /*****************************************************************************/ { - rtl::OUString sElementName = rtl::OUString( XML_CHAR_TO_OUSTRING( name )); + OUString sElementName = OUString( XML_CHAR_TO_OUSTRING( name )); XMLElement *pElement = new XMLElement( sElementName, ( XMLParentNode * ) pCurNode ); pCurNode = pElement; pCurData = NULL; @@ -970,8 +970,8 @@ void SimpleXMLParser::StartElement( int i = 0; while( atts[i] ) { pElement->AddAttribute( - rtl::OUString( XML_CHAR_TO_OUSTRING( atts[ i ] )), - rtl::OUString( XML_CHAR_TO_OUSTRING( atts[ i + 1 ] ))); + OUString( XML_CHAR_TO_OUSTRING( atts[ i ] )), + OUString( XML_CHAR_TO_OUSTRING( atts[ i + 1 ] ))); i += 2; } } @@ -995,11 +995,11 @@ void SimpleXMLParser::CharacterData( /*****************************************************************************/ { if ( !pCurData ){ - rtl::OUString x = XML_CHAR_N_TO_OUSTRING( s, len ); + OUString x = XML_CHAR_N_TO_OUSTRING( s, len ); XMLUtil::UnQuotHTML(x); pCurData = new XMLData( x , pCurNode ); }else{ - rtl::OUString x = XML_CHAR_N_TO_OUSTRING( s, len ); + OUString x = XML_CHAR_N_TO_OUSTRING( s, len ); XMLUtil::UnQuotHTML(x); pCurData->AddData( x ); @@ -1012,7 +1012,7 @@ void SimpleXMLParser::Comment( /*****************************************************************************/ { pCurData = NULL; - new XMLComment( rtl::OUString( XML_CHAR_TO_OUSTRING( data )), pCurNode ); + new XMLComment( OUString( XML_CHAR_TO_OUSTRING( data )), pCurNode ); } /*****************************************************************************/ @@ -1022,20 +1022,20 @@ void SimpleXMLParser::Default( { pCurData = NULL; new XMLDefault( - rtl::OUString( XML_CHAR_N_TO_OUSTRING( s, len )), pCurNode ); + OUString( XML_CHAR_N_TO_OUSTRING( s, len )), pCurNode ); } /*****************************************************************************/ -XMLFile *SimpleXMLParser::Execute( const rtl::OUString &rFileName, XMLFile* pXMLFileIn ) +XMLFile *SimpleXMLParser::Execute( const OUString &rFileName, XMLFile* pXMLFileIn ) /*****************************************************************************/ { aErrorInformation.eCode = XML_ERROR_NONE; aErrorInformation.nLine = 0; aErrorInformation.nColumn = 0; - aErrorInformation.sMessage = rtl::OUString( "ERROR: Unable to open file "); + aErrorInformation.sMessage = OUString( "ERROR: Unable to open file "); aErrorInformation.sMessage += rFileName; - rtl::OUString aFileURL(lcl_pathnameToAbsoluteUrl(rFileName)); + OUString aFileURL(lcl_pathnameToAbsoluteUrl(rFileName)); oslFileHandle h; if (osl_openFile(aFileURL.pData, &h, osl_File_OpenFlag_Read) @@ -1065,12 +1065,12 @@ XMLFile *SimpleXMLParser::Execute( const rtl::OUString &rFileName, XMLFile* pXML aErrorInformation.nLine = 0; aErrorInformation.nColumn = 0; if ( !pXMLFile->GetName().isEmpty()) { - aErrorInformation.sMessage = rtl::OUString( "File "); + aErrorInformation.sMessage = OUString( "File "); aErrorInformation.sMessage += pXMLFile->GetName(); - aErrorInformation.sMessage += rtl::OUString( " parsed successfully"); + aErrorInformation.sMessage += OUString( " parsed successfully"); } else - aErrorInformation.sMessage = rtl::OUString( "XML-File parsed successfully"); + aErrorInformation.sMessage = OUString( "XML-File parsed successfully"); if (!XML_Parse(aParser, reinterpret_cast< char * >(p), s, true)) { @@ -1078,84 +1078,84 @@ XMLFile *SimpleXMLParser::Execute( const rtl::OUString &rFileName, XMLFile* pXML aErrorInformation.nLine = XML_GetErrorLineNumber( aParser ); aErrorInformation.nColumn = XML_GetErrorColumnNumber( aParser ); - aErrorInformation.sMessage = rtl::OUString( "ERROR: "); + aErrorInformation.sMessage = OUString( "ERROR: "); if ( !pXMLFile->GetName().isEmpty()) aErrorInformation.sMessage += pXMLFile->GetName(); else - aErrorInformation.sMessage += rtl::OUString( "XML-File ("); - aErrorInformation.sMessage += rtl::OUString::valueOf( + aErrorInformation.sMessage += OUString( "XML-File ("); + aErrorInformation.sMessage += OUString::valueOf( sal::static_int_cast< sal_Int64 >(aErrorInformation.nLine)); - aErrorInformation.sMessage += rtl::OUString( ","); - aErrorInformation.sMessage += rtl::OUString::valueOf( + aErrorInformation.sMessage += OUString( ","); + aErrorInformation.sMessage += OUString::valueOf( sal::static_int_cast< sal_Int64 >(aErrorInformation.nColumn)); - aErrorInformation.sMessage += rtl::OUString( "): "); + aErrorInformation.sMessage += OUString( "): "); switch (aErrorInformation.eCode) { case XML_ERROR_NO_MEMORY: - aErrorInformation.sMessage += rtl::OUString( "No memory"); + aErrorInformation.sMessage += OUString( "No memory"); break; case XML_ERROR_SYNTAX: - aErrorInformation.sMessage += rtl::OUString( "Syntax"); + aErrorInformation.sMessage += OUString( "Syntax"); break; case XML_ERROR_NO_ELEMENTS: - aErrorInformation.sMessage += rtl::OUString( "No elements"); + aErrorInformation.sMessage += OUString( "No elements"); break; case XML_ERROR_INVALID_TOKEN: - aErrorInformation.sMessage += rtl::OUString( "Invalid token"); + aErrorInformation.sMessage += OUString( "Invalid token"); break; case XML_ERROR_UNCLOSED_TOKEN: - aErrorInformation.sMessage += rtl::OUString( "Unclosed token"); + aErrorInformation.sMessage += OUString( "Unclosed token"); break; case XML_ERROR_PARTIAL_CHAR: - aErrorInformation.sMessage += rtl::OUString( "Partial char"); + aErrorInformation.sMessage += OUString( "Partial char"); break; case XML_ERROR_TAG_MISMATCH: - aErrorInformation.sMessage += rtl::OUString( "Tag mismatch"); + aErrorInformation.sMessage += OUString( "Tag mismatch"); break; case XML_ERROR_DUPLICATE_ATTRIBUTE: - aErrorInformation.sMessage += rtl::OUString( "Dublicat attribute"); + aErrorInformation.sMessage += OUString( "Dublicat attribute"); break; case XML_ERROR_JUNK_AFTER_DOC_ELEMENT: - aErrorInformation.sMessage += rtl::OUString( "Junk after doc element"); + aErrorInformation.sMessage += OUString( "Junk after doc element"); break; case XML_ERROR_PARAM_ENTITY_REF: - aErrorInformation.sMessage += rtl::OUString( "Param entity ref"); + aErrorInformation.sMessage += OUString( "Param entity ref"); break; case XML_ERROR_UNDEFINED_ENTITY: - aErrorInformation.sMessage += rtl::OUString( "Undefined entity"); + aErrorInformation.sMessage += OUString( "Undefined entity"); break; case XML_ERROR_RECURSIVE_ENTITY_REF: - aErrorInformation.sMessage += rtl::OUString( "Recursive entity ref"); + aErrorInformation.sMessage += OUString( "Recursive entity ref"); break; case XML_ERROR_ASYNC_ENTITY: - aErrorInformation.sMessage += rtl::OUString( "Async_entity"); + aErrorInformation.sMessage += OUString( "Async_entity"); break; case XML_ERROR_BAD_CHAR_REF: - aErrorInformation.sMessage += rtl::OUString( "Bad char ref"); + aErrorInformation.sMessage += OUString( "Bad char ref"); break; case XML_ERROR_BINARY_ENTITY_REF: - aErrorInformation.sMessage += rtl::OUString( "Binary entity"); + aErrorInformation.sMessage += OUString( "Binary entity"); break; case XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF: - aErrorInformation.sMessage += rtl::OUString( "Attribute external entity ref"); + aErrorInformation.sMessage += OUString( "Attribute external entity ref"); break; case XML_ERROR_MISPLACED_XML_PI: - aErrorInformation.sMessage += rtl::OUString( "Misplaced xml pi"); + aErrorInformation.sMessage += OUString( "Misplaced xml pi"); break; case XML_ERROR_UNKNOWN_ENCODING: - aErrorInformation.sMessage += rtl::OUString( "Unknown encoding"); + aErrorInformation.sMessage += OUString( "Unknown encoding"); break; case XML_ERROR_INCORRECT_ENCODING: - aErrorInformation.sMessage += rtl::OUString( "Incorrect encoding"); + aErrorInformation.sMessage += OUString( "Incorrect encoding"); break; case XML_ERROR_UNCLOSED_CDATA_SECTION: - aErrorInformation.sMessage += rtl::OUString( "Unclosed cdata section"); + aErrorInformation.sMessage += OUString( "Unclosed cdata section"); break; case XML_ERROR_EXTERNAL_ENTITY_HANDLING: - aErrorInformation.sMessage += rtl::OUString( "External entity handling"); + aErrorInformation.sMessage += OUString( "External entity handling"); break; case XML_ERROR_NOT_STANDALONE: - aErrorInformation.sMessage += rtl::OUString( "Not standalone"); + aErrorInformation.sMessage += OUString( "Not standalone"); break; case XML_ERROR_NONE: break; diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index d531db496ca1..04fccfbf9484 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -86,7 +86,7 @@ int InitXrmExport( char*, char* pFilename) /*****************************************************************************/ { // instanciate Export - rtl::OString sFilename( pFilename ); + OString sFilename( pFilename ); if ( bMergeMode ) pParser = new XRMResMerge( sMergeSrc, sOutputFile, sFilename ); @@ -179,11 +179,11 @@ XRMResParser::~XRMResParser() int XRMResParser::Execute( int nToken, char * pToken ) /*****************************************************************************/ { - rtl::OString rToken( pToken ); + OString rToken( pToken ); switch ( nToken ) { case XRM_TEXT_START:{ - rtl::OString sNewGID = GetAttribute( rToken, "id" ); + OString sNewGID = GetAttribute( rToken, "id" ); if ( sNewGID != sGID ) { sGID = sNewGID; } @@ -196,14 +196,14 @@ int XRMResParser::Execute( int nToken, char * pToken ) case XRM_TEXT_END: { sCurrentCloseTag = rToken; - sResourceType = rtl::OString ( "readmeitem" ); - sLangAttribute = rtl::OString ( "xml:lang" ); + sResourceType = OString ( "readmeitem" ); + sLangAttribute = OString ( "xml:lang" ); WorkOnText( sCurrentOpenTag, sCurrentText ); Output( sCurrentText ); EndOfText( sCurrentOpenTag, sCurrentCloseTag ); bText = sal_False; - rToken = rtl::OString(""); - sCurrentText = rtl::OString(""); + rToken = OString(""); + sCurrentText = OString(""); } break; @@ -219,7 +219,7 @@ int XRMResParser::Execute( int nToken, char * pToken ) case DESC_TEXT_START:{ if (bDisplayName) { - sGID = rtl::OString("dispname"); + sGID = OString("dispname"); bText = sal_True; sCurrentText = ""; sCurrentOpenTag = rToken; @@ -231,14 +231,14 @@ int XRMResParser::Execute( int nToken, char * pToken ) case DESC_TEXT_END: { if (bDisplayName) { sCurrentCloseTag = rToken; - sResourceType = rtl::OString ( "description" ); - sLangAttribute = rtl::OString ( "lang" ); + sResourceType = OString ( "description" ); + sLangAttribute = OString ( "lang" ); WorkOnText( sCurrentOpenTag, sCurrentText ); Output( sCurrentText ); EndOfText( sCurrentOpenTag, sCurrentCloseTag ); bText = sal_False; - rToken = rtl::OString(""); - sCurrentText = rtl::OString(""); + rToken = OString(""); + sCurrentText = OString(""); } } break; @@ -255,17 +255,17 @@ int XRMResParser::Execute( int nToken, char * pToken ) case DESC_EXTENSION_DESCRIPTION_SRC: { if (bExtensionDescription) { - sGID = rtl::OString("extdesc"); - sResourceType = rtl::OString ( "description" ); - sLangAttribute = rtl::OString ( "lang" ); + sGID = OString("extdesc"); + sResourceType = OString ( "description" ); + sLangAttribute = OString ( "lang" ); sCurrentOpenTag = rToken; - sCurrentText = rtl::OString(""); + sCurrentText = OString(""); Output( rToken ); WorkOnDesc( sCurrentOpenTag, sCurrentText ); sCurrentCloseTag = rToken; Output( sCurrentText ); - rToken = rtl::OString(""); - sCurrentText = rtl::OString(""); + rToken = OString(""); + sCurrentText = OString(""); } } break; @@ -285,13 +285,13 @@ int XRMResParser::Execute( int nToken, char * pToken ) } /*****************************************************************************/ -rtl::OString XRMResParser::GetAttribute( const rtl::OString &rToken, const rtl::OString &rAttribute ) +OString XRMResParser::GetAttribute( const OString &rToken, const OString &rAttribute ) /*****************************************************************************/ { - rtl::OString sTmp( rToken ); + OString sTmp( rToken ); sTmp = sTmp.replace('\t', ' '); - rtl::OString sSearch( " " ); + OString sSearch( " " ); sSearch += rAttribute; sSearch += "="; sal_Int32 nPos = sTmp.indexOf( sSearch ); @@ -299,29 +299,29 @@ rtl::OString XRMResParser::GetAttribute( const rtl::OString &rToken, const rtl:: if ( nPos != -1 ) { sTmp = sTmp.copy( nPos ); - rtl::OString sId = sTmp.getToken(1, '"'); + OString sId = sTmp.getToken(1, '"'); return sId; } - return rtl::OString(); + return OString(); } /*****************************************************************************/ -void XRMResParser::Error( const rtl::OString &rError ) +void XRMResParser::Error( const OString &rError ) /*****************************************************************************/ { yyerror(( char * ) rError.getStr()); } /*****************************************************************************/ -void XRMResParser::ConvertStringToDBFormat( rtl::OString &rString ) +void XRMResParser::ConvertStringToDBFormat( OString &rString ) /*****************************************************************************/ { rString = rString.trim().replaceAll("\t", "\\t"); } /*****************************************************************************/ -void XRMResParser::ConvertStringToXMLFormat( rtl::OString &rString ) +void XRMResParser::ConvertStringToXMLFormat( OString &rString ) /*****************************************************************************/ { rString = rString.replaceAll("\\t", "\t"); @@ -343,7 +343,7 @@ XRMResExport::XRMResExport( pOutputStream.open( rOutputFile, PoOfstream::APP ); if (!pOutputStream.isOpen()) { - rtl::OString sError( "Unable to open output file: " ); + OString sError( "Unable to open output file: " ); sError += rOutputFile; Error( sError ); } @@ -357,17 +357,17 @@ XRMResExport::~XRMResExport() delete pResData; } -void XRMResExport::Output( const rtl::OString& ) {} +void XRMResExport::Output( const OString& ) {} /*****************************************************************************/ void XRMResExport::WorkOnDesc( - const rtl::OString &rOpenTag, - rtl::OString &rText + const OString &rOpenTag, + OString &rText ) /*****************************************************************************/ { - rtl::OString sDescFileName( - sInputFileName.replaceAll("description.xml", rtl::OString())); + OString sDescFileName( + sInputFileName.replaceAll("description.xml", OString())); sDescFileName += GetAttribute( rOpenTag, "xlink:href" ); ifstream file (sDescFileName.getStr(), ios::in|ios::binary|ios::ate); if (file.is_open()) { @@ -377,7 +377,7 @@ void XRMResExport::WorkOnDesc( file.read (memblock, size); file.close(); memblock[size] = '\0'; - rText = rtl::OString(memblock).replaceAll("\n", "\\n"); + rText = OString(memblock).replaceAll("\n", "\\n"); delete[] memblock; } WorkOnText( rOpenTag, rText ); @@ -386,40 +386,40 @@ void XRMResExport::WorkOnDesc( //*****************************************************************************/ void XRMResExport::WorkOnText( - const rtl::OString &rOpenTag, - rtl::OString &rText + const OString &rOpenTag, + OString &rText ) /*****************************************************************************/ { - rtl::OString sLang( GetAttribute( rOpenTag, sLangAttribute )); + OString sLang( GetAttribute( rOpenTag, sLangAttribute )); if ( !pResData ) { - rtl::OString sPlatform( "" ); + OString sPlatform( "" ); pResData = new ResData( sPlatform, GetGID() ); } - rtl::OString sText(rText); + OString sText(rText); ConvertStringToDBFormat(sText); pResData->sText[sLang] = sText; } /*****************************************************************************/ void XRMResExport::EndOfText( - const rtl::OString &, - const rtl::OString & + const OString &, + const OString & ) /*****************************************************************************/ { if ( pResData ) { - rtl::OString sCur; + OString sCur; for( unsigned int n = 0; n < aLanguages.size(); n++ ) { sCur = aLanguages[ n ]; - rtl::OString sAct( - pResData->sText[sCur].replaceAll("\x0A", rtl::OString())); + OString sAct( + pResData->sText[sCur].replaceAll("\x0A", OString())); if( !sAct.isEmpty() ) common::writePoEntry( @@ -457,7 +457,7 @@ XRMResMerge::XRMResMerge( pOutputStream.open( rOutputFile.getStr(), std::ios_base::out | std::ios_base::trunc); if (!pOutputStream.is_open()) { - rtl::OString sError( "Unable to open output file: " ); + OString sError( "Unable to open output file: " ); sError += rOutputFile; Error( sError ); } @@ -474,8 +474,8 @@ XRMResMerge::~XRMResMerge() /*****************************************************************************/ void XRMResMerge::WorkOnDesc( - const rtl::OString &rOpenTag, - rtl::OString &rText + const OString &rOpenTag, + OString &rText ) /*****************************************************************************/ { @@ -483,32 +483,32 @@ void XRMResMerge::WorkOnDesc( if ( pMergeDataFile && pResData ) { PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); if ( pEntrys ) { - rtl::OString sCur; - rtl::OString sDescFilename = GetAttribute ( rOpenTag, "xlink:href" ); + OString sCur; + OString sDescFilename = GetAttribute ( rOpenTag, "xlink:href" ); for( unsigned int n = 0; n < aLanguages.size(); n++ ){ sCur = aLanguages[ n ]; - rtl::OString sContent; + OString sContent; if ( !sCur.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("en-US")) && ( pEntrys->GetText( sContent, STRING_TYP_TEXT, sCur, sal_True )) && ( sContent != "-" ) && !sContent.isEmpty()) { - rtl::OString sText( sContent ); - rtl::OString sAdditionalLine( "\n " ); + OString sText( sContent ); + OString sAdditionalLine( "\n " ); sAdditionalLine += rOpenTag; - rtl::OString sSearch = sLangAttribute; + OString sSearch = sLangAttribute; sSearch += "=\""; - rtl::OString sReplace( sSearch ); + OString sReplace( sSearch ); sSearch += GetAttribute( rOpenTag, sLangAttribute ); sReplace += sCur; sAdditionalLine = sAdditionalLine.replaceFirst( sSearch, sReplace); - sSearch = rtl::OString("xlink:href=\""); + sSearch = OString("xlink:href=\""); sReplace = sSearch; - rtl::OString sLocDescFilename = sDescFilename; + OString sLocDescFilename = sDescFilename; sLocDescFilename = sLocDescFilename.replaceFirst( "en-US", sCur); @@ -526,7 +526,7 @@ void XRMResMerge::WorkOnDesc( << " does not contain any /\n"; throw false; //TODO } - rtl::OString sOutputDescFile( + OString sOutputDescFile( sOutputFile.copy(0, i + 1) + sLocDescFilename); sText = sText.replaceAll("\\n", "\n"); ofstream file(sOutputDescFile.getStr()); @@ -549,23 +549,23 @@ void XRMResMerge::WorkOnDesc( /*****************************************************************************/ void XRMResMerge::WorkOnText( - const rtl::OString &rOpenTag, - rtl::OString &rText + const OString &rOpenTag, + OString &rText ) /*****************************************************************************/ { - rtl::OString sLang( GetAttribute( rOpenTag, sLangAttribute )); + OString sLang( GetAttribute( rOpenTag, sLangAttribute )); if ( pMergeDataFile ) { if ( !pResData ) { - rtl::OString sPlatform( "" ); + OString sPlatform( "" ); pResData = new ResData( sPlatform, GetGID() , sFilename ); pResData->sResTyp = sResourceType; } PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); if ( pEntrys ) { - rtl::OString sContent; + OString sContent; if ( !sLang.equalsIgnoreAsciiCase("en-US") && ( pEntrys->GetText( sContent, STRING_TYP_TEXT, sLang )) && @@ -580,7 +580,7 @@ void XRMResMerge::WorkOnText( } /*****************************************************************************/ -void XRMResMerge::Output( const rtl::OString& rOutput ) +void XRMResMerge::Output( const OString& rOutput ) /*****************************************************************************/ { if (!rOutput.isEmpty()) @@ -589,8 +589,8 @@ void XRMResMerge::Output( const rtl::OString& rOutput ) /*****************************************************************************/ void XRMResMerge::EndOfText( - const rtl::OString &rOpenTag, - const rtl::OString &rCloseTag + const OString &rOpenTag, + const OString &rCloseTag ) /*****************************************************************************/ { @@ -599,22 +599,22 @@ void XRMResMerge::EndOfText( if ( pMergeDataFile && pResData ) { PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); if ( pEntrys ) { - rtl::OString sCur; + OString sCur; for( unsigned int n = 0; n < aLanguages.size(); n++ ){ sCur = aLanguages[ n ]; - rtl::OString sContent; + OString sContent; if (!sCur.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("en-US")) && ( pEntrys->GetText( sContent, STRING_TYP_TEXT, sCur, sal_True )) && ( sContent != "-" ) && !sContent.isEmpty() && helper::isWellFormedXML( sContent )) { - rtl::OString sText( sContent ); - rtl::OString sAdditionalLine( "\n " ); + OString sText( sContent ); + OString sAdditionalLine( "\n " ); sAdditionalLine += rOpenTag; - rtl::OString sSearch = sLangAttribute; + OString sSearch = sLangAttribute; sSearch += "=\""; - rtl::OString sReplace( sSearch ); + OString sReplace( sSearch ); sSearch += GetAttribute( rOpenTag, sLangAttribute ); sReplace += sCur; |