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

Noel Grandin noel at peralex.com
Tue Feb 9 06:16:49 UTC 2016


 idl/inc/lex.hxx               |    4 ++--
 idl/inc/types.hxx             |    4 +---
 idl/source/cmptools/lex.cxx   |   27 +--------------------------
 idl/source/objects/object.cxx |    9 +++++----
 idl/source/objects/slot.cxx   |   11 ++---------
 idl/source/objects/types.cxx  |   19 +++++++------------
 6 files changed, 18 insertions(+), 56 deletions(-)

New commits:
commit c7b66c1968371e335babfbada8b6bac2f83d9901
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Feb 8 15:42:29 2016 +0200

    remove some more dead code, found by LCOV
    
    Change-Id: I23404778d13b690fa2330f6db1a90d578b23468b

diff --git a/idl/inc/lex.hxx b/idl/inc/lex.hxx
index c06b605..dc86dfb 100644
--- a/idl/inc/lex.hxx
+++ b/idl/inc/lex.hxx
@@ -29,7 +29,7 @@
 enum class SVTOKENTYPE { Empty,      Comment,
                          Integer,    String,
                          Bool,       Identifier,
-                         Char,       RttiBase,
+                         Char,
                          EndOfFile,  HashId };
 
 class SvToken
@@ -47,7 +47,7 @@ friend class SvTokenStream;
     };
 public:
             SvToken();
-            SvToken( const SvToken & rObj );
+            SvToken( const SvToken & rObj ) = delete;
 
     SvToken & operator = ( const SvToken & rObj );
 
diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx
index a4ef530..67c2cf1 100644
--- a/idl/source/cmptools/lex.cxx
+++ b/idl/source/cmptools/lex.cxx
@@ -50,9 +50,6 @@ OString SvToken::GetTokenAsString() const
         case SVTOKENTYPE::Char:
             aStr = OString(cChar);
             break;
-        case SVTOKENTYPE::RttiBase:
-            aStr = "RTTIBASE";
-            break;
         case SVTOKENTYPE::EndOfFile:
         case SVTOKENTYPE::HashId:
             break;
@@ -61,15 +58,6 @@ OString SvToken::GetTokenAsString() const
     return aStr;
 }
 
-SvToken::SvToken( const SvToken & rObj )
-{
-    nLine = rObj.nLine;
-    nColumn = rObj.nColumn;
-    nType = rObj.nType;
-    aString = rObj.aString;
-    nLong = rObj.nLong;
-}
-
 SvToken & SvToken::operator = ( const SvToken & rObj )
 {
     if( this != &rObj )
@@ -291,20 +279,7 @@ bool SvTokenStream::MakeToken( SvToken & rToken )
             if( c == '"' )
             {
                 c = GetFastNextChar();
-                if( c == '"' )
-                {
-                    aStr.append('"');
-                    aStr.append('"');
-                }
-                else
-                    bDone = true;
-            }
-            else if( c == '\\' )
-            {
-                aStr.append('\\');
-                c = GetFastNextChar();
-                if( c )
-                    aStr.append(static_cast<char>(c));
+                bDone = true;
             }
             else
                 aStr.append(static_cast<char>(c));
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index d2cddd7..5ed8b11 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -283,21 +283,14 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase,
             SvToken * pTok = rInStm.GetToken_Next();
             if( pTok->Is( SvHash_SlotType() ) )
             {
-                bool bBraket = rInStm.Read( '(' );
-                if( bBraket || rInStm.Read( '=' ) )
+                if( rInStm.Read( '=' ) )
                 {
                     aSlotType = rBase.ReadKnownType( rInStm );
                     if( aSlotType.Is() )
                     {
                         if( aSlotType->IsItem() )
                         {
-                            if( bBraket )
-                            {
-                                if( rInStm.Read( ')' ) )
-                                    return;
-                            }
-                            else
-                                return;
+                            return;
                         }
                         rBase.SetError( "the SlotType is not a item", rInStm.GetToken() );
                         rBase.WriteError( rInStm );
commit 7a6c044e97d02f6168d13cd7528d89e3b3a1dd3f
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Feb 8 14:41:57 2016 +0200

    split MetaTypeType::Class into Interface and Shell
    
    Change-Id: Id405be797d516e3e608044a375c40b2138c89aa3

diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx
index 48d3331..ae229af 100644
--- a/idl/inc/types.hxx
+++ b/idl/inc/types.hxx
@@ -53,14 +53,13 @@ public:
                                 SvIdlDataBase& );
 };
 
-enum MetaTypeType { Method, Struct, Base, Enum, Class };
+enum MetaTypeType { Method, Struct, Base, Enum, Interface, Shell };
 
 class SvMetaType : public SvMetaReference
 {
     SvRefMemberList<SvMetaAttribute *>  aAttrList;
     MetaTypeType                        nType;
     bool                                bIsItem;
-    bool                                bIsShell;
 
     void                WriteSfxItem( const OString& rItemName, SvIdlDataBase & rBase,
                                       SvStream & rOutStm );
@@ -84,7 +83,6 @@ public:
     SvMetaType *        GetBaseType() const;
     SvMetaType *        GetReturnType() const;
     bool                IsItem() const { return bIsItem; }
-    bool                IsShell() const { return bIsShell; }
 
     virtual bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
 
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index f95ea36..bb39019 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -109,7 +109,8 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase,
 bool SvMetaClass::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
 {
     sal_uLong nTokPos = rInStm.Tell();
-    if( SvMetaType::ReadHeaderSvIdl( rBase, rInStm ) && GetMetaTypeType() == MetaTypeType::Class )
+    if( SvMetaType::ReadHeaderSvIdl( rBase, rInStm ) &&
+        (GetMetaTypeType() == MetaTypeType::Interface || GetMetaTypeType() == MetaTypeType::Shell) )
     {
         bool bOk = true;
         if( rInStm.Read( ':' ) )
@@ -261,7 +262,7 @@ void SvMetaClass::InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>&
     // written any more.
     // It is prohibited that Shell and SuperShell directly import the same
     //class.
-    if( IsShell() && aSuperClass.Is() )
+    if( GetMetaTypeType() == MetaTypeType::Shell && aSuperClass.Is() )
         aSuperClass->FillClasses( rClassList );
 
     // Write all attributes of the imported classes, as long as they have
@@ -281,7 +282,7 @@ void SvMetaClass::InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>&
     }
 
     // only write superclass if no shell and not in the list
-    if( !IsShell() && aSuperClass.Is() )
+    if( GetMetaTypeType() != MetaTypeType::Shell && aSuperClass.Is() )
     {
         aSuperClass->InsertSlots( rList, rSuperList, rClassList, rPrefix, rBase );
     }
@@ -334,7 +335,7 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
     rOutStm.WriteCharPtr( "#define ShellClass " ).WriteCharPtr( GetName().getStr() ) << endl;
 
     // no slotmaps get written for interfaces
-    if( !IsShell() )
+    if( GetMetaTypeType() != MetaTypeType::Shell )
     {
         rOutStm.WriteCharPtr( "#endif" ) << endl << endl;
         return;
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index 392b0b0..19726d1 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -134,7 +134,6 @@ void SvMetaAttribute::Insert (SvSlotElementList&, const OString&, SvIdlDataBase&
 #define CTOR                            \
     : nType( MetaTypeType::Base )       \
     , bIsItem( false )                  \
-    , bIsShell( false )                 \
 
 SvMetaType::SvMetaType()
     CTOR
@@ -153,11 +152,6 @@ SvMetaType::~SvMetaType()
 void SvMetaType::SetType( MetaTypeType nT )
 {
     nType = nT;
-    if( nType == MetaTypeType::Class )
-    {
-        OStringBuffer aTmp("C_");
-        aTmp.append("Object *");
-    }
 }
 
 SvMetaType * SvMetaType::GetBaseType() const
@@ -181,14 +175,15 @@ bool SvMetaType::ReadHeaderSvIdl( SvIdlDataBase & rBase,
     sal_uInt32  nTokPos = rInStm.Tell();
     SvToken * pTok = rInStm.GetToken_Next();
 
-    if( pTok->Is( SvHash_interface() )
-      || pTok->Is( SvHash_shell() ) )
+    if( pTok->Is( SvHash_interface() ) )
     {
-        if( pTok->Is( SvHash_shell() ) )
-            bIsShell = true;
-        SetType( MetaTypeType::Class );
+        SetType( MetaTypeType::Interface );
+        bOk = ReadNamesSvIdl( rInStm );
+    }
+    else if( pTok->Is( SvHash_shell() ) )
+    {
+        SetType( MetaTypeType::Shell );
         bOk = ReadNamesSvIdl( rInStm );
-
     }
     else if( pTok->Is( SvHash_struct() ) )
     {


More information about the Libreoffice-commits mailing list