summaryrefslogtreecommitdiff
path: root/idl
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2012-03-11 12:03:11 +0200
committerCaolán McNamara <caolanm@redhat.com>2012-03-20 14:23:46 +0000
commite516f134fac55a14b155fea70064e1c0553ea50c (patch)
treecfb6f8f07e488a52ac58ad175d7fa9e9bf3831cf /idl
parentdbd9198aa9d325dd5bbeb110cc8a3db57838d1e6 (diff)
Convert tools/table.hxx usage to std::map in IDL module
Along the way, convert the table parameter passing to using references since we are never passing a null pointer.
Diffstat (limited to 'idl')
-rw-r--r--idl/inc/module.hxx2
-rw-r--r--idl/inc/object.hxx2
-rw-r--r--idl/inc/slot.hxx2
-rw-r--r--idl/inc/types.hxx9
-rw-r--r--idl/source/objects/module.cxx4
-rw-r--r--idl/source/objects/object.cxx4
-rw-r--r--idl/source/objects/slot.cxx10
-rw-r--r--idl/source/objects/types.cxx2
-rw-r--r--idl/source/prj/database.cxx6
9 files changed, 22 insertions, 19 deletions
diff --git a/idl/inc/module.hxx b/idl/inc/module.hxx
index 4e5953eff717..3a316050db0f 100644
--- a/idl/inc/module.hxx
+++ b/idl/inc/module.hxx
@@ -96,7 +96,7 @@ public:
WriteType, WriteAttribute = 0 );
virtual void WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm );
virtual void WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
- Table* pTable );
+ HelpIdTable& rTable );
};
SV_DECL_IMPL_REF(SvMetaModule)
SV_DECL_IMPL_PERSIST_LIST(SvMetaModule,SvMetaModule *)
diff --git a/idl/inc/object.hxx b/idl/inc/object.hxx
index 1dd2cef9fefb..f23262d95189 100644
--- a/idl/inc/object.hxx
+++ b/idl/inc/object.hxx
@@ -140,7 +140,7 @@ public:
WriteType, WriteAttribute = 0 );
virtual void WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm );
virtual void WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
- Table* pTable );
+ HelpIdTable& rTable );
};
SV_IMPL_REF(SvMetaClass)
SV_IMPL_PERSIST_LIST(SvMetaClass,SvMetaClass *)
diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx
index 3c00ca80e59b..d4ae0be1cab2 100644
--- a/idl/inc/slot.hxx
+++ b/idl/inc/slot.hxx
@@ -260,7 +260,7 @@ public:
sal_uInt16 WriteSlotParamArray( SvIdlDataBase & rBase,
SvStream & rOutStm );
virtual void WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
- Table * pIdTable );
+ HelpIdTable& rIdTable );
virtual void WriteCSV( SvIdlDataBase&, SvStream& );
};
SV_DECL_IMPL_REF(SvMetaSlot)
diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx
index 508f5a0c2963..b29a83cb4655 100644
--- a/idl/inc/types.hxx
+++ b/idl/inc/types.hxx
@@ -31,12 +31,15 @@
#include <rtl/strbuf.hxx>
#include <tools/ref.hxx>
-#include <tools/table.hxx>
#include <basobj.hxx>
+#include <map>
struct SvSlotElement;
typedef std::vector< SvSlotElement* > SvSlotElementList;
+class SvMetaSlot;
+typedef std::map<sal_uLong, SvMetaSlot*> HelpIdTable;
+
SV_DECL_REF(SvMetaType)
SV_DECL_REF(SvMetaAttribute)
SV_DECL_PERSIST_LIST(SvMetaAttribute,SvMetaAttribute *)
@@ -119,9 +122,9 @@ public:
virtual void Insert( SvSlotElementList&, const rtl::OString& rPrefix,
SvIdlDataBase& );
virtual void WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
- Table * pIdTable );
+ HelpIdTable& rIdTable );
virtual void WriteCSV( SvIdlDataBase&, SvStream& );
- void FillIDTable(Table *pIDTable);
+ void FillIDTable(HelpIdTable& rIDTable);
rtl::OString Compare( SvMetaAttribute *pAttr );
};
SV_IMPL_REF(SvMetaAttribute)
diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx
index c261d4c76dd3..02a7cc7546d5 100644
--- a/idl/source/objects/module.cxx
+++ b/idl/source/objects/module.cxx
@@ -385,12 +385,12 @@ void SvMetaModule::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
}
void SvMetaModule::WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
- Table* pTable )
+ HelpIdTable& rTable )
{
for( sal_uLong n = 0; n < aClassList.Count(); n++ )
{
SvMetaClass * pClass = aClassList.GetObject( n );
- pClass->WriteHelpIds( rBase, rOutStm, pTable );
+ pClass->WriteHelpIds( rBase, rOutStm, rTable );
}
}
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index b95b0a031b54..2ed6d1d2a618 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -652,12 +652,12 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
}
void SvMetaClass::WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
- Table* pTable )
+ HelpIdTable& rTable )
{
for( sal_uLong n=0; n<aAttrList.Count(); n++ )
{
SvMetaAttribute * pAttr = aAttrList.GetObject( n );
- pAttr->WriteHelpId( rBase, rOutStm, pTable );
+ pAttr->WriteHelpId( rBase, rOutStm, rTable );
}
}
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index f180719786a5..bec2e795baf6 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -1496,12 +1496,12 @@ sal_uInt16 SvMetaSlot::WriteSlotMap( const rtl::OString& rShellName, sal_uInt16
}
void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
- Table * pTable )
+ HelpIdTable& rTable )
{
sal_uLong nSId = GetSlotId().GetValue();
- if( !pTable->IsKeyValid( nSId ) )
+ if( rTable.find( nSId ) == rTable.end() )
{
- pTable->Insert( nSId, this );
+ rTable[ nSId ] = this;
rOutStm << "#define " << GetSlotId().getString().getStr() << '\t'
<< rtl::OString::valueOf(static_cast<sal_Int32>(nSId)).getStr()
<< endl;
@@ -1533,9 +1533,9 @@ void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
}
// if id not found, write always
- if( !bIdOk || !pTable->IsKeyValid( nSId2 ) )
+ if( !bIdOk || rTable.find( nSId2 ) == rTable.end() )
{
- pTable->Insert( nSId2, this );
+ rTable[ nSId2 ] = this;
rOutStm << "#define " << aSId.getStr() << '\t'
<< rtl::OString::valueOf(
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index 9eaf1973854f..4e0313a774df 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -740,7 +740,7 @@ void SvMetaAttribute::Insert (SvSlotElementList&, const rtl::OString&, SvIdlData
{
}
-void SvMetaAttribute::WriteHelpId( SvIdlDataBase &, SvStream &, Table * )
+void SvMetaAttribute::WriteHelpId( SvIdlDataBase &, SvStream &, HelpIdTable& )
{
}
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index b842bb3bf7b5..3171197a1d07 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -765,19 +765,19 @@ sal_Bool SvIdlWorkingBase::WriteHelpIds( SvStream& rOutStm )
if( rOutStm.GetError() != SVSTREAM_OK )
return sal_False;
- Table aIdTable;
+ HelpIdTable aIdTable;
sal_uLong n;
for( n = 0; n < GetModuleList().Count(); n++ )
{
SvMetaModule * pModule = GetModuleList().GetObject( n );
- pModule->WriteHelpIds( *this, rOutStm, &aIdTable );
+ pModule->WriteHelpIds( *this, rOutStm, aIdTable );
}
const SvMetaAttributeMemberList & rAttrList = GetAttrList();
for( n = 0; n < rAttrList.Count(); n++ )
{
SvMetaAttribute * pAttr = rAttrList.GetObject( n );
- pAttr->WriteHelpId( *this, rOutStm, &aIdTable );
+ pAttr->WriteHelpId( *this, rOutStm, aIdTable );
}
return sal_True;