summaryrefslogtreecommitdiff
path: root/xmloff/source/draw/shapeimport.cxx
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2001-08-15 09:31:02 +0000
committerChristian Lippka <cl@openoffice.org>2001-08-15 09:31:02 +0000
commit0c5f29e63b1d6cb5a2000a5d40196994cf43f0e9 (patch)
treef125c914312c1f808e96400350e9b7052e953560 /xmloff/source/draw/shapeimport.cxx
parentf9db70219c126ecac47880c4a084da21cd7032e5 (diff)
#91047# catch exceptions during sort, just to be save
Diffstat (limited to 'xmloff/source/draw/shapeimport.cxx')
-rw-r--r--xmloff/source/draw/shapeimport.cxx57
1 files changed, 32 insertions, 25 deletions
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index 01f746e167e2..9d5055eb8e86 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shapeimport.cxx,v $
*
- * $Revision: 1.41 $
+ * $Revision: 1.42 $
*
- * last change: $Author: aw $ $Date: 2001-08-01 11:44:09 $
+ * last change: $Author: cl $ $Date: 2001-08-15 10:31:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1023,38 +1023,45 @@ void XMLShapeImportHelper::popGroupAndSort()
if( mpImpl->mpSortContext == NULL )
return;
- // sort shapes
- list<ZOrderHint>& rZList = mpImpl->mpSortContext->maZOrderList;
- if( !rZList.empty() )
+ try
{
- // only do something if we have shapes to sort
- list<ZOrderHint>& rUnsortedList = mpImpl->mpSortContext->maUnsortedList;
-
- // sort z ordered shapes
- rZList.sort();
-
- // this is the current index, all shapes before that
- // index are finished
- sal_Int32 nIndex = 0;
- while( !rZList.empty() )
+ // sort shapes
+ list<ZOrderHint>& rZList = mpImpl->mpSortContext->maZOrderList;
+ if( !rZList.empty() )
{
- list<ZOrderHint>::iterator aIter( rZList.begin() );
+ // only do something if we have shapes to sort
+ list<ZOrderHint>& rUnsortedList = mpImpl->mpSortContext->maUnsortedList;
+
+ // sort z ordered shapes
+ rZList.sort();
- while( nIndex < (*aIter).nShould && !rUnsortedList.empty() )
+ // this is the current index, all shapes before that
+ // index are finished
+ sal_Int32 nIndex = 0;
+ while( !rZList.empty() )
{
- ZOrderHint aGapHint( *rUnsortedList.begin() );
- rUnsortedList.pop_front();
+ list<ZOrderHint>::iterator aIter( rZList.begin() );
- mpImpl->mpSortContext->moveShape( aGapHint.nIs, nIndex++ );
- }
+ while( nIndex < (*aIter).nShould && !rUnsortedList.empty() )
+ {
+ ZOrderHint aGapHint( *rUnsortedList.begin() );
+ rUnsortedList.pop_front();
- if( (*aIter).nIs != nIndex )
- mpImpl->mpSortContext->moveShape( (*aIter).nIs, nIndex );
+ mpImpl->mpSortContext->moveShape( aGapHint.nIs, nIndex++ );
+ }
+
+ if( (*aIter).nIs != nIndex )
+ mpImpl->mpSortContext->moveShape( (*aIter).nIs, nIndex );
- rZList.pop_front();
- nIndex++;
+ rZList.pop_front();
+ nIndex++;
+ }
}
}
+ catch( uno::Exception& )
+ {
+ DBG_ERROR("exception while sorting shapes, sorting failed!");
+ }
// put parent on top and delete current context, were done
ShapeSortContext* pContext = mpImpl->mpSortContext;