summaryrefslogtreecommitdiff
path: root/svl/source/notify
diff options
context:
space:
mode:
authorPhilipp Hofer <philipp.hofer@protonmail.com>2020-11-12 13:18:48 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-11-16 11:44:30 +0100
commit580b4c5f945df4e98bc2bacdf3620da688b2dbdf (patch)
tree4e428d83dad09dd13cb1c34ae6c74fbd8fa487e7 /svl/source/notify
parent69397a13d9458174ea3d0160cb65d77ac83c205c (diff)
tdf#123936 Formatting files in module svl with clang-format
Change-Id: Iaaac34428ef0e5b8f09f6cbcad16ea5bab145321 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105714 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'svl/source/notify')
-rw-r--r--svl/source/notify/SfxBroadcaster.cxx51
-rw-r--r--svl/source/notify/hint.cxx7
-rw-r--r--svl/source/notify/isethint.cxx11
3 files changed, 22 insertions, 47 deletions
diff --git a/svl/source/notify/SfxBroadcaster.cxx b/svl/source/notify/SfxBroadcaster.cxx
index 6e1629bff9d5..dbd1ab3a7191 100644
--- a/svl/source/notify/SfxBroadcaster.cxx
+++ b/svl/source/notify/SfxBroadcaster.cxx
@@ -27,17 +27,16 @@
#include <cassert>
#include <vector>
-
// broadcast immediately
-void SfxBroadcaster::Broadcast( const SfxHint &rHint )
+void SfxBroadcaster::Broadcast(const SfxHint& rHint)
{
// notify all registered listeners exactly once
for (size_t i = 0; i < m_Listeners.size(); ++i)
{
- SfxListener *const pListener = m_Listeners[i];
+ SfxListener* const pListener = m_Listeners[i];
if (pListener)
- pListener->Notify( *this, rHint );
+ pListener->Notify(*this, rHint);
}
}
@@ -45,34 +44,32 @@ void SfxBroadcaster::Broadcast( const SfxHint &rHint )
SfxBroadcaster::~SfxBroadcaster() COVERITY_NOEXCEPT_FALSE
{
- Broadcast( SfxHint(SfxHintId::Dying) );
+ Broadcast(SfxHint(SfxHintId::Dying));
// remove all still registered listeners
for (size_t i = 0; i < m_Listeners.size(); ++i)
{
- SfxListener *const pListener = m_Listeners[i];
+ SfxListener* const pListener = m_Listeners[i];
if (pListener)
pListener->RemoveBroadcaster_Impl(*this);
}
}
-
// copy ctor of class SfxBroadcaster
-SfxBroadcaster::SfxBroadcaster( const SfxBroadcaster &rOther )
+SfxBroadcaster::SfxBroadcaster(const SfxBroadcaster& rOther)
{
for (size_t i = 0; i < rOther.m_Listeners.size(); ++i)
{
- SfxListener *const pListener = rOther.m_Listeners[i];
+ SfxListener* const pListener = rOther.m_Listeners[i];
if (pListener)
- pListener->StartListening( *this );
+ pListener->StartListening(*this);
}
}
-
// add a new SfxListener to the list
-void SfxBroadcaster::AddListener( SfxListener& rListener )
+void SfxBroadcaster::AddListener(SfxListener& rListener)
{
DBG_TESTSOLARMUTEX();
if (m_RemovedPositions.empty())
@@ -88,23 +85,21 @@ void SfxBroadcaster::AddListener( SfxListener& rListener )
}
}
-
// forward a notification to all registered listeners
void SfxBroadcaster::Forward(SfxBroadcaster& rBC, const SfxHint& rHint)
{
for (size_t i = 0; i < m_Listeners.size(); ++i)
{
- SfxListener *const pListener = m_Listeners[i];
+ SfxListener* const pListener = m_Listeners[i];
if (pListener)
- pListener->Notify( rBC, rHint );
+ pListener->Notify(rBC, rHint);
}
}
-
// remove one SfxListener from the list
-void SfxBroadcaster::RemoveListener( SfxListener& rListener )
+void SfxBroadcaster::RemoveListener(SfxListener& rListener)
{
DBG_TESTSOLARMUTEX();
@@ -114,13 +109,13 @@ void SfxBroadcaster::RemoveListener( SfxListener& rListener )
if (!m_RemovedPositions.empty())
{
auto i = m_RemovedPositions.back();
- if (i < m_Listeners.size() - 2 && m_Listeners[i+1] == &rListener)
+ if (i < m_Listeners.size() - 2 && m_Listeners[i + 1] == &rListener)
{
positionOfRemovedElement = i + 1;
}
- else if (i > 0 && m_Listeners[i-1] == &rListener)
+ else if (i > 0 && m_Listeners[i - 1] == &rListener)
{
- positionOfRemovedElement = i-1;
+ positionOfRemovedElement = i - 1;
}
}
// then scan the whole list if we didn't find it
@@ -135,10 +130,7 @@ void SfxBroadcaster::RemoveListener( SfxListener& rListener )
m_RemovedPositions.push_back(positionOfRemovedElement);
}
-bool SfxBroadcaster::HasListeners() const
-{
- return (GetListenerCount() != 0);
-}
+bool SfxBroadcaster::HasListeners() const { return (GetListenerCount() != 0); }
size_t SfxBroadcaster::GetListenerCount() const
{
@@ -146,15 +138,8 @@ size_t SfxBroadcaster::GetListenerCount() const
return m_Listeners.size() - m_RemovedPositions.size();
}
-size_t SfxBroadcaster::GetSizeOfVector() const
-{
- return m_Listeners.size();
-}
-
-SfxListener* SfxBroadcaster::GetListener( size_t nNo ) const
-{
- return m_Listeners[nNo];
-}
+size_t SfxBroadcaster::GetSizeOfVector() const { return m_Listeners.size(); }
+SfxListener* SfxBroadcaster::GetListener(size_t nNo) const { return m_Listeners[nNo]; }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/notify/hint.cxx b/svl/source/notify/hint.cxx
index ad36d5098e1c..72cac43ef9a9 100644
--- a/svl/source/notify/hint.cxx
+++ b/svl/source/notify/hint.cxx
@@ -17,15 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <svl/hint.hxx>
-
// virtual dtor for the typical base-class Hint
-SfxHint::~SfxHint() COVERITY_NOEXCEPT_FALSE
-{
-}
-
+SfxHint::~SfxHint() COVERITY_NOEXCEPT_FALSE {}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/notify/isethint.cxx b/svl/source/notify/isethint.cxx
index 6f810240a76d..2ac61804312b 100644
--- a/svl/source/notify/isethint.cxx
+++ b/svl/source/notify/isethint.cxx
@@ -17,22 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <svl/isethint.hxx>
#include <svl/itemset.hxx>
-
/**
* Copies the SfxItemSet passed as a parameter.
*/
-SfxItemSetHint::SfxItemSetHint( const SfxItemSet &rItemSet )
-: _pItemSet( rItemSet.Clone() )
-{
-}
-
-SfxItemSetHint::~SfxItemSetHint()
+SfxItemSetHint::SfxItemSetHint(const SfxItemSet& rItemSet)
+ : _pItemSet(rItemSet.Clone())
{
}
+SfxItemSetHint::~SfxItemSetHint() {}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */