diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-26 14:05:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-26 21:11:48 +0100 |
commit | c8afb4000f178badaf63c2f38fd3fbc12ec832f3 (patch) | |
tree | 65bb8d7e673e80635bd3adc27c608ad8a90336b6 /toolkit | |
parent | b1e73fd49661e07e6085310f3f6ecc6ade2a3762 (diff) |
tdf#129037 add a way to select multiple entries of a ListBox together
Change-Id: I362a9e9e644e15f0dd3aeb691973a0979d17eeb0
Reviewed-on: https://gerrit.libreoffice.org/83771
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 5645bf099288..50071403d6e5 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -1716,19 +1716,24 @@ void VCLXListBox::selectItemsPos( const css::uno::Sequence<sal_Int16>& aPosition VclPtr< ListBox > pBox = GetAs< ListBox >(); if ( pBox ) { + std::vector<sal_Int32> aPositionVec; + aPositionVec.reserve(aPositions.getLength()); + bool bChanged = false; for ( auto n = aPositions.getLength(); n; ) { const auto nPos = aPositions.getConstArray()[--n]; if ( pBox->IsEntryPosSelected( nPos ) != bool(bSelect) ) { - pBox->SelectEntryPos( nPos, bSelect ); + aPositionVec.push_back(nPos); bChanged = true; } } if ( bChanged ) { + pBox->SelectEntriesPos(aPositionVec, bSelect); + // VCL doesn't call select handler after API call. // ImplCallItemListeners(); |