Kaydet (Commit) 2676ee8e authored tarafından Michael Stahl's avatar Michael Stahl

sw: fix GCC undefined reference to `typeinfo for sw::LegacyModifyHint'

Stop pointlessly inlining these virtual functions.

Change-Id: I11d123bc704ec6cf54925a13d139fce70cc59566
üst f5ca824f
......@@ -115,17 +115,9 @@ public:
// should be called only from SwModify the client is registered in
// mba: IMHO this method should be pure virtual
// DO NOT USE IN NEW CODE! use SwClientNotify instead.
virtual void Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{ CheckRegistration( pOldValue, pNewValue ); }
virtual void Modify(const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue);
// when overriding this, you MUST call SwClient::SwClientModify() in the override!
virtual void SwClientNotify( const SwModify&, const SfxHint& rHint) SAL_OVERRIDE
{
if(typeid(rHint) == typeid(sw::LegacyModifyHint))
{
auto pLegacyHint(static_cast<const sw::LegacyModifyHint*>(&rHint));
Modify(pLegacyHint->m_pOld, pLegacyHint->m_pNew);
}
};
virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) SAL_OVERRIDE;
// 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
......
......@@ -57,6 +57,20 @@ void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem* )
}
}
void SwClient::SwClientNotify(const SwModify&, const SfxHint& rHint)
{
if (typeid(rHint) == typeid(sw::LegacyModifyHint))
{
auto pLegacyHint(static_cast<const sw::LegacyModifyHint*>(&rHint));
Modify(pLegacyHint->m_pOld, pLegacyHint->m_pNew);
}
};
void SwClient::Modify(SfxPoolItem const*const pOldValue, SfxPoolItem const*const pNewValue)
{
CheckRegistration( pOldValue, pNewValue );
}
SwModify::~SwModify()
{
OSL_ENSURE( !IsModifyLocked(), "Modify destroyed but locked." );
......
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