summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-06-14 14:39:05 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-06-15 09:41:09 +0200
commitea48cb21bb3b5f8a4f1a01987d393bddb9985a8e (patch)
tree1870802910eebcd3fe66966bad7f462a21b3be88
parent2f851dd40543aff46e75c739120b41d7f1ae1160 (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>
-rw-r--r--svx/source/sidebar/shapes/DefaultShapesPanel.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
index 3d52ae23fb0d..cbbde9196953 100644
--- a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
+++ b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
@@ -130,8 +130,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();
@@ -152,7 +152,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);
}
}
}