changeset 847:df6c52402484

merge
author Benjamin Golinvaux <bgo@osimis.io>
date Sat, 15 Jun 2019 20:37:48 +0200
parents 17423d072a95 (current diff) cdba0dbb4682 (diff)
children df0c73ee7afa
files
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Generic/GuiAdapter.cpp	Sat Jun 15 20:37:12 2019 +0200
+++ b/Applications/Generic/GuiAdapter.cpp	Sat Jun 15 20:37:48 2019 +0200
@@ -479,19 +479,19 @@
 
   void GuiAdapter::OnAnimationFrame()
   {
-    for (const auto& handler : animationFrameHandlers_)
+    for (size_t i = 0; i < animationFrameHandlers_.size(); i++)
     {
       // TODO: fix time 
-      (*(handler.first))(0,handler.second);
+      (*(animationFrameHandlers_[i].first))(0, animationFrameHandlers_[i].second);
     }
   }
 
   void GuiAdapter::OnResize()
   {
-    for (const auto& handler : resizeHandlers_)
+    for (size_t i = 0; i < resizeHandlers_.size(); i++)
     {
       // TODO: fix time 
-      (*(handler.first))(0, handler.second);
+      (*(resizeHandlers_[i].first))(0, resizeHandlers_[i].second);
     }
   }
    
--- a/Applications/Generic/GuiAdapter.h	Sat Jun 15 20:37:12 2019 +0200
+++ b/Applications/Generic/GuiAdapter.h	Sat Jun 15 20:37:48 2019 +0200
@@ -45,6 +45,7 @@
 # include "../../Framework/Messages/LockingEmitter.h"
 #endif
 
+#include <vector>
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
 
@@ -309,13 +310,13 @@
     */
     void ViewportsUpdateSize();
 
-    std::vector<boost::weak_ptr<IGuiAdapterWidget>> widgets_;
+    std::vector<boost::weak_ptr<IGuiAdapterWidget> > widgets_;
 
     template<typename F> void VisitWidgets(F func)
     {
-      for (auto w : widgets_)
+      for (size_t i = 0; i < widgets_.size(); i++)
       {
-        boost::shared_ptr<IGuiAdapterWidget> widget = w.lock();
+        boost::shared_ptr<IGuiAdapterWidget> widget = widgets_[i].lock();
         func(widget);
       }
     }