[wesnoth] Boost patch.
Jon Ciesla
limb at fedoraproject.org
Fri Jul 22 12:04:11 UTC 2011
commit 9880a95c26ffb6268a9017749ae2f0ebd24dca4c
Author: Jon Ciesla <limb at jcomserv.net>
Date: Fri Jul 22 06:59:45 2011 -0500
Boost patch.
wesnoth-1.8.6-boost-foreach.patch | 70 +++++++++++++++++++++++++++++++++++++
wesnoth.spec | 3 ++
2 files changed, 73 insertions(+), 0 deletions(-)
---
diff --git a/wesnoth-1.8.6-boost-foreach.patch b/wesnoth-1.8.6-boost-foreach.patch
new file mode 100644
index 0000000..f89a9d2
--- /dev/null
+++ b/wesnoth-1.8.6-boost-foreach.patch
@@ -0,0 +1,70 @@
+--- wesnoth-1.8.6/src/gui/widgets/tree_view_node.cpp~ 2011-07-21 23:05:56.594879049 +0200
++++ wesnoth-1.8.6/src/gui/widgets/tree_view_node.cpp~ 2011-07-21 23:28:07.540358742 +0200
+@@ -238,6 +238,17 @@ void ttree_view_node::clear()
+
+ struct ttree_view_node_implementation
+ {
++ template<class W, class It>
++ static W* find_at_aux(It begin, It end,
++ const tpoint& coordinate, const bool must_be_active) {
++ for (It it = begin; it != end; ++it) {
++ if(W* widget = it->find_at(coordinate, must_be_active)) {
++ return widget;
++ }
++ }
++ return NULL;
++ }
++
+ template<class W>
+ static W* find_at(
+ typename tconst_duplicator<W, ttree_view_node>::type&
+@@ -255,13 +266,9 @@ struct ttree_view_node_implementation
+ }
+
+ typedef typename tconst_duplicator<W, ttree_view_node>::type thack;
+- foreach(thack& node, tree_view_node.children_) {
+- if(W* widget = node.find_at(coordinate, must_be_active)) {
+- return widget;
+- }
+- }
+-
+- return NULL;
++ return find_at_aux<W>(tree_view_node.children_.begin(),
++ tree_view_node.children_.end(),
++ coordinate, must_be_active);
+ }
+ };
+
+@@ -313,7 +320,9 @@ tpoint ttree_view_node::get_current_size
+ return size;
+ }
+
+- foreach(const ttree_view_node& node, children_) {
++ for (boost::ptr_vector<ttree_view_node>::const_iterator it
++ = children_.begin (); it != children_.end (); ++it) {
++ const ttree_view_node& node = *it;
+
+ if(node.grid_.get_visible() == twidget::INVISIBLE) {
+ continue;
+@@ -344,7 +353,9 @@ tpoint ttree_view_node::get_unfolded_siz
+ size.x += (get_indention_level() - 1) * tree_view().indention_step_size_;
+ }
+
+- foreach(const ttree_view_node& node, children_) {
++ for (boost::ptr_vector<ttree_view_node>::const_iterator it
++ = children_.begin (); it != children_.end (); ++it) {
++ const ttree_view_node& node = *it;
+
+ if(node.grid_.get_visible() == twidget::INVISIBLE) {
+ continue;
+@@ -378,7 +389,9 @@ tpoint ttree_view_node::calculate_best_s
+
+ DBG_GUI_L << LOG_HEADER << " own grid best size " << best_size << ".\n";
+
+- foreach(const ttree_view_node& node, children_) {
++ for (boost::ptr_vector<ttree_view_node>::const_iterator it
++ = children_.begin (); it != children_.end (); ++it) {
++ const ttree_view_node& node = *it;
+
+ if(node.grid_.get_visible() == twidget::INVISIBLE) {
+ continue;
diff --git a/wesnoth.spec b/wesnoth.spec
index 6fab6eb..3503de5 100644
--- a/wesnoth.spec
+++ b/wesnoth.spec
@@ -14,6 +14,7 @@ Patch1: wesnoth-1.5.11-remove-ogg-test.patch
#Patch2: wesnoth-1.6.4-fribidi.patch
#Patch3: wesnoth-1.8.3-boost-iostreams.patch
Patch4: wesnoth-1.8.5-cstddef.patch
+Patch5: wesnoth-1.8.6-boost-foreach.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: wesnoth-data = %{version}
@@ -93,6 +94,7 @@ This package contains the data files for Wesnoth.
#%patch2 -p0
#%patch3 -p1 -b .boost-iostreams
%patch4 -p0 -b .cstddef
+%patch5 -p0 -b .boost-foreach
autoreconf -i
@@ -260,6 +262,7 @@ fi
%changelog
* Thu Jul 21 2011 Jon Ciesla <limb at jcomserv.net> - 1.8.6-3
- Rebuild for new boost.
+- Patch for foreach change, BZ 724818.
* Fri Jun 17 2011 Jon Ciesla <limb at jcomserv.net> - 1.8.6-2
- Bump and rebuild for BZ 712251.
More information about the scm-commits
mailing list