summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-08-23 00:38:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-08-23 10:35:45 +0100
commit050b80a6fc9b6f0c550c5ca20fa3c93e9552c13a (patch)
treeadde9066eb1669bc9df616b839c96ab6070d1b12
parentaf6ce167af13f896e1786ef7d3c2d194aaf1c3dd (diff)
ditch deprecated api
-rw-r--r--lotuswordpro/source/filter/lwptblformula.cxx48
-rw-r--r--lotuswordpro/source/filter/lwptblformula.hxx16
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.cxx4
-rw-r--r--sw/source/ui/utlui/attrdesc.cxx10
-rw-r--r--tools/inc/tools/string.hxx4
-rw-r--r--tools/source/inet/inetstrm.cxx8
-rw-r--r--tools/source/stream/stream.cxx12
-rw-r--r--tools/source/stream/strmunx.cxx10
-rw-r--r--tools/source/string/tstring.cxx9
-rw-r--r--tools/source/string/tustring.cxx20
10 files changed, 44 insertions, 97 deletions
diff --git a/lotuswordpro/source/filter/lwptblformula.cxx b/lotuswordpro/source/filter/lwptblformula.cxx
index 89c3f840a973..23c207b2aa2b 100644
--- a/lotuswordpro/source/filter/lwptblformula.cxx
+++ b/lotuswordpro/source/filter/lwptblformula.cxx
@@ -68,7 +68,7 @@
#include "lwptblformula.hxx"
#include "lwptablelayout.hxx"
-
+#include <rtl/ustrbuf.hxx>
#include <boost/scoped_array.hpp>
//////////////////////////////////////////////////////////////////
@@ -442,16 +442,9 @@ LwpFormulaConst::LwpFormulaConst(double dVal)
m_dVal = dVal;
}
-/**
-*
-* @date 03/26/2005
-* @param
-* @param
-* @return sal_Bool.
-*/
-String LwpFormulaConst::ToString(LwpTableLayout* /*pCellsMap*/)
+rtl::OUString LwpFormulaConst::ToString(LwpTableLayout* /*pCellsMap*/)
{
- return String::CreateFromDouble(m_dVal);
+ return rtl::OUString::valueOf(m_dVal);
}
/**
@@ -486,14 +479,8 @@ LwpFormulaCellAddr::LwpFormulaCellAddr(sal_Int16 aCol, sal_Int16 aRow)
* @param
* @return String
*/
-String LwpFormulaCellAddr::ToString(LwpTableLayout* pCellsMap)
+rtl::OUString LwpFormulaCellAddr::ToString(LwpTableLayout* pCellsMap)
{
-// String aCellAddr;
-// aCellAddr.AppendAscii("<");//&lt;
-// aCellAddr+=m_aCol;
-// aCellAddr+=m_aRow;
-// aCellAddr.AppendAscii(">");//&gt;
-
String aCellAddr;
aCellAddr.AppendAscii("<");//&lt;
@@ -528,17 +515,8 @@ LwpFormulaCellRangeAddr::LwpFormulaCellRangeAddr(sal_Int16 aStartCol,
* @param
* @return String.
*/
-String LwpFormulaCellRangeAddr::ToString(LwpTableLayout* pCellsMap)
+rtl::OUString LwpFormulaCellRangeAddr::ToString(LwpTableLayout* pCellsMap)
{
-// String aCellAddr;
-// aCellAddr.AppendAscii("<");//&lt;
-// aCellAddr+=m_aStartCol;
-// aCellAddr+=m_aStartRow;
-// aCellAddr.AppendAscii(":");
-// aCellAddr+=m_aEndCol;
-// aCellAddr+=m_aEndRow;
-// aCellAddr.AppendAscii(">");//&gt;
-
String aCellAddr;
aCellAddr.AppendAscii("<");//&lt;
@@ -605,11 +583,11 @@ void LwpFormulaFunc::AddArg(LwpFormulaArg* pArg)
*/
String LwpFormulaFunc::ToArgString(LwpTableLayout* pCellsMap)
{
- String aFormula;
- aFormula.AppendAscii("(");
- aFormula+=ToString(pCellsMap);
- aFormula.AppendAscii(")");
- return aFormula;
+ rtl::OUStringBuffer aFormula;
+ aFormula.append(static_cast<sal_Unicode>('('));
+ aFormula.append(ToString(pCellsMap));
+ aFormula.append(static_cast<sal_Unicode>(')'));
+ return aFormula.makeStringAndClear();
}
/**
* Convert the function to a formula string.
@@ -618,7 +596,7 @@ String LwpFormulaFunc::ToArgString(LwpTableLayout* pCellsMap)
* @param
* @return sal_Bool.
*/
-String LwpFormulaFunc::ToString(LwpTableLayout* pCellsMap)
+rtl::OUString LwpFormulaFunc::ToString(LwpTableLayout* pCellsMap)
{
String aFormula;
@@ -654,7 +632,7 @@ String LwpFormulaFunc::ToString(LwpTableLayout* pCellsMap)
* @param
* @return sal_Bool.
*/
-String LwpFormulaOp::ToString(LwpTableLayout* pCellsMap)
+rtl::OUString LwpFormulaOp::ToString(LwpTableLayout* pCellsMap)
{
String aFormula;
if (2==m_aArgs.size())
@@ -687,7 +665,7 @@ String LwpFormulaOp::ToString(LwpTableLayout* pCellsMap)
* @param
* @return sal_Bool.
*/
-String LwpFormulaUnaryOp::ToString(LwpTableLayout* pCellsMap)
+rtl::OUString LwpFormulaUnaryOp::ToString(LwpTableLayout* pCellsMap)
{
String aFormula;
if (1==m_aArgs.size())
diff --git a/lotuswordpro/source/filter/lwptblformula.hxx b/lotuswordpro/source/filter/lwptblformula.hxx
index 7901e83d939b..648b9266f329 100644
--- a/lotuswordpro/source/filter/lwptblformula.hxx
+++ b/lotuswordpro/source/filter/lwptblformula.hxx
@@ -109,7 +109,7 @@ class LwpTableLayout;
class LwpFormulaArg
{
public:
- virtual String ToString(LwpTableLayout* pCellsMap)=0;
+ virtual rtl::OUString ToString(LwpTableLayout* pCellsMap)=0;
virtual String ToArgString(LwpTableLayout* pCellsMap){ return ToString(pCellsMap);}
};
@@ -124,7 +124,7 @@ class LwpFormulaConst:public LwpFormulaArg
{
public:
LwpFormulaConst( double dVal);
- virtual String ToString(LwpTableLayout* pCellsMap);
+ virtual rtl::OUString ToString(LwpTableLayout* pCellsMap);
private:
double m_dVal;
};
@@ -133,7 +133,7 @@ class LwpFormulaText:public LwpFormulaArg
{
public:
LwpFormulaText( String aText);
- virtual String ToString(LwpTableLayout* /*pCellsMap*/){return m_aText;}
+ virtual rtl::OUString ToString(LwpTableLayout* /*pCellsMap*/){return m_aText;}
private:
String m_aText;
};
@@ -146,7 +146,7 @@ public:
sal_Int16 GetCol(){return m_aCol;}
sal_Int16 GetRow(){return m_aRow;}
- virtual String ToString(LwpTableLayout* pCellsMap);
+ virtual rtl::OUString ToString(LwpTableLayout* pCellsMap);
private:
sal_Int16 m_aCol;
sal_Int16 m_aRow;
@@ -157,7 +157,7 @@ class LwpFormulaCellRangeAddr:public LwpFormulaArg
public:
LwpFormulaCellRangeAddr(sal_Int16 aStartCol, sal_Int16 aStartRow, sal_Int16 aEndCol, sal_Int16 aEndRow);
- virtual String ToString(LwpTableLayout* pCellsMap);
+ virtual rtl::OUString ToString(LwpTableLayout* pCellsMap);
private:
sal_Int16 m_aStartCol;
sal_Int16 m_aStartRow;
@@ -173,7 +173,7 @@ public:
void AddArg(LwpFormulaArg* pArg);
- virtual String ToString(LwpTableLayout* pCellsMap);
+ virtual rtl::OUString ToString(LwpTableLayout* pCellsMap);
String ToArgString(LwpTableLayout* pCellsMap);
protected:
@@ -185,14 +185,14 @@ class LwpFormulaOp : public LwpFormulaFunc
{
public:
LwpFormulaOp(sal_uInt16 nTokenType):LwpFormulaFunc(nTokenType){;}
- String ToString(LwpTableLayout* pCellsMap);
+ virtual rtl::OUString ToString(LwpTableLayout* pCellsMap);
};
class LwpFormulaUnaryOp : public LwpFormulaFunc
{
public:
LwpFormulaUnaryOp(sal_uInt16 nTokenType):LwpFormulaFunc(nTokenType){;}
- String ToString(LwpTableLayout* pCellsMap);
+ virtual rtl::OUString ToString(LwpTableLayout* pCellsMap);
};
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index b75eaf23620c..a10db789f2b6 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -1947,7 +1947,7 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(Window* pParent,
if( nPos != LISTBOX_ENTRY_NOTFOUND )
mpCBDuration->SelectEntryPos( nPos );
else
- mpCBDuration->SetText( String::CreateFromDouble( fDuration ) );
+ mpCBDuration->SetText(rtl::OUString::valueOf(fDuration));
}
}
@@ -1978,7 +1978,7 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(Window* pParent,
if( nPos != LISTBOX_ENTRY_NOTFOUND )
mpCBRepeat->SelectEntryPos( nPos );
else
- mpCBRepeat->SetText( String::CreateFromDouble( fRepeat ) );
+ mpCBRepeat->SetText(rtl::OUString::valueOf(fRepeat));
}
else if( aRepeatCount.getValueType() == ::getCppuType((const Timing*)0) )
{
diff --git a/sw/source/ui/utlui/attrdesc.cxx b/sw/source/ui/utlui/attrdesc.cxx
index 79b59b8b66ea..e8eb645c5640 100644
--- a/sw/source/ui/utlui/attrdesc.cxx
+++ b/sw/source/ui/utlui/attrdesc.cxx
@@ -36,6 +36,7 @@
#include <svtools/grfmgr.hxx>
#include <unotools/intlwrapper.hxx>
#include <comphelper/processfactory.hxx>
+#include <rtl/ustrbuf.hxx>
#include <fmtanchr.hxx>
#include <fmtfsize.hxx>
#include <fmtinfmt.hxx>
@@ -1204,22 +1205,21 @@ SfxItemPresentation SwGammaGrf::GetPresentation(
SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
String &rText, const IntlWrapper* /*pIntl*/) const
{
+ rtl::OUStringBuffer aText;
switch( ePres )
{
case SFX_ITEM_PRESENTATION_NAMELESS:
case SFX_ITEM_PRESENTATION_COMPLETE:
if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
- rText = SW_RESSTR( STR_GAMMA );
- else if( rText.Len() )
- rText.Erase();
- ( rText += UniString::CreateFromDouble( GetValue() )) += '%';
+ aText.append(SW_RESSTR(STR_GAMMA));
+ aText.append(GetValue()).append(static_cast<sal_Unicode>('%'));
break;
default:
ePres = SFX_ITEM_PRESENTATION_NONE;
- rText.Erase();
break;
}
+ rText = aText.makeStringAndClear();
return ePres;
}
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()
{