]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed #11212 [RichText sample] Assert/Crash when Styles combo box opened
authorJulian Smart <julian@anthemion.co.uk>
Wed, 18 Nov 2009 14:01:21 +0000 (14:01 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 18 Nov 2009 14:01:21 +0000 (14:01 +0000)
Patch by Catalin

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

src/richtext/richtextstyles.cpp

index 1d05028cd870e7acbb395f28acb3d764a115915c..731634e4925171870acf8f91e9c4fe6df7df31a3 100644 (file)
@@ -753,7 +753,7 @@ void wxRichTextStyleListBox::OnLeftDown(wxMouseEvent& event)
 {
     wxVListBox::OnLeftDown(event);
 
-    int item = HitTest(event.GetPosition());
+    int item = VirtualHitTest(event.GetPosition().y);
     if (item != wxNOT_FOUND && GetApplyOnSelection())
         ApplyStyle(item);
 }
@@ -762,7 +762,7 @@ void wxRichTextStyleListBox::OnLeftDoubleClick(wxMouseEvent& event)
 {
     wxVListBox::OnLeftDown(event);
 
-    int item = HitTest(event.GetPosition());
+    int item = VirtualHitTest(event.GetPosition().y);
     if (item != wxNOT_FOUND && !GetApplyOnSelection())
         ApplyStyle(item);
 }
@@ -1099,7 +1099,7 @@ void wxRichTextStyleComboPopup::OnMouseMove(wxMouseEvent& event)
 {
     // Move selection to cursor if it is inside the popup
 
-    int itemHere = wxRichTextStyleListBox::HitTest(event.GetPosition());
+    int itemHere = wxRichTextStyleListBox::VirtualHitTest(event.GetPosition().y);
     if ( itemHere >= 0 )
     {
         wxRichTextStyleListBox::SetSelection(itemHere);