summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-22 14:34:51 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-23 11:37:06 +0000
commitb1f74de0311af25596e861c24be8b829f4b27cb4 (patch)
treea5c17d136efca429a72d2d17f0640fa9e5b9e12f /svtools
parentd3c0bf6c8087c4573b181fc5d01a70cffc17c78f (diff)
ByteString->rtl::OString
Diffstat (limited to 'svtools')
-rw-r--r--svtools/bmpmaker/bmpcore.cxx28
-rw-r--r--svtools/bmpmaker/bmpsum.cxx8
-rw-r--r--svtools/source/filter/ixbm/xbmread.cxx24
-rw-r--r--svtools/source/inc/xbmread.hxx2
4 files changed, 31 insertions, 31 deletions
diff --git a/svtools/bmpmaker/bmpcore.cxx b/svtools/bmpmaker/bmpcore.cxx
index 5209a923d160..2a7c709fdb34 100644
--- a/svtools/bmpmaker/bmpcore.cxx
+++ b/svtools/bmpmaker/bmpcore.cxx
@@ -93,7 +93,7 @@ void BmpCreator::ImplCreate( const ::std::vector< DirEntry >& rInDirs,
if( !rInDirs.empty() )
{
- ByteString aLine;
+ rtl::OString aLine;
String aInfo, aPrefix, aName( rName ), aString;
SvFileStream aOutStream;
BitmapEx aTotalBmpEx;
@@ -123,7 +123,7 @@ void BmpCreator::ImplCreate( const ::std::vector< DirEntry >& rInDirs,
aOutFile += DirEntry( aName );
// get number of bitmaps
- while( aLine.Search( '}' ) == STRING_NOTFOUND )
+ while( aLine.indexOf('}') == -1 )
{
if( !pSRS->ReadLine( aLine ) )
break;
@@ -136,11 +136,11 @@ void BmpCreator::ImplCreate( const ::std::vector< DirEntry >& rInDirs,
{
aString = aPrefix;
- if( atoi( aLine.GetBuffer() ) < 10000 )
+ if( atoi( aLine.getStr() ) < 10000 )
aString += String::CreateFromInt32( 0 );
// search for pngs by default
- String aPngString( aString += String( aLine.GetBuffer(), RTL_TEXTENCODING_UTF8 ) );
+ String aPngString( aString += rtl::OStringToOUString(aLine, RTL_TEXTENCODING_UTF8) );
aNameVector.push_back( aPngString += String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) ) );
}
}
@@ -361,9 +361,11 @@ void BmpCreator::Create( const String& rSRSName,
else
{
String aText;
- ByteString aByteText;
+ rtl::OString aByteText;
sal_Bool bLangDep = sal_False;
+ using comphelper::string::indexOfL;
+
do
{
do
@@ -371,24 +373,24 @@ void BmpCreator::Create( const String& rSRSName,
if (!pSRS->ReadLine(aByteText))
break;
}
- while ( aByteText.Search( "ImageList" ) == STRING_NOTFOUND );
+ while ( indexOfL(aByteText, RTL_CONSTASCII_STRINGPARAM("ImageList")) == -1 );
do
{
if (!pSRS->ReadLine( aByteText ) )
break;
}
- while ( aByteText.Search( "File" ) == STRING_NOTFOUND );
- aText = String::CreateFromAscii( aByteText.GetBuffer() );
+ while ( indexOfL(aByteText, RTL_CONSTASCII_STRINGPARAM("File")) == -1 );
+ aText = rtl::OStringToOUString(aByteText, RTL_TEXTENCODING_ASCII_US);
const String aName( aText.GetToken( 1, '"' ) );
do
{
if( !bLangDep &&
- aByteText.Search( "File" ) != STRING_NOTFOUND &&
- aByteText.Search( '[' ) != STRING_NOTFOUND &&
- aByteText.Search( ']' ) != STRING_NOTFOUND )
+ indexOfL(aByteText, RTL_CONSTASCII_STRINGPARAM("File")) != -1 &&
+ aByteText.indexOf('[') != -1 &&
+ aByteText.indexOf(']') != -1 )
{
bLangDep = sal_True;
}
@@ -396,8 +398,8 @@ void BmpCreator::Create( const String& rSRSName,
if (!pSRS->ReadLine(aByteText))
break;
}
- while (aByteText.Search( "IdList" ) == STRING_NOTFOUND );
- aText = String::CreateFromAscii( aByteText.GetBuffer() );
+ while (indexOfL(aByteText, RTL_CONSTASCII_STRINGPARAM("IdList")) == -1);
+ aText = rtl::OStringToOUString(aByteText, RTL_TEXTENCODING_ASCII_US);
// if image list is not language dependent, don't do anything for languages except german
if( aText.Len() )
diff --git a/svtools/bmpmaker/bmpsum.cxx b/svtools/bmpmaker/bmpsum.cxx
index ead4930b4f09..223f76d79b63 100644
--- a/svtools/bmpmaker/bmpsum.cxx
+++ b/svtools/bmpmaker/bmpsum.cxx
@@ -297,15 +297,15 @@ void BmpSum::ProcessFileList( const String& rInFileList,
if( aIStm.IsOpen() && aOStm.IsOpen() )
{
- ByteString aReadLine;
+ rtl::OString aReadLine;
::std::set< ByteString > aFileNameSet;
while( aIStm.ReadLine( aReadLine ) )
{
- if( aReadLine.Len() )
+ if( !aReadLine.isEmpty() )
aFileNameSet.insert( aReadLine );
- if( aReadLine.Search( "enus" ) != STRING_NOTFOUND )
+ if( comphelper::string::indexOfL(aReadLine, RTL_CONSTASCII_STRINGPARAM("enus") ) != -1 )
{
static const char* aLanguages[] =
{
@@ -340,7 +340,7 @@ void BmpSum::ProcessFileList( const String& rInFileList,
}
}
- aReadLine.Erase();
+ aReadLine = rtl::OString();
}
aIStm.Close();
diff --git a/svtools/source/filter/ixbm/xbmread.cxx b/svtools/source/filter/ixbm/xbmread.cxx
index 559f12190375..3e8bec34af05 100644
--- a/svtools/source/filter/ixbm/xbmread.cxx
+++ b/svtools/source/filter/ixbm/xbmread.cxx
@@ -101,13 +101,11 @@ void XBMReader::InitTable()
// ------------------------------------------------------------------------
-ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
+rtl::OString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
const char* pTok2, const char* pTok3 )
{
- ByteString aRet;
- long nPos1;
- long nPos2;
- long nPos3;
+ rtl::OString aRet;
+ sal_Int32 nPos1, nPos2, nPos3;
bStatus = sal_False;
@@ -118,7 +116,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
if( pTok1 )
{
- if( ( nPos1 = aRet.Search( pTok1 ) ) != STRING_NOTFOUND )
+ if( ( nPos1 = aRet.indexOf( pTok1 ) ) != -1 )
{
bStatus = sal_True;
@@ -126,7 +124,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
{
bStatus = sal_False;
- if( ( ( nPos2 = aRet.Search( pTok2 ) ) != STRING_NOTFOUND ) &&
+ if( ( ( nPos2 = aRet.indexOf( pTok2 ) ) != -1 ) &&
( nPos2 > nPos1 ) )
{
bStatus = sal_True;
@@ -135,7 +133,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
{
bStatus = sal_False;
- if( ( ( nPos3 = aRet.Search( pTok3 ) ) != STRING_NOTFOUND ) && ( nPos3 > nPos2 ) )
+ if( ( ( nPos3 = aRet.indexOf( pTok3 ) ) != -1 ) && ( nPos3 > nPos2 ) )
bStatus = sal_True;
}
}
@@ -201,7 +199,7 @@ long XBMReader::ParseDefine( const sal_Char* pDefine )
sal_Bool XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat )
{
- ByteString aLine;
+ rtl::OString aLine;
long nRow = 0;
long nCol = 0;
long nBits = ( eFormat == XBM10 ) ? 16 : 8;
@@ -214,18 +212,18 @@ sal_Bool XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XB
{
if( bFirstLine )
{
- xub_StrLen nPos;
+ sal_Int32 nPos;
// einfuehrende geschweifte Klammer loeschen
- if( (nPos = ( aLine = aLastLine ).Search( '{' ) ) != STRING_NOTFOUND )
- aLine.Erase( 0, nPos + 1 );
+ if( (nPos = ( aLine = aLastLine ).indexOf('{') ) != -1 )
+ aLine = aLine.copy(nPos + 1);
bFirstLine = sal_False;
}
else if( !pInStm->ReadLine( aLine ) )
break;
- if( aLine.Len() )
+ if (!aLine.isEmpty())
{
const sal_Int32 nCount = comphelper::string::getTokenCount(aLine, ',');
diff --git a/svtools/source/inc/xbmread.hxx b/svtools/source/inc/xbmread.hxx
index 0e9b178e9428..0bf513638eea 100644
--- a/svtools/source/inc/xbmread.hxx
+++ b/svtools/source/inc/xbmread.hxx
@@ -69,7 +69,7 @@ class XBMReader : public GraphicReader
sal_Bool bStatus;
void InitTable();
- ByteString FindTokenLine( SvStream* pInStm, const char* pTok1,
+ rtl::OString FindTokenLine( SvStream* pInStm, const char* pTok1,
const char* pTok2 = NULL, const char* pTok3 = NULL );
long ParseDefine( const sal_Char* pDefine );
sal_Bool ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat );