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 | 54bc34f17a07913857d08c4b1cbe54b12216857d (patch) | |
tree | 648a48b65279c562d21e4f152d1fecfade8e4239 | |
parent | ec4edaf0ed47f1261d8132924ee128a9e5370170 (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
-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 132a42fcc..b65195a11 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 ) { |