summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-10-20 11:14:00 +0200
committerNoel Grandin <noel@peralex.com>2016-10-20 11:14:59 +0200
commit85b5ef2809dfea18cdad4700f7a46e864c70726c (patch)
tree7806ac51b268a205390b07ca78fb9c5505ec909e
parent3e3f490da5bf05424bfcb66827187fa7b5bf1870 (diff)
revert part of "simplify some use of typeid"
commit 553ee72041d6f66e26156eb1ad0d9e3c13457f7a is wrong in that typeid has different semantics to dynamic_cast i.e. is-exactly vs. is-exactly- or-subtype checked the other cases to make sure that non of them have any subclasses Change-Id: Id045e6d5e80aa1f7ba29a3475514eb0ae5320806
-rw-r--r--sw/source/core/layout/atrfrm.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 4f554babfd6a..f8eb4a5505f2 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -664,15 +664,17 @@ void SwFormatPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
case RES_OBJECTDYING:
//The Pagedesc where I'm registered dies, therefore I unregister
//from that format. During this I get deleted!
- if( auto pSwFormat = dynamic_cast<SwFormat*>(pDefinedIn) )
+ if( typeid(SwFormat) == typeid( pDefinedIn ))
{
- bool const bResult = pSwFormat->ResetFormatAttr(RES_PAGEDESC);
+ bool const bResult =
+ static_cast<SwFormat*>(pDefinedIn)->ResetFormatAttr(RES_PAGEDESC);
OSL_ENSURE( bResult, "FormatPageDesc not deleted" );
(void) bResult; // unused in non-debug
}
- else if( auto pSwContentNode = dynamic_cast<SwContentNode*>(pDefinedIn) )
+ else if( typeid(SwContentNode) == typeid( pDefinedIn ))
{
- bool const bResult = pSwContentNode->ResetAttr(RES_PAGEDESC);
+ bool const bResult = static_cast<SwContentNode*>(pDefinedIn)
+ ->ResetAttr(RES_PAGEDESC);
OSL_ENSURE( bResult, "FormatPageDesc not deleted" );
(void) bResult; // unused in non-debug
}