summaryrefslogtreecommitdiff
path: root/src/guichan/widgets/scrollarea.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-26 21:29:59 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-26 21:29:59 +0300
commita33a8dc48761d7cb2b4c1c468e1e3b188bcbf709 (patch)
tree1b1e98a615e2c03641c99b66cb4667b56f7087c3 /src/guichan/widgets/scrollarea.cpp
parent012a10fd8153f3ddb775dde1e4dba4456f2aa9de (diff)
downloadmanaplus-a33a8dc48761d7cb2b4c1c468e1e3b188bcbf709.tar.gz
manaplus-a33a8dc48761d7cb2b4c1c468e1e3b188bcbf709.tar.bz2
manaplus-a33a8dc48761d7cb2b4c1c468e1e3b188bcbf709.tar.xz
manaplus-a33a8dc48761d7cb2b4c1c468e1e3b188bcbf709.zip
Add const to some classes.
Diffstat (limited to 'src/guichan/widgets/scrollarea.cpp')
-rw-r--r--src/guichan/widgets/scrollarea.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/guichan/widgets/scrollarea.cpp b/src/guichan/widgets/scrollarea.cpp
index 9668f9778..1251bc665 100644
--- a/src/guichan/widgets/scrollarea.cpp
+++ b/src/guichan/widgets/scrollarea.cpp
@@ -195,7 +195,7 @@ namespace gcn
void ScrollArea::setVerticalScrollAmount(int vScroll)
{
- int max = getVerticalMaxScroll();
+ const int max = getVerticalMaxScroll();
mVScroll = vScroll;
@@ -213,7 +213,7 @@ namespace gcn
void ScrollArea::setHorizontalScrollAmount(int hScroll)
{
- int max = getHorizontalMaxScroll();
+ const int max = getHorizontalMaxScroll();
mHScroll = hScroll;
@@ -241,7 +241,7 @@ namespace gcn
if (!getContent())
return 0;
- int value = getContent()->getWidth() - getChildrenArea().width +
+ const int value = getContent()->getWidth() - getChildrenArea().width +
2 * getContent()->getFrameSize();
if (value < 0)
@@ -283,8 +283,8 @@ namespace gcn
void ScrollArea::mousePressed(MouseEvent& mouseEvent)
{
- int x = mouseEvent.getX();
- int y = mouseEvent.getY();
+ const int x = mouseEvent.getX();
+ const int y = mouseEvent.getY();
if (getUpButtonDimension().isPointInRect(x, y))
{
@@ -368,11 +368,11 @@ namespace gcn
{
if (mIsVerticalMarkerDragged)
{
- Rectangle barDim = getVerticalBarDimension();
+ const Rectangle barDim = getVerticalBarDimension();
- int pos = mouseEvent.getY() - barDim.y
+ const int pos = mouseEvent.getY() - barDim.y
- mVerticalMarkerDragOffset;
- int length = getVerticalMarkerDimension().height;
+ const int length = getVerticalMarkerDimension().height;
if ((barDim.height - length) > 0)
{
@@ -387,11 +387,11 @@ namespace gcn
if (mIsHorizontalMarkerDragged)
{
- Rectangle barDim = getHorizontalBarDimension();
+ const Rectangle barDim = getHorizontalBarDimension();
- int pos = mouseEvent.getX() - barDim.x
+ const int pos = mouseEvent.getX() - barDim.x
- mHorizontalMarkerDragOffset;
- int length = getHorizontalMarkerDimension().width;
+ const int length = getHorizontalMarkerDimension().width;
if ((barDim.width - length) > 0)
{
@@ -464,13 +464,12 @@ namespace gcn
void ScrollArea::checkPolicies()
{
- int w = getWidth();
- int h = getHeight();
+ const int w = getWidth();
+ const int h = getHeight();
mHBarVisible = false;
mVBarVisible = false;
-
if (!getContent())
{
mHBarVisible = (mHPolicy == SHOW_ALWAYS);
@@ -616,7 +615,7 @@ namespace gcn
Rectangle ScrollArea::getChildrenArea()
{
- Rectangle area = Rectangle(0, 0,
+ const Rectangle area = Rectangle(0, 0,
mVBarVisible ? (getWidth() - mScrollbarWidth) : getWidth(),
mHBarVisible ? (getHeight() - mScrollbarWidth) : getHeight());