summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-12-21 22:55:35 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-12-22 09:07:47 +0000
commit80a11f0d43309f336d9ca4723f06b8e49ac1d7d7 (patch)
tree578b3cf8a2cbfd180e69295aeba9b7eff6e9631f
parent1c1961786a519101bbf34c62542542c8a56e0328 (diff)
ByteString->rtl::OString
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx4
-rw-r--r--editeng/source/editeng/editobj.cxx14
-rw-r--r--linguistic/source/dicimp.cxx13
-rw-r--r--sc/source/core/tool/interpr2.cxx2
4 files changed, 16 insertions, 17 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index cfabfbff4b0d..40f1469ef827 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -691,7 +691,7 @@ void ODbaseTable::refreshIndexes()
Config aInfFile(aURL.getFSysPath(INetURLObject::FSYS_DETECT));
aInfFile.SetGroup(dBASE_III_GROUP);
sal_uInt16 nKeyCnt = aInfFile.GetKeyCount();
- ByteString aKeyName;
+ rtl::OString aKeyName;
ByteString aIndexName;
for (sal_uInt16 nKey = 0; nKey < nKeyCnt; nKey++)
@@ -699,7 +699,7 @@ void ODbaseTable::refreshIndexes()
// Refences the key an index-file?
aKeyName = aInfFile.GetKeyName( nKey );
//...if yes, add the index list of the table
- if (aKeyName.Copy(0,3) == ByteString("NDX") )
+ if (aKeyName.copy(0,3).equalsL(RTL_CONSTASCII_STRINGPARAM("NDX")))
{
aIndexName = aInfFile.ReadKey(aKeyName);
aURL.setName(String(aIndexName,m_eEncoding));
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index e6ca9a513e10..51fb1d6d5b3b 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1226,7 +1226,7 @@ void BinTextObject::CreateData( SvStream& rIStream )
ContentInfo* pC = CreateAndInsertContent();
// The Text...
- ByteString aByteString = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStream);
+ rtl::OString aByteString = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStream);
pC->GetText() = rtl::OStringToOUString(aByteString, eSrcEncoding);
// StyleName and Family...
@@ -1260,7 +1260,7 @@ void BinTextObject::CreateData( SvStream& rIStream )
{
if ( pItem->Which() == EE_FEATURE_NOTCONV )
{
- sal_Char cEncodedChar = aByteString.GetChar(nStart);
+ sal_Char cEncodedChar = aByteString[nStart];
sal_Unicode cChar = rtl::OUString(&cEncodedChar, 1,
((SvxCharSetColorItem*)pItem)->GetCharSet()).toChar();
pC->GetText().SetChar(nStart, cChar);
@@ -1273,8 +1273,8 @@ void BinTextObject::CreateData( SvStream& rIStream )
if ( ( _nWhich >= EE_FEATURE_START ) && ( _nWhich <= EE_FEATURE_END ) )
{
// Convert CH_FEATURE to CH_FEATURE_OLD
- DBG_ASSERT( (sal_uInt8) aByteString.GetChar( nStart ) == CH_FEATURE_OLD, "CreateData: CH_FEATURE expected!" );
- if ( (sal_uInt8) aByteString.GetChar( nStart ) == CH_FEATURE_OLD )
+ DBG_ASSERT( (sal_uInt8) aByteString[nStart] == CH_FEATURE_OLD, "CreateData: CH_FEATURE expected!" );
+ if ( (sal_uInt8) aByteString[nStart] == CH_FEATURE_OLD )
pC->GetText().SetChar( nStart, CH_FEATURE );
}
}
@@ -1290,7 +1290,7 @@ void BinTextObject::CreateData( SvStream& rIStream )
const SvxFontItem& rFontItem = (const SvxFontItem&)pC->GetParaAttribs().Get( EE_CHAR_FONTINFO );
if ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL )
{
- pC->GetText() = String( aByteString, RTL_TEXTENCODING_SYMBOL );
+ pC->GetText() = rtl::OStringToOUString(aByteString, RTL_TEXTENCODING_SYMBOL);
bSymbolPara = sal_True;
}
}
@@ -1305,8 +1305,8 @@ void BinTextObject::CreateData( SvStream& rIStream )
|| ( bSymbolPara && ( rFontItem.GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
{
// Not correctly converted
- ByteString aPart( aByteString, pAttr->GetStart(), pAttr->GetEnd()-pAttr->GetStart() );
- String aNew( aPart, rFontItem.GetCharSet() );
+ rtl::OString aPart(aByteString.copy(pAttr->GetStart(), pAttr->GetEnd()-pAttr->GetStart()));
+ rtl::OUString aNew(rtl::OStringToOUString(aPart, rFontItem.GetCharSet()));
pC->GetText().Erase( pAttr->GetStart(), pAttr->GetEnd()-pAttr->GetStart() );
pC->GetText().Insert( aNew, pAttr->GetStart() );
}
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 3f6257cc2bc9..1af7d36be92f 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -339,8 +339,7 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL)
// Paste in dictionary without converting
if(*aWordBuf)
{
- ByteString aDummy( aWordBuf );
- String aText( aDummy, eEnc );
+ rtl::OUString aText(aWordBuf, rtl_str_getLength(aWordBuf), eEnc);
uno::Reference< XDictionaryEntry > xEntry =
new DicEntry( aText, bNegativ );
addEntry_Impl( xEntry , sal_True ); //! don't launch events here
@@ -440,11 +439,11 @@ sal_uLong DictionaryNeo::saveEntries(const OUString &rURL)
// Always write as the latest version, i.e. DIC_VERSION_7
//
rtl_TextEncoding eEnc = RTL_TEXTENCODING_UTF8;
- pStream->WriteLine(ByteString (pVerOOo7));
+ pStream->WriteLine(rtl::OString(pVerOOo7));
if (0 != (nErr = pStream->GetError()))
return nErr;
if (nLanguage == LANGUAGE_NONE)
- pStream->WriteLine(ByteString("lang: <none>"));
+ pStream->WriteLine(rtl::OString(RTL_CONSTASCII_STRINGPARAM("lang: <none>")));
else
{
rtl::OStringBuffer aLine(RTL_CONSTASCII_STRINGPARAM("lang: "));
@@ -454,12 +453,12 @@ sal_uLong DictionaryNeo::saveEntries(const OUString &rURL)
if (0 != (nErr = pStream->GetError()))
return nErr;
if (eDicType == DictionaryType_POSITIVE)
- pStream->WriteLine(ByteString("type: positive"));
+ pStream->WriteLine(rtl::OString(RTL_CONSTASCII_STRINGPARAM("type: positive")));
else
- pStream->WriteLine(ByteString("type: negative"));
+ pStream->WriteLine(rtl::OString(RTL_CONSTASCII_STRINGPARAM("type: negative")));
if (0 != (nErr = pStream->GetError()))
return nErr;
- pStream->WriteLine(ByteString("---"));
+ pStream->WriteLine(rtl::OString(RTL_CONSTASCII_STRINGPARAM("---")));
if (0 != (nErr = pStream->GetError()))
return nErr;
const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray();
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 388c318b575c..234988614994 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2772,7 +2772,7 @@ void ScInterpreter::ScEuroConvert()
#define UTF8_TH_MINUS "\340\270\245\340\270\232"
#define UTF8_STRINGPARAM( ascii ) ascii, static_cast< xub_StrLen >( sizeof( ascii ) - 1 )
-#define UTF8_CREATE( ascii ) ByteString( UTF8_STRINGPARAM( ascii ) )
+#define UTF8_CREATE( ascii ) rtl::OString( RTL_CONSTASCII_STRINGPARAM( ascii ) )
#define UTF8_APPEND( ascii ) Append( UTF8_STRINGPARAM( ascii ) )
#define UTF8_PREPEND( ascii ) Insert( UTF8_CREATE( ascii ), 0 )