Kaydet (Commit) 317c8e5c authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

use static_cast<> and typeid, its faster

Change-Id: I80f66686a09dfe629b9aa9f9cb7babe1c5a6edac
üst f18d1141
...@@ -120,13 +120,13 @@ public: ...@@ -120,13 +120,13 @@ public:
virtual void Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) virtual void Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{ CheckRegistration( pOldValue, pNewValue ); } { CheckRegistration( pOldValue, pNewValue ); }
// when overriding this, you MUST call SwClient::SwClientModify() in the override! // when overriding this, you MUST call SwClient::SwClientModify() in the override!
virtual void SwClientNotify( const SwModify&, const SfxHint& rHint) virtual void SwClientNotify( const SwModify&, const SfxHint& rHint) SAL_OVERRIDE
SAL_OVERRIDE
{ {
// assuming the compiler to realize that a dynamic_cast to a final class is just a pointer compare ... if(typeid(rHint) == typeid(sw::LegacyModifyHint))
auto pLegacyHint(dynamic_cast<const sw::LegacyModifyHint*>(&rHint)); {
if(pLegacyHint) auto pLegacyHint(static_cast<const sw::LegacyModifyHint*>(&rHint));
Modify(pLegacyHint->m_pOld, pLegacyHint->m_pNew); Modify(pLegacyHint->m_pOld, pLegacyHint->m_pNew);
}
}; };
// in case an SwModify object is destroyed that itself is registered in another SwModify, // in case an SwModify object is destroyed that itself is registered in another SwModify,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment