diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-03-02 17:45:26 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-03-02 17:45:26 +0100 |
commit | 0e4d294db8bc143bb686fd845a46c80d5cb5ad02 (patch) | |
tree | 252aa7884d363104127aee08b5ee03c7d8bae93a | |
parent | 89bbb94e03df0ccd5cf3f5737c12b7c29fd4fae7 (diff) |
vcl110: #i106575# fix erase from list (thanks thb)
-rw-r--r-- | toolkit/source/layout/core/box-base.cxx | 5 | ||||
-rw-r--r-- | toolkit/source/layout/core/box-base.hxx | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/toolkit/source/layout/core/box-base.cxx b/toolkit/source/layout/core/box-base.cxx index 63cb49901ec4..20377ea97c4e 100644 --- a/toolkit/source/layout/core/box-base.cxx +++ b/toolkit/source/layout/core/box-base.cxx @@ -108,15 +108,16 @@ Box_Base::addChild (uno::Reference <awt::XLayoutConstrains> const& xChild) } Box_Base::ChildData* -Box_Base::removeChildData( std::list< ChildData* > lst, css::uno::Reference< css::awt::XLayoutConstrains > const& xChild ) +Box_Base::removeChildData( std::list< ChildData* >& lst, css::uno::Reference< css::awt::XLayoutConstrains > const& xChild ) { for ( std::list< ChildData* >::iterator it = lst.begin(); it != lst.end(); it++ ) { if ( (*it)->mxChild == xChild ) { + ChildData* pRet = *it; lst.erase( it ); - return *it; + return pRet; } } return 0; diff --git a/toolkit/source/layout/core/box-base.hxx b/toolkit/source/layout/core/box-base.hxx index c4958a303540..26e147772a66 100644 --- a/toolkit/source/layout/core/box-base.hxx +++ b/toolkit/source/layout/core/box-base.hxx @@ -66,7 +66,7 @@ protected: virtual ChildData *createChild( css::uno::Reference< css::awt::XLayoutConstrains > const& xChild ) = 0; virtual ChildProps *createChildProps( ChildData* pData ) = 0; - ChildData *removeChildData( std::list< ChildData *>, css::uno::Reference< css::awt::XLayoutConstrains > const& Child ); + ChildData *removeChildData( std::list< ChildData *>&, css::uno::Reference< css::awt::XLayoutConstrains > const& Child ); public: void AddChild( const css::uno::Reference< css::awt::XLayoutConstrains >& Child); |