summaryrefslogtreecommitdiff
path: root/idl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-27 07:52:36 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-27 12:59:46 +0000
commitf75694e5b13236248171885633b0a3612940e04a (patch)
tree68dc468fde558672059ec50a7966a6461844ddaf /idl
parent41e92ab2b7a8fcb7f5738f656bdac47bc0847f29 (diff)
ByteString->rtl::OString
Diffstat (limited to 'idl')
-rw-r--r--idl/inc/basobj.hxx4
-rw-r--r--idl/inc/hash.hxx22
-rw-r--r--idl/inc/lex.hxx14
-rw-r--r--idl/inc/module.hxx2
-rw-r--r--idl/inc/slot.hxx2
-rw-r--r--idl/inc/types.hxx24
-rw-r--r--idl/source/cmptools/hash.cxx29
-rw-r--r--idl/source/objects/basobj.cxx16
-rw-r--r--idl/source/objects/bastype.cxx20
-rw-r--r--idl/source/objects/module.cxx10
-rw-r--r--idl/source/objects/object.cxx4
-rw-r--r--idl/source/objects/slot.cxx166
-rw-r--r--idl/source/objects/types.cxx100
-rw-r--r--idl/source/prj/database.cxx6
14 files changed, 210 insertions, 209 deletions
diff --git a/idl/inc/basobj.hxx b/idl/inc/basobj.hxx
index 959a9f830224..6d49b4c9cfdd 100644
--- a/idl/inc/basobj.hxx
+++ b/idl/inc/basobj.hxx
@@ -151,8 +151,8 @@ public:
SV_DECL_META_FACTORY1( SvMetaName, SvMetaObject, 15 )
SvMetaName();
- virtual sal_Bool SetName( const ByteString & rName, SvIdlDataBase * = NULL );
- void SetDescription( const ByteString& rText )
+ virtual sal_Bool SetName( const rtl::OString& rName, SvIdlDataBase * = NULL );
+ void SetDescription( const rtl::OString& rText )
{ aDescription.setString(rText); }
const SvHelpContext& GetHelpContext() const { return aHelpContext; }
virtual const SvString & GetName() const { return aName; }
diff --git a/idl/inc/hash.hxx b/idl/inc/hash.hxx
index 6449dfd7b9e6..733f0ebbdb93 100644
--- a/idl/inc/hash.hxx
+++ b/idl/inc/hash.hxx
@@ -40,12 +40,12 @@ class SvHashTable
sal_uInt32 lAsk; // number of requests
sal_uInt32 lTry; // number of tries
protected:
- sal_Bool Test_Insert( const void *, sal_Bool bInsert, sal_uInt32 * pInsertPos );
+ sal_Bool Test_Insert( const rtl::OString&, sal_Bool bInsert, sal_uInt32 * pInsertPos );
// compare element with entry
- virtual StringCompare Compare( const void * , sal_uInt32 ) const = 0;
+ virtual bool equals( const rtl::OString& , sal_uInt32 ) const = 0;
// get hash value from subclass
- virtual sal_uInt32 HashFunc( const void * ) const = 0;
+ virtual sal_uInt32 HashFunc( const rtl::OString& ) const = 0;
public:
SvHashTable( sal_uInt32 nMaxEntries );
virtual ~SvHashTable();
@@ -59,20 +59,20 @@ class SvStringHashTable;
class SvStringHashEntry : public SvRefBase
{
friend class SvStringHashTable;
- ByteString aName;
+ rtl::OString aName;
sal_uInt32 nHashId;
sal_uLong nValue;
sal_Bool bHasId;
public:
SvStringHashEntry() : bHasId( sal_False ) {;}
- SvStringHashEntry( const ByteString & rName, sal_uInt32 nIdx )
+ SvStringHashEntry( const rtl::OString& rName, sal_uInt32 nIdx )
: aName( rName )
, nHashId( nIdx )
, nValue( 0 )
, bHasId( sal_True ) {}
~SvStringHashEntry();
- const ByteString & GetName() const { return aName; }
+ const rtl::OString& GetName() const { return aName; }
sal_Bool HasId() const { return bHasId; }
sal_uInt32 GetId() const { return nHashId; }
@@ -101,17 +101,17 @@ class SvStringHashTable : public SvHashTable
{
SvStringHashEntry* pEntries;
protected:
- virtual sal_uInt32 HashFunc( const void * pElement ) const;
- virtual StringCompare Compare( const void * pElement, sal_uInt32 nIndex ) const;
+ virtual sal_uInt32 HashFunc( const rtl::OString& rElement ) const;
+ virtual bool equals( const rtl::OString &rElement, sal_uInt32 nIndex ) const;
public:
SvStringHashTable( sal_uInt32 nMaxEntries ); // max size of hash-tabel
virtual ~SvStringHashTable();
- ByteString GetNearString( const ByteString & rName ) const;
+ rtl::OString GetNearString( const rtl::OString& rName ) const;
virtual sal_Bool IsEntry( sal_uInt32 nIndex ) const;
- sal_Bool Insert( const ByteString & rStr, sal_uInt32 * pHash ); // insert string
- sal_Bool Test( const ByteString & rStr, sal_uInt32 * pHash ) const; // test of insert string
+ sal_Bool Insert( const rtl::OString& rStr, sal_uInt32 * pHash ); // insert string
+ sal_Bool Test( const rtl::OString& rStr, sal_uInt32 * pHash ) const; // test of insert string
SvStringHashEntry * Get ( sal_uInt32 nIndex ) const; // return pointer to string
SvStringHashEntry & operator []( sal_uInt32 nPos ) const
{ return pEntries[ nPos ]; }
diff --git a/idl/inc/lex.hxx b/idl/inc/lex.hxx
index 3b51dd848f2b..03b657890f71 100644
--- a/idl/inc/lex.hxx
+++ b/idl/inc/lex.hxx
@@ -45,13 +45,13 @@ class BigInt;
class SvToken
{
friend class SvTokenStream;
- sal_uLong nLine, nColumn;
+ sal_uLong nLine, nColumn;
SVTOKEN_ENUM nType;
- ByteString aString;
+ rtl::OString aString;
union
{
- sal_uLong nLong;
- sal_Bool bBool;
+ sal_uLong nLong;
+ sal_Bool bBool;
char cChar;
SvStringHashEntry * pHash;
};
@@ -61,7 +61,7 @@ public:
SvToken( sal_uLong n );
SvToken( SVTOKEN_ENUM nTypeP, sal_Bool b );
SvToken( char c );
- SvToken( SVTOKEN_ENUM nTypeP, const ByteString & rStr );
+ SvToken( SVTOKEN_ENUM nTypeP, const rtl::OString& rStr );
SvToken( SVTOKEN_ENUM nTypeP );
SvToken & operator = ( const SvToken & rObj );
@@ -91,7 +91,7 @@ public:
sal_Bool IsRttiBase() const { return nType == SVTOKEN_RTTIBASE; }
sal_Bool IsEof() const { return nType == SVTOKEN_EOF; }
- const ByteString & GetString() const
+ const rtl::OString& GetString() const
{
return IsIdentifierHash()
? pHash->GetName()
@@ -122,7 +122,7 @@ inline SvToken::SvToken( SVTOKEN_ENUM nTypeP, sal_Bool b )
inline SvToken::SvToken( char c )
: nType( SVTOKEN_CHAR ), cChar( c ) {}
-inline SvToken::SvToken( SVTOKEN_ENUM nTypeP, const ByteString & rStr )
+inline SvToken::SvToken( SVTOKEN_ENUM nTypeP, const rtl::OString& rStr )
: nType( nTypeP ), aString( rStr ) {}
inline SvToken::SvToken( SVTOKEN_ENUM nTypeP )
diff --git a/idl/inc/module.hxx b/idl/inc/module.hxx
index 471a0a5d1c82..750914d206c9 100644
--- a/idl/inc/module.hxx
+++ b/idl/inc/module.hxx
@@ -70,7 +70,7 @@ public:
const String & GetIdlFileName() const { return aIdlFileName; }
const rtl::OString& GetModulePrefix() const { return aModulePrefix.getString(); }
- virtual sal_Bool SetName( const ByteString & rName, SvIdlDataBase * = NULL );
+ virtual sal_Bool SetName( const rtl::OString& rName, SvIdlDataBase * = NULL );
const rtl::OString& GetHelpFileName() const { return aHelpFileName.getString(); }
const rtl::OString& GetTypeLibFileName() const { return aTypeLibFile.getString(); }
diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx
index 85e56ebe1617..50d5d08c638e 100644
--- a/idl/inc/slot.hxx
+++ b/idl/inc/slot.hxx
@@ -245,7 +245,7 @@ public:
virtual sal_Bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
virtual void WriteSvIdl( SvIdlDataBase & rBase,
SvStream & rOutStm, sal_uInt16 nTab );
- virtual void Insert( SvSlotElementList&, const ByteString & rPrefix,
+ virtual void Insert( SvSlotElementList&, const rtl::OString& rPrefix,
SvIdlDataBase& );
void WriteSlotStubs( const rtl::OString& rShellName,
ByteStringList & rList,
diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx
index b0d5f21713e0..8db0b7ed48cd 100644
--- a/idl/inc/types.hxx
+++ b/idl/inc/types.hxx
@@ -115,7 +115,7 @@ public:
virtual void Write( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab,
WriteType, WriteAttribute = 0 );
sal_uLong MakeSfx( rtl::OStringBuffer& rAtrrArray );
- virtual void Insert( SvSlotElementList&, const ByteString & rPrefix,
+ virtual void Insert( SvSlotElementList&, const rtl::OString& rPrefix,
SvIdlDataBase& );
virtual void WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
Table * pIdTable );
@@ -123,7 +123,7 @@ public:
Table * pIdTable );
virtual void WriteCSV( SvIdlDataBase&, SvStream& );
void FillIDTable(Table *pIDTable);
- ByteString Compare( SvMetaAttribute *pAttr );
+ rtl::OString Compare( SvMetaAttribute *pAttr );
};
SV_IMPL_REF(SvMetaAttribute)
SV_IMPL_PERSIST_LIST(SvMetaAttribute,SvMetaAttribute *)
@@ -150,7 +150,7 @@ class SvMetaType : public SvMetaExtern
sal_Bool bIsShell;
char cParserChar;
- void WriteSfxItem( const ByteString & rItemName, SvIdlDataBase & rBase,
+ void WriteSfxItem( const rtl::OString& rItemName, SvIdlDataBase & rBase,
SvStream & rOutStm );
protected:
sal_Bool ReadNamesSvIdl( SvIdlDataBase & rBase,
@@ -208,7 +208,7 @@ public:
void SetCall1( int e);
int GetCall1() const;
- void SetBasicName(const ByteString& rName)
+ void SetBasicName(const rtl::OString& rName)
{ aBasicName.setString(rName); }
const rtl::OString& GetBasicName() const;
@@ -219,10 +219,10 @@ public:
const rtl::OString& GetCName() const;
char GetParserChar() const { return cParserChar; }
- virtual sal_Bool SetName( const ByteString & rName, SvIdlDataBase * = NULL );
+ virtual sal_Bool SetName( const rtl::OString& rName, SvIdlDataBase * = NULL );
- virtual sal_Bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
+ virtual sal_Bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
virtual void WriteSvIdl( SvIdlDataBase & rBase,
SvStream & rOutStm, sal_uInt16 nTab );
virtual void Write( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab,
@@ -240,7 +240,7 @@ public:
void WriteTheType( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab, WriteType );
rtl::OString GetParserString() const;
void WriteParamNames( SvIdlDataBase & rBase, SvStream & rOutStm,
- const ByteString & rChief );
+ const rtl::OString& rChief );
};
SV_IMPL_REF(SvMetaType)
SV_DECL_IMPL_PERSIST_LIST(SvMetaType,SvMetaType *)
@@ -258,10 +258,10 @@ SV_DECL_IMPL_PERSIST_LIST(SvMetaTypeString,SvMetaTypeString *)
class SvMetaEnumValue : public SvMetaName
{
- ByteString aEnumValue;
+ rtl::OString aEnumValue;
public:
- SV_DECL_META_FACTORY1( SvMetaEnumValue, SvMetaName, 20 )
- SvMetaEnumValue();
+ SV_DECL_META_FACTORY1( SvMetaEnumValue, SvMetaName, 20 )
+ SvMetaEnumValue();
virtual sal_Bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
virtual void WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
@@ -275,7 +275,7 @@ SV_DECL_IMPL_PERSIST_LIST(SvMetaEnumValue,SvMetaEnumValue *)
class SvMetaTypeEnum : public SvMetaType
{
SvMetaEnumValueMemberList aEnumValueList;
- ByteString aPrefix;
+ rtl::OString aPrefix;
protected:
virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
virtual void WriteContextSvIdl( SvIdlDataBase &, SvStream & rOutStm,
@@ -288,7 +288,7 @@ public:
sal_uInt16 GetMaxValue() const;
sal_uLong Count() const { return aEnumValueList.Count(); }
- const ByteString & GetPrefix() const { return aPrefix; }
+ const rtl::OString& GetPrefix() const { return aPrefix; }
SvMetaEnumValue * GetObject( sal_uLong n ) const
{ return aEnumValueList.GetObject( n ); }
diff --git a/idl/source/cmptools/hash.cxx b/idl/source/cmptools/hash.cxx
index 6021a56b3ea8..c4c0f9f04273 100644
--- a/idl/source/cmptools/hash.cxx
+++ b/idl/source/cmptools/hash.cxx
@@ -50,7 +50,7 @@ SvHashTable::~SvHashTable()
{
}
-sal_Bool SvHashTable::Test_Insert( const void * pElement, sal_Bool bInsert,
+sal_Bool SvHashTable::Test_Insert( const rtl::OString& rElement, sal_Bool bInsert,
sal_uInt32 * pInsertPos )
{
sal_uInt32 nHash;
@@ -60,13 +60,13 @@ sal_Bool SvHashTable::Test_Insert( const void * pElement, sal_Bool bInsert,
lAsk++;
lTry++;
- nHash = HashFunc( pElement );
+ nHash = HashFunc( rElement );
nIndex = nHash % nMax;
nLoop = 0; // divide to range
while( (nMax != nLoop) && IsEntry( nIndex ) )
{ // is place occupied
- if( COMPARE_EQUAL == Compare( pElement, nIndex ) )
+ if( equals( rElement, nIndex ) )
{
if( pInsertPos )
*pInsertPos = nIndex; // place of Element
@@ -123,10 +123,10 @@ SvStringHashTable::~SvStringHashTable()
delete [] pEntries;
}
-sal_uInt32 SvStringHashTable::HashFunc( const void * pElement ) const
+sal_uInt32 SvStringHashTable::HashFunc( const rtl::OString& rElement ) const
{
sal_uInt32 nHash = 0; // hash value
- const char * pStr = ((const ByteString * )pElement)->GetBuffer();
+ const char * pStr = rElement.getStr();
int nShift = 0;
while( *pStr )
@@ -144,18 +144,18 @@ sal_uInt32 SvStringHashTable::HashFunc( const void * pElement ) const
return( nHash );
}
-ByteString SvStringHashTable::GetNearString( const ByteString & rName ) const
+rtl::OString SvStringHashTable::GetNearString( const rtl::OString& rName ) const
{
for( sal_uInt32 i = 0; i < GetMax(); i++ )
{
SvStringHashEntry * pE = Get( i );
if( pE )
{
- if( pE->GetName().EqualsIgnoreCaseAscii( rName ) && !pE->GetName().Equals( rName ) )
+ if( pE->GetName().equalsIgnoreAsciiCase( rName ) && !pE->GetName().equals( rName ) )
return pE->GetName();
}
}
- return ByteString();
+ return rtl::OString();
}
sal_Bool SvStringHashTable::IsEntry( sal_uInt32 nIndex ) const
@@ -165,13 +165,13 @@ sal_Bool SvStringHashTable::IsEntry( sal_uInt32 nIndex ) const
return pEntries[ nIndex ].HasId();
}
-sal_Bool SvStringHashTable::Insert( const ByteString & rName, sal_uInt32 * pIndex )
+sal_Bool SvStringHashTable::Insert( const rtl::OString& rName, sal_uInt32 * pIndex )
{
sal_uInt32 nIndex;
if( !pIndex ) pIndex = &nIndex;
- if( !SvHashTable::Test_Insert( &rName, sal_True, pIndex ) )
+ if( !SvHashTable::Test_Insert( rName, sal_True, pIndex ) )
return sal_False;
if( !IsEntry( *pIndex ) )
@@ -179,10 +179,9 @@ sal_Bool SvStringHashTable::Insert( const ByteString & rName, sal_uInt32 * pInde
return sal_True;
}
-sal_Bool SvStringHashTable::Test( const ByteString & rName, sal_uInt32 * pPos ) const
+sal_Bool SvStringHashTable::Test( const rtl::OString& rName, sal_uInt32 * pPos ) const
{
- return ((SvStringHashTable *)this)->SvHashTable::
- Test_Insert( &rName, sal_False, pPos );
+ return const_cast<SvStringHashTable*>(this)->Test_Insert( rName, sal_False, pPos );
}
SvStringHashEntry * SvStringHashTable::Get( sal_uInt32 nIndex ) const
@@ -192,10 +191,10 @@ SvStringHashEntry * SvStringHashTable::Get( sal_uInt32 nIndex ) const
return( NULL );
}
-StringCompare SvStringHashTable::Compare( const void * pElement,
+bool SvStringHashTable::equals( const rtl::OString& rElement,
sal_uInt32 nIndex ) const
{
- return ((const ByteString *)pElement)->CompareTo( pEntries[ nIndex ].GetName() );
+ return rElement.equals( pEntries[ nIndex ].GetName() );
}
void SvStringHashTable::FillHashList( SvStringHashList * pList ) const
diff --git a/idl/source/objects/basobj.cxx b/idl/source/objects/basobj.cxx
index b08e89144c49..9a55bfc68326 100644
--- a/idl/source/objects/basobj.cxx
+++ b/idl/source/objects/basobj.cxx
@@ -169,7 +169,7 @@ void SvMetaName::Save( SvPersistStream & rStm )
if( nMask & 0x10 ) rStm << aDescription;
}
-sal_Bool SvMetaName::SetName( const ByteString & rName, SvIdlDataBase * )
+sal_Bool SvMetaName::SetName( const rtl::OString& rName, SvIdlDataBase * )
{
aName.setString(rName);
return sal_True;
@@ -237,16 +237,16 @@ void SvMetaName::WriteDescription( SvStream & rOutStm )
{
rOutStm << "<DESCRIPTION>" << endl;
- ByteString aDesc( GetDescription().getString() );
- sal_uInt16 nPos = aDesc.Search( '\n' );
- while ( nPos != STRING_NOTFOUND )
+ rtl::OString aDesc( GetDescription().getString() );
+ sal_Int32 nPos = aDesc.indexOf('\n');
+ while ( nPos != -1 )
{
- rOutStm << aDesc.Copy( 0, nPos ).GetBuffer() << endl;
- aDesc.Erase(0,nPos+1);
- nPos = aDesc.Search( '\n' );
+ rOutStm << aDesc.copy( 0, nPos ).getStr() << endl;
+ aDesc = aDesc.copy(nPos+1);
+ nPos = aDesc.indexOf('\n');
}
- rOutStm << aDesc.GetBuffer() << endl << "</DESCRIPTION>" << endl;
+ rOutStm << aDesc.getStr() << endl << "</DESCRIPTION>" << endl;
}
void SvMetaName::WriteAttributesSvIdl( SvIdlDataBase & rBase,
diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx
index e31bcfeb97d7..87771116be98 100644
--- a/idl/source/objects/bastype.cxx
+++ b/idl/source/objects/bastype.cxx
@@ -169,9 +169,9 @@ sal_Bool SvBOOL::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm )
sal_Bool SvBOOL::WriteSvIdl( SvStringHashEntry * pName, SvStream & rOutStm )
{
if( nVal )
- rOutStm << pName->GetName().GetBuffer();
+ rOutStm << pName->GetName().getStr();
else
- rOutStm << pName->GetName().GetBuffer() << "(FALSE)";
+ rOutStm << pName->GetName().getStr() << "(FALSE)";
return sal_True;
}
@@ -199,7 +199,7 @@ sal_Bool SvIdentifier::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rIn
pTok = rInStm.GetToken();
if( pTok->IsIdentifier() )
{
- *(ByteString *)this = pTok->GetString();
+ setString(pTok->GetString());
rInStm.GetToken_Next();
}
if( bOk && bBraket )
@@ -216,7 +216,7 @@ sal_Bool SvIdentifier::WriteSvIdl( SvStringHashEntry * pName,
SvStream & rOutStm,
sal_uInt16 /*nTab */ )
{
- rOutStm << pName->GetName().GetBuffer() << '(';
+ rOutStm << pName->GetName().getStr() << '(';
rOutStm << getString().getStr() << ')';
return sal_True;
}
@@ -269,7 +269,7 @@ sal_Bool SvNumberIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
sal_uLong n;
if( rBase.FindId( pTok->GetString(), &n ) )
{
- *(ByteString *)this = pTok->GetString();
+ setString(pTok->GetString());
nValue = n;
return sal_True;
}
@@ -315,7 +315,7 @@ sal_Bool SvString::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm
pTok = rInStm.GetToken();
if( pTok->IsString() )
{
- *(ByteString *)this = pTok->GetString();
+ setString(pTok->GetString());
rInStm.GetToken_Next();
}
if( bOk && bBraket )
@@ -331,7 +331,7 @@ sal_Bool SvString::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm
sal_Bool SvString::WriteSvIdl( SvStringHashEntry * pName, SvStream & rOutStm,
sal_uInt16 /*nTab */ )
{
- rOutStm << pName->GetName().GetBuffer() << "(\"";
+ rOutStm << pName->GetName().getStr() << "(\"";
rOutStm << m_aStr.getStr() << "\")";
return sal_True;
}
@@ -374,7 +374,7 @@ sal_Bool SvUUId::ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm )
if( pTok->IsString() )
{
pTok = rInStm.GetToken_Next();
- bOk = MakeId( String::CreateFromAscii( pTok->GetString().GetBuffer() ) );
+ bOk = MakeId( String::CreateFromAscii( pTok->GetString().getStr() ) );
}
if( bOk && bBraket )
bOk = rInStm.Read( ')' );
@@ -389,7 +389,7 @@ sal_Bool SvUUId::ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm )
sal_Bool SvUUId::WriteSvIdl( SvStream & rOutStm )
{
// write global id
- rOutStm << SvHash_uuid()->GetName().GetBuffer() << "(\"";
+ rOutStm << SvHash_uuid()->GetName().getStr() << "(\"";
rOutStm << rtl::OUStringToOString(GetHexName(), RTL_TEXTENCODING_UTF8).getStr() << "\")";
return sal_True;
}
@@ -421,7 +421,7 @@ sal_Bool SvVersion::ReadSvIdl( SvTokenStream & rInStm )
sal_Bool SvVersion::WriteSvIdl( SvStream & rOutStm )
{
- rOutStm << SvHash_Version()->GetName().GetBuffer() << '('
+ rOutStm << SvHash_Version()->GetName().getStr() << '('
<< rtl::OString::valueOf(static_cast<sal_Int32>(nMajorVersion)).getStr()
<< '.'
<< rtl::OString::valueOf(static_cast<sal_Int32>(nMinorVersion)).getStr()
diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx
index 84502c20da65..ab40dcd4e97c 100644
--- a/idl/source/objects/module.cxx
+++ b/idl/source/objects/module.cxx
@@ -109,7 +109,7 @@ void SvMetaModule::Save( SvPersistStream & rStm )
rStm.Seek( nPos );
}
-sal_Bool SvMetaModule::SetName( const ByteString & rName, SvIdlDataBase * pBase )
+sal_Bool SvMetaModule::SetName( const rtl::OString& rName, SvIdlDataBase * pBase )
{
if( pBase )
{
@@ -231,7 +231,7 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
SvToken * pTok = rInStm.GetToken_Next();
if( pTok->IsString() )
{
- DirEntry aFullName( String::CreateFromAscii( pTok->GetString().GetBuffer() ) );
+ DirEntry aFullName( String::CreateFromAscii( pTok->GetString().getStr() ) );
rBase.StartNewFile( aFullName.GetFull() );
if( aFullName.Find( rBase.GetPath() ) )
{
@@ -334,14 +334,14 @@ sal_Bool SvMetaModule::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm
{
pTok = rInStm.GetToken_Next();
if( pTok->IsString() )
- bOk = aBeginName.MakeId( String::CreateFromAscii( pTok->GetString().GetBuffer() ) );
+ bOk = aBeginName.MakeId( String::CreateFromAscii( pTok->GetString().getStr() ) );
}
rInStm.ReadDelemiter();
if( bOk )
{
pTok = rInStm.GetToken_Next();
if( pTok->IsString() )
- bOk = aEndName.MakeId( String::CreateFromAscii( pTok->GetString().GetBuffer() ) );
+ bOk = aEndName.MakeId( String::CreateFromAscii( pTok->GetString().getStr() ) );
}
rInStm.ReadDelemiter();
if( bOk )
@@ -366,7 +366,7 @@ sal_Bool SvMetaModule::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm
void SvMetaModule::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab )
{
- rOutStm << SvHash_module()->GetName().GetBuffer() << endl
+ rOutStm << SvHash_module()->GetName().getStr() << endl
<< '\"';
rOutStm.WriteUniOrByteString( aBeginName.GetHexName(), rOutStm.GetStreamCharSet() );
rOutStm << '\"' << endl << '\"';
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index a9ebfa3a36ef..033e5a2c68e6 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -275,10 +275,10 @@ void SvMetaClass::WriteContextSvIdl
{
SvClassElement * pEle = aClassList.GetObject( n );
WriteTab( rOutStm, nTab );
- rOutStm << SvHash_import()->GetName().GetBuffer() << ' '
+ rOutStm << SvHash_import()->GetName().getStr() << ' '
<< pEle->GetPrefix().getStr();
if( pEle->GetAutomation() )
- rOutStm << " [ " << SvHash_Automation()->GetName().GetBuffer()
+ rOutStm << " [ " << SvHash_Automation()->GetName().getStr()
<< " ]";
if( !pEle->GetPrefix().isEmpty() )
rOutStm << ' ' << pEle->GetPrefix().getStr();
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index c690c25d7b86..8742c12cb489 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -638,7 +638,7 @@ void SvMetaSlot::WriteAttributesSvIdl( SvIdlDataBase & rBase,
if( aSlotType.Is() )
{
WriteTab( rOutStm, nTab );
- rOutStm << SvHash_SlotType()->GetName().GetBuffer() << '(';
+ rOutStm << SvHash_SlotType()->GetName().getStr() << '(';
aSlotType->WriteTheType( rBase, rOutStm, nTab, WRITE_IDL );
rOutStm << ");" << endl;
}
@@ -702,105 +702,107 @@ void SvMetaSlot::WriteAttributesSvIdl( SvIdlDataBase & rBase,
rOutStm << ';' << endl;
}
- ByteString aDel( ", " );
- ByteString aOut;
+ rtl::OString aDel(RTL_CONSTASCII_STRINGPARAM(", "));
+ rtl::OStringBuffer aOut;
if( aVolatile )
- aOut += aVolatile.GetSvIdlString( SvHash_Volatile() );
+ aOut.append(aVolatile.GetSvIdlString( SvHash_Volatile() ));
else if( !aCachable )
// because of Default == TRUE, only when no other is set
- aOut += aCachable.GetSvIdlString( SvHash_Cachable() );
+ aOut.append(aCachable.GetSvIdlString( SvHash_Cachable() ));
else
- aDel.Erase();
+ aDel = rtl::OString();
if( aToggle )
{
- ( aOut += aDel ) += aToggle.GetSvIdlString( SvHash_Toggle() );
- aDel = ", ";
+ aOut.append(aDel).append(aToggle.GetSvIdlString( SvHash_Toggle() ));
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
}
if( aAutoUpdate )
{
- (aOut += aDel ) += aAutoUpdate.GetSvIdlString( SvHash_AutoUpdate() );
- aDel = ", ";
+ aOut.append(aDel).append(aAutoUpdate.GetSvIdlString( SvHash_AutoUpdate() ));
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
}
- ByteString aDel1( ", " );
+ rtl::OString aDel1(RTL_CONSTASCII_STRINGPARAM(", "));
if( aAsynchron )
- ( aOut += aDel ) += aAsynchron.GetSvIdlString( SvHash_Asynchron() );
+ aOut.append(aDel).append(aAsynchron.GetSvIdlString( SvHash_Asynchron() ));
else if( !aSynchron )
+ {
// because of Default == TRUE, only when no other is set
- ( aOut += aDel ) += aSynchron.GetSvIdlString( SvHash_Synchron() );
+ aOut.append(aDel).append(aSynchron.GetSvIdlString( SvHash_Synchron() ));
+ }
else
aDel1 = aDel;
- aDel = ", ";
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
if( aRecordManual )
- ( aOut += aDel1 ) += aRecordManual.GetSvIdlString( SvHash_RecordManual() );
+ aOut.append(aDel1).append(aRecordManual.GetSvIdlString( SvHash_RecordManual() ));
else if( aNoRecord )
- ( aOut += aDel1 ) += aNoRecord.GetSvIdlString( SvHash_NoRecord() );
+ aOut.append(aDel1).append(aNoRecord.GetSvIdlString( SvHash_NoRecord() ));
else if( !aRecordPerSet )
// because of Default == TRUE, only when no other is set
- ( aOut += aDel1 ) += aRecordPerSet.GetSvIdlString( SvHash_RecordPerSet() );
+ aOut.append(aDel1).append(aRecordPerSet.GetSvIdlString( SvHash_RecordPerSet() ));
else if( aRecordPerItem )
- ( aOut += aDel1 ) += aRecordPerItem.GetSvIdlString( SvHash_RecordPerItem() );
+ aOut.append(aDel1).append(aRecordPerItem.GetSvIdlString( SvHash_RecordPerItem() ));
else
aDel = aDel1;
if( aRecordAbsolute )
{
- ( aOut += aDel ) += aRecordAbsolute.GetSvIdlString( SvHash_RecordAbsolute() );
- aDel = ", ";
+ aOut.append(aDel).append(aRecordAbsolute.GetSvIdlString( SvHash_RecordAbsolute() ));
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
}
if( aHasDialog )
{
- ( aOut += aDel ) += aHasDialog.GetSvIdlString( SvHash_HasDialog() );
- aDel = ", ";
+ aOut.append(aDel).append(aHasDialog.GetSvIdlString( SvHash_HasDialog() ));
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
}
if( aMenuConfig )
{
- ( aOut += aDel ) += aMenuConfig.GetSvIdlString( SvHash_MenuConfig() );
- aDel = ", ";
+ aOut.append(aDel).append(aMenuConfig.GetSvIdlString( SvHash_MenuConfig() ));
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
}
if( aToolBoxConfig )
{
- ( aOut += aDel ) += aToolBoxConfig.GetSvIdlString( SvHash_ToolBoxConfig() );
- aDel = ", ";
+ aOut.append(aDel).append(aToolBoxConfig.GetSvIdlString( SvHash_ToolBoxConfig() ));
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
}
if( aStatusBarConfig )
{
- ( aOut += aDel ) += aStatusBarConfig.GetSvIdlString( SvHash_StatusBarConfig() );
- aDel = ", ";
+ aOut.append(aDel).append(aStatusBarConfig.GetSvIdlString( SvHash_StatusBarConfig() ));
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
}
if( aAccelConfig )
{
- ( aOut += aDel ) += aAccelConfig.GetSvIdlString( SvHash_AccelConfig() );
- aDel = ", ";
+ aOut.append(aDel).append(aAccelConfig.GetSvIdlString( SvHash_AccelConfig() ));
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
}
if( aFastCall )
{
- ( aOut += aDel ) += aFastCall.GetSvIdlString( SvHash_FastCall() );
- aDel = ", ";
+ aOut.append(aDel).append(aFastCall.GetSvIdlString( SvHash_FastCall() ));
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
}
if( aContainer )
{
- ( aOut += aDel ) += aContainer.GetSvIdlString( SvHash_Container() );
- aDel = ", ";
+ aOut.append(aDel).append(aContainer.GetSvIdlString( SvHash_Container() ));
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
}
if( aImageRotation )
{
- ( aOut += aDel ) += aImageRotation.GetSvIdlString( SvHash_ImageRotation() );
- aDel = ", ";
+ aOut.append(aDel).append(aImageRotation.GetSvIdlString( SvHash_ImageRotation() ));
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
}
if( aImageReflection )
{
- ( aOut += aDel ) += aImageReflection.GetSvIdlString( SvHash_ImageReflection() );
- aDel = ", ";
+ aOut.append(aDel).append(aImageReflection.GetSvIdlString( SvHash_ImageReflection() ));
+ aDel = rtl::OString(RTL_CONSTASCII_STRINGPARAM(", "));
}
- if( aOut.Len() )
+ if( aOut.getLength() )
{
WriteTab( rOutStm, nTab );
- rOutStm << aOut.GetBuffer() << endl;
+ rOutStm << aOut.getStr() << endl;
}
}
@@ -929,7 +931,7 @@ void SvMetaSlot::Write( SvIdlDataBase & rBase,
}
-void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
+void SvMetaSlot::Insert( SvSlotElementList& rList, const rtl::OString& rPrefix,
SvIdlDataBase& rBase)
{
// get insert position through binary search in slotlist
@@ -1008,14 +1010,14 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
{
// create SlotId
SvMetaEnumValue *enumValue = pEnum->GetObject(n);
- ByteString aValName = enumValue->GetName().getString();
+ rtl::OString aValName = enumValue->GetName().getString();
rtl::OStringBuffer aBuf;
if( !GetPseudoPrefix().isEmpty() )
aBuf.append(GetPseudoPrefix());
else
aBuf.append(GetSlotId().getString());
aBuf.append('_');
- aBuf.append(aValName.Copy(pEnum->GetPrefix().Len()));
+ aBuf.append(aValName.copy(pEnum->GetPrefix().getLength()));
rtl::OString aSId = aBuf.makeStringAndClear();
@@ -1081,7 +1083,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
}
-static ByteString MakeSlotName( SvStringHashEntry * pEntry )
+static rtl::OString MakeSlotName( SvStringHashEntry * pEntry )
{
rtl::OStringBuffer aName(RTL_CONSTASCII_STRINGPARAM("SFX_SLOT_"));
aName.append(pEntry->GetName());
@@ -1161,9 +1163,9 @@ void SvMetaSlot::WriteSlot( const rtl::OString& rShellName, sal_uInt16 nCount,
rOutStm << "// Slot Nr. "
<< rtl::OString::valueOf(static_cast<sal_Int32>(nListPos)).getStr()
<< " : ";
- ByteString aSlotIdValue(rtl::OString::valueOf(static_cast<sal_Int32>(
+ rtl::OString aSlotIdValue(rtl::OString::valueOf(static_cast<sal_Int32>(
GetSlotId().GetValue())));
- rOutStm << aSlotIdValue.GetBuffer() << endl;
+ rOutStm << aSlotIdValue.getStr() << endl;
WriteTab( rOutStm, 1 );
if( bIsEnumSlot )
rOutStm << "SFX_NEW_SLOT_ENUM( ";
@@ -1284,49 +1286,49 @@ void SvMetaSlot::WriteSlot( const rtl::OString& rShellName, sal_uInt16 nCount,
// write flags
if( GetHasCoreId() )
- rOutStm << MakeSlotName( SvHash_HasCoreId() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_HasCoreId() ).getStr() << '|';
if( GetCachable() )
- rOutStm << MakeSlotName( SvHash_Cachable() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_Cachable() ).getStr() << '|';
if( GetVolatile() )
- rOutStm << MakeSlotName( SvHash_Volatile() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_Volatile() ).getStr() << '|';
if( GetToggle() )
- rOutStm << MakeSlotName( SvHash_Toggle() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_Toggle() ).getStr() << '|';
if( GetAutoUpdate() )
- rOutStm << MakeSlotName( SvHash_AutoUpdate() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_AutoUpdate() ).getStr() << '|';
if( GetSynchron() )
- rOutStm << MakeSlotName( SvHash_Synchron() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_Synchron() ).getStr() << '|';
if( GetAsynchron() )
- rOutStm << MakeSlotName( SvHash_Asynchron() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_Asynchron() ).getStr() << '|';
if( GetRecordPerItem() )
- rOutStm << MakeSlotName( SvHash_RecordPerItem() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_RecordPerItem() ).getStr() << '|';
if( GetRecordPerSet() )
- rOutStm << MakeSlotName( SvHash_RecordPerSet() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_RecordPerSet() ).getStr() << '|';
if( GetRecordManual() )
- rOutStm << MakeSlotName( SvHash_RecordManual() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_RecordManual() ).getStr() << '|';
if( GetNoRecord() )
- rOutStm << MakeSlotName( SvHash_NoRecord() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_NoRecord() ).getStr() << '|';
if( GetRecordAbsolute() )
- rOutStm << MakeSlotName( SvHash_RecordAbsolute() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_RecordAbsolute() ).getStr() << '|';
if( GetHasDialog() )
- rOutStm << MakeSlotName( SvHash_HasDialog() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_HasDialog() ).getStr() << '|';
if( GetMenuConfig() )
- rOutStm << MakeSlotName( SvHash_MenuConfig() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_MenuConfig() ).getStr() << '|';
if( GetToolBoxConfig() )
- rOutStm << MakeSlotName( SvHash_ToolBoxConfig() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_ToolBoxConfig() ).getStr() << '|';
if( GetStatusBarConfig() )
- rOutStm << MakeSlotName( SvHash_StatusBarConfig() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_StatusBarConfig() ).getStr() << '|';
if( GetAccelConfig() )
- rOutStm << MakeSlotName( SvHash_AccelConfig() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_AccelConfig() ).getStr() << '|';
if( GetFastCall() )
- rOutStm << MakeSlotName( SvHash_FastCall() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_FastCall() ).getStr() << '|';
if( GetContainer() )
- rOutStm << MakeSlotName( SvHash_Container() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_Container() ).getStr() << '|';
if ( GetReadOnlyDoc() )
- rOutStm << MakeSlotName( SvHash_ReadOnlyDoc() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_ReadOnlyDoc() ).getStr() << '|';
if( GetImageRotation() )
- rOutStm << MakeSlotName( SvHash_ImageRotation() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_ImageRotation() ).getStr() << '|';
if( GetImageReflection() )
- rOutStm << MakeSlotName( SvHash_ImageReflection() ).GetBuffer() << '|';
+ rOutStm << MakeSlotName( SvHash_ImageReflection() ).getStr() << '|';
rOutStm << '0';
rOutStm << ',' << endl;
@@ -1508,17 +1510,17 @@ void SvMetaSlot::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
<< endl << '{' << endl;
WriteTab( rOutStm, 1 );
- ByteString aStr = GetConfigName().getString();
- if( !aStr.Len() )
+ rtl::OString aStr = GetConfigName().getString();
+ if( aStr.isEmpty() )
aStr = GetName().getString();
- rOutStm << "SlotName = \"" << aStr.GetBuffer() << "\";" << endl;
+ rOutStm << "SlotName = \"" << aStr.getStr() << "\";" << endl;
aStr = GetHelpText().getString();
- if( aStr.Len() )
+ if( !aStr.isEmpty() )
{
WriteTab( rOutStm, 1 );
- rOutStm << "HelpText = \"" << aStr.GetBuffer() << "\";" << endl;
+ rOutStm << "HelpText = \"" << aStr.getStr() << "\";" << endl;
}
rOutStm << "};" << endl;
@@ -1529,14 +1531,14 @@ void SvMetaSlot::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
{
for( sal_uLong n = 0; n < pEnum->Count(); n++ )
{
- ByteString aValName = pEnum->GetObject( n )->GetName().getString();
+ rtl::OString aValName = pEnum->GetObject( n )->GetName().getString();
rtl::OStringBuffer aBuf;
if( !GetPseudoPrefix().isEmpty() )
aBuf.append(GetPseudoPrefix());
else
aBuf.append(GetSlotId().getString());
aBuf.append('_');
- aBuf.append(aValName.Copy(pEnum->GetPrefix().Len()));
+ aBuf.append(aValName.copy(pEnum->GetPrefix().getLength()));
rtl::OString aSId = aBuf.makeStringAndClear();
@@ -1556,13 +1558,13 @@ void SvMetaSlot::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
<< endl << '{' << endl;
WriteTab( rOutStm, 1 );
- rOutStm << "SlotName = \"" << aValName.GetBuffer() << "\";" << endl;
+ rOutStm << "SlotName = \"" << aValName.getStr() << "\";" << endl;
- ByteString aStr = GetHelpText().getString();
- if( aStr.Len() )
+ rtl::OString aStr = GetHelpText().getString();
+ if (!aStr.isEmpty())
{
WriteTab( rOutStm, 1 );
- rOutStm << "HelpText = \"" << aStr.GetBuffer() << "\";" << endl;
+ rOutStm << "HelpText = \"" << aStr.getStr() << "\";" << endl;
}
rOutStm << "};" << endl;
}
@@ -1585,9 +1587,9 @@ void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
SvMetaTypeEnum * pEnum = PTR_CAST( SvMetaTypeEnum, GetType() );
if( GetPseudoSlots() && pEnum )
{
- for( sal_uLong n = 0; n < pEnum->Count(); n++ )
+ for( sal_uLong n = 0; n < pEnum->Count(); ++n )
{
- ByteString aValName = pEnum->GetObject( n )->GetName().getString();
+ rtl::OString aValName = pEnum->GetObject( n )->GetName().getString();
rtl::OStringBuffer aBuf;
if( !GetPseudoPrefix().isEmpty() )
@@ -1595,7 +1597,7 @@ void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
else
aBuf.append(GetSlotId().getString());
aBuf.append('_');
- aBuf.append(aValName.Copy(pEnum->GetPrefix().Len()));
+ aBuf.append(aValName.copy(pEnum->GetPrefix().getLength()));
rtl::OString aSId = aBuf.makeStringAndClear();
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index da182b5a8957..080a9e16f1d6 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -469,13 +469,13 @@ void SvMetaAttribute::WriteCSource( SvIdlDataBase & rBase, SvStream & rOutStm,
WriteTab( rOutStm, 3 );
rOutStm << " h" << rBase.aIFaceName.getStr() << " , ";
- ByteString aParserStr;
+ rtl::OString aParserStr;
if( pBaseType->GetType() == TYPE_METHOD || bSet )
aParserStr = pBaseType->GetParserString();
- if( aParserStr.Len() )
+ if( !aParserStr.isEmpty() )
{
rOutStm << '\"';
- rOutStm << aParserStr.GetBuffer();
+ rOutStm << aParserStr.getStr();
rOutStm << "\", ";
}
else
@@ -496,11 +496,11 @@ void SvMetaAttribute::WriteCSource( SvIdlDataBase & rBase, SvStream & rOutStm,
else
rOutStm << '0';
- if( aParserStr.Len() )
+ if( !aParserStr.isEmpty() )
{
rOutStm << ", ";
if( IsMethod() )
- pBaseType->WriteParamNames( rBase, rOutStm, ByteString() );
+ pBaseType->WriteParamNames( rBase, rOutStm, rtl::OString() );
else if( bSet )
pBaseType->WriteParamNames( rBase, rOutStm, GetName().getString() );
}
@@ -590,10 +590,8 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
{
if( !bVariable && IsMethod() )
{
- ByteString name;
- name += rBase.aIFaceName;
- name += GetName().getString();
- const char * pName = name.GetBuffer();
+ rtl::OString name = rBase.aIFaceName + GetName().getString();
+ const char * pName = name.getStr();
WriteTab( rOutStm, nTab );
pBaseType->WriteTypePrefix( rBase, rOutStm, nTab, nT );
rOutStm << ' ' << pName;
@@ -614,7 +612,7 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
}
else
{
- ByteString name = GetName().getString();
+ rtl::OString name = GetName().getString();
sal_Bool bReadonly = GetReadonly() || ( nA & WA_READONLY );
if ( !bReadonly && !IsMethod() )
@@ -623,11 +621,11 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
WriteTab( rOutStm, nTab );
rOutStm << "void ";
rOutStm << rBase.aIFaceName.getStr()
- << "Set" << name.GetBuffer() << "( " << C_PREF
+ << "Set" << name.getStr() << "( " << C_PREF
<< "Object h" << rBase.aIFaceName.getStr() << ", " << endl;
WriteTab( rOutStm, nTab+1 );
pBaseType->WriteTypePrefix( rBase, rOutStm, nTab, nT );
- rOutStm << ' ' << name.GetBuffer() << " )";
+ rOutStm << ' ' << name.getStr() << " )";
if( nT == WRITE_C_HEADER )
rOutStm << ';' << endl << endl;
else
@@ -639,7 +637,7 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
pBaseType->WriteTypePrefix( rBase, rOutStm, nTab, nT );
rOutStm << ' ';
rOutStm << rBase.aIFaceName.getStr()
- << "Get" << name.GetBuffer() << "( " << C_PREF
+ << "Get" << name.getStr() << "( " << C_PREF
<< "Object h" << rBase.aIFaceName.getStr() << " )";
if( nT == WRITE_C_HEADER )
rOutStm << ';' << endl << endl;
@@ -738,7 +736,7 @@ sal_uLong SvMetaAttribute::MakeSfx( rtl::OStringBuffer& rAttrArray )
}
}
-void SvMetaAttribute::Insert (SvSlotElementList&, const ByteString &, SvIdlDataBase&)
+void SvMetaAttribute::Insert (SvSlotElementList&, const rtl::OString&, SvIdlDataBase&)
{
}
@@ -1011,7 +1009,7 @@ const rtl::OString& SvMetaType::GetCName() const
return ((SvMetaType *)GetRef())->GetCName();
}
-sal_Bool SvMetaType::SetName( const ByteString & rName, SvIdlDataBase * pBase )
+sal_Bool SvMetaType::SetName( const rtl::OString& rName, SvIdlDataBase * pBase )
{
aSvName.setString(rName);
aSbxName.setString(rName);
@@ -1254,27 +1252,27 @@ void SvMetaType::WriteHeaderSvIdl( SvIdlDataBase & rBase,
case TYPE_CLASS:
{
if( IsShell() )
- rOutStm << SvHash_shell()->GetName().GetBuffer();
+ rOutStm << SvHash_shell()->GetName().getStr();
else
- rOutStm << SvHash_interface()->GetName().GetBuffer();
+ rOutStm << SvHash_interface()->GetName().getStr();
rOutStm << ' ' << GetName().getString().getStr();
}
break;
case TYPE_STRUCT:
{
- rOutStm << SvHash_struct()->GetName().GetBuffer()
+ rOutStm << SvHash_struct()->GetName().getStr()
<< ' ' << GetName().getString().getStr();
}
break;
case TYPE_UNION:
{
- rOutStm << SvHash_union()->GetName().GetBuffer()
+ rOutStm << SvHash_union()->GetName().getStr()
<< ' ' << GetName().getString().getStr();
}
break;
case TYPE_ENUM:
{
- rOutStm << SvHash_enum()->GetName().GetBuffer()
+ rOutStm << SvHash_enum()->GetName().getStr()
<< ' ' << GetName().getString().getStr();
}
break;
@@ -1282,9 +1280,9 @@ void SvMetaType::WriteHeaderSvIdl( SvIdlDataBase & rBase,
case TYPE_BASE:
{
if( IsItem() )
- rOutStm << SvHash_item()->GetName().GetBuffer() << ' ';
+ rOutStm << SvHash_item()->GetName().getStr() << ' ';
else
- rOutStm << SvHash_typedef()->GetName().GetBuffer() << ' ';
+ rOutStm << SvHash_typedef()->GetName().getStr() << ' ';
if( GetRef() )
{
((SvMetaType *)GetRef())->WriteTheType( rBase, rOutStm, nTab, WRITE_IDL );
@@ -1295,7 +1293,7 @@ void SvMetaType::WriteHeaderSvIdl( SvIdlDataBase & rBase,
break;
case TYPE_METHOD:
{
- rOutStm << SvHash_typedef()->GetName().GetBuffer() << ' ';
+ rOutStm << SvHash_typedef()->GetName().getStr() << ' ';
((SvMetaType *)GetRef())->WriteTheType( rBase, rOutStm, nTab, WRITE_IDL );
rOutStm << ' ' << GetName().getString().getStr() << "( ";
WriteContextSvIdl( rBase, rOutStm, nTab );
@@ -1405,7 +1403,7 @@ sal_uLong SvMetaType::MakeSfx( rtl::OStringBuffer& rAttrArray )
}
void SvMetaType::WriteSfxItem(
- const ByteString & rItemName, SvIdlDataBase &, SvStream & rOutStm )
+ const rtl::OString& rItemName, SvIdlDataBase &, SvStream & rOutStm )
{
WriteStars( rOutStm );
rtl::OStringBuffer aVarName(RTL_CONSTASCII_STRINGPARAM(" a"));
@@ -1426,7 +1424,7 @@ void SvMetaType::WriteSfxItem(
<< aTypeName.getStr() << aVarName.getStr()
<< " = " << endl;
rOutStm << '{' << endl
- << "\tTYPE(" << rItemName.GetBuffer() << "), "
+ << "\tTYPE(" << rItemName.getStr() << "), "
<< aAttrCount.getStr();
if( nAttrCount )
{
@@ -1573,11 +1571,11 @@ void SvMetaType::WriteTypePrefix( SvIdlDataBase & rBase, SvStream & rOutStm,
case WRITE_IDL:
{
if( GetIn() && GetOut() )
- rOutStm << SvHash_inout()->GetName().GetBuffer() << ' ';
+ rOutStm << SvHash_inout()->GetName().getStr() << ' ';
else if( GetIn() )
- rOutStm << SvHash_in()->GetName().GetBuffer() << ' ';
+ rOutStm << SvHash_in()->GetName().getStr() << ' ';
else if( GetOut() )
- rOutStm << SvHash_out()->GetName().GetBuffer() << ' ';
+ rOutStm << SvHash_out()->GetName().getStr() << ' ';
rOutStm << GetCString().getStr();
}
break;
@@ -1596,7 +1594,7 @@ void SvMetaType::WriteTypePrefix( SvIdlDataBase & rBase, SvStream & rOutStm,
rOutStm << "[out] ";
}
- ByteString out;
+ rtl::OString out;
if( GetType() == TYPE_METHOD )
out = GetReturnType()->GetBaseType()->GetOdlName();
else
@@ -1610,7 +1608,7 @@ void SvMetaType::WriteTypePrefix( SvIdlDataBase & rBase, SvStream & rOutStm,
if( aCall1 == (int)CALL_POINTER
|| aCall1 == (int)CALL_REFERENCE )
rOutStm << " *";
- rOutStm << out.GetBuffer();
+ rOutStm << out.getStr();
}
break;
@@ -1711,7 +1709,7 @@ rtl::OString SvMetaType::GetParserString() const
void SvMetaType::WriteParamNames( SvIdlDataBase & rBase,
SvStream & rOutStm,
- const ByteString & rChief )
+ const rtl::OString& rChief )
{
SvMetaType * pBT = GetBaseType();
if( pBT != this )
@@ -1734,7 +1732,7 @@ void SvMetaType::WriteParamNames( SvIdlDataBase & rBase,
}
}
else
- rOutStm << rChief.GetBuffer();
+ rOutStm << rChief.getStr();
}
}
@@ -1780,7 +1778,7 @@ void SvMetaEnumValue::Save( SvPersistStream & rStm )
// create mask
sal_uInt8 nMask = 0;
- if( aEnumValue.Len() ) nMask |= 0x01;
+ if( !aEnumValue.isEmpty() ) nMask |= 0x01;
// write data
rStm << nMask;
@@ -1838,7 +1836,7 @@ void SvMetaTypeEnum::Save( SvPersistStream & rStm )
// create mask
sal_uInt8 nMask = 0;
if( aEnumValueList.Count() ) nMask |= 0x01;
- if( aPrefix.Len() ) nMask |= 0x02;
+ if( !aPrefix.isEmpty() ) nMask |= 0x02;
// write data
rStm << nMask;
@@ -1860,9 +1858,9 @@ void SvMetaTypeEnum::ReadContextSvIdl( SvIdlDataBase & rBase,
aPrefix = aEnumVal->GetName().getString();
else
{
- sal_uInt16 nPos = aPrefix.Match( aEnumVal->GetName().getString() );
- if( nPos != aPrefix.Len() && nPos != STRING_MATCH )
- aPrefix.Erase( nPos );
+ sal_uInt16 nPos = ByteString(aPrefix).Match( aEnumVal->GetName().getString() );
+ if( nPos != aPrefix.getLength() && nPos != STRING_MATCH )
+ aPrefix = aPrefix.copy(0, nPos);
}
aEnumValueList.Append( aEnumVal );
}
@@ -1956,9 +1954,9 @@ void SvMetaTypevoid::Save( SvPersistStream & rStm )
SvMetaType::Save( rStm );
}
-ByteString SvMetaAttribute::Compare( SvMetaAttribute* pAttr )
+rtl::OString SvMetaAttribute::Compare( SvMetaAttribute* pAttr )
{
- ByteString aStr;
+ rtl::OStringBuffer aStr;
if ( aType.Is() )
{
@@ -1966,10 +1964,12 @@ ByteString SvMetaAttribute::Compare( SvMetaAttribute* pAttr )
{
// Test only when the attribute is a method not if it has one!
if ( !pAttr->GetType()->GetType() == TYPE_METHOD )
- aStr += " IsMethod\n";
+ aStr.append(" IsMethod\n");
else if ( aType->GetReturnType() &&
aType->GetReturnType()->GetType() != pAttr->GetType()->GetReturnType()->GetType() )
- aStr += " ReturnType\n";
+ {
+ aStr.append(" ReturnType\n");
+ }
if ( aType->GetAttrCount() )
{
@@ -1978,7 +1978,7 @@ ByteString SvMetaAttribute::Compare( SvMetaAttribute* pAttr )
SvMetaAttributeMemberList& rOtherList = pAttr->GetType()->GetAttrList();
if ( pAttr->GetType()->GetAttrCount() != nCount )
{
- aStr += " AttributeCount\n";
+ aStr.append(" AttributeCount\n");
}
else
{
@@ -1993,28 +1993,28 @@ ByteString SvMetaAttribute::Compare( SvMetaAttribute* pAttr )
}
if ( GetType()->GetType() != pAttr->GetType()->GetType() )
- aStr += " Type\n";
+ aStr.append(" Type\n");
if ( !GetType()->GetSvName().equals( pAttr->GetType()->GetSvName() ) )
- aStr += " ItemType\n";
+ aStr.append(" ItemType\n");
}
if ( GetExport() != pAttr->GetExport() )
- aStr += " Export\n";
+ aStr.append(" Export\n");
if ( GetAutomation() != pAttr->GetAutomation() )
- aStr += " Automation\n";
+ aStr.append(" Automation\n");
if ( GetIsCollection() != pAttr->GetIsCollection() )
- aStr += " IsCollection\n";
+ aStr.append(" IsCollection\n");
if ( GetReadOnlyDoc() != pAttr->GetReadOnlyDoc() )
- aStr += " ReadOnlyDoc\n";
+ aStr.append(" ReadOnlyDoc\n");
if ( GetExport() && GetReadonly() != pAttr->GetReadonly() )
- aStr += " Readonly\n";
+ aStr.append(" Readonly\n");
- return aStr;
+ return aStr.makeStringAndClear();
}
void SvMetaAttribute::WriteCSV( SvIdlDataBase&, SvStream& rStrm )
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index cea9ba568568..b842bb3bf7b5 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -618,7 +618,7 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
{
rtl::OString aN = IDLAPP->pHashTable->GetNearString( pTok->GetString() );
if( !aN.isEmpty() )
- fprintf( stderr, "%s versus %s\n", pTok->GetString().GetBuffer(), aN.getStr() );
+ fprintf( stderr, "%s versus %s\n", pTok->GetString().getStr(), aN.getStr() );
}
}
@@ -640,7 +640,7 @@ sal_Bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, sal_Bool bImported
pTok = rInStm.GetToken_Next();
if( pTok->IsString() )
{
- DirEntry aFullName( String::CreateFromAscii( pTok->GetString().GetBuffer() ) );
+ DirEntry aFullName( String::CreateFromAscii( pTok->GetString().getStr() ) );
if( aFullName.Find( rPath ) )
{
this->AddDepFile(aFullName.GetFull());
@@ -718,7 +718,7 @@ sal_Bool SvIdlWorkingBase::WriteSvIdl( SvStream & rOutStm )
for ( size_t i = 0, n = aList.size(); i < n; ++i )
{
SvStringHashEntry* pEntry = aList[ i ];
- rOutStm << "#define " << pEntry->GetName().GetBuffer()
+ rOutStm << "#define " << pEntry->GetName().getStr()
<< '\t'
<< rtl::OString::valueOf(static_cast<sal_Int64>(
pEntry->GetValue())).getStr()