diff options
Diffstat (limited to 'svx/source/unodraw/unopage.cxx')
-rw-r--r-- | svx/source/unodraw/unopage.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index a905aa0fd2f4..af6a35ddd5ef 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -58,6 +58,7 @@ #include <svx/extrud3d.hxx> #include <svx/lathe3d.hxx> #include <vcl/svapp.hxx> +#include <tools/diagnose_ex.h> using ::rtl::OUString; using namespace ::vos; @@ -306,7 +307,7 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape { OGuard aGuard( Application::GetSolarMutex() ); - if( (mpModel == 0) || (mpPage == 0) ) + if ( ( mpModel == NULL ) || ( mpPage == NULL ) ) throw lang::DisposedException(); SvxShape* pShape = SvxShape::getImplementation( xShape ); @@ -319,6 +320,7 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape if(!pObj) { pObj = CreateSdrObject( xShape ); + ENSURE_OR_RETURN_VOID( pObj != NULL, "SvxDrawPage::add: no SdrObject was created!" ); } else if ( !pObj->IsInserted() ) { @@ -326,14 +328,10 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape mpPage->InsertObject( pObj ); } - if(pObj == NULL) - return; - - if(pShape) - pShape->Create( pObj, this ); + pShape->Create( pObj, this ); + OSL_ENSURE( pShape->GetSdrObject() == pObj, "SvxDrawPage::add: shape does not know about its newly created SdrObject!" ); - if( mpModel ) - mpModel->SetChanged(); + mpModel->SetChanged(); } //---------------------------------------------------------------------- |