BScrollbar: remove unused field.

* Nothing ever reads fTargetName in the scrollbar code, so remove the
field.
* Frees one reserved slot, and a little memory, as the target name was
copied with strdup.
This commit is contained in:
Adrien Destugues
2014-04-29 16:46:00 +02:00
parent 8073fcbb39
commit 1d09e9cee3
2 changed files with 5 additions and 14 deletions
+1 -2
View File
@@ -133,11 +133,10 @@ private:
float fProportion;
BView* fTarget;
orientation fOrientation;
char* fTargetName;
Private* fPrivateData;
uint32 _reserved[3];
uint32 _reserved[4];
};
#endif // _SCROLL_BAR_H
+4 -12
View File
@@ -207,8 +207,7 @@ BScrollBar::BScrollBar(BRect frame, const char* name, BView* target,
fValue(0),
fProportion(0.0f),
fTarget(NULL),
fOrientation(direction),
fTargetName(NULL)
fOrientation(direction)
{
SetViewColor(B_TRANSPARENT_COLOR);
@@ -237,8 +236,7 @@ BScrollBar::BScrollBar(const char* name, BView* target,
fValue(0),
fProportion(0.0f),
fTarget(NULL),
fOrientation(direction),
fTargetName(NULL)
fOrientation(direction)
{
SetViewColor(B_TRANSPARENT_COLOR);
@@ -255,8 +253,7 @@ BScrollBar::BScrollBar(const char* name, BView* target,
BScrollBar::BScrollBar(BMessage* data)
:
BView(data),
fTarget(NULL),
fTargetName(NULL)
fTarget(NULL)
{
fPrivateData = new BScrollBar::Private(this);
@@ -567,17 +564,12 @@ BScrollBar::SetTarget(BView* target)
}
fTarget = target;
free(fTargetName);
if (fTarget) {
fTargetName = strdup(target->Name());
if (fOrientation == B_VERTICAL)
fTarget->fVerScroller = this;
else
fTarget->fHorScroller = this;
} else
fTargetName = NULL;
}
}