]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed a 'variable could be used uninitialized' warning
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 10 Sep 2003 12:02:04 +0000 (12:02 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 10 Sep 2003 12:02:04 +0000 (12:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/helpfrm.cpp

index 5c1dffd66e2375f703e846df82f8e01d6d7364e7..e317b2159841a2ca4f22974a6279ef3f6035ae85 100644 (file)
@@ -740,21 +740,29 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword,
     if (foundcnt)
     {
         wxHtmlContentsItem *it;
-        if (mode == wxHELP_SEARCH_ALL)
+        switch ( mode )
         {
-            it = (wxHtmlContentsItem*) m_SearchList->GetClientData(0);
-        }
-        else if (mode == wxHELP_SEARCH_INDEX)
-        {
-            it = (wxHtmlContentsItem*) m_IndexList->GetClientData(0);
+            default:
+                wxFAIL_MSG( _T("unknown help search mode") );
+                // fall back
+
+            case wxHELP_SEARCH_ALL:
+                it = (wxHtmlContentsItem*) m_SearchList->GetClientData(0);
+                break;
+
+            case wxHELP_SEARCH_INDEX:
+                it = (wxHtmlContentsItem*) m_IndexList->GetClientData(0);
+                break;
         }
+
         if (it)
         {
             m_HtmlWin->LoadPage(it->GetFullPath());
             NotifyPageChanged();
         }
     }
-    return (foundcnt > 0);
+
+    return foundcnt > 0;
 }
 
 void wxHtmlHelpFrame::CreateContents()