Lines 495-503
Link Here
|
495 |
nLayerId(0), |
495 |
nLayerId(0), |
496 |
mpProperties(0L), |
496 |
mpProperties(0L), |
497 |
// #110094# |
497 |
// #110094# |
498 |
mpViewContact(0L) |
498 |
mpViewContact(0L), |
|
|
499 |
mpUnoShape( NULL ) |
499 |
{ |
500 |
{ |
500 |
DBG_CTOR(SdrObject,NULL); |
501 |
DBG_CTOR(SdrObject,NULL); |
501 |
bVirtObj =FALSE; |
502 |
bVirtObj =FALSE; |
502 |
bBoundRectDirty =TRUE; |
503 |
bBoundRectDirty =TRUE; |
503 |
bSnapRectDirty =TRUE; |
504 |
bSnapRectDirty =TRUE; |
Lines 531-536
Link Here
|
531 |
|
532 |
|
532 |
SdrObject::~SdrObject() |
533 |
SdrObject::~SdrObject() |
533 |
{ |
534 |
{ |
|
|
535 |
DBG_TESTSOLARMUTEX(); |
536 |
|
534 |
// tell all the registered ObjectUsers that the page is in destruction |
537 |
// tell all the registered ObjectUsers that the page is in destruction |
535 |
for(::sdr::ObjectUserVector::iterator aIterator = maObjectUsers.begin(); aIterator != maObjectUsers.end(); aIterator++) |
538 |
for(::sdr::ObjectUserVector::iterator aIterator = maObjectUsers.begin(); aIterator != maObjectUsers.end(); aIterator++) |
536 |
{ |
539 |
{ |
Lines 543-551
Link Here
|
543 |
// when they get called from ObjectInDestruction(). |
546 |
// when they get called from ObjectInDestruction(). |
544 |
maObjectUsers.clear(); |
547 |
maObjectUsers.clear(); |
545 |
|
548 |
|
546 |
uno::Reference< lang::XComponent > xShape( mxUnoShape, uno::UNO_QUERY ); |
549 |
if ( mpUnoShape ) |
547 |
if( xShape.is() ) |
550 |
{ |
548 |
xShape->dispose(); |
551 |
mpUnoShape->dispose(); |
|
|
552 |
mpUnoShape = NULL; |
553 |
} |
549 |
|
554 |
|
550 |
DBG_DTOR(SdrObject,NULL); |
555 |
DBG_DTOR(SdrObject,NULL); |
551 |
SendUserCall(SDRUSERCALL_DELETE, GetLastBoundRect()); |
556 |
SendUserCall(SDRUSERCALL_DELETE, GetLastBoundRect()); |
Lines 595-607
Link Here
|
595 |
// update listeners at possible api wrapper object |
600 |
// update listeners at possible api wrapper object |
596 |
if( pModel != pNewModel ) |
601 |
if( pModel != pNewModel ) |
597 |
{ |
602 |
{ |
598 |
uno::Reference< uno::XInterface > xShape( mxUnoShape ); |
603 |
DBG_TESTSOLARMUTEX(); |
599 |
if( xShape.is() ) |
604 |
if ( mpUnoShape ) |
600 |
{ |
605 |
mpUnoShape->ChangeModel( pNewModel ); |
601 |
SvxShape* pShape = SvxShape::getImplementation( xShape ); |
|
|
602 |
if( pShape ) |
603 |
pShape->ChangeModel( pNewModel ); |
604 |
} |
605 |
} |
606 |
} |
606 |
|
607 |
|
607 |
pModel = pNewModel; |
608 |
pModel = pNewModel; |
Lines 3770-3800
Link Here
|
3770 |
|
3771 |
|
3771 |
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SdrObject::getUnoShape() |
3772 |
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SdrObject::getUnoShape() |
3772 |
{ |
3773 |
{ |
3773 |
// try weak reference first |
3774 |
DBG_TESTSOLARMUTEX(); |
3774 |
uno::Reference< uno::XInterface > xShape( mxUnoShape ); |
3775 |
|
3775 |
if( !xShape.is() ) |
3776 |
uno::Reference< uno::XInterface > xShape; |
3776 |
{ |
3777 |
|
3777 |
if ( pPage ) |
3778 |
// try weak reference first |
3778 |
{ |
3779 |
if ( mpUnoShape ) |
3779 |
uno::Reference< uno::XInterface > xPage( pPage->getUnoPage() ); |
3780 |
xShape = xShape.query( *mpUnoShape ); |
3780 |
if( xPage.is() ) |
3781 |
else |
3781 |
{ |
3782 |
{ |
3782 |
SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation(xPage); |
3783 |
if ( pPage ) |
3783 |
if( pDrawPage ) |
3784 |
{ |
3784 |
{ |
3785 |
uno::Reference< uno::XInterface > xPage( pPage->getUnoPage() ); |
3785 |
// create one |
3786 |
if( xPage.is() ) |
3786 |
xShape = pDrawPage->_CreateShape( this ); |
3787 |
{ |
3787 |
mxUnoShape = xShape; |
3788 |
SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation(xPage); |
3788 |
} |
3789 |
if( pDrawPage ) |
3789 |
} |
3790 |
// create one |
3790 |
} |
3791 |
xShape = pDrawPage->_CreateShape( this ); |
3791 |
else |
3792 |
} |
3792 |
{ |
3793 |
} |
3793 |
uno::Reference< drawing::XShape > xS( SvxDrawPage::CreateShapeByTypeAndInventor( GetObjIdentifier(), GetObjInventor(), this, NULL ) ); |
3794 |
else |
3794 |
xShape = xS; |
3795 |
{ |
3795 |
mxUnoShape = xShape; |
3796 |
uno::Reference< drawing::XShape > xS( SvxDrawPage::CreateShapeByTypeAndInventor( GetObjIdentifier(), GetObjInventor(), this, NULL ) ); |
3796 |
} |
3797 |
xShape = xS; |
3797 |
} |
3798 |
} |
|
|
3799 |
mpUnoShape = SvxShape::getImplementation( xShape ); |
3800 |
DBG_ASSERT( ( mpUnoShape != NULL ) || ( !xShape.is() ), |
3801 |
"SdrObject::getUnoShape: invalid SvxShape!" ); |
3802 |
} |
3798 |
|
3803 |
|
3799 |
return xShape; |
3804 |
return xShape; |
3800 |
} |
3805 |
} |