fix bug that treebox::item_proxy::size returns the depth of the node
This commit is contained in:
		
							parent
							
								
									dd0c75fb0d
								
							
						
					
					
						commit
						335305c97c
					
				@ -1,7 +1,7 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 *	A Treebox Implementation
 | 
					 *	A Treebox Implementation
 | 
				
			||||||
 *	Nana C++ Library(http://www.nanapro.org)
 | 
					 *	Nana C++ Library(http://www.nanapro.org)
 | 
				
			||||||
 *	Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
 | 
					 *	Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 *	Distributed under the Boost Software License, Version 1.0.
 | 
					 *	Distributed under the Boost Software License, Version 1.0.
 | 
				
			||||||
 *	(See accompanying file LICENSE_1_0.txt or copy at
 | 
					 *	(See accompanying file LICENSE_1_0.txt or copy at
 | 
				
			||||||
@ -958,10 +958,14 @@ namespace nana
 | 
				
			|||||||
					return *this;
 | 
										return *this;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				std::size_t item_proxy::size() const
 | 
									std::size_t item_proxy::size() const
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					std::size_t n = 0;
 | 
										std::size_t n = 0;
 | 
				
			||||||
					for(auto child = node_->child; child; child = child->child)
 | 
					
 | 
				
			||||||
 | 
										//Fixed by ErrorFlynn
 | 
				
			||||||
 | 
										//this method incorrectly returned the number of levels beneath the nodes using child = child->child
 | 
				
			||||||
 | 
										for(auto child = node_->child; child; child = child->next)
 | 
				
			||||||
						++n;
 | 
											++n;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					return n;
 | 
										return n;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user