[Libreoffice-commits] core.git: basic/source mergeclasses.results rsc/inc rsc/source vcl/source

Noel Grandin noel at peralex.com
Tue Sep 8 00:20:56 PDT 2015


 basic/source/classes/sbunoobj.cxx |   16 ++++------------
 mergeclasses.results              |    2 --
 rsc/inc/rsctree.hxx               |   38 ++++++++++++++------------------------
 rsc/source/tools/rsctree.cxx      |   24 ++++++++++++------------
 vcl/source/filter/sgvmain.cxx     |    2 --
 vcl/source/filter/sgvmain.hxx     |   11 +++--------
 6 files changed, 33 insertions(+), 60 deletions(-)

New commits:
commit 751c771adc45cb150fa42bc70397e2571b28a60b
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Aug 27 13:07:42 2015 +0200

    loplugin:mergeclass, merge BiNode with NameNode, Obj0Type with ObjkType
    
    Change-Id: Icbc0dfc6096a6e2c651dad4fe9f78d176f389390

diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index da07e3b..c7a95f1 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -4311,18 +4311,9 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
 
 
 
-namespace {
-class OMutexBasis
-{
-protected:
-    // this mutex is necessary for OInterfaceContainerHelper
-    ::osl::Mutex m_aMutex;
-};
-} // namespace
-
-class ModuleInvocationProxy : public OMutexBasis,
-                              public WeakImplHelper< XInvocation, XComponent >
+class ModuleInvocationProxy : public WeakImplHelper< XInvocation, XComponent >
 {
+    ::osl::Mutex        m_aMutex;
     OUString            m_aPrefix;
     SbxObjectRef        m_xScopeObj;
     bool                m_bProxyIsClassModuleObject;
@@ -4357,7 +4348,8 @@ public:
 };
 
 ModuleInvocationProxy::ModuleInvocationProxy( const OUString& aPrefix, SbxObjectRef xScopeObj )
-    : m_aPrefix( aPrefix + "_" )
+    : m_aMutex()
+    , m_aPrefix( aPrefix + "_" )
     , m_xScopeObj( xScopeObj )
     , m_aListeners( m_aMutex )
 {
diff --git a/mergeclasses.results b/mergeclasses.results
index 85739e1..572d9a4 100644
--- a/mergeclasses.results
+++ b/mergeclasses.results
@@ -5,7 +5,6 @@ merge AbstractMailMergeWizard with AbstractMailMergeWizard_Impl
 merge AbstractSearchProgress with AbstractSearchProgress_Impl
 merge AbstractSwInsertDBColAutoPilot with AbstractSwInsertDBColAutoPilot_Impl
 merge AbstractTakeProgress with AbstractTakeProgress_Impl
-merge BiNode with NameNode
 merge CffGlobal with CffSubsetterContext
 merge CompareLine with SwCompareLine
 merge DdeGetPutItem with sfx2::ImplDdeItem
@@ -53,7 +52,6 @@ merge ImplGlyphFallbackFontSubstitution with FcGlyphFallbackSubstititution
 merge ImplPreMatchFontSubstitution with FcPreMatchSubstititution
 merge LwpDLList with LwpParaProperty
 merge LwpDLVListHead with LwpPropList
-merge Obj0Type with ObjkType
 merge OldBasicPassword with basic::SfxScriptLibraryContainer
 merge OpenGLDeviceInfo with X11OpenGLDeviceInfo
 merge OpenGLSalBitmapOp with ScaleOp
diff --git a/rsc/inc/rsctree.hxx b/rsc/inc/rsctree.hxx
index 12ee456..f2f6ac2 100644
--- a/rsc/inc/rsctree.hxx
+++ b/rsc/inc/rsctree.hxx
@@ -22,40 +22,30 @@
 #include <tools/link.hxx>
 #include <rsctools.hxx>
 
-class BiNode
+class NameNode
 {
+    void                SubOrderTree( NameNode * pOrderNode );
+
 protected:
-    BiNode*     pLeft;    // left subtree
-    BiNode*     pRight;   // right subtree
+    NameNode*     pLeft;    // left subtree
+    NameNode*     pRight;   // right subtree
 
-public:
+                        // pCmp ist Zeiger auf Namen
+            NameNode*   Search( const void * pCmp ) const;
 
                          // convert a double linked list into a binary tree
-            BiNode *    ChangeDLListBTree( BiNode * pList );
-
-                        BiNode();
-    virtual             ~BiNode();
+            NameNode*   ChangeDLListBTree( NameNode * pList );
 
+                        NameNode();
+    virtual             ~NameNode();
 
                         // convert a binary tree in a double linked list
-                        BiNode* ChangeBTreeDLList();
-
-            BiNode *    Left() const { return pLeft  ; }
-            BiNode *    Right() const{ return pRight ; }
-            void        EnumNodes( Link<> aLink ) const;
-};
-
-class NameNode : public BiNode
-{
-    void                SubOrderTree( NameNode * pOrderNode );
-
-protected:
-                        // pCmp is a pointer to name
-            NameNode*   Search( const void * pCmp ) const;
+                        NameNode* ChangeBTreeDLList();
 
 public:
-            NameNode*   Left() const { return static_cast<NameNode *>(pLeft); }
-            NameNode*   Right() const{ return static_cast<NameNode *>(pRight); }
+            void        EnumNodes( Link<> aLink ) const;
+            NameNode*   Left() const { return pLeft; }
+            NameNode*   Right() const{ return pRight; }
             NameNode*   Search( const NameNode * pName ) const;
                         // insert a new node in the b-tree
             bool        Insert( NameNode * pTN, sal_uInt32 * nDepth );
diff --git a/rsc/source/tools/rsctree.cxx b/rsc/source/tools/rsctree.cxx
index eb69285..8ee5036 100644
--- a/rsc/source/tools/rsctree.cxx
+++ b/rsc/source/tools/rsctree.cxx
@@ -26,32 +26,32 @@
 #include <rsctree.hxx>
 
 
-BiNode::BiNode()
+NameNode::NameNode()
 {
     pLeft = pRight = NULL;
 }
 
-BiNode::~BiNode()
+NameNode::~NameNode()
 {
 }
 
-void BiNode::EnumNodes( Link<> aLink ) const
+void NameNode::EnumNodes( Link<> aLink ) const
 {
     if( Left() )
         Left()->EnumNodes( aLink );
-    aLink.Call( const_cast<BiNode *>(this) );
+    aLink.Call( const_cast<NameNode *>(this) );
     if( Right() )
         Right()->EnumNodes( aLink );
 }
 
-BiNode * BiNode::ChangeDLListBTree( BiNode * pList )
+NameNode * NameNode::ChangeDLListBTree( NameNode * pList )
 {
-    BiNode * pMiddle;
-    BiNode * pTmp;
+    NameNode * pMiddle;
+    NameNode * pTmp;
     sal_uInt32 nEle, i;
 
     if( pList )
-{
+    {
         while( pList->Left() )
             pList = pList->Left();
         pTmp = pList;
@@ -75,7 +75,7 @@ BiNode * BiNode::ChangeDLListBTree( BiNode * pList )
             pTmp->pRight = nullptr;
 
         // set left pointer to NULL
-        BiNode * pRightNode = pMiddle->Right();
+        NameNode * pRightNode = pMiddle->Right();
         if (pRightNode)
             pRightNode->pLeft = nullptr;
 
@@ -87,10 +87,10 @@ BiNode * BiNode::ChangeDLListBTree( BiNode * pList )
     return pList;
 }
 
-BiNode * BiNode::ChangeBTreeDLList()
+NameNode * NameNode::ChangeBTreeDLList()
 {
-    BiNode * pList;
-    BiNode * pLL_RN;    // right node of left list
+    NameNode * pList;
+    NameNode * pLL_RN;    // right node of left list
 
     if( Right() )
     {
diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx
index fe318a0..189f66a 100644
--- a/vcl/source/filter/sgvmain.cxx
+++ b/vcl/source/filter/sgvmain.cxx
@@ -339,8 +339,6 @@ void ObjkType::Draw(OutputDevice&)
 {
 }
 
-void Obj0Type::Draw(OutputDevice&) {}
-
 void StrkType::Draw(OutputDevice& rOut)
 {
     SetLine(L,rOut);
diff --git a/vcl/source/filter/sgvmain.hxx b/vcl/source/filter/sgvmain.hxx
index e0f9de8..77c4981 100644
--- a/vcl/source/filter/sgvmain.hxx
+++ b/vcl/source/filter/sgvmain.hxx
@@ -137,14 +137,8 @@ public:
     void   SetFont(sal_uInt32 FontID);
 };
 
-class Obj0Type {                // SuperClass for Apple-VMT
-public:
-    virtual void Draw(OutputDevice& rOut);
-    virtual ~Obj0Type() {}
-};
-
 #define ObjkSize 20                /* should be 21. due to alignment we shifted the flag */
-class ObjkType: public Obj0Type {  // basic componenents of all Stardraw objects
+class ObjkType {  // basic componenents of all Stardraw objects
 public:
     sal_uInt32     Last;
     sal_uInt32     Next;
@@ -161,9 +155,10 @@ public:
         , Layer(0)
     {
     }
+    virtual ~ObjkType() {}
     friend SvStream& ReadObjkType(SvStream& rIStream, ObjkType& rObjk);
     friend bool ObjOverSeek(SvStream& rInp, ObjkType& rObjk);
-    virtual void Draw(OutputDevice& rOut) SAL_OVERRIDE;
+    virtual void Draw(OutputDevice& rOut);
 };
 
 #define StrkSize 38


More information about the Libreoffice-commits mailing list