mail[Wesnoth-commits] r33437 - in /trunk: changelog src/gui/widgets/scrollbar_container.cpp src/gui/widgets/scrollbar_container.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on March 08, 2009 - 17:33:
Author: mordante
Date: Sun Mar  8 17:33:45 2009
New Revision: 33437

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33437&view=rev
Log:
Don't use a scrollbar in an invisible widget.

AI0867 discovered the following problem:
start the test scenario, move a unit to "open sesame", move a unit to
"math test", enter a number longer than the input box, select "ints &
floats".

The game ended with an assertion failure due to using a scrollbar on an
invisible widget. Added a minimal fix, this needs to be fixed cleaner
post 1.6.

Modified:
    trunk/changelog
    trunk/src/gui/widgets/scrollbar_container.cpp
    trunk/src/gui/widgets/scrollbar_container.hpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=33437&r1=33436&r2=33437&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sun Mar  8 17:33:45 2009
@@ -4,6 +4,8 @@
  * Language and i18n:
    * updated translations: Chinese (Simplified), Czech, French, Finnish,
      Hungarian, Polish, Russian, Slovak, Turkish
+ * User interface:
+   * Fixed a crash when trying to use scrollbars in an invisible widget.
  * Miscellaneous and bug fixes:
    * Fix another savegame cache corruption
    * Fixed bug #13099: MP lobby player list becomes inaccurate over time

Modified: trunk/src/gui/widgets/scrollbar_container.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/scrollbar_container.cpp?rev=33437&r1=33436&r2=33437&view=diff
==============================================================================
--- trunk/src/gui/widgets/scrollbar_container.cpp (original)
+++ trunk/src/gui/widgets/scrollbar_container.cpp Sun Mar  8 17:33:45 2009
@@ -125,6 +125,20 @@
        content_grid_->layout_wrap(maximum_width - offset);
 }
 
+bool tscrollbar_container::has_vertical_scrollbar() const
+{
+       /** 
+        * @todo look at cleaning the has_X_scrollbar and can_wrap to do the
+        * visibility test in a more generic way, preferably in the grid.
+        */
+       return is_visible() && vertical_scrollbar_mode_ != HIDE; 
+}
+
+bool tscrollbar_container::has_horizontal_scrollbar() const
+{ 
+       return is_visible() && horizontal_scrollbar_mode_ != HIDE; 
+}
+
 void tscrollbar_container::
                layout_use_vertical_scrollbar(const unsigned maximum_height)
 {

Modified: trunk/src/gui/widgets/scrollbar_container.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/scrollbar_container.hpp?rev=33437&r1=33436&r2=33437&view=diff
==============================================================================
--- trunk/src/gui/widgets/scrollbar_container.hpp (original)
+++ trunk/src/gui/widgets/scrollbar_container.hpp Sun Mar  8 17:33:45 2009
@@ -82,15 +82,13 @@
        void layout_wrap(const unsigned maximum_width);
 
        /** Inherited from twidget (not tcontainer_). */
-       bool has_vertical_scrollbar() const
-               { return vertical_scrollbar_mode_ != HIDE; }
+       bool has_vertical_scrollbar() const;
 
        /** Inherited from tcontainer_. */
        void layout_use_vertical_scrollbar(const unsigned maximum_height);
 
        /** Inherited from twidget (not tcontainer_). */
-       bool has_horizontal_scrollbar() const
-               { return horizontal_scrollbar_mode_ != HIDE; }
+       bool has_horizontal_scrollbar() const;
 
        /** Inherited from tcontainer_. */
        void layout_use_horizontal_scrollbar(const unsigned maximum_width);




Related Messages


Powered by MHonArc, Updated Sun Mar 08 18:00:28 2009