svtools/source/control/valueset.cxx | 9 +++++++++ 1 file changed, 9 insertions(+)
New commits: commit 2ebc6595ba5ca9b0be4554b5b4f2601b771dd3bb Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Mar 28 16:37:26 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Fri Mar 28 20:04:43 2025 +0100 Resolves: tdf#165881 use position of mouse release for ValueSet select somewhat dubious to my mind, but that's what's wanted and it used to do this, whether by design or chance is unclear. Change-Id: I6f2aa7076e4819b7f310fdabff4f678b331b6c08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183462 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 06fa29977900..a56e6edf763a 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -495,6 +495,15 @@ bool ValueSet::MouseButtonUp( const MouseEvent& rMouseEvent ) { if (rMouseEvent.IsLeft() && !rMouseEvent.IsMod2()) { + // tdf#165881 MouseUp may be seen without previous MouseDown. Select + // what's under the mouse on mouse release when in menu-alike modes. + const bool bMenuAlike = GetStyle() & WB_MENUSTYLEVALUESET || GetStyle() & WB_FLATVALUESET; + if (bMenuAlike) + { + if (ValueSetItem* pItem = ImplGetItem(ImplGetItem(rMouseEvent.GetPosPixel()))) + SelectItem(pItem->mnId); + } + // tdf#142150 MouseUp seen without previous MouseDown if (mnSelItemId) Select();