Browse Source

now passing SparseSet<int> as const& instead of by value in ListBox::createSnapshotOfRows/startDragAndDrop.

tags/2021-05-28
Timur Doumler 10 years ago
parent
commit
ca6aa75bc8
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      modules/juce_gui_basics/widgets/juce_ListBox.cpp
  2. +2
    -2
      modules/juce_gui_basics/widgets/juce_ListBox.h

+ 2
- 2
modules/juce_gui_basics/widgets/juce_ListBox.cpp View File

@@ -886,7 +886,7 @@ void ListBox::repaintRow (const int rowNumber) noexcept
repaint (getRowPosition (rowNumber, true));
}
Image ListBox::createSnapshotOfRows (SparseSet<int> rows, int& imageX, int& imageY)
Image ListBox::createSnapshotOfRows (const SparseSet<int>& rows, int& imageX, int& imageY)
{
Rectangle<int> imageArea;
const int firstRow = getRowContainingPosition (0, viewport->getY());
@@ -929,7 +929,7 @@ Image ListBox::createSnapshotOfRows (SparseSet<int> rows, int& imageX, int& imag
return snapshot;
}
void ListBox::startDragAndDrop (const MouseEvent& e, SparseSet<int> rowsToDrag, const var& dragDescription, bool allowDraggingToOtherWindows)
void ListBox::startDragAndDrop (const MouseEvent& e, const SparseSet<int>& rowsToDrag, const var& dragDescription, bool allowDraggingToOtherWindows)
{
if (DragAndDropContainer* const dragContainer = DragAndDropContainer::findParentDragContainerFor (this))
{


+ 2
- 2
modules/juce_gui_basics/widgets/juce_ListBox.h View File

@@ -530,7 +530,7 @@ public:
@see Component::createComponentSnapshot
*/
virtual Image createSnapshotOfRows (SparseSet<int> rows, int& x, int& y);
virtual Image createSnapshotOfRows (const SparseSet<int>& rows, int& x, int& y);
/** Returns the viewport that this ListBox uses.
@@ -561,7 +561,7 @@ public:
/** @internal */
void parentHierarchyChanged() override;
/** @internal */
void startDragAndDrop (const MouseEvent&, SparseSet<int> rowsToDrag,
void startDragAndDrop (const MouseEvent&, const SparseSet<int>& rowsToDrag,
const var& dragDescription, bool allowDraggingToOtherWindows);
private:


Loading…
Cancel
Save