[Libreoffice-commits] core.git: compilerplugins/clang rsc/inc rsc/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Dec 23 11:42:54 UTC 2016


 compilerplugins/clang/mergeclasses.results |    1 
 rsc/inc/rscdef.hxx                         |   33 +++++++++++++++++-----------
 rsc/inc/rsctree.hxx                        |   17 --------------
 rsc/source/tools/rscdef.cxx                |   34 ++++++++++++++++++++++++-----
 rsc/source/tools/rsctree.cxx               |   29 ------------------------
 5 files changed, 49 insertions(+), 65 deletions(-)

New commits:
commit b641929e69aa5917536fad72644d0da4d67f8adc
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Dec 23 10:50:17 2016 +0200

    merge StringNode with RscDefine
    
    Change-Id: Ia64b7419ccbb06ff55907717963864caef2023a8
    Reviewed-on: https://gerrit.libreoffice.org/32374
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index df4df30..8a7db69 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -137,7 +137,6 @@ merge StgAvlIterator with StgIterator
 merge StgAvlNode with StgDirEntry
 merge StgCache with StgIo
 merge StgReader with WW8Reader
-merge StringNode with RscDefine
 merge SvListView with SvTreeListBox
 merge SvXMLExportItemMapper with SwXMLTableItemMapper_Impl
 merge SvXMLImportItemMapper with SwXMLImportTableItemMapper_Impl
diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx
index 2a21818..e336fac 100644
--- a/rsc/inc/rscdef.hxx
+++ b/rsc/inc/rscdef.hxx
@@ -114,34 +114,41 @@ public:
 };
 
 /*********** R s c D e f i n e *******************************************/
-class RscDefine : public StringNode
+class RscDefine : public NameNode
 {
 friend class RscFileTab;
 friend class RscDefineList;
 friend class RscDefTree;
 friend class RscExpression;
 friend class RscId;
+
     sal_uLong   lFileKey;   // file the define belongs to
     sal_uInt32  nRefCount;  // reference count to this object
     sal_Int32   lId;        // identifier
-    RscExpression * pExp;       // expression
+    RscExpression * pExp;   // expression
+    OString     m_aName;
+
+    virtual COMPARE Compare( const NameNode * ) const override;
+    virtual COMPARE Compare( const void * ) const override;
+
 protected:
 
-                RscDefine( sal_uLong lFileKey, const OString& rDefName,
+    RscDefine( sal_uLong lFileKey, const OString& rDefName,
                            sal_Int32 lDefId );
-                RscDefine( sal_uLong lFileKey, const OString& rDefName,
+    RscDefine( sal_uLong lFileKey, const OString& rDefName,
                            RscExpression * pExpression );
-                virtual ~RscDefine() override;
-    void        IncRef(){ nRefCount++; }
-    void        DecRef();
-    void        DefineToNumber();
+    virtual ~RscDefine() override;
+
+    void          IncRef() { nRefCount++; }
+    void          DecRef();
+    void          DefineToNumber();
 
-    using StringNode::Search;
 public:
-    RscDefine * Search( const char * );
-    sal_uLong   GetFileKey() const { return lFileKey; }
-    void        Evaluate();
-    sal_Int32   GetNumber() const  { return lId;      }
+    sal_uLong      GetFileKey() const { return lFileKey; }
+    void           Evaluate();
+    sal_Int32      GetNumber() const  { return lId;      }
+    RscDefine*     Search( const char * ) const;
+    const OString& GetName() const { return m_aName; }
 };
 
 typedef ::std::vector< RscDefine* > RscSubDefList;
diff --git a/rsc/inc/rsctree.hxx b/rsc/inc/rsctree.hxx
index 62db17b..c6de949 100644
--- a/rsc/inc/rsctree.hxx
+++ b/rsc/inc/rsctree.hxx
@@ -71,23 +71,6 @@ public:
     virtual sal_uInt32  GetId() const;
 };
 
-class StringNode : public NameNode
-{
-    virtual COMPARE Compare( const NameNode * ) const override;
-    virtual COMPARE Compare( const void * ) const override;
-
-protected:
-    using NameNode::Search;
-
-    OString m_aName;
-
-public:
-    StringNode(const OString& rStr) { m_aName = rStr; }
-
-    StringNode*     Search( const char * ) const;
-    const OString&  GetName() const { return m_aName; }
-};
-
 #endif // INCLUDED_RSC_INC_RSCTREE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx
index 9beb17e..2e2a057 100644
--- a/rsc/source/tools/rscdef.cxx
+++ b/rsc/source/tools/rscdef.cxx
@@ -115,7 +115,7 @@ OString RscId::GetName() const
 }
 
 RscDefine::RscDefine( sal_uLong lKey, const OString& rDefName, sal_Int32 lDefId )
-    : StringNode( rDefName )
+    : m_aName( rDefName )
 {
     nRefCount = 0;
     lFileKey  = lKey;
@@ -125,8 +125,7 @@ RscDefine::RscDefine( sal_uLong lKey, const OString& rDefName, sal_Int32 lDefId
 
 RscDefine::RscDefine( sal_uLong lKey, const OString& rDefName,
                       RscExpression * pExpression  )
-    : StringNode( rDefName )
-    , lId(0)
+    : lId(0), m_aName( rDefName )
 {
     nRefCount = 0;
     lFileKey  = lKey;
@@ -163,9 +162,34 @@ void RscDefine::Evaluate()
         pExp->Evaluate( &lId );
 }
 
-RscDefine * RscDefine::Search( const char * pStr )
+RscDefine * RscDefine::Search( const char * pSearch ) const
 {
-    return static_cast<RscDefine *>(StringNode::Search( pStr ));
+    return static_cast<RscDefine *>(NameNode::Search( static_cast<const void *>(pSearch) ));
+}
+
+COMPARE RscDefine::Compare( const NameNode * pSearch ) const
+{
+    int nCmp = strcmp( m_aName.getStr(),
+                       static_cast<const RscDefine *>(pSearch)->m_aName.getStr() );
+    if( nCmp < 0 )
+        return LESS;
+    else if( nCmp > 0 )
+        return GREATER;
+    else
+        return EQUAL;
+}
+
+// pSearch is a pointer to const char *
+COMPARE RscDefine::Compare( const void * pSearch ) const
+{
+    int nCmp = strcmp( m_aName.getStr(), static_cast<const char *>(pSearch) );
+
+    if( nCmp < 0 )
+        return LESS;
+    else if( nCmp > 0 )
+        return GREATER;
+    else
+        return EQUAL;
 }
 
 RscDefine * RscDefineList::New( sal_uLong lFileKey, const OString& rDefName,
diff --git a/rsc/source/tools/rsctree.cxx b/rsc/source/tools/rsctree.cxx
index 7d9f677..410b7bb 100644
--- a/rsc/source/tools/rsctree.cxx
+++ b/rsc/source/tools/rsctree.cxx
@@ -355,34 +355,5 @@ sal_uInt32 IdNode::GetId() const
     return 0xFFFFFFFF;
 }
 
-StringNode * StringNode::Search( const char * pSearch ) const
-{
-    return static_cast<StringNode *>(NameNode::Search( static_cast<const void *>(pSearch) ));
-}
-
-COMPARE StringNode::Compare( const NameNode * pSearch ) const
-{
-    int nCmp = strcmp( m_aName.getStr(),
-                       static_cast<const StringNode *>(pSearch)->m_aName.getStr() );
-    if( nCmp < 0 )
-        return LESS;
-    else if( nCmp > 0 )
-        return GREATER;
-    else
-        return EQUAL;
-}
-
-// pSearch is a pointer to const char *
-COMPARE StringNode::Compare( const void * pSearch ) const
-{
-    int nCmp = strcmp( m_aName.getStr(), static_cast<const char *>(pSearch) );
-
-    if( nCmp < 0 )
-        return LESS;
-    else if( nCmp > 0 )
-        return GREATER;
-    else
-        return EQUAL;
-}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list