summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2005-07-14 09:45:40 +0000
committerKurt Zenker <kz@openoffice.org>2005-07-14 09:45:40 +0000
commitac5731e442e222d09d78e31905c8a165ad68d589 (patch)
tree337b61eddccad7bbc684672c5d53f4ec3bbd9999 /sd
parent79be3d71d981990d9c3213d39e5f1cd6d4816b97 (diff)
INTEGRATION: CWS impress61 (1.70.136); FILE MERGED
2005/06/27 15:11:54 cl 1.70.136.1: #120379# check for disposed page when creating a xshape
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/unoidl/unopage.cxx185
1 files changed, 98 insertions, 87 deletions
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 7e92b418da1c..84ffee885b1d 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unopage.cxx,v $
*
- * $Revision: 1.70 $
+ * $Revision: 1.71 $
*
- * last change: $Author: vg $ $Date: 2005-02-16 17:02:21 $
+ * last change: $Author: kz $ $Date: 2005-07-14 10:45:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1180,106 +1180,117 @@ void SAL_CALL SdGenericDrawPage::removeVetoableChangeListener( const OUString& P
Reference< drawing::XShape > SdGenericDrawPage::_CreateShape( SdrObject *pObj ) const throw()
{
- PresObjKind eKind = GetPage()->GetPresObjKind(pObj);
+ DBG_ASSERT( GetPage(), "SdGenericDrawPage::_CreateShape(), can't create shape for disposed page!" );
+ DBG_ASSERT( pObj, "SdGenericDrawPage::_CreateShape(), invalid call with pObj == 0!" );
- SvxShape* pShape = NULL;
-
- if(pObj->GetObjInventor() == SdrInventor)
+ if( GetPage() && pObj )
{
- sal_uInt32 nInventor = pObj->GetObjIdentifier();
- switch( nInventor )
+ PresObjKind eKind = GetPage()->GetPresObjKind(pObj);
+
+ SvxShape* pShape = NULL;
+
+ if(pObj->GetObjInventor() == SdrInventor)
{
- case OBJ_TITLETEXT:
- pShape = new SvxShapeText( pObj );
- if( GetPage()->GetPageKind() == PK_NOTES && GetPage()->IsMasterPage() )
- {
- // fake a empty PageShape if its a title shape on the master page
- pShape->SetShapeType(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.PageShape")));
- }
- else
+ sal_uInt32 nInventor = pObj->GetObjIdentifier();
+ switch( nInventor )
{
- pShape->SetShapeType(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.TitleTextShape")));
+ case OBJ_TITLETEXT:
+ pShape = new SvxShapeText( pObj );
+ if( GetPage()->GetPageKind() == PK_NOTES && GetPage()->IsMasterPage() )
+ {
+ // fake a empty PageShape if its a title shape on the master page
+ pShape->SetShapeType(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.PageShape")));
+ }
+ else
+ {
+ pShape->SetShapeType(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.TitleTextShape")));
+ }
+ eKind = PRESOBJ_NONE;
+ break;
+ case OBJ_OUTLINETEXT:
+ pShape = new SvxShapeText( pObj );
+ pShape->SetShapeType(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.OutlinerShape")));
+ eKind = PRESOBJ_NONE;
+ break;
}
- eKind = PRESOBJ_NONE;
- break;
- case OBJ_OUTLINETEXT:
- pShape = new SvxShapeText( pObj );
- pShape->SetShapeType(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.OutlinerShape")));
- eKind = PRESOBJ_NONE;
- break;
}
- }
- Reference< drawing::XShape > xShape( pShape );
+ Reference< drawing::XShape > xShape( pShape );
- if(!xShape.is())
- xShape = SvxFmDrawPage::_CreateShape( pObj );
+ if(!xShape.is())
+ xShape = SvxFmDrawPage::_CreateShape( pObj );
- if( eKind != PRESOBJ_NONE )
- {
- String aShapeType( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation."));
-
- switch( eKind )
+ if( eKind != PRESOBJ_NONE )
{
- case PRESOBJ_TITLE:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("TitleTextShape") );
- break;
- case PRESOBJ_OUTLINE:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("OutlinerShape") );
- break;
- case PRESOBJ_TEXT:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("SubtitleShape") );
- break;
- case PRESOBJ_GRAPHIC:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("GraphicObjectShape") );
- break;
- case PRESOBJ_OBJECT:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("OLE2Shape") );
- break;
- case PRESOBJ_CHART:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("ChartShape") );
- break;
- case PRESOBJ_ORGCHART:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("OrgChartShape") );
- break;
- case PRESOBJ_TABLE:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("TableShape") );
- break;
- case PRESOBJ_BACKGROUND:
- DBG_ASSERT( sal_False, "Danger! Someone got hold of the horrible background shape!" );
- break;
- case PRESOBJ_PAGE:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("PageShape") );
- break;
- case PRESOBJ_HANDOUT:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("HandoutShape") );
- break;
- case PRESOBJ_NOTES:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("NotesShape") );
- break;
- case PRESOBJ_FOOTER:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("FooterShape") );
- break;
- case PRESOBJ_HEADER:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("HeaderShape") );
- break;
- case PRESOBJ_SLIDENUMBER:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("SlideNumberShape") );
- break;
- case PRESOBJ_DATETIME:
- aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("DateTimeShape") );
- break;
+ String aShapeType( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation."));
+
+ switch( eKind )
+ {
+ case PRESOBJ_TITLE:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("TitleTextShape") );
+ break;
+ case PRESOBJ_OUTLINE:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("OutlinerShape") );
+ break;
+ case PRESOBJ_TEXT:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("SubtitleShape") );
+ break;
+ case PRESOBJ_GRAPHIC:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("GraphicObjectShape") );
+ break;
+ case PRESOBJ_OBJECT:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("OLE2Shape") );
+ break;
+ case PRESOBJ_CHART:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("ChartShape") );
+ break;
+ case PRESOBJ_ORGCHART:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("OrgChartShape") );
+ break;
+ case PRESOBJ_TABLE:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("TableShape") );
+ break;
+ case PRESOBJ_BACKGROUND:
+ DBG_ASSERT( sal_False, "Danger! Someone got hold of the horrible background shape!" );
+ break;
+ case PRESOBJ_PAGE:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("PageShape") );
+ break;
+ case PRESOBJ_HANDOUT:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("HandoutShape") );
+ break;
+ case PRESOBJ_NOTES:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("NotesShape") );
+ break;
+ case PRESOBJ_FOOTER:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("FooterShape") );
+ break;
+ case PRESOBJ_HEADER:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("HeaderShape") );
+ break;
+ case PRESOBJ_SLIDENUMBER:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("SlideNumberShape") );
+ break;
+ case PRESOBJ_DATETIME:
+ aShapeType += String( RTL_CONSTASCII_USTRINGPARAM("DateTimeShape") );
+ break;
+ }
+
+ SvxShape* pShape = SvxShape::getImplementation( xShape );
+ if( pShape )
+ pShape->SetShapeType( aShapeType );
}
- SvxShape* pShape = SvxShape::getImplementation( xShape );
- if( pShape )
- pShape->SetShapeType( aShapeType );
+ // SdXShape aggregiert SvxShape
+ new SdXShape( SvxShape::getImplementation( xShape ), mpModel );
+ return xShape;
+ }
+ else
+ {
+ return SvxFmDrawPage::_CreateShape( pObj );
}
- // SdXShape aggregiert SvxShape
- new SdXShape( SvxShape::getImplementation( xShape ), mpModel );
- return xShape;
}
//----------------------------------------------------------------------