diff options
author | Jürgen Schmidt <jsc@apache.org> | 2012-06-08 09:10:43 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-12 08:01:26 +0100 |
commit | 2c737cedd914e30b013b090392a43a4cb48e62a6 (patch) | |
tree | 378f19f9000402935119fd2bfa0e8a997cc875ae /sw | |
parent | ac8461c6287f39c600333fb7a8df90a6f44dbee0 (diff) |
Resolves: #i119912# Crash when redo split pasted table used by chart
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
(cherry picked from commit a92e353922d63d785e3d46aa1a4783846a9dea18)
Change-Id: I239824e92d13e42b83674dbdeaeef053f1e6ea9a
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unochart.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 17b116aa5235..14484459e1ea 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -1583,6 +1583,7 @@ sal_Bool SwChartDataProvider::DeleteBox( const SwTable *pTable, const SwTableBox { 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 > xTemp(*aIt); // temporary needed for g++ 3.3.5 @@ -1593,10 +1594,16 @@ sal_Bool SwChartDataProvider::DeleteBox( const SwTable *pTable, const SwTableBox pDataSeq = static_cast< SwChartDataSequence * >( xRef.get() ); if (pDataSeq) { -#if OSL_DEBUG_LEVEL > 1 - OUString aRangeStr( pDataSeq->getSourceRangeRepresentation() ); -#endif - bNowEmpty = pDataSeq->DeleteBox( rBox ); + try + { + bNowEmpty = pDataSeq->DeleteBox( rBox ); + } + catch (const lang::DisposedException&) + { + bNowEmpty = sal_True; + bSeqDisposed = sal_True; + } + if (bNowEmpty) aDelIt = aIt; } @@ -1606,7 +1613,7 @@ sal_Bool SwChartDataProvider::DeleteBox( const SwTable *pTable, const SwTableBox if (bNowEmpty) { rSet.erase( aDelIt ); - if (pDataSeq) + if (pDataSeq && !bSeqDisposed) pDataSeq->dispose(); // the current way to tell chart that sth. got removed } } @@ -2512,6 +2519,9 @@ void SAL_CALL SwChartDataSequence::removeEventListener( sal_Bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox ) { + if (bDisposed) + throw lang::DisposedException(); + #if OSL_DEBUG_LEVEL > 1 String aBoxName( rBox.GetName() ); #endif |