]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wrong return value from wxWebViewIE::Find() in 64 bit build.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 12 Jul 2013 14:12:38 +0000 (14:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 12 Jul 2013 14:12:38 +0000 (14:12 +0000)
Using wxNOT_FOUND and an unsigned size() return value in the same operator ?:
resulted in wxNOT_FOUND being converted to an unsigned size_t type and while
converting it back to (signed) long worked in 32 bit builds where long and
size_t have the same size, it was broken in 64 bit builds where their sizes
are different.

Thanks g++ for catching this one.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/webview_ie.cpp

index b3f5e289ef2b613928e6ea4eb7d95e0799a5970e..dc6b42b952e639009d3926dcdd8b945aecaefbc9 100644 (file)
@@ -670,9 +670,13 @@ long wxWebViewIE::Find(const wxString& text, int flags)
     ClearSelection();
     m_findText = text;
     m_findFlags = flags;
-    //find the text and return count.
+    //find the text and return wxNOT_FOUND if there are no matches.
     FindInternal(text, flags, wxWEBVIEW_FIND_ADD_POINTERS);
-    return m_findPointers.empty() ? wxNOT_FOUND : m_findPointers.size();
+    if(m_findPointers.empty())
+        return wxNOT_FOUND;
+
+    // Or their number if there are.
+    return m_findPointers.size();
 }
 
 void wxWebViewIE::SetEditable(bool enable)