summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-13 13:23:40 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-14 02:23:43 +0100
commit3fc8c700e5964690b637847294a0b38ac4fbbb02 (patch)
treeb35bcb1333ff1301b9e036148a9f4683e9beb2a6 /sw
parente07c6a6fea726904b5669baa50fc8ea45b4328f8 (diff)
inline trivial SwClient functions
Change-Id: I1672844d0ad7f95d5c5add62703729588190d20f
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/calbck.hxx15
-rw-r--r--sw/source/core/attr/calbck.cxx26
2 files changed, 15 insertions, 26 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 421f61b6f430..fd7785b3888f 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -96,7 +96,7 @@ class SW_DLLPUBLIC SwClient : ::sw::WriterListener
protected:
// single argument ctors shall be explicit.
- explicit SwClient(SwModify *pToRegisterIn);
+ inline explicit SwClient( SwModify* pToRegisterIn );
// write access to pRegisteredIn shall be granted only to the object itself (protected access)
SwModify* GetRegisteredInNonConst() const { return pRegisteredIn; }
@@ -105,7 +105,8 @@ public:
SwClient() : pRegisteredIn(nullptr) {}
virtual ~SwClient();
- virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
+ { CheckRegistration( pOldValue, pNewValue ); }
// in case an SwModify object is destroyed that itself is registered in another SwModify,
// its SwClient objects can decide to get registered to the latter instead by calling this method
@@ -114,7 +115,7 @@ public:
// controlled access to Modify method
// mba: this is still considered a hack and it should be fixed; the name makes grep-ing easier
void ModifyNotification( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ) { this->Modify ( pOldValue, pNewValue ); }
- void SwClientNotifyCall( const SwModify& rModify, const SfxHint& rHint ) { SwClientNotify( rModify, rHint ); }
+ void SwClientNotifyCall( const SwModify& rModify, const SfxHint& rHint ) { SwClientNotify( rModify, rHint ); }
const SwModify* GetRegisteredIn() const { return pRegisteredIn; }
SwModify* GetRegisteredIn() { return pRegisteredIn; }
@@ -123,7 +124,7 @@ public:
TYPEINFO();
// get information about attribute
- virtual bool GetInfo( SfxPoolItem& ) const;
+ virtual bool GetInfo( SfxPoolItem& ) const { return true; }
};
@@ -313,6 +314,12 @@ public:
}
};
+SwClient::SwClient( SwModify* pToRegisterIn )
+ : pRegisteredIn( nullptr )
+{
+ if(pToRegisterIn)
+ pToRegisterIn->Add(this);
+}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index 58fe03ee30f3..350030c376e8 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -26,12 +26,11 @@
TYPEINIT0( SwClient );
-SwClient::SwClient( SwModify* pToRegisterIn )
- : pRegisteredIn( nullptr )
+SwClient::~SwClient()
{
- if(pToRegisterIn)
- // connect to SwModify
- pToRegisterIn->Add(this);
+ OSL_ENSURE( !pRegisteredIn || pRegisteredIn->GetDepends(), "SwModify still known, but Client already disconnected!" );
+ if( pRegisteredIn && pRegisteredIn->GetDepends() )
+ pRegisteredIn->Remove( this );
}
void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem* )
@@ -57,23 +56,6 @@ void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem* )
}
}
-void SwClient::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
-{
- CheckRegistration( pOldValue, pNewValue );
-}
-
-SwClient::~SwClient()
-{
- OSL_ENSURE( !pRegisteredIn || pRegisteredIn->GetDepends(), "SwModify still known, but Client already disconnected!" );
- if( pRegisteredIn && pRegisteredIn->GetDepends() )
- // still connected
- pRegisteredIn->Remove( this );
-}
-
-bool SwClient::GetInfo( SfxPoolItem& ) const
-{
- return true;
-}
SwModify::SwModify()
: SwClient(nullptr), pRoot(nullptr)