compilation fix (not all paths returned a value)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-06-01 22:33:06 +00:00
parent adf2eb2d34
commit 6d41981d89

View File

@@ -637,7 +637,7 @@ const wxHtmlCell* wxHtmlContainerCell::Find(int condition, const void* param) co
wxHtmlCell *wxHtmlContainerCell::FindCellByPos(wxCoord x, wxCoord y, wxHtmlCell *wxHtmlContainerCell::FindCellByPos(wxCoord x, wxCoord y,
unsigned flags) const unsigned flags) const
{ {
if (flags & wxHTML_FIND_EXACT) if ( flags & wxHTML_FIND_EXACT )
{ {
for ( const wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext() ) for ( const wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext() )
{ {
@@ -650,10 +650,8 @@ wxHtmlCell *wxHtmlContainerCell::FindCellByPos(wxCoord x, wxCoord y,
return cell->FindCellByPos(x - cx, y - cy, flags); return cell->FindCellByPos(x - cx, y - cy, flags);
} }
} }
return NULL;
} }
else if ( flags & wxHTML_FIND_NEAREST_AFTER )
if ( flags & wxHTML_FIND_NEAREST_AFTER )
{ {
wxHtmlCell *c; wxHtmlCell *c;
int y2; int y2;
@@ -666,24 +664,22 @@ wxHtmlCell *wxHtmlContainerCell::FindCellByPos(wxCoord x, wxCoord y,
flags); flags);
if (c) return c; if (c) return c;
} }
return NULL;
} }
else if ( flags & wxHTML_FIND_NEAREST_BEFORE )
if ( flags & wxHTML_FIND_NEAREST_BEFORE )
{ {
wxHtmlCell *c = NULL; wxHtmlCell *c;
wxHtmlCell *cx;
for ( const wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext() ) for ( const wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext() )
{ {
if (cell->GetPosY() > y || if (cell->GetPosY() > y ||
(cell->GetPosY() == y && cell->GetPosX() > x)) (cell->GetPosY() == y && cell->GetPosX() > x))
break; break;
cx = cell->FindCellByPos(x - cell->GetPosX(), y - cell->GetPosY(), c = cell->FindCellByPos(x - cell->GetPosX(), y - cell->GetPosY(),
flags); flags);
if (cx) c = cx; if (c) return c;
} }
return c;
} }
return NULL;
} }