]> git.saurik.com Git - wxWidgets.git/commitdiff
compilation fix (not all paths returned a value)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 1 Jun 2003 22:33:06 +0000 (22:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 1 Jun 2003 22:33:06 +0000 (22:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/htmlcell.cpp

index b54d5d19538e932ed7ab439ff2b2e21c1b4ad884..ad79eb042fc0c6d4feb8a15ef7a42c0f3d89bf2d 100644 (file)
@@ -637,7 +637,7 @@ const wxHtmlCell* wxHtmlContainerCell::Find(int condition, const void* param) co
 wxHtmlCell *wxHtmlContainerCell::FindCellByPos(wxCoord x, wxCoord y,
                                                unsigned flags) const
 {
-    if (flags & wxHTML_FIND_EXACT)
+    if ( flags & wxHTML_FIND_EXACT )
     {
         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 NULL;
     }
-
-    if ( flags & wxHTML_FIND_NEAREST_AFTER )
+    else if ( flags & wxHTML_FIND_NEAREST_AFTER )
     {
         wxHtmlCell *c;
         int y2;
@@ -666,24 +664,22 @@ wxHtmlCell *wxHtmlContainerCell::FindCellByPos(wxCoord x, wxCoord y,
                                     flags);
             if (c) return c;
         }
-        return NULL;
     }
-
-    if ( flags & wxHTML_FIND_NEAREST_BEFORE )
+    else if ( flags & wxHTML_FIND_NEAREST_BEFORE )
     {
-        wxHtmlCell *c = NULL;
-        wxHtmlCell *cx;
+        wxHtmlCell *c;
         for ( const wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext() )
         {
             if (cell->GetPosY() > y || 
                     (cell->GetPosY() == y && cell->GetPosX() > x))
                 break;
-            cx = cell->FindCellByPos(x - cell->GetPosX(), y - cell->GetPosY(),
-                                     flags);
-            if (cx) c = cx;
+            c = cell->FindCellByPos(x - cell->GetPosX(), y - cell->GetPosY(),
+                                    flags);
+            if (c) return c;
         }
-        return c;
     }
+
+    return NULL;
 }