diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-08-23 00:38:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-08-23 10:35:45 +0100 |
commit | 050b80a6fc9b6f0c550c5ca20fa3c93e9552c13a (patch) | |
tree | adde9066eb1669bc9df616b839c96ab6070d1b12 /tools | |
parent | af6ce167af13f896e1786ef7d3c2d194aaf1c3dd (diff) |
ditch deprecated api
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/string.hxx | 4 | ||||
-rw-r--r-- | tools/source/inet/inetstrm.cxx | 8 | ||||
-rw-r--r-- | tools/source/stream/stream.cxx | 12 | ||||
-rw-r--r-- | tools/source/stream/strmunx.cxx | 10 | ||||
-rw-r--r-- | tools/source/string/tstring.cxx | 9 | ||||
-rw-r--r-- | tools/source/string/tustring.cxx | 20 |
6 files changed, 16 insertions, 47 deletions
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index ae4d8a9955ea..fc03584c6de1 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -199,8 +199,6 @@ public: return rtl::OString (reinterpret_cast<rtl_String*>(mpData)); } - sal_Int32 ToInt32() const; - ByteString& Assign( const ByteString& rStr ); ByteString& Assign( const rtl::OString& rStr ); ByteString& Assign( const sal_Char* pCharStr ); @@ -446,8 +444,6 @@ public: static UniString CreateFromInt32( sal_Int32 n, sal_Int16 nRadix = 10 ); static UniString CreateFromInt64( sal_Int64 n, sal_Int16 nRadix = 10 ); - static UniString CreateFromFloat( float f ); - static UniString CreateFromDouble( double d ); static const UniString& EmptyString(); sal_Int32 ToInt32() const; sal_Int64 ToInt64() const; diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx index 7a04ea24af20..6243889cfe7f 100644 --- a/tools/source/inet/inetstrm.cxx +++ b/tools/source/inet/inetstrm.cxx @@ -1609,13 +1609,13 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize) if (pMsg->GetMultipartBoundary().Len() == 0) { // Determine boundary. - ByteString aType ( - pMsg->GetContentType(), RTL_TEXTENCODING_ASCII_US); - ByteString aLowerType (aType); + rtl::OString aType(rtl::OUStringToOString( + pMsg->GetContentType(), RTL_TEXTENCODING_ASCII_US)); + ByteString aLowerType(aType); aLowerType.ToLowerAscii(); sal_uInt16 nPos = aLowerType.Search ("boundary="); - ByteString aBoundary (aType.Copy (nPos + 9)); + ByteString aBoundary(aType.copy(nPos + 9)); aBoundary.EraseLeadingAndTrailingChars (' '); aBoundary.EraseLeadingAndTrailingChars ('"'); diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index db7820e838c1..a1f55392749a 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -896,8 +896,8 @@ sal_Bool SvStream::WriteUnicodeOrByteText( const String& rStr, rtl_TextEncoding return WriteUnicodeText( rStr ); else { - ByteString aStr( rStr, eDestCharSet ); - Write( aStr.GetBuffer(), aStr.Len() ); + rtl::OString aStr(rtl::OUStringToOString(rStr, eDestCharSet)); + Write(aStr.getStr(), aStr.getLength()); return nError == SVSTREAM_OK; } } @@ -910,7 +910,7 @@ sal_Bool SvStream::WriteUnicodeOrByteText( const String& rStr, rtl_TextEncoding sal_Bool SvStream::WriteByteStringLine( const String& rStr, rtl_TextEncoding eDestCharSet ) { - return WriteLine( ByteString( rStr, eDestCharSet ) ); + return WriteLine(rtl::OUStringToOString(rStr, eDestCharSet)); } sal_Bool SvStream::WriteLine( const ByteString& rStr ) @@ -947,8 +947,8 @@ sal_Bool SvStream::WriteUniOrByteChar( sal_Unicode ch, rtl_TextEncoding eDestCha *this << ch; else { - ByteString aStr( ch, eDestCharSet ); - Write( aStr.GetBuffer(), aStr.Len() ); + rtl::OString aStr(&ch, 1, eDestCharSet); + Write(aStr.getStr(), aStr.getLength()); } return nError == SVSTREAM_OK; } @@ -1583,7 +1583,7 @@ SvStream& SvStream::WriteByteString( const UniString& rStr, rtl_TextEncoding eDe return *this; } - return WriteByteString(ByteString( rStr, eDestCharSet )); + return WriteByteString(rtl::OUStringToOString(rStr, eDestCharSet)); } // ----------------------------------------------------------------------- diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index 5c7412208905..04d45a3c9964 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -736,12 +736,14 @@ void SvFileStream::Close() { InternalStreamLock::UnlockFile( 0, 0, this ); - if ( IsOpen() ) + if ( IsOpen() ) { #ifdef DBG_UTIL - ByteString aTraceStr( "SvFileStream::Close(): " ); - aTraceStr += ByteString(aFilename, osl_getThreadTextEncoding()); - OSL_TRACE( "%s", aTraceStr.GetBuffer() ); + rtl::OStringBuffer aTraceStr( + RTL_CONSTASCII_STRINGPARAM("SvFileStream::Close(): ")); + aTraceStr.append(rtl::OUStringToOString(aFilename, + osl_getThreadTextEncoding())); + OSL_TRACE("%s", aTraceStr.getStr()); #endif Flush(); diff --git a/tools/source/string/tstring.cxx b/tools/source/string/tstring.cxx index e0872ee66049..833e0d4fa9c7 100644 --- a/tools/source/string/tstring.cxx +++ b/tools/source/string/tstring.cxx @@ -90,15 +90,6 @@ xub_StrLen ImplStringLen( const sal_Unicode* pStr ) // ----------------------------------------------------------------------- -sal_Int32 ByteString::ToInt32() const -{ - DBG_CHKTHIS( ByteString, DbgCheckByteString ); - - return atoi( mpData->maStr ); -} - -// ----------------------------------------------------------------------- - sal_Bool ByteString::IsLowerAscii() const { DBG_CHKTHIS( ByteString, DbgCheckByteString ); diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index c7ab3162f601..877b6d86fb49 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -93,26 +93,6 @@ UniString UniString::CreateFromInt64( sal_Int64 n, sal_Int16 nRadix ) // ----------------------------------------------------------------------- -UniString UniString::CreateFromFloat( float f ) -{ - sal_Unicode aBuf[RTL_USTR_MAX_VALUEOFFLOAT]; - BOOST_STATIC_ASSERT(RTL_USTR_MAX_VALUEOFFLOAT <= STRING_MAXLEN); - return UniString( - aBuf, static_cast< xub_StrLen >(rtl_ustr_valueOfFloat( aBuf, f )) ); -} - -// ----------------------------------------------------------------------- - -UniString UniString::CreateFromDouble( double d ) -{ - sal_Unicode aBuf[RTL_USTR_MAX_VALUEOFDOUBLE]; - BOOST_STATIC_ASSERT(RTL_USTR_MAX_VALUEOFDOUBLE <= STRING_MAXLEN); - return UniString( - aBuf, static_cast< xub_StrLen >(rtl_ustr_valueOfDouble( aBuf, d )) ); -} - -// ----------------------------------------------------------------------- - namespace { struct Empty : public rtl::Static< const UniString, Empty> {}; } const UniString& UniString::EmptyString() { |