summaryrefslogtreecommitdiff
path: root/include/svl
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-11-02 22:13:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-03 16:49:49 +0100
commit41f1b2bd1deaf67a08de240eb806189e122d9852 (patch)
treeade169e514c1091ab45b2ab7b53344392a4b3843 /include/svl
parent6152659e80970883a6a3c0a86cdc3e53008b2009 (diff)
remove pimpl in SfxBroadcaster/SfxListener
and provide an optimised copy constructor, we can avoid a bunch of work. Change-Id: I3a373fbbfab02455e6a65e9036b3629366174379 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105205 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svl')
-rw-r--r--include/svl/SfxBroadcaster.hxx8
-rw-r--r--include/svl/lstner.hxx14
2 files changed, 16 insertions, 6 deletions
diff --git a/include/svl/SfxBroadcaster.hxx b/include/svl/SfxBroadcaster.hxx
index bacef8d2d3ce..847643b8aceb 100644
--- a/include/svl/SfxBroadcaster.hxx
+++ b/include/svl/SfxBroadcaster.hxx
@@ -21,6 +21,7 @@
#include <svl/svldllapi.h>
#include <memory>
+#include <vector>
class SfxListener;
class SfxHint;
@@ -28,8 +29,9 @@ class SfxBroadcasterTest;
class SVL_DLLPUBLIC SfxBroadcaster
{
- struct Impl;
- std::unique_ptr<Impl> mpImpl;
+ /** Contains the positions of removed listeners. */
+ std::vector<size_t> m_RemovedPositions;
+ std::vector<SfxListener*> m_Listeners;
private:
void AddListener( SfxListener& rListener );
@@ -41,7 +43,7 @@ protected:
public:
- SfxBroadcaster();
+ SfxBroadcaster() {}
SfxBroadcaster( const SfxBroadcaster &rBC );
virtual ~SfxBroadcaster() COVERITY_NOEXCEPT_FALSE;
diff --git a/include/svl/lstner.hxx b/include/svl/lstner.hxx
index 1e3aa6becbdd..1b0e8806376b 100644
--- a/include/svl/lstner.hxx
+++ b/include/svl/lstner.hxx
@@ -20,7 +20,12 @@
#define INCLUDED_SVL_LSTNER_HXX
#include <svl/svldllapi.h>
+#include <map>
#include <memory>
+#include <vector>
+#ifdef DBG_UTIL
+#include <sal/backtrace.hxx>
+#endif
class SfxBroadcaster;
class SfxHint;
@@ -37,15 +42,18 @@ enum class DuplicateHandling { Unexpected, Prevent, Allow };
class SVL_DLLPUBLIC SfxListener
{
- struct Impl;
- std::unique_ptr<Impl> mpImpl;
+ std::vector<SfxBroadcaster*> maBCs;
+#ifdef DBG_UTIL
+ std::map<SfxBroadcaster*, std::unique_ptr<sal::BacktraceState>>
+ maCallStacks;
+#endif
private:
const SfxListener& operator=(const SfxListener &) = delete;
public:
- SfxListener();
+ SfxListener() {}
SfxListener( const SfxListener &rCopy );
virtual ~SfxListener() COVERITY_NOEXCEPT_FALSE;