fix syntax errors and warnings
This commit is contained in:
		
							parent
							
								
									33424f0c75
								
							
						
					
					
						commit
						431f0af893
					
				| @ -96,7 +96,7 @@ namespace nana | |||||||
| 					*ptr() = std::forward<U>(value); | 					*ptr() = std::forward<U>(value); | ||||||
| 				else | 				else | ||||||
| 				{ | 				{ | ||||||
| 					::new (data) value_type(std::forward<U>(value)); | 					::new (data_) value_type(std::forward<U>(value)); | ||||||
| 					initialized_ = true; | 					initialized_ = true; | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| @ -110,10 +110,10 @@ namespace nana | |||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				if (initialized_) | 				if (initialized_) | ||||||
| 					*ptr = *other.ptr(); | 					*ptr() = *other.ptr(); | ||||||
| 				else | 				else | ||||||
| 				{ | 				{ | ||||||
| 					::new (data) value_type(*other.ptr()); | 					::new (data_) value_type(*other.ptr()); | ||||||
| 					initialized_ = true; | 					initialized_ = true; | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| @ -130,7 +130,7 @@ namespace nana | |||||||
| 					*ptr() = std::move(*other.ptr()); | 					*ptr() = std::move(*other.ptr()); | ||||||
| 				else | 				else | ||||||
| 				{ | 				{ | ||||||
| 					::new (data) value_type(std::move(*other.ptr())); | 					::new (data_) value_type(std::move(*other.ptr())); | ||||||
| 					initialized_ = true; | 					initialized_ = true; | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| @ -203,9 +203,9 @@ namespace nana | |||||||
| 		{ | 		{ | ||||||
| 			if (this != &other) | 			if (this != &other) | ||||||
| 			{ | 			{ | ||||||
| 				storage_.assign(std::move(other.storage_)) | 				storage_.assign(std::move(other.storage_)); | ||||||
| 			} | 			} | ||||||
| 			return *this;l | 			return *this; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		template<typename U> | 		template<typename U> | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| /*
 | /*
 | ||||||
|  *	A Bedrock Implementation |  *	A Bedrock Implementation | ||||||
|  *	Nana C++ Library(http://www.nanapro.org)
 |  *	Nana C++ Library(http://www.nanapro.org)
 | ||||||
|  *	Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) |  *	Copyright(C) 2003-2017 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 | ||||||
|  | |||||||
| @ -1150,21 +1150,6 @@ namespace nana | |||||||
| 							px = (vert ? move_r.height : move_r.width); | 							px = (vert ? move_r.height : move_r.width); | ||||||
| 							moved = true; | 							moved = true; | ||||||
| 						} | 						} | ||||||
| 						/*
 |  | ||||||
| 						auto extent = API::content_extent(el.handle, 0, false);	//deprecated
 |  | ||||||
| 						if (extent) |  | ||||||
| 						{ |  | ||||||
| 							move_r.dimension(extent->second); |  | ||||||
| 
 |  | ||||||
| 							if (vert) |  | ||||||
| 								move_r.x += place_parts::differ(area_margined.width, move_r.width) / 2; |  | ||||||
| 							else |  | ||||||
| 								move_r.y += place_parts::differ(area_margined.height, move_r.height) / 2; |  | ||||||
| 
 |  | ||||||
| 							px = (vert ? move_r.height : move_r.width); |  | ||||||
| 							moved = true; |  | ||||||
| 						} |  | ||||||
| 						*/ |  | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					if (!moved) | 					if (!moved) | ||||||
|  | |||||||
| @ -27,7 +27,7 @@ namespace nana{	namespace drawerbase | |||||||
| 				: trigger_{ t } | 				: trigger_{ t } | ||||||
| 			{} | 			{} | ||||||
| 
 | 
 | ||||||
| 			optional<size> measure(graph_reference graph, unsigned limit_pixels, bool limit_width) const override | 			optional<size> measure(graph_reference graph, unsigned limit_pixels, bool /*limit_width*/) const override | ||||||
| 			{ | 			{ | ||||||
| 				//Button doesn't provide a support of vfit and hfit
 | 				//Button doesn't provide a support of vfit and hfit
 | ||||||
| 				if (limit_pixels) | 				if (limit_pixels) | ||||||
|  | |||||||
| @ -90,14 +90,14 @@ namespace nana | |||||||
| 						: drw_{ drwimpl } | 						: drw_{ drwimpl } | ||||||
| 					{} | 					{} | ||||||
| 
 | 
 | ||||||
| 					optional<size> measure(graph_reference graph, unsigned limit_pixels, bool limit_width) const override | 					optional<size> measure(graph_reference graph, unsigned limit_pixels, bool /*limit_width*/) const override | ||||||
| 					{ | 					{ | ||||||
| 						//Button doesn't provide a support of vfit and hfit
 | 						//Combox doesn't provide a support of vfit and hfit
 | ||||||
| 						if (limit_pixels) | 						if (limit_pixels) | ||||||
| 							return{}; | 							return{}; | ||||||
| 
 | 
 | ||||||
| 						size content_size; | 						size content_size; | ||||||
| 						for (auto i = 0; i < drw_->the_number_of_options(); ++i) | 						for (std::size_t i = 0; i < drw_->the_number_of_options(); ++i) | ||||||
| 						{ | 						{ | ||||||
| 							auto & m = drw_->at(i); | 							auto & m = drw_->at(i); | ||||||
| 							auto sz = graph.text_extent_size(m.item_text); | 							auto sz = graph.text_extent_size(m.item_text); | ||||||
|  | |||||||
| @ -3406,9 +3406,6 @@ namespace nana | |||||||
| 
 | 
 | ||||||
| 							/// is ignored if no change (maybe set last_selected anyway??), but if change emit event, deselect others if need ans set/unset last_selected
 | 							/// is ignored if no change (maybe set last_selected anyway??), but if change emit event, deselect others if need ans set/unset last_selected
 | ||||||
| 							item_proxy::from_display(ess_, next_selected_dpl).select(true); | 							item_proxy::from_display(ess_, next_selected_dpl).select(true); | ||||||
| 
 |  | ||||||
| 							//if (trace_selected)
 |  | ||||||
| 							//	ess_->trace_item_dpl(next_selected_dpl);	//deprecated
 |  | ||||||
| 						} | 						} | ||||||
| 						break; | 						break; | ||||||
| 					} | 					} | ||||||
| @ -4576,17 +4573,8 @@ namespace nana | |||||||
| 					if (essence_->header.sortable() && essence_->pointer_where.first == parts::header && prev_state == item_state::pressed) | 					if (essence_->header.sortable() && essence_->pointer_where.first == parts::header && prev_state == item_state::pressed) | ||||||
| 					{ | 					{ | ||||||
| 						if(essence_->pointer_where.second < essence_->header.cont().size()) | 						if(essence_->pointer_where.second < essence_->header.cont().size()) | ||||||
| 						{ |  | ||||||
| 							/*
 |  | ||||||
| 							if(essence_->lister.sort_column(essence_->pointer_where.second, nullptr)) |  | ||||||
| 							{ |  | ||||||
| 								//essence_->trace_item_dpl(index_pair{0,0});	//deprecated
 |  | ||||||
| 								need_refresh = true; |  | ||||||
| 							} |  | ||||||
| 							*/ |  | ||||||
| 							need_refresh = essence_->lister.sort_column(essence_->pointer_where.second, nullptr); | 							need_refresh = essence_->lister.sort_column(essence_->pointer_where.second, nullptr); | ||||||
| 					} | 					} | ||||||
| 					} |  | ||||||
| 					else if (item_state::grabbed == prev_state) | 					else if (item_state::grabbed == prev_state) | ||||||
| 					{ | 					{ | ||||||
| 						nana::point pos = arg.pos; | 						nana::point pos = arg.pos; | ||||||
| @ -4720,8 +4708,6 @@ namespace nana | |||||||
| 							else if (!essence_->lister.single_status(true))	//not selected
 | 							else if (!essence_->lister.single_status(true))	//not selected
 | ||||||
| 								essence_->lister.cat_status(idx.cat, true, true); | 								essence_->lister.cat_status(idx.cat, true, true); | ||||||
| 
 | 
 | ||||||
| 							//essence_->trace_last_selected_item ();	//deprecated
 |  | ||||||
| 
 |  | ||||||
| 							break; | 							break; | ||||||
| 						} | 						} | ||||||
| 					case keyboard::os_home: | 					case keyboard::os_home: | ||||||
| @ -4734,13 +4720,11 @@ namespace nana | |||||||
| 							else if (!essence_->lister.single_status(true))	//not selected
 | 							else if (!essence_->lister.single_status(true))	//not selected
 | ||||||
| 								essence_->lister.cat_status(frst.cat, true, true); | 								essence_->lister.cat_status(frst.cat, true, true); | ||||||
| 
 | 
 | ||||||
| 							//essence_->trace_last_selected_item ();	//deprecated
 |  | ||||||
| 							break; | 							break; | ||||||
| 						} | 						} | ||||||
| 					case keyboard::os_end: | 					case keyboard::os_end: | ||||||
| 						essence_->lister.select_for_all(false); | 						essence_->lister.select_for_all(false); | ||||||
| 						item_proxy::from_display(essence_, essence_->lister.last()).select(true); | 						item_proxy::from_display(essence_, essence_->lister.last()).select(true); | ||||||
| 						//essence_->trace_last_selected_item ();	//deprecated
 |  | ||||||
| 						break; | 						break; | ||||||
| 					default: | 					default: | ||||||
| 						return; | 						return; | ||||||
|  | |||||||
| @ -58,9 +58,9 @@ namespace nana | |||||||
| 					: impl_{impl} | 					: impl_{impl} | ||||||
| 				{} | 				{} | ||||||
| 
 | 
 | ||||||
| 				optional<size> measure(graph_reference graph, unsigned limit_pixels, bool limit_width) const override | 				optional<size> measure(graph_reference /*graph*/, unsigned limit_pixels, bool /*limit_width*/) const override | ||||||
| 				{ | 				{ | ||||||
| 					//Button doesn't provide a support of vfit and hfit
 | 					//Picture doesn't provide a support of vfit and hfit
 | ||||||
| 					if (!limit_pixels) | 					if (!limit_pixels) | ||||||
| 					{ | 					{ | ||||||
| 						if (impl_->backimg.valid_area.empty()) | 						if (impl_->backimg.valid_area.empty()) | ||||||
|  | |||||||
| @ -446,8 +446,11 @@ namespace nana{	namespace widgets | |||||||
| 					std::swap(first, second); | 					std::swap(first, second); | ||||||
| 
 | 
 | ||||||
| 				if (second < this->sections_.size()) | 				if (second < this->sections_.size()) | ||||||
|  | #ifdef _MSC_VER | ||||||
| 					this->sections_.erase(this->sections_.cbegin() + (first + 1), this->sections_.cbegin() + second); | 					this->sections_.erase(this->sections_.cbegin() + (first + 1), this->sections_.cbegin() + second); | ||||||
| 
 | #else | ||||||
|  | 					this->sections_.erase(this->sections_.begin() + (first + 1), this->sections_.begin() + second); | ||||||
|  | #endif | ||||||
| 				pre_calc_line(first, 0); | 				pre_calc_line(first, 0); | ||||||
| 
 | 
 | ||||||
| 				//textbase is implement by using deque, and the linemtr holds the text pointers
 | 				//textbase is implement by using deque, and the linemtr holds the text pointers
 | ||||||
| @ -468,8 +471,11 @@ namespace nana{	namespace widgets | |||||||
| 				if (pos < this->sections_.size()) | 				if (pos < this->sections_.size()) | ||||||
| 				{ | 				{ | ||||||
| 					for (std::size_t i = 0; i < line_size; ++i) | 					for (std::size_t i = 0; i < line_size; ++i) | ||||||
|  | #ifdef _MSC_VER | ||||||
| 						this->sections_.emplace(this->sections_.cbegin() + (pos + i)); | 						this->sections_.emplace(this->sections_.cbegin() + (pos + i)); | ||||||
| 
 | #else | ||||||
|  | 						this->sections_.emplace(this->sections_.begin() + (pos + i)); | ||||||
|  | #endif | ||||||
| 					//textbase is implement by using deque, and the linemtr holds the text pointers
 | 					//textbase is implement by using deque, and the linemtr holds the text pointers
 | ||||||
| 					//If the textbase is changed, it will check the text pointers.
 | 					//If the textbase is changed, it will check the text pointers.
 | ||||||
| 					std::size_t line = 0; | 					std::size_t line = 0; | ||||||
| @ -2664,7 +2670,6 @@ namespace nana{	namespace widgets | |||||||
| 			unicode_bidi{}.linestr(text_ptr, text_size, reordered); | 			unicode_bidi{}.linestr(text_ptr, text_size, reordered); | ||||||
| 
 | 
 | ||||||
| 			nana::upoint res(static_cast<unsigned>(real_str.begin - sections.front().begin), static_cast<unsigned>(row.first)); | 			nana::upoint res(static_cast<unsigned>(real_str.begin - sections.front().begin), static_cast<unsigned>(row.first)); | ||||||
| 			//scrpos.x += points_.offset.x - text_area_.area.x;	//deprecated
 |  | ||||||
| 			scrpos.x -= _m_text_x(sections[row.second]); | 			scrpos.x -= _m_text_x(sections[row.second]); | ||||||
| 
 | 
 | ||||||
| 			if (scrpos.x < 0) | 			if (scrpos.x < 0) | ||||||
| @ -3440,12 +3445,9 @@ namespace nana{	namespace widgets | |||||||
| 
 | 
 | ||||||
| 		void text_editor::_m_draw_string(int top, const ::nana::color& clr, const nana::upoint& text_coord, const text_section& sct, bool if_mask) const | 		void text_editor::_m_draw_string(int top, const ::nana::color& clr, const nana::upoint& text_coord, const text_section& sct, bool if_mask) const | ||||||
| 		{ | 		{ | ||||||
| 			auto const behavior = impl_->capacities.behavior; |  | ||||||
| 			point text_draw_pos{ _m_text_x(sct), top }; | 			point text_draw_pos{ _m_text_x(sct), top }; | ||||||
| 
 | 
 | ||||||
| 			const int text_right = text_area_.area.right(); | 			const int text_right = text_area_.area.right(); | ||||||
| 
 |  | ||||||
| 			//auto text_ptr = &text;	//deprecated
 |  | ||||||
| 			auto const text_len = static_cast<unsigned>(sct.end - sct.begin); | 			auto const text_len = static_cast<unsigned>(sct.end - sct.begin); | ||||||
| 			auto text_ptr = sct.begin; | 			auto text_ptr = sct.begin; | ||||||
| 
 | 
 | ||||||
| @ -3482,8 +3484,6 @@ namespace nana{	namespace widgets | |||||||
| 			{ | 			{ | ||||||
| 				if (a.y < text_coord.y && text_coord.y < b.y) | 				if (a.y < text_coord.y && text_coord.y < b.y) | ||||||
| 				{ | 				{ | ||||||
| 					//sbegin = text_ptr->c_str();	//deprecated
 |  | ||||||
| 					//send = sbegin + text_ptr->size();
 |  | ||||||
| 					sbegin = sct.begin; | 					sbegin = sct.begin; | ||||||
| 					send = sct.end; | 					send = sct.end; | ||||||
| 				} | 				} | ||||||
|  | |||||||
| @ -611,7 +611,7 @@ namespace nana | |||||||
| 						{ | 						{ | ||||||
| 							scroll.create(*data.widget_ptr, nana::rectangle(data.graph->width() - 16, 0, 16, data.graph->height())); | 							scroll.create(*data.widget_ptr, nana::rectangle(data.graph->width() - 16, 0, 16, data.graph->height())); | ||||||
| 
 | 
 | ||||||
| 							scroll.events().value_changed.connect_unignorable([this](const arg_scroll& arg) | 							scroll.events().value_changed.connect_unignorable([this](const arg_scroll&) | ||||||
| 							{ | 							{ | ||||||
| 								adjust.scroll_timestamp = nana::system::timestamp(); | 								adjust.scroll_timestamp = nana::system::timestamp(); | ||||||
| 								adjust.timer.start(); | 								adjust.timer.start(); | ||||||
| @ -1791,7 +1791,6 @@ namespace nana | |||||||
| 					if (!node) | 					if (!node) | ||||||
| 						return; | 						return; | ||||||
| 
 | 
 | ||||||
| 					auto & node_state = impl_->node_state; |  | ||||||
| 					switch (nl.what()) | 					switch (nl.what()) | ||||||
| 					{ | 					{ | ||||||
| 					case component::icon: | 					case component::icon: | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jinhao
						Jinhao