Fix for divide by zero in FixedRuler::GetPageFromPosition() 35/30135/5
authorAndrew Cox <andrew.cox@partner.samsung.com>
Tue, 4 Nov 2014 16:27:59 +0000 (16:27 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 12 Nov 2014 16:36:56 +0000 (08:36 -0800)
commitca4705cf3cfb2ad6be0a8c7c672381b69055c821
tree62dcdb0be56d9e638c405309edeedde5716976d9
parent7957e6e4dd4c6f97a7296d3125c7410a4b6bc5d7
Fix for divide by zero in FixedRuler::GetPageFromPosition()

[problem]      A crash has been reported with a stack trace showing an integer
               divide by zero exception in FixedRuler::GetPageFromPosition().
[cause]        We have code there that divides by zero if a FixedRuler is setup
               with a domain that is smaller than its page spacing
               (a nonsensical state)
[solution]     Clamp the divisor to be >= 1 and log an error so the App devs can
               choose to fix the setup of the FixedRuler. Additionally, force
               the page spacing to a reasonable value at construction time to
               avoid a second set of possible divide by zero errors in floating
               point numbers.

Change-Id: Iae4fa025600c2ee54796fc458ca367d993c6ef66
Signed-off-by: Andrew Cox <andrew.cox@partner.samsung.com>
base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp