Use the already defined wxGridBlockCoordsVector type (defined in grid.h)
instead of introducing a new one, i.e. wxVectorGridBlockCoords
This commit is contained in:
ali kettab 2022-09-12 15:53:17 +01:00
parent 0bc6609fbf
commit 40d3649d2e
3 changed files with 6 additions and 7 deletions

View file

@ -19,7 +19,6 @@
#include "wx/vector.h"
typedef wxVector<wxGridBlockCoords> wxVectorGridBlockCoords;
// Note: for all eventType arguments of the methods of this class wxEVT_NULL
// may be passed to forbid events generation completely.
@ -109,7 +108,7 @@ public:
wxArrayInt GetRowSelection() const;
wxArrayInt GetColSelection() const;
wxVectorGridBlockCoords& GetBlocks() { return m_selection; }
wxGridBlockCoordsVector& GetBlocks() { return m_selection; }
void EndSelecting();
void CancelSelecting();
@ -136,7 +135,7 @@ private:
// We don't currently check if the new block is contained by several
// existing blocks, as this would be more difficult and doesn't seem to be
// really needed in practice.
void MergeOrAddBlock(wxVectorGridBlockCoords& blocks,
void MergeOrAddBlock(wxGridBlockCoordsVector& blocks,
const wxGridBlockCoords& block);
// All currently selected blocks. We expect there to be a relatively small
@ -146,7 +145,7 @@ private:
// Selection may be empty, but if it isn't, the last block is special, as
// it is the current block, which is affected by operations such as
// extending the current selection from keyboard.
wxVectorGridBlockCoords m_selection;
wxGridBlockCoordsVector m_selection;
wxGrid *m_grid;
wxGrid::wxGridSelectionModes m_selectionMode;

View file

@ -10948,7 +10948,7 @@ wxGridBlocks wxGrid::GetSelectedBlocks() const
if ( !m_selection )
return wxGridBlocks();
const wxVectorGridBlockCoords& blocks = m_selection->GetBlocks();
const wxGridBlockCoordsVector& blocks = m_selection->GetBlocks();
return wxGridBlocks(blocks.begin(), blocks.end());
}

View file

@ -312,7 +312,7 @@ wxGridSelection::DeselectBlock(const wxGridBlockCoords& block,
// Note: in row/column selection mode, we only need part1 and part2
// Blocks to refresh.
wxVectorGridBlockCoords refreshBlocks;
wxGridBlockCoordsVector refreshBlocks;
// Add the deselected block.
refreshBlocks.push_back(canonicalizedBlock);
@ -882,7 +882,7 @@ wxGridSelection::Select(const wxGridBlockCoords& block,
}
}
void wxGridSelection::MergeOrAddBlock(wxVectorGridBlockCoords& blocks,
void wxGridSelection::MergeOrAddBlock(wxGridBlockCoordsVector& blocks,
const wxGridBlockCoords& newBlock)
{
size_t count = blocks.size();