summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2015-04-13 20:32:22 -0400
committerEike Rathke <erack@redhat.com>2015-04-20 19:00:19 +0000
commit1cc023dc093cc858637c1bcf4a756ddd44d61658 (patch)
tree8770a800fc6fcf75830d25138081693ca551a7f1
parent887370fe830a148f309b23011f3428d80a53811d (diff)
Resolves tdf#83366 Copy and Paste crashes Calc when original doc closed
Change-Id: I5ab279a7d7af6829735b47ef5228f56dc77580c9 Reviewed-on: https://gerrit.libreoffice.org/15292 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/filter/excel/xichart.cxx51
1 files changed, 27 insertions, 24 deletions
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 2c01e7f0bb5b..077a1c828d01 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -830,35 +830,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;
}