sd/source/ui/animations/CustomAnimationList.cxx | 9 +++++++++ 1 file changed, 9 insertions(+)
New commits: commit 528008104bcb7433f818ab3e8bf10bf1296e09b9 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed May 11 15:28:23 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed May 11 20:41:25 2022 +0200 tdf#149029 Scroll to the selected object in the Animation panel on selecting Change-Id: I2c14f9c6df74d4534c936b392f0e066dabebea9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134172 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 9dcde6d8e9a2..db8bcf126405 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -931,6 +931,8 @@ static void selectShape(weld::TreeView* pTreeList, const Reference< XShape >& xS if (!pTreeList->get_iter_first(*xEntry)) return; + bool bFirstEntry = true; + do { CustomAnimationListEntryItem* pEntry = weld::fromId<CustomAnimationListEntryItem*>(pTreeList->get_id(*xEntry)); @@ -938,7 +940,14 @@ static void selectShape(weld::TreeView* pTreeList, const Reference< XShape >& xS if (pEffect) { if (pEffect->getTarget() == xShape) + { pTreeList->select(*xEntry); + if (bFirstEntry) + { + pTreeList->scroll_to_row(*xEntry); + bFirstEntry = false; + } + } } } while (pTreeList->iter_next(*xEntry)); }