diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-03-20 15:22:44 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-03-20 19:07:21 +0100 |
commit | 317c8e5c80308e829c4bc29958e03931cd8db3ef (patch) | |
tree | 54cb501abd1819f6cc65da6da5ee9cf4b1681188 /sw | |
parent | f18d1141936eafc15d428ceb823fe28584b0e2d5 (diff) |
use static_cast<> and typeid, its faster
Change-Id: I80f66686a09dfe629b9aa9f9cb7babe1c5a6edac
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/calbck.hxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 4ff6cc71038f..6ad31166440c 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -120,13 +120,13 @@ public: virtual void Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) { CheckRegistration( pOldValue, pNewValue ); } // when overriding this, you MUST call SwClient::SwClientModify() in the override! - virtual void SwClientNotify( const SwModify&, const SfxHint& rHint) - SAL_OVERRIDE + virtual void SwClientNotify( const SwModify&, const SfxHint& rHint) SAL_OVERRIDE { - // assuming the compiler to realize that a dynamic_cast to a final class is just a pointer compare ... - auto pLegacyHint(dynamic_cast<const sw::LegacyModifyHint*>(&rHint)); - if(pLegacyHint) + if(typeid(rHint) == typeid(sw::LegacyModifyHint)) + { + auto pLegacyHint(static_cast<const sw::LegacyModifyHint*>(&rHint)); Modify(pLegacyHint->m_pOld, pLegacyHint->m_pNew); + } }; // in case an SwModify object is destroyed that itself is registered in another SwModify, |