From 1b48beaaf07513d9924b3b84e148957d4e69cfa2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 12 Jul 2013 14:12:38 +0000 Subject: [PATCH] Fix wrong return value from wxWebViewIE::Find() in 64 bit build. 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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index b3f5e289ef..dc6b42b952 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -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)