summaryrefslogtreecommitdiff
path: root/idl/source/objects
diff options
context:
space:
mode:
Diffstat (limited to 'idl/source/objects')
-rw-r--r--idl/source/objects/object.cxx13
-rw-r--r--idl/source/objects/slot.cxx44
-rw-r--r--idl/source/objects/types.cxx32
3 files changed, 53 insertions, 36 deletions
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index a393ee1c98b9..676dcdd30f82 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -32,6 +32,8 @@
#include <ctype.h>
#include <stdio.h>
+#include <rtl/strbuf.hxx>
+
#include <tools/debug.hxx>
#include <object.hxx>
@@ -516,13 +518,14 @@ void SvMetaClass::InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>&
{
SvClassElement * pEle = aClassList.GetObject( n );
SvMetaClass * pCl = pEle->GetClass();
- ByteString rPre = rPrefix;
- if( rPre.Len() && pEle->GetPrefix().Len() )
- rPre += '.';
- rPre += pEle->GetPrefix();
+ rtl::OStringBuffer rPre(rPrefix);
+ if( rPre.getLength() && pEle->GetPrefix().Len() )
+ rPre.append('.');
+ rPre.append(pEle->GetPrefix());
// first of all write direct imported interfaces
- pCl->InsertSlots( rList, rSuperList, rClassList, rPre, rBase );
+ pCl->InsertSlots( rList, rSuperList, rClassList,
+ rPre.makeStringAndClear(), rBase );
}
// only write superclass if no shell and not in the list
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index e56d95776960..8f2eeb76b61e 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -31,6 +31,7 @@
#include <ctype.h>
#include <stdio.h>
+#include <rtl/strbuf.hxx>
#include <tools/debug.hxx>
#include <slot.hxx>
#include <globals.hxx>
@@ -1011,17 +1012,21 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
// create SlotId
SvMetaEnumValue *enumValue = pEnum->GetObject(n);
ByteString aValName = enumValue->GetName();
- ByteString aSId( GetSlotId() );
+ rtl::OStringBuffer aBuf;
if( GetPseudoPrefix().Len() )
- aSId = GetPseudoPrefix();
- aSId += '_';
- aSId += aValName.Copy( pEnum->GetPrefix().Len() );
+ aBuf.append(GetPseudoPrefix());
+ else
+ aBuf.append(GetSlotId());
+ aBuf.append('_');
+ aBuf.append(aValName.Copy(pEnum->GetPrefix().Len()));
+
+ rtl::OString aSId = aBuf.makeStringAndClear();
xEnumSlot = NULL;
for( m=0; m<rBase.GetAttrList().Count(); m++ )
{
SvMetaAttribute * pAttr = rBase.GetAttrList().GetObject( m );
- if( pAttr->GetSlotId() == aSId )
+ if (aSId.equals(pAttr->GetSlotId()))
{
SvMetaSlot* pSlot = PTR_CAST( SvMetaSlot, pAttr );
xEnumSlot = pSlot->Clone();
@@ -1520,11 +1525,15 @@ void SvMetaSlot::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
for( sal_uLong n = 0; n < pEnum->Count(); n++ )
{
ByteString aValName = pEnum->GetObject( n )->GetName();
- ByteString aSId( GetSlotId() );
+ rtl::OStringBuffer aBuf;
if( GetPseudoPrefix().Len() )
- aSId = GetPseudoPrefix();
- aSId += '_';
- aSId += aValName.Copy( pEnum->GetPrefix().Len() );
+ aBuf.append(GetPseudoPrefix());
+ else
+ aBuf.append(GetSlotId());
+ aBuf.append('_');
+ aBuf.append(aValName.Copy(pEnum->GetPrefix().Len()));
+
+ rtl::OString aSId = aBuf.makeStringAndClear();
sal_uLong nSId2;
sal_Bool bIdOk = sal_False;
@@ -1538,7 +1547,7 @@ void SvMetaSlot::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
if( !bIdOk || !pTable->IsKeyValid( nSId2 ) )
{
pTable->Insert( nSId2, this );
- rOutStm << "SfxSlotInfo " << aSId.GetBuffer()
+ rOutStm << "SfxSlotInfo " << aSId.getStr()
<< endl << '{' << endl;
WriteTab( rOutStm, 1 );
@@ -1574,11 +1583,16 @@ void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
for( sal_uLong n = 0; n < pEnum->Count(); n++ )
{
ByteString aValName = pEnum->GetObject( n )->GetName();
- ByteString aSId( GetSlotId() );
+
+ rtl::OStringBuffer aBuf;
if( GetPseudoPrefix().Len() )
- aSId = GetPseudoPrefix();
- aSId += '_';
- aSId += aValName.Copy( pEnum->GetPrefix().Len() );
+ aBuf.append(GetPseudoPrefix());
+ else
+ aBuf.append( GetSlotId() );
+ aBuf.append('_');
+ aBuf.append(aValName.Copy(pEnum->GetPrefix().Len()));
+
+ rtl::OString aSId = aBuf.makeStringAndClear();
sal_uLong nSId2;
sal_Bool bIdOk = sal_False;
@@ -1593,7 +1607,7 @@ void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
{
pTable->Insert( nSId2, this );
- rOutStm << "#define " << aSId.GetBuffer() << '\t'
+ rOutStm << "#define " << aSId.getStr() << '\t'
<< rtl::OString::valueOf(
static_cast<sal_Int32>(nSId2)).getStr()
<< endl;
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index a32bff132fb7..c6d980f20a4b 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -722,7 +722,7 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-sal_uLong SvMetaAttribute::MakeSfx( ByteString& rAttrArray )
+sal_uLong SvMetaAttribute::MakeSfx( rtl::OStringBuffer& rAttrArray )
{
SvMetaType * pType = GetType();
DBG_ASSERT( pType, "no type for attribute" );
@@ -732,11 +732,11 @@ sal_uLong SvMetaAttribute::MakeSfx( ByteString& rAttrArray )
return pBaseType->MakeSfx( rAttrArray );
else
{
- rAttrArray += '{';
- rAttrArray += GetSlotId();
- rAttrArray += ",\"";
- rAttrArray += GetName();
- rAttrArray += "\"}";
+ rAttrArray.append('{');
+ rAttrArray.append(GetSlotId());
+ rAttrArray.append(",\"");
+ rAttrArray.append(GetName());
+ rAttrArray.append("\"}");
return 1;
}
}
@@ -1035,16 +1035,16 @@ sal_Bool SvMetaType::SetName( const ByteString & rName, SvIdlDataBase * pBase )
#ifdef IDL_COMPILER
ByteString SvMetaType::GetCString() const
{
- ByteString out( GetSvName() );
+ rtl::OStringBuffer out( GetSvName() );
if( aCall0 == (int)CALL_POINTER )
- out += " *";
+ out.append(" *");
else if( aCall0 == (int)CALL_REFERENCE )
- out += " &";
+ out.append(" &");
if( aCall1 == (int)CALL_POINTER )
- out += '*';
+ out.append('*');
else if( aCall1 == (int)CALL_REFERENCE )
- out += '&';
- return out;
+ out.append('&');
+ return out.makeStringAndClear();
}
sal_Bool SvMetaType::ReadHeaderSvIdl( SvIdlDataBase & rBase,
@@ -1399,7 +1399,7 @@ void SvMetaType::WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm,
SvMetaExtern::WriteAttributes( rBase, rOutStm, nTab, nT, nA );
}
-sal_uLong SvMetaType::MakeSfx( ByteString& rAttrArray )
+sal_uLong SvMetaType::MakeSfx( rtl::OStringBuffer& rAttrArray )
{
sal_uLong nC = 0;
@@ -1411,7 +1411,7 @@ sal_uLong SvMetaType::MakeSfx( ByteString& rAttrArray )
{
nC += pAttrList->GetObject( n )->MakeSfx( rAttrArray );
if( n +1 < nAttrCount )
- rAttrArray += ", ";
+ rAttrArray.append(", ");
}
}
return nC;
@@ -1426,7 +1426,7 @@ void SvMetaType::WriteSfxItem(
aVarName += "_Impl";
ByteString aTypeName = "SfxType";
- ByteString aAttrArray;
+ rtl::OStringBuffer aAttrArray;
sal_uLong nAttrCount = MakeSfx( aAttrArray );
ByteString aAttrCount(
rtl::OString::valueOf(static_cast<sal_Int32>(nAttrCount)));
@@ -1446,7 +1446,7 @@ void SvMetaType::WriteSfxItem(
{
rOutStm << ", { ";
// write the single attributes
- rOutStm << aAttrArray.GetBuffer();
+ rOutStm << aAttrArray.getStr();
rOutStm << " }";
}
rOutStm << endl << "};" << endl