diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-07-03 02:35:31 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-07-03 20:53:12 +0000 |
commit | bb45bdf359c65c174fd557d615f77ceb46fa685c (patch) | |
tree | 1f87575ee1d0471b14f5078a99d3a589d955d56d /rsc/source/res/rscclobj.cxx | |
parent | 27a4d5597c0757611d0e2e682d0c05441859cc4e (diff) |
module rsc: String, bool and other clean-up.
Change-Id: I2dcde42e6068631a5a643961a764df86dc63dca2
Reviewed-on: https://gerrit.libreoffice.org/4690
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'rsc/source/res/rscclobj.cxx')
-rw-r--r-- | rsc/source/res/rscclobj.cxx | 58 |
1 files changed, 35 insertions, 23 deletions
diff --git a/rsc/source/res/rscclobj.cxx b/rsc/source/res/rscclobj.cxx index d11ce80195bd..908030cd4b3c 100644 --- a/rsc/source/res/rscclobj.cxx +++ b/rsc/source/res/rscclobj.cxx @@ -22,46 +22,50 @@ #include <rsctop.hxx> -RefNode::RefNode( Atom nTyp ){ +RefNode::RefNode( Atom nTyp ) +{ pObjBiTree = 0; nTypNameId = nTyp; } sal_uInt32 RefNode::GetId() const { - return( nTypNameId ); + return nTypNameId; } -sal_Bool RefNode::PutObjNode( ObjNode * pPutObject ){ // insert a node in the b-tree pObjBiTree // if the node with the same name is in pObjBiTree, // return sal_False and no insert, +bool RefNode::PutObjNode( ObjNode * pPutObject ) +{ if( pObjBiTree ) - return( pObjBiTree->Insert( pPutObject ) ); + return pObjBiTree->Insert( pPutObject ); pObjBiTree = pPutObject; - return( sal_True ); + return true; } -ObjNode * RefNode :: GetObjNode( const RscId & rRscId ){ // insert a node in the b-tree pObjBiTree // if the node with the same name is in pObjBiTree, // return NULL and no insert, // if not return the pointer to the Object - +ObjNode * RefNode :: GetObjNode( const RscId & rRscId ) +{ if( pObjBiTree ) - return( pObjBiTree->Search( rRscId ) ); - return( NULL ); + return pObjBiTree->Search( rRscId ); + return NULL; } -ObjNode::ObjNode( const RscId & rId, CLASS_DATA pData, sal_uLong lKey ){ +ObjNode::ObjNode( const RscId & rId, CLASS_DATA pData, sal_uLong lKey ) +{ pRscObj = pData; aRscId = rId; lFileKey = lKey; } -ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uLong nFileKey ){ +ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uLong nFileKey ) +{ ObjNode * pRetNode = this; if( Right() ) @@ -69,18 +73,22 @@ ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uLong nFileKey ){ if( Left() ) pLeft = ((ObjNode *)Left())->DelObjNode( pClass, nFileKey ); - if( GetFileKey() == nFileKey ){ - if( GetRscObj() ){ + if( GetFileKey() == nFileKey ) + { + if( GetRscObj() ) + { pClass->Destroy( RSCINST( pClass, GetRscObj() ) ); rtl_freeMemory( GetRscObj() ); } pRetNode = (ObjNode *)Right(); - if( pRetNode ){ + if( pRetNode ) + { if( Left() ) pRetNode->Insert( (ObjNode *)Left() ); } else pRetNode = (ObjNode *)Left(); + delete this; } return pRetNode; @@ -88,40 +96,44 @@ ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uLong nFileKey ){ sal_uInt32 ObjNode::GetId() const { - return( (sal_uInt32)(long)aRscId ); + return (sal_uInt32)(long)aRscId; } -sal_Bool ObjNode::IsConsistent() +bool ObjNode::IsConsistent() { - sal_Bool bRet = sal_True; + bool bRet = true; if( (long)aRscId > 0x7FFF || (long)aRscId < 1 ) { - bRet = sal_False; + bRet = false; } else { if( Left() ) { if( !((ObjNode *)Left())->IsConsistent() ) - bRet = sal_False; + { + bRet = false; + } if( ((ObjNode *)Left())->aRscId >= aRscId ) { - bRet = sal_False; + bRet = false; } }; if( Right() ) { if( ((ObjNode *)Right())->aRscId <= aRscId ) { - bRet = sal_False; + bRet = false; } if( !((ObjNode *)Right())->IsConsistent() ) - bRet = sal_False; + { + bRet = false; + } }; }; - return( bRet ); + return bRet; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |