summaryrefslogtreecommitdiff
path: root/rsc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-08-27 13:07:42 +0200
committerNoel Grandin <noel@peralex.com>2015-09-08 09:20:31 +0200
commit751c771adc45cb150fa42bc70397e2571b28a60b (patch)
treebe54e28005ac5c4d00a0c01dca2119f80d7f8119 /rsc
parentf36f17f691903a389a7d98e85af12e08b75f6876 (diff)
loplugin:mergeclass, merge BiNode with NameNode, Obj0Type with ObjkType
Change-Id: Icbc0dfc6096a6e2c651dad4fe9f78d176f389390
Diffstat (limited to 'rsc')
-rw-r--r--rsc/inc/rsctree.hxx38
-rw-r--r--rsc/source/tools/rsctree.cxx24
2 files changed, 26 insertions, 36 deletions
diff --git a/rsc/inc/rsctree.hxx b/rsc/inc/rsctree.hxx
index 12ee456171ac..f2f6ac29d6ee 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 eb69285cd22f..8ee50368efdf 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() )
{