Author: hdu Date: Fri Jul 26 13:04:33 2013 New Revision: 1507304 URL: http://svn.apache.org/r1507304 Log: #i122853# replace use of size() method for single linked lists
Modified: openoffice/trunk/main/autodoc/source/inc/estack.hxx openoffice/trunk/main/autodoc/source/parser/cpp/sownstck.hxx Modified: openoffice/trunk/main/autodoc/source/inc/estack.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/autodoc/source/inc/estack.hxx?rev=1507304&r1=1507303&r2=1507304&view=diff ============================================================================== --- openoffice/trunk/main/autodoc/source/inc/estack.hxx (original) +++ openoffice/trunk/main/autodoc/source/inc/estack.hxx Fri Jul 26 13:04:33 2013 @@ -74,7 +74,6 @@ class EStack : private std::slist<ELEM> // INQUIRY const value_type & top() const { return base::front(); } - size_type size() const { return base::size(); } bool empty() const { return base::empty(); } // ACCESS Modified: openoffice/trunk/main/autodoc/source/parser/cpp/sownstck.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/autodoc/source/parser/cpp/sownstck.hxx?rev=1507304&r1=1507303&r2=1507304&view=diff ============================================================================== --- openoffice/trunk/main/autodoc/source/parser/cpp/sownstck.hxx (original) +++ openoffice/trunk/main/autodoc/source/parser/cpp/sownstck.hxx Fri Jul 26 13:04:33 2013 @@ -121,7 +121,7 @@ inline ary::cpp::Class * ContextForAry:: S_OwnerStack::CurClass() const { - return aStack_Classes.size() > 0 + return !aStack_Classes.empty() ? aStack_Classes.top().first : (ary::cpp::Class *) 0; } @@ -130,7 +130,7 @@ inline void ContextForAry:: S_OwnerStack::SetOwner_2CurNamespace() { - csv_assert( aStack_Namespaces.size() > 0 ); + csv_assert( !aStack_Namespaces.empty() ); pOwner_Cur = pOwner_Namespace.MutablePtr(); pOwner_Namespace->SetAnotherNamespace( CurNamespace() ); } @@ -139,7 +139,7 @@ inline void ContextForAry:: S_OwnerStack::SetOwner_2CurClass() { - csv_assert( aStack_Classes.size() > 0 ); + csv_assert( !aStack_Classes.empty() ); pOwner_Cur = pOwner_Class.MutablePtr(); pOwner_Class->SetAnotherClass( *CurClass() ); } @@ -173,7 +173,7 @@ inline void ContextForAry:: S_OwnerStack::SetGlobalNamespace( ary::cpp::Namespace & io_rGlobalNamespace ) { - csv_assert( aStack_Namespaces.size() == 0 ); + csv_assert( aStack_Namespaces.empty() ); aStack_Namespaces.push(&io_rGlobalNamespace); SetOwner_2CurNamespace(); } @@ -187,7 +187,7 @@ inline void ContextForAry:: S_OwnerStack::OpenNamespace( ary::cpp::Namespace & io_rOpenedNamespace ) { - csv_assert( aStack_Namespaces.size() > 0 OR io_rOpenedNamespace.Parent() == 0 ); + csv_assert( !aStack_Namespaces.empty() OR io_rOpenedNamespace.Parent() == 0 ); aStack_Namespaces.push(&io_rOpenedNamespace); SetOwner_2CurNamespace(); } @@ -228,7 +228,7 @@ inline E_Protection ContextForAry:: S_OwnerStack::CurProtection() const { - return aStack_Classes.size() > 0 + return !aStack_Classes.empty() ? aStack_Classes.top().second : ary::cpp::PROTECT_global; } @@ -271,15 +271,15 @@ S_OwnerStack::CloseBlock() } else { - // csv_assert( aStack_Classes.size() == 0 ); - if ( aStack_Classes.size() > 0 ) + // csv_assert( aStack_Classes.empty() ); + if ( !aStack_Classes.empty() ) throw X_Parser(X_Parser::x_UnspecifiedSyntaxError, "", String::Null_(), 0); csv_assert( pCurEnum == 0 ); aStack_Namespaces.pop(); - // csv_assert( aStack_Namespaces.size() > 0 ); - if( aStack_Namespaces.size() == 0 ) + // csv_assert( !aStack_Namespaces.empty() ); + if( aStack_Namespaces.empty() ) throw X_Parser(X_Parser::x_UnspecifiedSyntaxError, "", String::Null_(), 0); } @@ -290,12 +290,12 @@ void ContextForAry:: S_OwnerStack::CloseClass() { - // csv_assert( aStack_Classes.size() > 0 ); - if ( aStack_Classes.size() == 0 ) + // csv_assert( !aStack_Classes.empty() ); + if ( aStack_Classes.empty() ) throw X_Parser(X_Parser::x_UnspecifiedSyntaxError, "", String::Null_(), 0); aStack_Classes.pop(); - if ( aStack_Classes.size() > 0 ) + if ( !aStack_Classes.empty() ) SetOwner_2CurClass(); else SetOwner_2CurNamespace(); @@ -307,7 +307,7 @@ S_OwnerStack::CloseEnum() { csv_assert( pCurEnum != 0 ); pCurEnum = 0; - if ( aStack_Classes.size() > 0 ) + if ( !aStack_Classes.empty() ) SetOwner_2CurClass(); else SetOwner_2CurNamespace();