[Libreoffice-commits] core.git: idl/inc idl/source

Noel Grandin noel at peralex.com
Sun Feb 7 06:51:02 UTC 2016


 idl/inc/basobj.hxx            |   12 ++----------
 idl/inc/database.hxx          |   24 ++++++++++++------------
 idl/inc/globals.hxx           |    1 +
 idl/inc/hash.hxx              |    3 ---
 idl/inc/module.hxx            |    9 +++------
 idl/inc/object.hxx            |   21 +++++++--------------
 idl/inc/slot.hxx              |    7 ++-----
 idl/inc/types.hxx             |   32 +++++++++-----------------------
 idl/source/objects/module.cxx |    8 ++++----
 idl/source/objects/object.cxx |    2 +-
 idl/source/objects/slot.cxx   |    4 ++--
 idl/source/objects/types.cxx  |    8 ++++----
 idl/source/prj/database.cxx   |   14 +++++++-------
 13 files changed, 54 insertions(+), 91 deletions(-)

New commits:
commit 8beb3e713febf588de8dff00890b223e41f4654a
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Feb 5 11:05:24 2016 +0200

    .SDI compiler: expand out some typedefs
    
    Change-Id: I898bc1d95b1d3394cae74776c0e7dcbaafa934e4
    Reviewed-on: https://gerrit.libreoffice.org/22146
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/idl/inc/basobj.hxx b/idl/inc/basobj.hxx
index 9639b87..1768e0c 100644
--- a/idl/inc/basobj.hxx
+++ b/idl/inc/basobj.hxx
@@ -82,8 +82,6 @@ public:
     }
 };
 
-class SvMetaObjectMemberList : public SvRefMemberList<SvMetaObject *> {};
-
 class SvMetaObject : public SvRttiBase
 {
 protected:
@@ -117,7 +115,7 @@ template<class T> bool checkSvMetaObject(const SvMetaObject* pObject)
 
 class SvMetaObjectMemberStack
 {
-    SvMetaObjectMemberList aList;
+    SvRefMemberList<SvMetaObject *> aList;
 public:
             SvMetaObjectMemberStack() {;}
 
@@ -126,15 +124,13 @@ public:
     void            Pop() { aList.pop_back(); }
     SvMetaObject *  Get( std::function<bool ( const SvMetaObject* )> isSvMetaObject )
                     {
-                        for( SvMetaObjectMemberList::reverse_iterator it = aList.rbegin(); it != aList.rend(); ++it )
+                        for( SvRefMemberList<SvMetaObject *>::reverse_iterator it = aList.rbegin(); it != aList.rend(); ++it )
                             if( isSvMetaObject(*it) )
                                 return *it;
                         return nullptr;
                     }
 };
 
-class SvMetaNameMemberList : public SvRefMemberList<SvMetaObject *> {};
-
 class SvMetaReference : public SvMetaObject
 {
 protected:
@@ -163,9 +159,6 @@ public:
                         { aRef = pRef; }
 };
 
-class SvMetaReferenceMemberList : public SvRefMemberList<SvMetaReference *> {};
-
-
 class SvMetaModule;
 class SvMetaExtern : public SvMetaReference
 {
@@ -180,7 +173,6 @@ public:
     virtual bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
 };
 
-class SvMetaExternMemberList : public SvRefMemberList<SvMetaExtern *> {};
 
 #endif // INCLUDED_IDL_INC_BASOBJ_HXX
 
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx
index f7658b2..f7c8e7b 100644
--- a/idl/inc/database.hxx
+++ b/idl/inc/database.hxx
@@ -61,11 +61,11 @@ class SvIdlDataBase
     StringList                  aIdFileList;
     SvStringHashTable *         pIdTable;
 
-    SvMetaTypeMemberList        aTypeList;
-    SvMetaClassMemberList       aClassList;
-    SvMetaModuleMemberList      aModuleList;
-    SvMetaAttributeMemberList   aAttrList;
-    SvMetaTypeMemberList        aTmpTypeList; // not persistent
+    SvRefMemberList<SvMetaType *>      aTypeList;
+    SvRefMemberList<SvMetaClass *>     aClassList;
+    SvRefMemberList<SvMetaModule *>    aModuleList;
+    SvRefMemberList<SvMetaAttribute *> aAttrList;
+    SvRefMemberList<SvMetaType *>      aTmpTypeList; // not persistent
 
 protected:
     ::std::set< OUString > m_DepFiles;
@@ -83,15 +83,15 @@ public:
                 explicit SvIdlDataBase( const SvCommand& rCmd );
                 ~SvIdlDataBase();
 
-    SvMetaAttributeMemberList&  GetAttrList() { return aAttrList; }
-    SvMetaTypeMemberList &      GetTypeList();
-    SvMetaClassMemberList &     GetClassList()  { return aClassList; }
-    SvMetaModuleMemberList &    GetModuleList() { return aModuleList; }
+    SvRefMemberList<SvMetaAttribute *>&  GetAttrList() { return aAttrList; }
+    SvRefMemberList<SvMetaType *>&       GetTypeList();
+    SvRefMemberList<SvMetaClass *>&      GetClassList()  { return aClassList; }
+    SvRefMemberList<SvMetaModule *>&     GetModuleList() { return aModuleList; }
     SvMetaModule *              GetModule( const OString& rName );
 
     // list of used types while writing
-    SvMetaTypeMemberList    aUsedTypes;
-    OString                 aIFaceName;
+    SvRefMemberList<SvMetaType *>    aUsedTypes;
+    OString                          aIFaceName;
 
     void                    StartNewFile( const OUString& rName );
     void                    SetExportFile( const OUString& rName )
@@ -118,7 +118,7 @@ public:
     bool                    ReadIdFile( const OUString & rFileName );
 
     SvMetaType *            FindType( const OString& rName );
-    static SvMetaType *     FindType( const SvMetaType *, SvMetaTypeMemberList & );
+    static SvMetaType *     FindType( const SvMetaType *, SvRefMemberList<SvMetaType *>& );
 
     SvMetaType *            ReadKnownType( SvTokenStream & rInStm );
     SvMetaAttribute *       ReadKnownAttr( SvTokenStream & rInStm,
diff --git a/idl/inc/globals.hxx b/idl/inc/globals.hxx
index 1bb5198..a78e3aa 100644
--- a/idl/inc/globals.hxx
+++ b/idl/inc/globals.hxx
@@ -22,6 +22,7 @@
 
 #include <hash.hxx>
 
+typedef tools::SvRef<SvStringHashEntry> SvStringHashEntryRef;
 
 class SvClassManager;
 struct SvGlobalHashNames
diff --git a/idl/inc/hash.hxx b/idl/inc/hash.hxx
index 70a5d6a..a2e923c 100644
--- a/idl/inc/hash.hxx
+++ b/idl/inc/hash.hxx
@@ -87,9 +87,6 @@ public:
         }
 };
 
-typedef tools::SvRef<SvStringHashEntry> SvStringHashEntryRef;
-
-
 class SvStringHashTable : public SvHashTable
 {
     SvStringHashEntry*      pEntries;
diff --git a/idl/inc/module.hxx b/idl/inc/module.hxx
index d5f9356..b09ae4e 100644
--- a/idl/inc/module.hxx
+++ b/idl/inc/module.hxx
@@ -25,9 +25,9 @@
 
 class SvMetaModule : public SvMetaExtern
 {
-    SvMetaClassMemberList       aClassList;
-    SvMetaTypeMemberList        aTypeList;
-    SvMetaAttributeMemberList   aAttrList;
+    SvRefMemberList<SvMetaClass *>      aClassList;
+    SvRefMemberList<SvMetaType *>       aTypeList;
+    SvRefMemberList<SvMetaAttribute *>  aAttrList;
 // browser
     SvString                aSlotIdFile;
     SvString                aModulePrefix;
@@ -52,9 +52,6 @@ public:
     void                WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm );
 };
 
-class SvMetaModuleMemberList : public SvRefMemberList<SvMetaModule *> {};
-
-
 #endif // INCLUDED_IDL_INC_MODULE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/object.hxx b/idl/inc/object.hxx
index 34005e5..4e1e38a 100644
--- a/idl/inc/object.hxx
+++ b/idl/inc/object.hxx
@@ -26,22 +26,18 @@
 
 struct SvSlotElement
 {
-    SvMetaSlotRef   xSlot;
-    SvSlotElement( SvMetaSlot * pS )
-    : xSlot( pS )
-    {
-    }
+    tools::SvRef<SvMetaSlot>   xSlot;
+    SvSlotElement( SvMetaSlot * pS ) : xSlot( pS ) {}
 };
 typedef std::vector< SvSlotElement* > SvSlotElementList;
 
 class SvMetaClass;
 typedef ::std::vector< SvMetaClass* > SvMetaClassList;
 
-typedef tools::SvRef<SvMetaClass> SvMetaClassRef;
 class SvClassElement : public SvRttiBase
 {
-    OString                aPrefix;
-    SvMetaClassRef         xClass;
+    OString                   aPrefix;
+    tools::SvRef<SvMetaClass> xClass;
 public:
             SvClassElement();
 
@@ -56,15 +52,12 @@ public:
                     { return xClass; }
 };
 
-class SvClassElementMemberList : public SvRefMemberList<SvClassElement *> {};
-
-class SvMetaClassMemberList : public SvRefMemberList<SvMetaClass *> {};
 
 class SvMetaClass : public SvMetaType
 {
-    SvMetaAttributeMemberList   aAttrList;
-    SvClassElementMemberList    aClassList;
-    SvMetaClassRef              aSuperClass;
+    SvRefMemberList<SvMetaAttribute *>  aAttrList;
+    SvRefMemberList<SvClassElement *>   aClassList;
+    tools::SvRef<SvMetaClass>           aSuperClass;
 
     bool                    TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInStm,
                                      SvMetaAttribute & rAttr ) const;
diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx
index cdcc14f..8fab390 100644
--- a/idl/inc/slot.hxx
+++ b/idl/inc/slot.hxx
@@ -25,8 +25,8 @@
 
 class SvMetaSlot : public SvMetaAttribute
 {
-    SvMetaTypeRef   aSlotType;
-    SvMetaAttributeRef aMethod;
+    tools::SvRef<SvMetaType>      aSlotType;
+    tools::SvRef<SvMetaAttribute> aMethod;
     SvIdentifier    aGroupId;
     SvIdentifier    aConfigId;
     SvIdentifier    aExecMethod;
@@ -165,9 +165,6 @@ public:
     sal_uInt16          WriteSlotParamArray( SvIdlDataBase & rBase,
                                             SvStream & rOutStm );
 };
-typedef tools::SvRef<SvMetaSlot> SvMetaSlotRef;
-
-class SvMetaSlotMemberList : public SvRefMemberList<SvMetaSlot *> {};
 
 #endif // INCLUDED_IDL_INC_SLOT_HXX
 
diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx
index 849db75..789ef46 100644
--- a/idl/inc/types.hxx
+++ b/idl/inc/types.hxx
@@ -30,15 +30,14 @@ typedef std::vector< SvSlotElement* > SvSlotElementList;
 class SvMetaSlot;
 
 class SvMetaType;
-typedef tools::SvRef<SvMetaType> SvMetaTypeRef;
 
 class SvMetaAttribute : public SvMetaReference
 {
-    SvMetaTypeRef       aType;
-    SvIdentifier        aSlotId;
-    SvBOOL              aExport;
-    SvBOOL              aReadOnlyDoc;
-    bool                bNewAttr;
+    tools::SvRef<SvMetaType> aType;
+    SvIdentifier             aSlotId;
+    SvBOOL                   aExport;
+    SvBOOL                   aReadOnlyDoc;
+    bool                     bNewAttr;
 
 protected:
     virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase,
@@ -69,10 +68,6 @@ public:
                                 SvIdlDataBase& );
 };
 
-typedef tools::SvRef<SvMetaAttribute> SvMetaAttributeRef;
-
-class SvMetaAttributeMemberList : public SvRefMemberList<SvMetaAttribute *> {};
-
 enum { CALL_VALUE, CALL_POINTER, CALL_REFERENCE };
 enum { TYPE_METHOD, TYPE_STRUCT, TYPE_BASE, TYPE_ENUM,
       TYPE_CLASS, TYPE_POINTER };
@@ -82,7 +77,7 @@ class SvMetaType : public SvMetaExtern
     SvIdentifier                aCName;
     SvIdentifier                aBasicPostfix;
     SvIdentifier                aBasicName;
-    SvMetaAttributeMemberList * pAttrList;
+    SvRefMemberList<SvMetaAttribute *>* pAttrList;
     int                         nType;
     bool                        bIsItem;
     bool                        bIsShell;
@@ -107,8 +102,8 @@ public:
 
     virtual ~SvMetaType();
 
-    SvMetaAttributeMemberList & GetAttrList() const;
-    sal_uLong               GetAttrCount() const
+    SvRefMemberList<SvMetaAttribute *>& GetAttrList() const;
+    sal_uLong           GetAttrCount() const
                         {
                             return pAttrList ? pAttrList->size() : 0L;
                         }
@@ -145,16 +140,12 @@ public:
     OString             GetParserString() const;
 };
 
-class SvMetaTypeMemberList : public SvRefMemberList<SvMetaType *> {};
-
 class SvMetaTypeString : public SvMetaType
 {
 public:
             SvMetaTypeString();
 };
 
-class SvMetaTypeStringMemberList : public SvRefMemberList<SvMetaTypeString *> {};
-
 class SvMetaEnumValue : public SvMetaObject
 {
 public:
@@ -163,11 +154,9 @@ public:
     virtual bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
 };
 
-class SvMetaEnumValueMemberList : public SvRefMemberList<SvMetaEnumValue *> {};
-
 class SvMetaTypeEnum : public SvMetaType
 {
-    SvMetaEnumValueMemberList   aEnumValueList;
+    SvRefMemberList<SvMetaEnumValue *> aEnumValueList;
     OString aPrefix;
 protected:
     virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
@@ -182,14 +171,11 @@ public:
     virtual bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
 };
 
-class SvMetaTypeEnumMemberList : public SvRefMemberList<SvMetaTypeEnum *> {};
-
 class SvMetaTypevoid : public SvMetaType
 {
 public:
             SvMetaTypevoid();
 };
-class SvMetaTypevoidMemberList : public SvRefMemberList<SvMetaTypevoid *> {};
 
 
 #endif // INCLUDED_IDL_INC_TYPES_HXX
diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx
index 5766040..470f768 100644
--- a/idl/source/objects/module.cxx
+++ b/idl/source/objects/module.cxx
@@ -71,7 +71,7 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
     if( rInStm.GetToken().Is( SvHash_interface() )
       || rInStm.GetToken().Is( SvHash_shell() ) )
     {
-        SvMetaClassRef aClass = new SvMetaClass();
+        tools::SvRef<SvMetaClass> aClass( new SvMetaClass() );
         if( aClass->ReadSvIdl( rBase, rInStm ) )
         {
             aClassList.push_back( aClass );
@@ -81,7 +81,7 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
     }
     else if( rInStm.GetToken().Is( SvHash_enum() ) )
     {
-        tools::SvRef<SvMetaTypeEnum> aEnum = new SvMetaTypeEnum();
+        tools::SvRef<SvMetaTypeEnum> aEnum( new SvMetaTypeEnum() );
 
         if( aEnum->ReadSvIdl( rBase, rInStm ) )
         {
@@ -94,7 +94,7 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
     else if( rInStm.GetToken().Is( SvHash_item() )
       || rInStm.GetToken().Is( SvHash_struct() ) )
     {
-        SvMetaTypeRef xItem = new SvMetaType();
+        tools::SvRef<SvMetaType> xItem(new SvMetaType() );
 
         if( xItem->ReadSvIdl( rBase, rInStm ) )
         {
@@ -162,7 +162,7 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
     }
     else
     {
-        SvMetaSlotRef xSlot = new SvMetaSlot();
+        tools::SvRef<SvMetaSlot> xSlot( new SvMetaSlot() );
 
         if( xSlot->ReadSvIdl( rBase, rInStm ) )
         {
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index d8d633a..d4d8002 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -81,7 +81,7 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase,
         SvMetaType * pType = rBase.ReadKnownType( rInStm );
 
         bool bOk = false;
-        SvMetaAttributeRef xAttr;
+        tools::SvRef<SvMetaAttribute> xAttr;
         if( !pType || pType->IsItem() )
         {
             xAttr = new SvMetaSlot( pType );
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index 805a37d..ad11111 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -469,7 +469,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix,
     if( GetPseudoSlots() && pEnum && pEnum->Count() )
     {
         // clone the MasterSlot
-        SvMetaSlotRef xEnumSlot;
+        tools::SvRef<SvMetaSlot> xEnumSlot;
         SvMetaSlot *pFirstEnumSlot = nullptr;
         for( sal_uLong n = 0; n < pEnum->Count(); n++ )
         {
@@ -871,7 +871,7 @@ sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rO
         if( !SvIdlDataBase::FindType( pType, rBase.aUsedTypes ) )
             rBase.aUsedTypes.push_back( pType );
 
-        const SvMetaAttributeMemberList & rList =
+        const SvRefMemberList<SvMetaAttribute *>& rList =
                     pType->GetAttrList();
         for( sal_uLong n = 0; n < rList.size(); n++ )
         {
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index b5d1c15..4ebfcc3 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -127,7 +127,7 @@ bool SvMetaAttribute::ReadSvIdl( SvIdlDataBase & rBase,
         SvToken& rTok  = rInStm.GetToken();
         if( bOk && rTok.IsChar() && rTok.GetChar() == '(' )
         {
-            SvMetaTypeRef xT = new SvMetaType();
+            tools::SvRef<SvMetaType> xT(new SvMetaType() );
             xT->SetRef( GetType() );
             aType = xT;
             bOk = aType->ReadMethodArgs( rBase, rInStm );
@@ -221,10 +221,10 @@ SvMetaType::~SvMetaType() {
     delete pAttrList;
 }
 
-SvMetaAttributeMemberList & SvMetaType::GetAttrList() const
+SvRefMemberList<SvMetaAttribute *>& SvMetaType::GetAttrList() const
 {
     if( !pAttrList )
-        const_cast<SvMetaType *>(this)->pAttrList = new SvMetaAttributeMemberList();
+        const_cast<SvMetaType *>(this)->pAttrList = new SvRefMemberList<SvMetaAttribute *>();
     return *pAttrList;
 }
 
@@ -414,7 +414,7 @@ bool SvMetaType::ReadNamesSvIdl( SvIdlDataBase & rBase,
 void SvMetaType::ReadContextSvIdl( SvIdlDataBase & rBase,
                                       SvTokenStream & rInStm )
 {
-    SvMetaAttributeRef xAttr = new SvMetaAttribute();
+    tools::SvRef<SvMetaAttribute> xAttr( new SvMetaAttribute() );
     if( xAttr->ReadSvIdl( rBase, rInStm ) )
     {
         if( xAttr->Test( rBase, rInStm ) )
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index 4a08b70..67c6c0a 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -49,7 +49,7 @@ SvIdlDataBase::~SvIdlDataBase()
     aTypeList.push_back( new SvMetaType( SvHash_##Name()->GetName(),   \
                      ParserChar, CName, BasName, BasPost ) );
 
-SvMetaTypeMemberList & SvIdlDataBase::GetTypeList()
+SvRefMemberList<SvMetaType *>& SvIdlDataBase::GetTypeList()
 {
     if( aTypeList.empty() )
     { // fill initially
@@ -265,9 +265,9 @@ bool SvIdlDataBase::ReadIdFile( const OUString & rFileName )
 }
 
 SvMetaType * SvIdlDataBase::FindType( const SvMetaType * pPType,
-                                    SvMetaTypeMemberList & rList )
+                                    SvRefMemberList<SvMetaType *>& rList )
 {
-    for( SvMetaTypeMemberList::const_iterator it = rList.begin(); it != rList.end(); ++it )
+    for( SvRefMemberList<SvMetaType *>::const_iterator it = rList.begin(); it != rList.end(); ++it )
         if( *it == pPType )
             return *it;
     return nullptr;
@@ -275,7 +275,7 @@ SvMetaType * SvIdlDataBase::FindType( const SvMetaType * pPType,
 
 SvMetaType * SvIdlDataBase::FindType( const OString& rName )
 {
-    for( SvMetaTypeMemberList::const_iterator it = aTypeList.begin(); it != aTypeList.end(); ++it )
+    for( SvRefMemberList<SvMetaType *>::const_iterator it = aTypeList.begin(); it != aTypeList.end(); ++it )
         if( rName.equals((*it)->GetName().getString()) )
             return *it;
     return nullptr;
@@ -302,8 +302,8 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm )
     if( pTok->IsIdentifier() )
     {
         OString aName = pTok->GetString();
-        SvMetaTypeMemberList & rList = GetTypeList();
-        SvMetaTypeMemberList::const_iterator it = rList.begin();
+        SvRefMemberList<SvMetaType *> & rList = GetTypeList();
+        SvRefMemberList<SvMetaType *>::const_iterator it = rList.begin();
         SvMetaType * pType = nullptr;
         while( it != rList.end() )
         {
@@ -340,7 +340,7 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm )
                 return pType;
 
             DBG_ASSERT( aTmpTypeList.front(), "mindestens ein Element" );
-            SvMetaTypeRef xType = new SvMetaType( pType->GetName().getString(), 'h', "dummy" );
+            tools::SvRef<SvMetaType> xType( new SvMetaType( pType->GetName().getString(), 'h', "dummy" ) );
             xType->SetRef( pType );
             xType->SetCall0( nCall0 );
             xType->SetCall1( nCall1 );


More information about the Libreoffice-commits mailing list