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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Aug 3 11:16:02 UTC 2018


 vcl/inc/impoctree.hxx     |    4 ++--
 vcl/inc/octree.hxx        |   16 ++++++++--------
 vcl/source/gdi/octree.cxx |   16 ++++++++--------
 3 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit ea59fc4831b9d2430de51faa8c3e0a24e6d90cd1
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Aug 3 11:49:59 2018 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Aug 3 13:15:35 2018 +0200

    Resolve unnecessary typedef
    
    Change-Id: Ide89f6082f877046eac0415f23a3e29c5f7f1e65
    Reviewed-on: https://gerrit.libreoffice.org/58554
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/vcl/inc/impoctree.hxx b/vcl/inc/impoctree.hxx
index 073720a9e319..97de164ed405 100644
--- a/vcl/inc/impoctree.hxx
+++ b/vcl/inc/impoctree.hxx
@@ -125,13 +125,13 @@ inline OctreeNode* ImpNodeCache::ImplGetFreeNode()
 
     if ( !pActNode )
     {
-        pActNode = new NODE;
+        pActNode = new OctreeNode;
         pActNode->pNextInCache = nullptr;
     }
 
     pNode = pActNode;
     pActNode = pNode->pNextInCache;
-    memset( pNode, 0, sizeof( NODE ) );
+    memset( pNode, 0, sizeof( OctreeNode ) );
 
     return pNode;
 }
diff --git a/vcl/inc/octree.hxx b/vcl/inc/octree.hxx
index 41a34987d40f..9178ce730381 100644
--- a/vcl/inc/octree.hxx
+++ b/vcl/inc/octree.hxx
@@ -26,7 +26,7 @@
 #define OCTREE_BITS     5
 #define OCTREE_BITS_1   10
 
-typedef struct OctreeNode
+struct OctreeNode
 {
     sal_uLong       nCount;
     sal_uLong       nRed;
@@ -37,7 +37,7 @@ typedef struct OctreeNode
     OctreeNode*     pNextInCache;
     sal_uInt16      nPalIndex;
     bool            bLeaf;
-} NODE;
+};
 
 class ImpNodeCache;
 class BitmapReadAccess;
@@ -45,19 +45,19 @@ class BitmapReadAccess;
 class VCL_PLUGIN_PUBLIC Octree
 {
 private:
-    void                        CreatePalette( NODE* pNode );
-    void                        GetPalIndex( NODE* pNode );
+    void                        CreatePalette( OctreeNode* pNode );
+    void                        GetPalIndex( OctreeNode* pNode );
 
-    SAL_DLLPRIVATE void         ImplDeleteOctree( NODE** ppNode );
-    SAL_DLLPRIVATE void         ImplAdd( NODE** ppNode );
+    SAL_DLLPRIVATE void         ImplDeleteOctree( OctreeNode** ppNode );
+    SAL_DLLPRIVATE void         ImplAdd( OctreeNode** ppNode );
     SAL_DLLPRIVATE void         ImplReduce();
 
 
     BitmapPalette               aPal;
     sal_uLong                   nLeafCount;
     sal_uLong                   nLevel;
-    NODE*                       pTree;
-    NODE*                       pReduce[ OCTREE_BITS + 1 ];
+    OctreeNode*                 pTree;
+    OctreeNode*                 pReduce[ OCTREE_BITS + 1 ];
     BitmapColor const *         pColor;
     std::unique_ptr<ImpNodeCache> pNodeCache;
     const BitmapReadAccess*     pAcc;
diff --git a/vcl/source/gdi/octree.cxx b/vcl/source/gdi/octree.cxx
index 6947fc365405..c2900cee7d1f 100644
--- a/vcl/source/gdi/octree.cxx
+++ b/vcl/source/gdi/octree.cxx
@@ -34,7 +34,7 @@ ImpNodeCache::ImpNodeCache( const sal_uLong nInitSize ) :
 
     for( sal_uLong i = 0; i < nSize; i++ )
     {
-        OctreeNode* pNewNode = new NODE;
+        OctreeNode* pNewNode = new OctreeNode;
 
         pNewNode->pNextInCache = pActNode;
         pActNode = pNewNode;
@@ -62,7 +62,7 @@ Octree::Octree(const BitmapReadAccess& rReadAcc, sal_uLong nColors)
 {
     sal_uLong nMax(nColors);
     pNodeCache.reset( new ImpNodeCache( nColors ) );
-    memset( pReduce, 0, ( OCTREE_BITS + 1 ) * sizeof( NODE* ) );
+    memset( pReduce, 0, ( OCTREE_BITS + 1 ) * sizeof( OctreeNode* ) );
 
     if( !!*pAcc )
     {
@@ -114,7 +114,7 @@ Octree::~Octree()
     pNodeCache.reset();
 }
 
-void Octree::ImplDeleteOctree( NODE** ppNode )
+void Octree::ImplDeleteOctree( OctreeNode** ppNode )
 {
     for (OctreeNode* i : (*ppNode)->pChild)
     {
@@ -126,7 +126,7 @@ void Octree::ImplDeleteOctree( NODE** ppNode )
     *ppNode = nullptr;
 }
 
-void Octree::ImplAdd( NODE** ppNode )
+void Octree::ImplAdd( OctreeNode** ppNode )
 {
     // possibly generate new nodes
     if( !*ppNode )
@@ -166,7 +166,7 @@ void Octree::ImplAdd( NODE** ppNode )
 void Octree::ImplReduce()
 {
     sal_uLong   i;
-    NODE*       pNode;
+    OctreeNode* pNode;
     sal_uLong   nRedSum = 0;
     sal_uLong   nGreenSum = 0;
     sal_uLong   nBlueSum = 0;
@@ -181,7 +181,7 @@ void Octree::ImplReduce()
     {
         if ( pNode->pChild[ i ] )
         {
-            NODE* pChild = pNode->pChild[ i ];
+            OctreeNode* pChild = pNode->pChild[ i ];
 
             nRedSum += pChild->nRed;
             nGreenSum += pChild->nGreen;
@@ -201,7 +201,7 @@ void Octree::ImplReduce()
     nLeafCount -= --nChildren;
 }
 
-void Octree::CreatePalette( NODE* pNode )
+void Octree::CreatePalette( OctreeNode* pNode )
 {
     if( pNode->bLeaf )
     {
@@ -216,7 +216,7 @@ void Octree::CreatePalette( NODE* pNode )
 
 }
 
-void Octree::GetPalIndex( NODE* pNode )
+void Octree::GetPalIndex( OctreeNode* pNode )
 {
     if ( pNode->bLeaf )
         nPalIndex = pNode->nPalIndex;


More information about the Libreoffice-commits mailing list