diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-14 14:39:05 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-06-17 13:00:11 +0200 |
commit | a4d78bbbd7b264d3445a0adc9b25bc008eaea10b (patch) | |
tree | 82d22910e97a003507e46617b6b2d0351167da63 /svx | |
parent | 5736fce7d4ce35f4ab1aab17b47917a22e5f35cc (diff) |
Resolves: tdf#142767 cannot use itemid of 0 in ValueSets
Change-Id: I2c2b655b512e4e7869fe3784f1b073ecdbd0dac9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117123
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/shapes/DefaultShapesPanel.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx index 8b97bb5ee4d1..5bdf70ff6e68 100644 --- a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx +++ b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx @@ -121,8 +121,8 @@ IMPL_LINK(DefaultShapesPanel, ShapeSelectHdl, ValueSet*, rValueSet, void) { if(rValueSet == aSetMap.first) { - int aSelection = aSetMap.first->GetSelectedItemId(); - comphelper::dispatchCommand(aSetMap.second[aSelection], {}); + sal_uInt16 nSelectionId = aSetMap.first->GetSelectedItemId(); + comphelper::dispatchCommand(aSetMap.second[nSelectionId - 1], {}); } else aSetMap.first->SetNoSelection(); @@ -143,7 +143,8 @@ void DefaultShapesPanel::populateShapes() auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(sSlotStr, vcl::CommandInfoProvider::GetModuleIdentifier(mxFrame)); sLabel = vcl::CommandInfoProvider::GetTooltipForCommand(sSlotStr, aProperties, mxFrame); - aSet.first->InsertItem(i, aSlotImage, sLabel); + sal_uInt16 nSelectionId = i + 1; // tdf#142767 id 0 is reserved for nothing-selected + aSet.first->InsertItem(nSelectionId, aSlotImage, sLabel); } } } |