]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct wxDataViewCtrl::IsExpanded
authorRobert Roebling <robert@roebling.de>
Mon, 15 Jun 2009 19:30:09 +0000 (19:30 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 15 Jun 2009 19:30:09 +0000 (19:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61064 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/dataview.cpp

index bbc49a00d60c59e05ebabf96afaa500f1cba3f60..a34d489cae82d0ea34cd823a17864f4c23c6b96e 100644 (file)
@@ -995,11 +995,12 @@ wxRect wxMacDataViewDataBrowserListViewControl::GetRectangle(wxDataViewItem cons
 
 bool wxMacDataViewDataBrowserListViewControl::IsExpanded(wxDataViewItem const& item) const
 {
-  DataBrowserItemState state;
+  DataBrowserItemState state = 0;
 
+  if (this->GetItemState(reinterpret_cast<DataBrowserItemID>(item.GetID()),&state) != noErr)
+     return false;
 
-  return ((this->GetItemState(reinterpret_cast<DataBrowserItemID>(item.GetID()),&state) == noErr) &&
-          (state & kDataBrowserContainerIsOpen != 0));
+  return ((state & kDataBrowserContainerIsOpen) != 0);
 }
 
 bool wxMacDataViewDataBrowserListViewControl::Reload(void)