summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-08-12 10:17:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-08-12 11:51:11 +0100
commit58ee09b87b11a6a6b56a06f772214e8835810bd3 (patch)
tree3dba493131b4b9fd670057b8df826bfbbb41fe23
parent7bd0fb7d7c0926575d8a7ec5ea2e4a7867f9f8dd (diff)
ByteString, shrink api
-rw-r--r--automation/source/testtool/objtest.cxx4
-rw-r--r--dbaccess/source/ui/browser/exsrcbrw.cxx7
-rw-r--r--forms/source/component/DatabaseForm.cxx4
-rw-r--r--sc/source/filter/excel/xestring.cxx4
-rw-r--r--tools/inc/tools/string.hxx9
-rw-r--r--tools/source/inet/inetmime.cxx16
-rw-r--r--tools/source/string/strcvt.cxx17
7 files changed, 23 insertions, 38 deletions
diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx
index 5fb34f0406c7..78a2928bd8ff 100644
--- a/automation/source/testtool/objtest.cxx
+++ b/automation/source/testtool/objtest.cxx
@@ -445,8 +445,8 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die d
if (i >= 0)
{
sPath = sPath.copy(0, i);
- ByteString bsPath( sPath.getStr(), sPath.getLength(),
- RTL_TEXTENCODING_UTF8 );
+ ByteString bsPath( rtl::OUStringToOString(sPath,
+ RTL_TEXTENCODING_UTF8) );
aConf.SetGroup( "OOoProgramDir" );
String aOPD;
diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx
index 898f78cd3ebe..a77874dba461 100644
--- a/dbaccess/source/ui/browser/exsrcbrw.cxx
+++ b/dbaccess/source/ui/browser/exsrcbrw.cxx
@@ -40,6 +40,7 @@
#include "dbustrings.hrc"
#include "dbu_reghelper.hxx"
#include <tools/diagnose_ex.h>
+#include <rtl/strbuf.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdb;
@@ -211,11 +212,9 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U
if (xNewColProperties->hasPropertyByName(pControlProps->Name))
xNewCol->setPropertyValue(pControlProps->Name, pControlProps->Value);
}
- catch(Exception&)
+ catch (const Exception&)
{
- OSL_FAIL(( ByteString("SbaExternalSourceBrowser::dispatch : could not set a column property (")
- += ByteString(pControlProps->Name.getStr(), (sal_uInt16)pControlProps->Name.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ByteString(")!")).GetBuffer());
+ OSL_FAIL(rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM("SbaExternalSourceBrowser::dispatch : could not set a column property (")).append(rtl::OUStringToOString(pControlProps->Name, RTL_TEXTENCODING_ASCII_US)).append(RTL_CONSTASCII_STRINGPARAM(")!")).getStr());
}
}
}
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 9ac10191d04d..c09e9f6cf3b9 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -2189,9 +2189,9 @@ void lcl_dispatch(const Reference< XFrame >& xFrame,const Reference<XURLTransfor
aArgs.getArray()[0].Value <<= aReferer;
// build a sequence from the to-be-submitted string
- ByteString a8BitData(aData.getStr(), (sal_uInt16)aData.getLength(), _eEncoding);
+ rtl::OString a8BitData(rtl::OUStringToOString(aData, _eEncoding));
// always ANSI #58641
- Sequence< sal_Int8 > aPostData((sal_Int8*)a8BitData.GetBuffer(), a8BitData.Len());
+ Sequence< sal_Int8 > aPostData((const sal_Int8*)a8BitData.getStr(), a8BitData.getLength());
Reference< XInputStream > xPostData = new SequenceInputStream(aPostData);
aArgs.getArray()[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PostData") );
diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx
index 74117e60ea2e..8647c21e1b31 100644
--- a/sc/source/filter/excel/xestring.cxx
+++ b/sc/source/filter/excel/xestring.cxx
@@ -177,8 +177,8 @@ void XclExpString::AppendByte( sal_Unicode cChar, rtl_TextEncoding eTextEnc )
}
else
{
- ByteString aByteStr( &cChar, 1, eTextEnc ); // length may be >1
- BuildAppend( aByteStr.GetBuffer(), aByteStr.Len() );
+ rtl::OString aByteStr( &cChar, 1, eTextEnc ); // length may be >1
+ BuildAppend( aByteStr.getStr(), aByteStr.getLength() );
}
}
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index 296dc296e72c..1141cd3e2f42 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -167,6 +167,12 @@ private:
ByteString( const int* pDummy ); // not implemented: to prevent ByteString( NULL )
ByteString(int); // not implemented; to detect misuses
// of ByteString(sal_Char);
+ ByteString( const UniString& rUniStr, xub_StrLen nPos, xub_StrLen nLen,
+ rtl_TextEncoding eTextEncoding,
+ sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS );
+ ByteString( const sal_Unicode* pUniStr, xub_StrLen nLen,
+ rtl_TextEncoding eTextEncoding,
+ sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS );
void Assign(int); // not implemented; to detect misuses of
// Assign(sal_Char)
void operator =(int); // not implemented; to detect misuses
@@ -186,9 +192,6 @@ public:
ByteString( const UniString& rUniStr,
rtl_TextEncoding eTextEncoding,
sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS );
- ByteString( const sal_Unicode* pUniStr, xub_StrLen nLen,
- rtl_TextEncoding eTextEncoding,
- sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS );
~ByteString();
operator rtl::OString () const
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index d1178f29253e..d8531bfd9f69 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -1118,8 +1118,8 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin,
}
if (p == pAttributeBegin)
break;
- ByteString aAttribute = ByteString(
- pAttributeBegin, static_cast< xub_StrLen >(p - pAttributeBegin),
+ ByteString aAttribute = rtl::OString(
+ pAttributeBegin, p - pAttributeBegin,
RTL_TEXTENCODING_ASCII_US);
if (bDowncaseAttribute)
aAttribute.ToLowerAscii();
@@ -1170,9 +1170,9 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin,
break;
if (pParameters)
{
- aCharset = ByteString(
+ aCharset = rtl::OString(
pCharsetBegin,
- static_cast< xub_StrLen >(p - pCharsetBegin),
+ p - pCharsetBegin,
RTL_TEXTENCODING_ASCII_US);
if (bDowncaseCharset)
aCharset.ToLowerAscii();
@@ -1205,9 +1205,9 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin,
break;
if (pParameters)
{
- aLanguage = ByteString(
+ aLanguage = rtl::OString(
pLanguageBegin,
- static_cast< xub_StrLen >(p - pLanguageBegin),
+ p - pLanguageBegin,
RTL_TEXTENCODING_ASCII_US);
if (bDowncaseLanguage)
aLanguage.ToLowerAscii();
@@ -1301,8 +1301,8 @@ sal_Unicode const * INetMIME::scanParameters(sal_Unicode const * pBegin,
if (p == pTokenBegin)
break;
if (pParameters)
- aValue = ByteString(
- pTokenBegin, static_cast< xub_StrLen >(p - pTokenBegin),
+ aValue = rtl::OString(
+ pTokenBegin, p - pTokenBegin,
RTL_TEXTENCODING_UTF8);
}
diff --git a/tools/source/string/strcvt.cxx b/tools/source/string/strcvt.cxx
index 210636f8073b..58717bcb5702 100644
--- a/tools/source/string/strcvt.cxx
+++ b/tools/source/string/strcvt.cxx
@@ -55,23 +55,6 @@ ByteString::ByteString( const UniString& rUniStr, rtl_TextEncoding eTextEncoding
eTextEncoding, nCvtFlags );
}
-// -----------------------------------------------------------------------
-
-ByteString::ByteString( const sal_Unicode* pUniStr, xub_StrLen nLen,
- rtl_TextEncoding eTextEncoding, sal_uInt32 nCvtFlags )
-{
- DBG_CTOR( ByteString, DbgCheckByteString );
- DBG_ASSERT( pUniStr, "ByteString::ByteString() - pUniStr is NULL" );
-
- if ( nLen == STRING_LEN )
- nLen = ImplStringLen( pUniStr );
-
- mpData = NULL;
- rtl_uString2String( (rtl_String **)(&mpData),
- pUniStr, nLen,
- eTextEncoding, nCvtFlags );
-}
-
// =======================================================================
static sal_uChar aImplByteTab[256] =