From 3cc85b071fdcf75adf8bcb3d59984940395c81e1 Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Fri, 8 Nov 2013 03:08:10 +0100 Subject: earlier failure in debug mode in the case that mpObj.get() is not a SdrOle2Obj* Change-Id: Idff7324242062665c137685096cd82284e24f0d9 --- svx/source/unodraw/unoshap4.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'svx') diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index 768896d9da36..d26546f89d48 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -174,7 +174,14 @@ bool SvxOle2Shape::setPropertyValueImpl( const OUString& rName, const SfxItemPro OUString aPersistName; if( rValue >>= aPersistName ) { - static_cast(mpObj.get())->SetPersistName( aPersistName ); + SdrOle2Obj *pOle; +#if OSL_DEBUG_LEVEL > 0 + pOle = dynamic_cast(mpObj.get()); + assert(pOle); +#else + pOle = static_cast(mpObj.get()); +#endif + pOle->SetPersistName( aPersistName ); return true; } break; -- cgit v1.2.3