diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 7e2c3f260e..01e8a8c354 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -227,7 +227,7 @@ void wxDataViewColumn::SetSortOrder(bool ascending) m_owner->UseColumnForSorting(idx); m_sort = true; } - + m_sortAscending = ascending; // Call this directly instead of using UpdateDisplay() as we already have @@ -3381,42 +3381,42 @@ void wxDataViewMainWindow::Collapse(unsigned int row) if (!node->HasChildren()) return; - if (node->IsOpen()) + if (node->IsOpen()) + { + if ( !SendExpanderEvent(wxEVT_DATAVIEW_ITEM_COLLAPSING,node->GetItem()) ) { - if ( !SendExpanderEvent(wxEVT_DATAVIEW_ITEM_COLLAPSING,node->GetItem()) ) - { - // Vetoed by the event handler. - return; - } - - const unsigned countDeletedRows = node->GetSubTreeCount(); - - if ( m_selection.OnItemsDeleted(row + 1, countDeletedRows) ) - { - SendSelectionChangedEvent(GetItemByRow(row)); - } - - node->ToggleOpen(); - - // Adjust the current row if necessary. - if ( m_currentRow > row ) - { - // If the current row was among the collapsed items, make the - // parent itself current. - if ( m_currentRow <= row + countDeletedRows ) - ChangeCurrentRow(row); - else // Otherwise just update the index. - ChangeCurrentRow(m_currentRow - countDeletedRows); - } - - if ( m_count != -1 ) - m_count -= countDeletedRows; - - GetOwner()->InvalidateColBestWidths(); - - UpdateDisplay(); - SendExpanderEvent(wxEVT_DATAVIEW_ITEM_COLLAPSED,node->GetItem()); + // Vetoed by the event handler. + return; } + + const unsigned countDeletedRows = node->GetSubTreeCount(); + + if ( m_selection.OnItemsDeleted(row + 1, countDeletedRows) ) + { + SendSelectionChangedEvent(GetItemByRow(row)); + } + + node->ToggleOpen(); + + // Adjust the current row if necessary. + if ( m_currentRow > row ) + { + // If the current row was among the collapsed items, make the + // parent itself current. + if ( m_currentRow <= row + countDeletedRows ) + ChangeCurrentRow(row); + else // Otherwise just update the index. + ChangeCurrentRow(m_currentRow - countDeletedRows); + } + + if ( m_count != -1 ) + m_count -= countDeletedRows; + + GetOwner()->InvalidateColBestWidths(); + + UpdateDisplay(); + SendExpanderEvent(wxEVT_DATAVIEW_ITEM_COLLAPSED,node->GetItem()); + } } wxDataViewTreeNode * wxDataViewMainWindow::FindNode( const wxDataViewItem & item ) diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index a1a24a47d2..82825ed324 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -1124,11 +1124,11 @@ bool wxRegKey::GetFirstValue(wxString& strValueName, long& lIndex) bool wxRegKey::GetNextValue(wxString& strValueName, long& lIndex) const { - wxASSERT( IsOpened() ); + wxASSERT( IsOpened() ); - // are we already at the end of enumeration? - if ( lIndex == -1 ) - return false; + // are we already at the end of enumeration? + if ( lIndex == -1 ) + return false; wxChar szValueName[1024]; // @@ use RegQueryInfoKey... DWORD dwValueLen = WXSIZEOF(szValueName); diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 0efefb363a..327a01788d 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -1633,7 +1633,7 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord x, wxCoord y) const // it's a separator or there is no tool at all there return NULL; - return m_tools.Item((size_t)index)->GetData(); + return m_tools.Item((size_t)index)->GetData(); } void wxToolBar::UpdateSize()