Removed superfluous BView::findView() and moved its functionality to BView::FindView().
Fixed it on the way - it's a bad idea to pass NULL pointers to strcmp(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13288 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -585,7 +585,6 @@ private:
|
|||||||
|
|
||||||
void deleteView( BView* aView);
|
void deleteView( BView* aView);
|
||||||
bool do_owner_check_no_pick() const;
|
bool do_owner_check_no_pick() const;
|
||||||
BView* findView( const BView* aView, const char* viewName ) const;
|
|
||||||
bool attachView( BView *aView );
|
bool attachView( BView *aView );
|
||||||
bool addToList( BView *aView, BView *before = NULL);
|
bool addToList( BView *aView, BView *before = NULL);
|
||||||
bool removeFromList();
|
bool removeFromList();
|
||||||
|
|||||||
+16
-20
@@ -3172,7 +3172,22 @@ BView::Parent() const
|
|||||||
BView *
|
BView *
|
||||||
BView::FindView(const char *name) const
|
BView::FindView(const char *name) const
|
||||||
{
|
{
|
||||||
return findView(this, name);
|
if (name == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (Name() != NULL && !strcmp(Name(), name))
|
||||||
|
return const_cast<BView *>(this);
|
||||||
|
|
||||||
|
BView *child = first_child;
|
||||||
|
while (child != NULL) {
|
||||||
|
BView *view = child->FindView(name);
|
||||||
|
if (view != NULL)
|
||||||
|
return view;
|
||||||
|
|
||||||
|
child = child->next_sibling;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3799,25 +3814,6 @@ BView::deleteView(BView* view)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BView *
|
|
||||||
BView::findView(const BView *view, const char *viewName) const
|
|
||||||
{
|
|
||||||
if (!strcmp(viewName, view->Name()))
|
|
||||||
return const_cast<BView *>(view);
|
|
||||||
|
|
||||||
BView *child = view->first_child;
|
|
||||||
while (child != NULL) {
|
|
||||||
BView *view;
|
|
||||||
if ((view = findView(child, viewName)) != NULL)
|
|
||||||
return view;
|
|
||||||
|
|
||||||
child = child->next_sibling;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BView::setCachedState()
|
BView::setCachedState()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user