diff options
author | Jean-Noël Rouvignac <jn.rouvignac@gmail.com> | 2013-02-08 09:06:10 +0100 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-02-08 14:57:16 +0000 |
commit | 9e310cc32923ceb4b18d97ce68d54a339b935f01 (patch) | |
tree | d79b44b80c15f6bdb3116db4c9b6955a9e6cb4c9 /tools | |
parent | 9c427991d9658a870ee0eb1bdc4cd3b393c93fd5 (diff) |
fdo#38838 Some removal/replacement of the String/UniString with OUString
Change-Id: I6daea312198fae3a9717bd8d4fea6371aa4cd275
Reviewed-on: https://gerrit.libreoffice.org/1962
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Tor Lillqvist <tml@iki.fi>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/resmgr.hxx | 8 | ||||
-rw-r--r-- | tools/source/inet/inetstrm.cxx | 5 | ||||
-rw-r--r-- | tools/source/rc/resmgr.cxx | 24 |
3 files changed, 18 insertions, 19 deletions
diff --git a/tools/inc/tools/resmgr.hxx b/tools/inc/tools/resmgr.hxx index 8a6e44cf481c..37aac4be9b6a 100644 --- a/tools/inc/tools/resmgr.hxx +++ b/tools/inc/tools/resmgr.hxx @@ -117,10 +117,10 @@ private: // the next two methods are needed to prevent the string hook called // with the res mgr mutex locked // like GetString, but doesn't call the string hook - TOOLS_DLLPRIVATE static sal_uInt32 GetStringWithoutHook( UniString& rStr, + TOOLS_DLLPRIVATE static sal_uInt32 GetStringWithoutHook( OUString& rStr, const sal_uInt8* pStr ); // like ReadString but doesn't call the string hook - TOOLS_DLLPRIVATE UniString ReadStringWithoutHook(); + TOOLS_DLLPRIVATE OUString ReadStringWithoutHook(); static ResMgr* ImplCreateResMgr( InternalResMgr* pImpl ) { return new ResMgr( pImpl ); } @@ -163,7 +163,7 @@ public: { return( pHT->GetGlobOff() ); } /// Return a string and its length out of the resource - static sal_uInt32 GetString( UniString& rStr, const sal_uInt8* pStr ); + static sal_uInt32 GetString( OUString& rStr, const sal_uInt8* pStr ); /// Return a byte string and its length out of the resource static sal_uInt32 GetByteString( rtl::OString& rStr, const sal_uInt8* pStr ); @@ -190,7 +190,7 @@ public: sal_Int16 ReadShort(); sal_Int32 ReadLong(); - UniString ReadString(); + OUString ReadString(); rtl::OString ReadByteString(); /// Generate auto help ID for current resource stack diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx index fb1c462d18e1..3b7d3487e922 100644 --- a/tools/source/inet/inetstrm.cxx +++ b/tools/source/inet/inetstrm.cxx @@ -1188,10 +1188,9 @@ int INetMIMEMessageStream::GetMsgLine (sal_Char *pData, sal_uIntPtr nSize) if (aContentType.Len()) { // Determine default Content-Type. - UniString aDefaultType = pMsg->GetDefaultContentType(); + OUString aDefaultType = pMsg->GetDefaultContentType(); - if (aDefaultType.CompareIgnoreCaseToAscii ( - aContentType, aContentType.Len()) == 0) + if (aDefaultType.equalsIgnoreAsciiCase(aContentType)) { // No need to specify default. pMsg->SetContentType (String()); diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx index 4d578f3a39a5..3a2a083f6c16 100644 --- a/tools/source/rc/resmgr.cxx +++ b/tools/source/rc/resmgr.cxx @@ -488,7 +488,7 @@ InternalResMgr::~InternalResMgr() const sal_Char* pLogFile = getenv( "STAR_RESOURCE_LOGGING" ); if ( pLogFile ) { - SvFileStream aStm( UniString( pLogFile, RTL_TEXTENCODING_ASCII_US ), STREAM_WRITE ); + SvFileStream aStm( OUString::createFromAscii( pLogFile ), STREAM_WRITE ); aStm.Seek( STREAM_SEEK_TO_END ); rtl::OStringBuffer aLine(RTL_CONSTASCII_STRINGPARAM("FileName: ")); aLine.append(rtl::OUStringToOString(aFileName, @@ -665,7 +665,7 @@ void InternalResMgr::FreeGlobalRes( void * pResHandle, void * pResource ) #ifdef DBG_UTIL -UniString GetTypeRes_Impl( const ResId& rTypeId ) +OUString GetTypeRes_Impl( const ResId& rTypeId ) { // Return on resource errors static int bInUse = sal_False; @@ -1236,11 +1236,11 @@ sal_uInt64 ResMgr::GetUInt64( void* pDatum ) (sal_uInt64(*((sal_uInt8*)pDatum + 7)) << 0) ); } -sal_uInt32 ResMgr::GetStringWithoutHook( UniString& rStr, const sal_uInt8* pStr ) +sal_uInt32 ResMgr::GetStringWithoutHook( OUString& rStr, const sal_uInt8* pStr ) { sal_uInt32 nLen=0; sal_uInt32 nRet = GetStringSize( pStr, nLen ); - UniString aString( (sal_Char*)pStr, RTL_TEXTENCODING_UTF8, + OUString aString( (sal_Char*)pStr, RTL_TEXTENCODING_UTF8, RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT | RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT ); @@ -1248,9 +1248,9 @@ sal_uInt32 ResMgr::GetStringWithoutHook( UniString& rStr, const sal_uInt8* pStr return nRet; } -sal_uInt32 ResMgr::GetString( UniString& rStr, const sal_uInt8* pStr ) +sal_uInt32 ResMgr::GetString( OUString& rStr, const sal_uInt8* pStr ) { - UniString aString; + OUString aString; sal_uInt32 nRet = GetStringWithoutHook( aString, pStr ); if ( pImplResHookProc ) aString = pImplResHookProc( aString ); @@ -1613,20 +1613,20 @@ sal_Int32 ResMgr::ReadLong() return n; } -UniString ResMgr::ReadStringWithoutHook() +OUString ResMgr::ReadStringWithoutHook() { osl::Guard<osl::Mutex> aGuard( getResMgrMutex() ); if( pFallbackResMgr ) return pFallbackResMgr->ReadStringWithoutHook(); - UniString aRet; + OUString aRet; const ImpRCStack& rTop = aStack[nCurStack]; if( (rTop.Flags & RC_NOTFOUND) ) { #if OSL_DEBUG_LEVEL > 0 - aRet = OUString( RTL_CONSTASCII_USTRINGPARAM( "<resource not found>" ) ); + aRet = OUString("<resource not found>"); #endif } else @@ -1635,9 +1635,9 @@ UniString ResMgr::ReadStringWithoutHook() return aRet; } -UniString ResMgr::ReadString() +OUString ResMgr::ReadString() { - UniString aRet = ReadStringWithoutHook(); + OUString aRet = ReadStringWithoutHook(); if ( pImplResHookProc ) aRet = pImplResHookProc( aRet ); return aRet; @@ -1827,7 +1827,7 @@ rtl::OUString SimpleResMgr::ReadString( sal_uInt32 nId ) DBG_ASSERT( m_pResImpl, "SimpleResMgr::ReadString : have no impl class !" ); // perhaps constructed with an invalid filename ? - UniString sReturn; + OUString sReturn; if ( !m_pResImpl ) return sReturn; |