include/svl/broadcast.hxx       |    4 +++-
 include/svl/listener.hxx        |   12 ++++++------
 svl/source/notify/broadcast.cxx |    8 --------
 svl/source/notify/listener.cxx  |   18 ------------------
 4 files changed, 9 insertions(+), 33 deletions(-)

New commits:
commit 35fad780879f0909187c7fa3cb3345814bdceb8c
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Sun Mar 6 08:31:20 2022 +0100
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Sun Mar 6 10:54:07 2022 +0100

    make a bunch of SvtBroadcaster/SvtListeners functions inline
    
    These classes are used extensively during some operations in Calc,
    and not even LTO can inline these when they end up in different
    binaries.
    
    Change-Id: I5b17a004c6cc039508b76d557d58714c83f237a5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131071
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/include/svl/broadcast.hxx b/include/svl/broadcast.hxx
index eaf4de8ba448..3c9f64967909 100644
--- a/include/svl/broadcast.hxx
+++ b/include/svl/broadcast.hxx
@@ -50,7 +50,9 @@ protected:
     virtual void            ListenersGone();
 
 public:
-                            SvtBroadcaster();
+                            SvtBroadcaster()
+                                : mnEmptySlots(0), 
mnListenersFirstUnsorted(0), mbAboutToDie(false)
+                                , mbDisposing(false), mbDestNormalized(true) {}
                             SvtBroadcaster( const SvtBroadcaster &rBC );
     virtual                 ~SvtBroadcaster();
 
diff --git a/include/svl/listener.hxx b/include/svl/listener.hxx
index 636e69d9cf8b..e7c589625304 100644
--- a/include/svl/listener.hxx
+++ b/include/svl/listener.hxx
@@ -41,14 +41,14 @@ public:
     {
         sal_uInt16 mnId;
     public:
-        QueryBase( sal_uInt16 nId );
-        virtual ~QueryBase();
+        QueryBase( sal_uInt16 nId ) : mnId(nId) {}
+        virtual ~QueryBase() {};
 
-        sal_uInt16 getId() const;
+        sal_uInt16 getId() const { return mnId; }
     };
 
-    SvtListener();
-    SvtListener( const SvtListener &r );
+    SvtListener() = default;
+    SvtListener( const SvtListener &r ) = default;
     virtual ~SvtListener() COVERITY_NOEXCEPT_FALSE;
 
     bool StartListening( SvtBroadcaster& rBroadcaster );
@@ -57,7 +57,7 @@ public:
 
     /// Overwrites existing broadcasters with the ones from the specified 
listener
     void CopyAllBroadcasters( const SvtListener& r );
-    bool HasBroadcaster() const;
+    bool HasBroadcaster() const { return !maBroadcasters.empty(); }
 
     virtual void Notify( const SfxHint& rHint );
     virtual void Query( QueryBase& rQuery ) const;
diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx
index 54373115c9db..042d1dacaae3 100644
--- a/svl/source/notify/broadcast.cxx
+++ b/svl/source/notify/broadcast.cxx
@@ -177,14 +177,6 @@ void SvtBroadcaster::Remove( SvtListener* p )
         ListenersGone();
 }
 
-SvtBroadcaster::SvtBroadcaster()
-    : mnEmptySlots(0)
-    , mnListenersFirstUnsorted(0)
-    , mbAboutToDie(false)
-    , mbDisposing(false)
-    , mbDestNormalized(true)
-{}
-
 SvtBroadcaster::SvtBroadcaster( const SvtBroadcaster &rBC ) :
     mnEmptySlots(0), mnListenersFirstUnsorted(0),
     mbAboutToDie(false), mbDisposing(false),
diff --git a/svl/source/notify/listener.cxx b/svl/source/notify/listener.cxx
index 172dbdb8b31d..6b1be0ca20b4 100644
--- a/svl/source/notify/listener.cxx
+++ b/svl/source/notify/listener.cxx
@@ -20,18 +20,6 @@
 #include <svl/listener.hxx>
 #include <svl/broadcast.hxx>
 
-SvtListener::QueryBase::QueryBase( sal_uInt16 nId ) : mnId(nId) {}
-SvtListener::QueryBase::~QueryBase() {}
-
-sal_uInt16 SvtListener::QueryBase::getId() const
-{
-    return mnId;
-}
-
-SvtListener::SvtListener() {}
-
-SvtListener::SvtListener( const SvtListener & )  {}
-
 SvtListener::~SvtListener() COVERITY_NOEXCEPT_FALSE
 {
     // Unregister itself from all broadcasters it's listening to.
@@ -94,14 +82,8 @@ void SvtListener::CopyAllBroadcasters( const SvtListener& r )
     }
 }
 
-bool SvtListener::HasBroadcaster() const
-{
-    return !maBroadcasters.empty();
-}
-
 void SvtListener::Notify( const SfxHint& /*rHint*/ ) {}
 
 void SvtListener::Query( QueryBase& /*rQuery*/ ) const {}
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to