diff options
author | Ingrid Halama <iha@openoffice.org> | 2010-05-10 13:23:57 +0200 |
---|---|---|
committer | Ingrid Halama <iha@openoffice.org> | 2010-05-10 13:23:57 +0200 |
commit | 6d0afcd0db46ad125c243b8854b78da250b5f581 (patch) | |
tree | d608fec30b50e965b1219a216507933d31ecd0e9 /chart2/source/controller/main/ObjectHierarchy.cxx | |
parent | 7e06e1078bfd4066e957e34c0466efcd96828c94 (diff) |
chart47: #i109770# #i110253# remove assertion caused by state without diagram during initialization
Diffstat (limited to 'chart2/source/controller/main/ObjectHierarchy.cxx')
-rw-r--r-- | chart2/source/controller/main/ObjectHierarchy.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx index 0fefa3d52310..fe73d15500f5 100644 --- a/chart2/source/controller/main/ObjectHierarchy.cxx +++ b/chart2/source/controller/main/ObjectHierarchy.cxx @@ -194,13 +194,17 @@ ImplObjectHierarchy::ImplObjectHierarchy( void ImplObjectHierarchy::createTree( const Reference< XChartDocument >& xChartDocument ) { + m_aChildMap = tChildMap();//clear tree + if( !xChartDocument.is() ) return; //@todo: change ObjectIdentifier to take an XChartDocument rather than XModel Reference< frame::XModel > xModel( xChartDocument, uno::UNO_QUERY ); Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartDocument ) ); - ObjectHierarchy::tOID aDiaOID( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram, xModel ) ) ); + ObjectHierarchy::tOID aDiaOID; + if( xDiagram.is() ) + aDiaOID = ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram, xModel ) ); ObjectHierarchy::tChildContainer aTopLevelContainer; // First Level @@ -209,9 +213,12 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument >& xChartD if( m_bOrderingForElementSelector ) { aTopLevelContainer.push_back( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) ) ); - aTopLevelContainer.push_back( aDiaOID ); - createWallAndFloor( aTopLevelContainer, xDiagram ); - createLegendTree( aTopLevelContainer, xChartDocument, xDiagram ); + if( xDiagram.is() ) + { + aTopLevelContainer.push_back( aDiaOID ); + createWallAndFloor( aTopLevelContainer, xDiagram ); + createLegendTree( aTopLevelContainer, xChartDocument, xDiagram ); + } } // Main Title |