You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by js...@apache.org on 2012/06/08 12:10:44 UTC

svn commit: r1348006 - /incubator/ooo/trunk/main/sw/source/core/unocore/unochart.cxx

Author: jsc
Date: Fri Jun  8 10:10:43 2012
New Revision: 1348006

URL: http://svn.apache.org/viewvc?rev=1348006&view=rev
Log:
119912: Crash when redo split the pasted table

fix: While deleting any box from chart data provider, verify whether there are any invalidate chart data sequence inside, if so, catch the exception and remove it.

Patch By: Peng Chen
Found By: yanji
Review By: jsc


Modified:
    incubator/ooo/trunk/main/sw/source/core/unocore/unochart.cxx

Modified: incubator/ooo/trunk/main/sw/source/core/unocore/unochart.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/unocore/unochart.cxx?rev=1348006&r1=1348005&r2=1348006&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/unocore/unochart.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/unocore/unochart.cxx Fri Jun  8 10:10:43 2012
@@ -1655,6 +1655,7 @@ sal_Bool SwChartDataProvider::DeleteBox(
         {
 			SwChartDataSequence *pDataSeq = 0;
             sal_Bool bNowEmpty = sal_False;
+            sal_Bool bSeqDisposed = sal_False;
 
             // check if weak reference is still valid...
 //            uno::Reference< chart2::data::XDataSequence > xRef( uno::Reference< chart2::data::XDataSequence>(*aIt), uno::UNO_QUERY );
@@ -1666,10 +1667,19 @@ sal_Bool SwChartDataProvider::DeleteBox(
                 pDataSeq = static_cast< SwChartDataSequence * >( xRef.get() );
                 if (pDataSeq)
                 {
+                    try
+                    {
 #if OSL_DEBUG_LEVEL > 1
                     OUString aRangeStr( pDataSeq->getSourceRangeRepresentation() );
 #endif
                     bNowEmpty = pDataSeq->DeleteBox( rBox );
+                    }
+                    catch (lang::DisposedException&)
+                    {
+                        bNowEmpty = sal_True;
+                        bSeqDisposed = sal_True;
+                    }
+					
                     if (bNowEmpty)
                         aDelIt = aIt;
                 }
@@ -1679,8 +1689,8 @@ sal_Bool SwChartDataProvider::DeleteBox(
             if (bNowEmpty)
 			{
                 rSet.erase( aDelIt );
-				if (pDataSeq)
-					pDataSeq->dispose();    // the current way to tell chart that sth. got removed
+                if (pDataSeq && !bSeqDisposed)
+                    pDataSeq->dispose();    // the current way to tell chart that sth. got removed
 			}
         }
     }
@@ -2636,6 +2646,9 @@ void SAL_CALL SwChartDataSequence::remov
 
 sal_Bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox )
 {
+	if (bDisposed)
+		throw lang::DisposedException();
+
 #if OSL_DEBUG_LEVEL > 1
 	String aBoxName( rBox.GetName() );
 #endif