incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhan...@apache.org
Subject svn commit: r1345624 - /incubator/ooo/trunk/main/sc/source/core/data/cell.cxx
Date Sun, 03 Jun 2012 05:46:47 GMT
Author: zhangjf
Date: Sun Jun  3 05:46:47 2012
New Revision: 1345624

URL: http://svn.apache.org/viewvc?rev=1345624&view=rev
Log:
Fix issue #118851: sc crashed when paste table data in a cell from excel

Suggested by: Jianfang Zhang
Found by:  yanji
Review by: Jianfang Zhang
Patch by: chao huang

Modified:
    incubator/ooo/trunk/main/sc/source/core/data/cell.cxx

Modified: incubator/ooo/trunk/main/sc/source/core/data/cell.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/core/data/cell.cxx?rev=1345624&r1=1345623&r2=1345624&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/core/data/cell.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/core/data/cell.cxx Sun Jun  3 05:46:47 2012
@@ -747,7 +747,7 @@ ScFormulaCell::ScFormulaCell( const ScFo
 	bNeedListening( sal_False ),
 	aPos( rPos )
 {
-	pCode = rCell.pCode->Clone();
+	pCode = (rCell.pCode) ? rCell.pCode->Clone() : NULL;
 
     if ( nCloneFlags & SC_CLONECELL_ADJUST3DREL )
         pCode->ReadjustRelative3DReferences( rCell.aPos, aPos );
@@ -912,7 +912,8 @@ void ScFormulaCell::GetResultDimensions(
 void ScFormulaCell::Compile( const String& rFormula, sal_Bool bNoListening,
                             const FormulaGrammar::Grammar eGrammar )
 {
-	if ( pDocument->IsClipOrUndo() ) return;
+	//#118851#, the initialization code for pCode after it can not be gnored if it is still
NULL
+	if ( pCode && pDocument->IsClipOrUndo() ) return;
 	sal_Bool bWasInFormulaTree = pDocument->IsInFormulaTree( this );
 	if ( bWasInFormulaTree )
 		pDocument->RemoveFromFormulaTree( this );



Mime
View raw message