cui/source/customize/eventdlg.cxx |    4 ++--
 cui/source/customize/macropg.cxx  |    9 ++++-----
 cui/source/inc/macropg.hxx        |    2 +-
 3 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit 0920e5dd036f956ab3956a22e47edbd5f2d57071
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sat Dec 21 20:09:46 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Dec 22 14:10:22 2024 +0100

    Resolves: tdf#161832 select row before update that depends on selection
    
    Change-Id: Ic1d291a68009749ce1464de60a78baf3047ddcc7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179092
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/cui/source/customize/eventdlg.cxx 
b/cui/source/customize/eventdlg.cxx
index 1dc004c33b57..bfdd847f8d31 100644
--- a/cui/source/customize/eventdlg.cxx
+++ b/cui/source/customize/eventdlg.cxx
@@ -125,7 +125,7 @@ IMPL_LINK_NOARG( SvxEventConfigPage, SelectHdl_Impl, 
weld::ComboBox&, void )
     if (bApp)
     {
         SetReadOnly( false );
-        SvxMacroTabPage_::DisplayAppEvents( true );
+        SvxMacroTabPage_::DisplayAppEvents(true, 0);
     }
     else
     {
@@ -151,7 +151,7 @@ IMPL_LINK_NOARG( SvxEventConfigPage, SelectHdl_Impl, 
weld::ComboBox&, void )
         }
 
         SetReadOnly( isReadonly );
-        SvxMacroTabPage_::DisplayAppEvents( false );
+        SvxMacroTabPage_::DisplayAppEvents(false, 0);
     }
 }
 
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index a6b13d5ff5c1..5fe30041a155 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -263,7 +263,7 @@ void SvxMacroTabPage_::Reset( const SfxItemSet* )
     catch (const Exception&)
     {
     }
-    DisplayAppEvents(bAppEvents);
+    DisplayAppEvents(bAppEvents, 0);
 }
 
 void SvxMacroTabPage_::SetReadOnly( bool bSet )
@@ -307,7 +307,7 @@ namespace
 }
 
 // displays the app events if appEvents=true, otherwise displays the doc events
-void SvxMacroTabPage_::DisplayAppEvents( bool appEvents)
+void SvxMacroTabPage_::DisplayAppEvents(bool appEvents, int nSelectIndex)
 {
     bAppEvents = appEvents;
 
@@ -363,7 +363,7 @@ void SvxMacroTabPage_::DisplayAppEvents( bool appEvents)
 
     if (mpImpl->xEventLB->n_children())
     {
-        mpImpl->xEventLB->select(0);
+        mpImpl->xEventLB->select(nSelectIndex);
         mpImpl->xEventLB->scroll_to_row(0);
     }
 
@@ -663,8 +663,7 @@ SvxMacroTabPage::SvxMacroTabPage(weld::Container* pPage, 
weld::DialogController*
     }
 
     InitAndSetHandler( xNameReplace, Reference< 
container::XNameReplace>(nullptr), Reference< util::XModifiable >(nullptr));
-    DisplayAppEvents(true);
-    mpImpl->xEventLB->select(nSelectedIndex);
+    DisplayAppEvents(true, nSelectedIndex);
 }
 
 SvxMacroAssignDlg::SvxMacroAssignDlg(weld::Window* pParent, const Reference< 
frame::XFrame >& _rxDocumentFrame, const SfxItemSet& rSet,
diff --git a/cui/source/inc/macropg.hxx b/cui/source/inc/macropg.hxx
index b40555bb76b9..86d93115b416 100644
--- a/cui/source/inc/macropg.hxx
+++ b/cui/source/inc/macropg.hxx
@@ -73,7 +73,7 @@ public:
 
     virtual void                Reset( const SfxItemSet* ) override;
 
-    void                        DisplayAppEvents( bool appEvents);
+    void                        DisplayAppEvents(bool appEvents, int 
nSelectIndex);
     void                        SetReadOnly( bool bSet );
     bool                        IsReadOnly() const override;
 };

Reply via email to