diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-09-04 06:24:36 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-09-04 06:24:36 +0000 |
commit | e67324786e54de9da6f2a86566994a299deb40b1 (patch) | |
tree | 558bfd02c5a4eb5ea17ade22989b2874bfac144a /oox/source/drawingml/diagram | |
parent | 9f7f902b7f36102f7dc92521deebdd8045ded63d (diff) |
INTEGRATION: CWS dba30j_DEV300 (1.5.16); FILE MERGED
2008/09/01 13:41:44 dr 1.5.16.1: #i93337# crash in diagram import
Diffstat (limited to 'oox/source/drawingml/diagram')
-rw-r--r-- | oox/source/drawingml/diagram/diagram.cxx | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx index e4bf8c743456..6fcf92162bc1 100644 --- a/oox/source/drawingml/diagram/diagram.cxx +++ b/oox/source/drawingml/diagram/diagram.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: diagram.cxx,v $ - * $Revision: 1.5 $ + * $Revision: 1.6 $ * * This file is part of OpenOffice.org. * @@ -240,14 +240,18 @@ void Diagram::build( ) } // check bounds OSL_ENSURE( aRoots.size() == 1, "more than one root" ); - mpRoot = aRoots.begin()->second; - OSL_TRACE( "root is %s", OUSTRING_TO_CSTR( mpRoot->getPoint()->getModelId() ) ); - for( PointsTreeMap::iterator iter = aTreeMap.begin(); - iter != aTreeMap.end(); iter++ ) + // #i92239# roots may be empty + if( !aRoots.empty() ) { - if(! iter->second->getParent() ) + mpRoot = aRoots.begin()->second; + OSL_TRACE( "root is %s", OUSTRING_TO_CSTR( mpRoot->getPoint()->getModelId() ) ); + for( PointsTreeMap::iterator iter = aTreeMap.begin(); + iter != aTreeMap.end(); iter++ ) { - OSL_TRACE("node without parent %s", OUSTRING_TO_CSTR( iter->first ) ); + if(! iter->second->getParent() ) + { + OSL_TRACE("node without parent %s", OUSTRING_TO_CSTR( iter->first ) ); + } } } } @@ -258,7 +262,8 @@ void Diagram::addTo( const ShapePtr & pParentShape ) dgm::Points & aPoints( mpData->getPoints( ) ); dgm::Points::iterator aPointsIter; build( ); - mpLayout->layout( mpRoot, awt::Point( 0, 0 ) ); + if( mpRoot.get() ) + mpLayout->layout( mpRoot, awt::Point( 0, 0 ) ); for( aPointsIter = aPoints.begin(); aPointsIter != aPoints.end(); ++aPointsIter ) { |