cui/source/customize/macropg.cxx |   49 +++++++++++++++++++--------------------
 cui/source/inc/macropg.hxx       |    2 -
 2 files changed, 25 insertions(+), 26 deletions(-)

New commits:
commit 4702910165dff6d5cef0d1bc707ff66b0b0d95bd
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Dec 9 10:30:34 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Dec 9 12:37:20 2022 +0000

    drop unnecessary pThis indirection
    
    Change-Id: I28c338a4f09036c9365937af99cb85fd4be95901
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143847
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index db36fe10713a..a1fe3dab39dc 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -375,20 +375,19 @@ IMPL_LINK_NOARG( SvxMacroTabPage_, SelectEvent_Impl, 
weld::TreeView&, void)
 
 IMPL_LINK( SvxMacroTabPage_, AssignDeleteHdl_Impl, weld::Button&, rBtn, void )
 {
-    GenericHandler_Impl(this, &rBtn);
+    GenericHandler_Impl(&rBtn);
 }
 
 IMPL_LINK_NOARG( SvxMacroTabPage_, DoubleClickHdl_Impl, weld::TreeView&, bool)
 {
-    GenericHandler_Impl(this, nullptr);
+    GenericHandler_Impl(nullptr);
     return true;
 }
 
 // handler for double click on the listbox, and for the assign/delete buttons
-void SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, const 
weld::Button* pBtn)
+void SvxMacroTabPage_::GenericHandler_Impl(const weld::Button* pBtn)
 {
-    SvxMacroTabPage_Impl*    pImpl = pThis->mpImpl.get();
-    weld::TreeView& rListBox = *pImpl->xEventLB;
+    weld::TreeView& rListBox = *mpImpl->xEventLB;
     int nEntry = rListBox.get_selected_index();
     if (nEntry == -1)
     {
@@ -396,16 +395,16 @@ void 
SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, const weld::
         return;
     }
 
-    const bool bAssEnabled = pBtn != pImpl->xDeletePB.get() && 
pImpl->xAssignPB->get_sensitive();
+    const bool bAssEnabled = pBtn != mpImpl->xDeletePB.get() && 
mpImpl->xAssignPB->get_sensitive();
 
     OUString sEventName = rListBox.get_id(nEntry);
 
     OUString sEventURL;
     OUString sEventType;
-    if(pThis->bAppEvents)
+    if (bAppEvents)
     {
-        EventsHash::iterator h_it = pThis->m_appEventsHash.find(sEventName);
-        if(h_it != pThis->m_appEventsHash.end() )
+        EventsHash::iterator h_it = m_appEventsHash.find(sEventName);
+        if (h_it != m_appEventsHash.end() )
         {
             sEventType = h_it->second.first;
             sEventURL = h_it->second.second;
@@ -413,8 +412,8 @@ void 
SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, const weld::
     }
     else
     {
-        EventsHash::iterator h_it = pThis->m_docEventsHash.find(sEventName);
-        if(h_it != pThis->m_docEventsHash.end() )
+        EventsHash::iterator h_it = m_docEventsHash.find(sEventName);
+        if (h_it != m_docEventsHash.end() )
         {
             sEventType = h_it->second.first;
             sEventURL = h_it->second.second;
@@ -423,57 +422,57 @@ void 
SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, const weld::
 
     bool bDoubleClick = (pBtn == nullptr);
     bool bUNOAssigned = sEventURL.startsWith( aVndSunStarUNO );
-    if( pBtn == pImpl->xDeletePB.get() )
+    if (pBtn == mpImpl->xDeletePB.get())
     {
         // delete pressed
         sEventType =  "Script" ;
         sEventURL.clear();
-        if(!pThis->bAppEvents)
-            pThis->bDocModified = true;
+        if (!bAppEvents)
+            bDocModified = true;
     }
     else if (   (   ( pBtn != nullptr )
-                &&  ( pBtn == pImpl->xAssignComponentPB.get() )
+                &&  ( pBtn == mpImpl->xAssignComponentPB.get() )
                 )
             ||  (   bDoubleClick
                 &&  bUNOAssigned
                 )
             )
     {
-        AssignComponentDialog aAssignDlg(pThis->GetFrameWeld(), sEventURL);
+        AssignComponentDialog aAssignDlg(GetFrameWeld(), sEventURL);
 
         short ret = aAssignDlg.run();
         if( ret )
         {
             sEventType = "UNO";
             sEventURL = aAssignDlg.getURL();
-            if(!pThis->bAppEvents)
-                pThis->bDocModified = true;
+            if (!bAppEvents)
+                bDocModified = true;
         }
     }
     else if( bAssEnabled )
     {
         // assign pressed
-        SvxScriptSelectorDialog aDlg(pThis->GetFrameWeld(), pThis->GetFrame());
+        SvxScriptSelectorDialog aDlg(GetFrameWeld(), GetFrame());
         short ret = aDlg.run();
         if ( ret )
         {
             sEventType = "Script";
             sEventURL = aDlg.GetScriptURL();
-            if(!pThis->bAppEvents)
-                pThis->bDocModified = true;
+            if (!bAppEvents)
+                bDocModified = true;
         }
     }
 
     // update the hashes
-    if(pThis->bAppEvents)
+    if (bAppEvents)
     {
-        EventsHash::iterator h_it = pThis->m_appEventsHash.find(sEventName);
+        EventsHash::iterator h_it = m_appEventsHash.find(sEventName);
         h_it->second.first = sEventType;
         h_it->second.second = sEventURL;
     }
     else
     {
-        EventsHash::iterator h_it = pThis->m_docEventsHash.find(sEventName);
+        EventsHash::iterator h_it = m_docEventsHash.find(sEventName);
         h_it->second.first = sEventType;
         h_it->second.second = sEventURL;
     }
@@ -484,7 +483,7 @@ void 
SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, const weld::
     rListBox.select(nEntry );
     rListBox.scroll_to_row(nEntry);
 
-    pThis->EnableButtons();
+    EnableButtons();
 }
 
 // pass in the XNameReplace.
diff --git a/cui/source/inc/macropg.hxx b/cui/source/inc/macropg.hxx
index 39e4ef284384..ef9e16c51bba 100644
--- a/cui/source/inc/macropg.hxx
+++ b/cui/source/inc/macropg.hxx
@@ -55,7 +55,7 @@ class SvxMacroTabPage_ : public SfxTabPage
     DECL_LINK( AssignDeleteHdl_Impl, weld::Button&, void );
     DECL_LINK( DoubleClickHdl_Impl, weld::TreeView&, bool );
 
-    static void GenericHandler_Impl( SvxMacroTabPage_* pThis, const 
weld::Button* pBtn );
+    void GenericHandler_Impl(const weld::Button* pBtn);
 
     css::uno::Reference< css::container::XNameReplace > m_xAppEvents;
 protected:

Reply via email to