diff options
author | Henry Castro <hcastro@collabora.com> | 2015-04-13 20:32:22 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-04-23 15:33:34 +0200 |
commit | 812fbc5fb2c5e3af6b709530639d697d3268c3be (patch) | |
tree | 83373a4126448d819c9ee39e383f6c31d4539a0c /sc/source/filter | |
parent | 505920b3e959dec5fb2afc83246b5f495fe318f5 (diff) |
Resolves tdf#83366 Copy and Paste crashes Calc when original doc closed
Change-Id: I5ab279a7d7af6829735b47ef5228f56dc77580c9
Reviewed-on: https://gerrit.libreoffice.org/15448
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/filter')
-rw-r--r-- | sc/source/filter/excel/xichart.cxx | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 6313fa533074..c7bb18d4a862 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -818,35 +818,38 @@ Reference< XDataSequence > XclImpChSourceLink::CreateDataSequence( const OUStrin { Reference< XDataSequence > xDataSeq; Reference< XDataProvider > xDataProv = GetDataProvider(); - if( xDataProv.is() && mxTokenArray ) + if( xDataProv.is() ) { - ScCompiler aComp( GetDocPtr(), ScAddress(), *mxTokenArray ); - aComp.SetGrammar(GetDoc().GetGrammar()); - OUStringBuffer aRangeRep; - aComp.CreateStringFromTokenArray( aRangeRep ); - try - { - xDataSeq = xDataProv->createDataSequenceByRangeRepresentation( aRangeRep.makeStringAndClear() ); - // set sequence role - ScfPropertySet aSeqProp( xDataSeq ); - aSeqProp.SetProperty( EXC_CHPROP_ROLE, rRole ); - } - catch( Exception& ) + if ( mxTokenArray ) { -// OSL_FAIL( "XclImpChSourceLink::CreateDataSequence - cannot create data sequence" ); + ScCompiler aComp( GetDocPtr(), ScAddress(), *mxTokenArray ); + aComp.SetGrammar(GetDoc().GetGrammar()); + OUStringBuffer aRangeRep; + aComp.CreateStringFromTokenArray( aRangeRep ); + try + { + xDataSeq = xDataProv->createDataSequenceByRangeRepresentation( aRangeRep.makeStringAndClear() ); + // set sequence role + ScfPropertySet aSeqProp( xDataSeq ); + aSeqProp.SetProperty( EXC_CHPROP_ROLE, rRole ); + } + catch( Exception& ) + { + // OSL_FAIL( "XclImpChSourceLink::CreateDataSequence - cannot create data sequence" ); + } } - } - else if( rRole == EXC_CHPROP_ROLE_LABEL && mxString && !mxString->GetText().isEmpty() ) - { - try + else if( rRole == EXC_CHPROP_ROLE_LABEL && mxString && !mxString->GetText().isEmpty() ) { - OUString aString("\""); - xDataSeq = xDataProv->createDataSequenceByRangeRepresentation( aString + mxString->GetText() + aString ); - // set sequence role - ScfPropertySet aSeqProp( xDataSeq ); - aSeqProp.SetProperty( EXC_CHPROP_ROLE, rRole ); + try + { + OUString aString("\""); + xDataSeq = xDataProv->createDataSequenceByRangeRepresentation( aString + mxString->GetText() + aString ); + // set sequence role + ScfPropertySet aSeqProp( xDataSeq ); + aSeqProp.SetProperty( EXC_CHPROP_ROLE, rRole ); + } + catch( Exception& ) { } } - catch( Exception& ) { } } return xDataSeq; } |