diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-05-11 15:28:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-05-11 20:41:25 +0200 |
commit | 528008104bcb7433f818ab3e8bf10bf1296e09b9 (patch) | |
tree | b5d42005766598341e377b229188a857bd40bb84 /sd/source/ui | |
parent | 5caa7f44b861876afa5b3b8f71e3848abd8875e6 (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/animations/CustomAnimationList.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
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)); } |